Skip to content

Commit

Permalink
fix per folder provide browse configuration
Browse files Browse the repository at this point in the history
We were returning the most recent stored browse configuration, which may be incorrect.
Rather, we should return null if we don't have the browseConfiguration for the requested URI.
  • Loading branch information
gcampbell-msft committed Jul 19, 2023
1 parent 15ff695 commit 3c5988f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Features:

Bug Fixes:
- When using CMake presets, the Project Status View now shows the build target along with the build preset. [PR #3241](https://github.com/microsoft/vscode-cmake-tools/pull/3241)
- Fix per-folder browse configurations returning incorrect information [#3155](https://github.com/microsoft/vscode-cmake-tools/issues/3155)

Improvements:
- Decreased the number of cases where we reconfigure erroneously upon usage of `cmake.getLaunchTargetPath` [#2878](https://github.com/microsoft/vscode-cmake-tools/issues/2878)
Expand Down
4 changes: 2 additions & 2 deletions src/cpptools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ export class CppConfigurationProvider implements cpptools.CustomConfigurationPro
return true;
}

async provideFolderBrowseConfiguration(uri: vscode.Uri): Promise<cpptools.WorkspaceBrowseConfiguration> {
return this.workspaceBrowseConfigurations.get(util.platformNormalizePath(uri.fsPath)) ?? this.workspaceBrowseConfiguration;
async provideFolderBrowseConfiguration(uri: vscode.Uri): Promise<cpptools.WorkspaceBrowseConfiguration | null> {
return this.workspaceBrowseConfigurations.get(util.platformNormalizePath(uri.fsPath)) ?? null;
}

/** No-op */
Expand Down

0 comments on commit 3c5988f

Please sign in to comment.