diff --git a/.vscode/launch.json b/.vscode/launch.json index d83318d936..1b65dacf85 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -41,7 +41,9 @@ "request": "launch", "runtimeExecutable": "${execPath}", "args": [ - "--disable-extensions", + // Create a temp profile that has no extensions / user settings. + // This allows us to only have the C# extension + the dotnet runtime installer extension dependency. + "--profile-temp", "--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test/featureTests" ], @@ -63,7 +65,9 @@ "request": "launch", "runtimeExecutable": "${execPath}", "args": [ - "--disable-extensions", + // Create a temp profile that has no extensions / user settings. + // This allows us to only have the C# extension + the dotnet runtime installer extension dependency. + "--profile-temp", "${workspaceRoot}/test/integrationTests/testAssets/singleCsproj", "--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test/integrationTests" @@ -78,7 +82,8 @@ }, "sourceMaps": true, "outFiles": [ - "${workspaceRoot}/dist/*.js" + "${workspaceRoot}/dist/*.js", + "${workspaceRoot}/out/test/**/*.js" ], "preLaunchTask": "buildDev" }, @@ -88,7 +93,9 @@ "request": "launch", "runtimeExecutable": "${execPath}", "args": [ - "--disable-extensions", + // Create a temp profile that has no extensions / user settings. + // This allows us to only have the C# extension + the dotnet runtime installer extension dependency. + "--profile-temp", "${workspaceRoot}/test/integrationTests/testAssets/BasicRazorApp2_1", "--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test/integrationTests" @@ -108,7 +115,9 @@ "request": "launch", "runtimeExecutable": "${execPath}", "args": [ - "--disable-extensions", + // Create a temp profile that has no extensions / user settings. + // This allows us to only have the C# extension + the dotnet runtime installer extension dependency. + "--profile-temp", "${workspaceRoot}/test/integrationTests/testAssets/slnWithCsproj", "--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test/integrationTests" @@ -124,7 +133,8 @@ "stopOnEntry": false, "sourceMaps": true, "outFiles": [ - "${workspaceRoot}/dist/*.js" + "${workspaceRoot}/dist/*.js", + "${workspaceRoot}/out/test/**/*.js" ], "preLaunchTask": "buildDev" }, @@ -134,7 +144,9 @@ "request": "launch", "runtimeExecutable": "${execPath}", "args": [ - "--disable-extensions", + // Create a temp profile that has no extensions / user settings. + // This allows us to only have the C# extension + the dotnet runtime installer extension dependency. + "--profile-temp", "${workspaceRoot}/test/integrationTests/testAssets/singleCsproj", "--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test/integrationTests" @@ -150,7 +162,8 @@ "stopOnEntry": false, "sourceMaps": true, "outFiles": [ - "${workspaceRoot}/dist/*.js" + "${workspaceRoot}/dist/*.js", + "${workspaceRoot}/out/test/**/*.js" ], "preLaunchTask": "buildDev" }, @@ -160,7 +173,9 @@ "request": "launch", "runtimeExecutable": "${execPath}", "args": [ - "--disable-extensions", + // Create a temp profile that has no extensions / user settings. + // This allows us to only have the C# extension + the dotnet runtime installer extension dependency. + "--profile-temp", "${workspaceRoot}/test/integrationTests/testAssets/BasicRazorApp2_1", "--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test/integrationTests" @@ -180,7 +195,9 @@ "request": "launch", "runtimeExecutable": "${execPath}", "args": [ - "--disable-extensions", + // Create a temp profile that has no extensions / user settings. + // This allows us to only have the C# extension + the dotnet runtime installer extension dependency. + "--profile-temp", "${workspaceRoot}/test/integrationTests/testAssets/slnWithCsproj", "--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test/integrationTests" @@ -195,7 +212,8 @@ }, "sourceMaps": true, "outFiles": [ - "${workspaceRoot}/dist/*.js" + "${workspaceRoot}/dist/*.js", + "${workspaceRoot}/out/test/**/*.js" ], "preLaunchTask": "buildDev" }, @@ -205,7 +223,9 @@ "request": "launch", "runtimeExecutable": "${execPath}", "args": [ - "--disable-extensions", + // Create a temp profile that has no extensions / user settings. + // This allows us to only have the C# extension + the dotnet runtime installer extension dependency. + "--profile-temp", "${workspaceRoot}/test/integrationTests/testAssets/slnFilterWithCsproj", "--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test/integrationTests" @@ -219,7 +239,8 @@ }, "sourceMaps": true, "outFiles": [ - "${workspaceRoot}/dist/*.js" + "${workspaceRoot}/dist/*.js", + "${workspaceRoot}/out/test/**/*.js" ], "preLaunchTask": "buildDev" }, @@ -229,7 +250,9 @@ "request": "launch", "runtimeExecutable": "${execPath}", "args": [ - "--disable-extensions", + // Create a temp profile that has no extensions / user settings. + // This allows us to only have the C# extension + the dotnet runtime installer extension dependency. + "--profile-temp", "${workspaceRoot}/test/integrationTests/testAssets/slnWithGenerator", "--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test/integrationTests" @@ -243,7 +266,8 @@ }, "sourceMaps": true, "outFiles": [ - "${workspaceRoot}/dist/*.js" + "${workspaceRoot}/dist/*.js", + "${workspaceRoot}/out/test/**/*.js" ], "preLaunchTask": "buildDev" }, diff --git a/test/integrationTests/integrationHelpers.ts b/test/integrationTests/integrationHelpers.ts index 439d429357..f86464076c 100644 --- a/test/integrationTests/integrationHelpers.ts +++ b/test/integrationTests/integrationHelpers.ts @@ -16,6 +16,14 @@ export interface ActivationResult { } export async function activateCSharpExtension(): Promise { + // Ensure the dependent extension exists - when launching via F5 launch.json we can't install the extension prior to opening vscode. + const vscodeDotnetRuntimeExtensionId = "ms-dotnettools.vscode-dotnet-runtime"; + let dotnetRuntimeExtension = vscode.extensions.getExtension(vscodeDotnetRuntimeExtensionId); + if (!dotnetRuntimeExtension) { + await vscode.commands.executeCommand("workbench.extensions.installExtension", vscodeDotnetRuntimeExtensionId); + await vscode.commands.executeCommand("workbench.action.reloadWindow"); + } + const configuration = vscode.workspace.getConfiguration(); configuration.update('omnisharp.enableLspDriver', process.env.OMNISHARP_DRIVER === 'lsp' ? true : false); if (process.env.OMNISHARP_LOCATION) {