Skip to content

Commit d4910cc

Browse files
authored
Fix the "Open File..." scenario (without a workspace folder) (#5054)
Fix the "Open File..." scenario (without a workspace folder)
1 parent 62222e5 commit d4910cc

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Extension/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# C/C++ for Visual Studio Code Change Log
22

3+
## Version 0.27.0-insiders2: March 4, 2019
4+
### Bug Fixes
5+
* Fix the `Open File...` scenario (without a workspace folder). [#5049](https://github.com/microsoft/vscode-cpptools/issues/5049)
6+
37
## Version 0.27.0-insiders: March 3, 2019
48
### Enhancements
59
* Improved multi-root implementation with a single language server process and database for the entire workspace (shared between workspace folders). Fixes most [multi-root bugs](https://github.com/microsoft/vscode-cpptools/issues?q=is%3Aopen+is%3Aissue+label%3A%22Feature%3A+Multiroot%22+label%3A%22fixed+%28release+pending%29%22+milestone%3A0.27.0).

Extension/src/LanguageServer/client.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,9 +1022,11 @@ export class DefaultClient implements Client {
10221022

10231023
settings.push(workspaceSettings);
10241024
otherSettings.push(workspaceOtherSettings);
1025-
for (let workspaceFolder of vscode.workspace.workspaceFolders) {
1026-
settings.push(new CppSettings(workspaceFolder.uri));
1027-
otherSettings.push(new OtherSettings(workspaceFolder.uri));
1025+
if (vscode.workspace.workspaceFolders) {
1026+
for (let workspaceFolder of vscode.workspace.workspaceFolders) {
1027+
settings.push(new CppSettings(workspaceFolder.uri));
1028+
otherSettings.push(new OtherSettings(workspaceFolder.uri));
1029+
}
10281030
}
10291031

10301032
for (let setting of settings) {

0 commit comments

Comments
 (0)