Skip to content
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

Fix problems with updating the code model #2985

Merged
merged 5 commits into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Improvements:
Bug Fixes:
- Compatibility between test and build presets was not enforced. [#2904](https://github.com/microsoft/vscode-cmake-tools/issues/2904)

## 1.13.44
Bug Fixes:
- Fix problems with updating the code model. [#2980](https://github.com/microsoft/vscode-cmake-tools/issues/2980)

## 1.13.43
Bug Fixes:
- Fix an issue causing the Add Presets commands not to appear. [PR #2977](https://github.com/microsoft/vscode-cmake-tools/pull/2977)
Expand Down
6 changes: 3 additions & 3 deletions src/drivers/cmakeFileApiDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ export class CMakeFileApiDriver extends CMakeDriver {
}

async doConfigure(args_: string[], outputConsumer?: proc.OutputConsumer, showCommandOnly?: boolean, configurePreset?: ConfigurePreset | null, options?: proc.ExecutionOptions): Promise<number> {
const api_path = this.getCMakeFileApiPath(configurePreset?.binaryDir);
const binaryDir = configurePreset?.binaryDir ?? this.binaryDir;
const api_path = this.getCMakeFileApiPath(binaryDir);
await createQueryFileForApi(api_path);

// Dup args so we can modify them
Expand All @@ -208,7 +209,6 @@ export class CMakeFileApiDriver extends CMakeDriver {
has_gen = true;
}
}
const binaryDir = configurePreset?.binaryDir ?? this.binaryDir;
// -S and -B were introduced in CMake 3.13 and this driver assumes CMake >= 3.15
args.push(`-S${util.lightNormalizePath(this.sourceDir)}`);
args.push(`-B${util.lightNormalizePath(binaryDir)}`);
Expand Down Expand Up @@ -258,7 +258,7 @@ export class CMakeFileApiDriver extends CMakeDriver {
if (!configurePreset) {
this._needsReconfigure = false;
}
await this.updateCodeModel(configurePreset?.binaryDir);
await this.updateCodeModel(binaryDir);
}
return result.retc === null ? -1 : result.retc;
}
Expand Down
3 changes: 2 additions & 1 deletion src/projectController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ export class ProjectController implements vscode.Disposable {
this.folderToProjectsMap.clear();
if (vscode.workspace.workspaceFolders) {
for (const folder of vscode.workspace.workspaceFolders) {
await this.addFolder(folder);
const projects: CMakeProject[] = await this.addFolder(folder);
this.afterAddFolderEmitter.fire({ folder: folder, projects: projects});
}
}
}
Expand Down