Skip to content

Commit 4f3e3c8

Browse files
authored
Fix regression. Add test case. (#6993)
* Add test case. * Fix regression bug.
1 parent 585cb66 commit 4f3e3c8

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

Extension/.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"request": "launch",
9999
"runtimeExecutable": "${execPath}",
100100
"args": [
101-
"${workspaceFolder}/test/integrationTests/testAssets/SimpleCppProject",
101+
"${workspaceFolder}/test/integrationTests/testAssets/SimpleCppProject/simpleCppProject.code-workspace",
102102
"--extensionDevelopmentPath=${workspaceFolder}",
103103
"--extensionTestsPath=${workspaceFolder}/out/test/integrationTests/languageServer/index"
104104
],

Extension/src/LanguageServer/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ export class DefaultClient implements Client {
705705

706706
constructor(allClients: ClientCollection, workspaceFolder?: vscode.WorkspaceFolder) {
707707
this.rootFolder = workspaceFolder;
708-
this.rootRealPath = this.RootPath ? fs.realpathSync(this.RootPath) : "";
708+
this.rootRealPath = this.RootPath ? (fs.existsSync(this.RootPath) ? fs.realpathSync(this.RootPath) : this.RootPath) : "";
709709
let storagePath: string | undefined;
710710
if (util.extensionContext) {
711711
const path: string | undefined = util.extensionContext.storageUri?.fsPath;

Extension/test/integrationTests/languageServer/runTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ async function main() {
1212
// Passed to --extensionTestsPath
1313
const extensionTestsPath = path.resolve(__dirname, './index');
1414

15-
const testWorkspace = path.resolve(extensionDevelopmentPath, 'test/integrationTests/testAssets/SimpleCppProject');
15+
const testWorkspace = path.resolve(extensionDevelopmentPath, 'test/integrationTests/testAssets/SimpleCppProject/simpleCppProject.code-workspace');
1616

1717
const launchArgs = [ "--disable-extensions", testWorkspace ];
1818

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"folders": [
3+
{
4+
"path": "."
5+
},
6+
{
7+
"path": "../nonExistent"
8+
}
9+
]
10+
}

0 commit comments

Comments
 (0)