-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin doesn't handle cmake.sourceDirectory
changes properly
#4203
Comments
cmake.sourceDirectory
changes properlycmake.sourceDirectory
changes properly
Update: here are the changes I figured were needed to fix these bugs. I'm still unsure about the changes to the Luke-zhang-mchp/vscode-cmake-tools@main...Luke-zhang-mchp:vscode-cmake-tools:config-change-fix |
@Luke-zhang-mchp We would like to reproduce your problem, please provide a record of the reproduction steps in as much detail as possible. Thank you in advance! |
For the first issue:
For the second issue, open command palette and run "Select Active Folder". The dropdown option should have title |
@Luke-zhang-04 Thank you for your reply! Based on your description of the problem, we have reproduced the problem, but we are not sure if we have reproduced your problem completely, here is a recording of me reproducing the problem, could you help me to confirm if we have reproduced the problem? |
Hey @Yingzi1234, that doesn't look like what I was trying to get at. Here's the first problem: recording.issue.1.mp4as you can see, the CMake view and CMake commands only show up after IDE refresh. The second problem: recording.issue.2.mp4In the select active folder command, the names of the project are sometimes wrong. This is the case when either:
Like I said, these were the changes I needed to fix the issue: Luke-zhang-mchp/vscode-cmake-tools@main...Luke-zhang-mchp:vscode-cmake-tools:config-change-fix, but I'm not sure if my changes will break something else or what the "historical reasons" mentioned in the comments are. |
@Luke-zhang-04 Thank you for your reply and help! With your help, we reproduced both of your issues and we have turned this issue into a bug The first issue: When
Second issue: When an invalid subfolder exists in the
|
Just a note: that second issue described in the video recording is actually the opposite of what I had initially intended to fix. For us, we started with |
@Luke-zhang-04 Thanks for the additions, we've changed the status of this issue to Bug, we'll let you know as soon as we have any updates! |
Brief Issue Summary
I have a workspace structure that looks like this:
When VSCode is first opened, the CMake view is not listed under "Open View" and many CMake commands are missing. This is to be expected, since the default value of
cmake.sourceDirectory
is${workspaceFolder}
, but there is no CMakeLists file there. However, when I give the preference a value, the commands are still missing, and the CMake view is still not listed. They only show once I reload the IDE.A related issue: when there is only 1 path in the
cmake.sourceDirectory
array, the path and name of the folder is automatically assumed to be the workspace folder, which is not always true.Related again: when there is an array of directories in the array, and one new entry is added, the path and name of the folder is also assumed to be the workspace folder. This is fixed on reload, and also does not occur if more than 1 entry is added at once.
CMake Tools Diagnostics
Debug Log
Additional Information
I did some preliminary digging. The second issue is caused by this line: https://github.com/microsoft/vscode-cmake-tools/blob/main/src/projectController.ts#L279. It should instead always return
this.sourceDir
.The last issue is caused by this line: https://github.com/microsoft/vscode-cmake-tools/blob/main/src/projectController.ts#L279. The parameter
value
only includes the newly added values, hence why checking forlength > 1
is incorrect.I wanted to make sure there weren't any edge cases I was missing making these changes. For example,
CMakeProject.folderPath
has a comment that says "For single-project folders, this is the WorkspaceFolder for historical reasons." I haven't looked at the first issue yet.The text was updated successfully, but these errors were encountered: