Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
54 changes: 39 additions & 15 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This launches vscode with an empty profile with no user settings / extensions. This is better than --disable-extensions as it

  1. Resets settings
  2. Allows us to install dependent extensions if needed.

I would have preferred if we could launch into a specific integration test profile, but that requires the profile to be imported first via a UI wizard. There's no way to launch and import a profile via the vscode cli that I could find.

See microsoft/vscode#159572 (comment)

"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/out/test/featureTests"
],
Expand All @@ -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"
Expand All @@ -78,7 +82,8 @@
},
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/dist/*.js"
"${workspaceRoot}/dist/*.js",
"${workspaceRoot}/out/test/**/*.js"
],
"preLaunchTask": "buildDev"
},
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -124,7 +133,8 @@
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/dist/*.js"
"${workspaceRoot}/dist/*.js",
"${workspaceRoot}/out/test/**/*.js"
],
"preLaunchTask": "buildDev"
},
Expand All @@ -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"
Expand All @@ -150,7 +162,8 @@
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/dist/*.js"
"${workspaceRoot}/dist/*.js",
"${workspaceRoot}/out/test/**/*.js"
],
"preLaunchTask": "buildDev"
},
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -195,7 +212,8 @@
},
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/dist/*.js"
"${workspaceRoot}/dist/*.js",
"${workspaceRoot}/out/test/**/*.js"
],
"preLaunchTask": "buildDev"
},
Expand All @@ -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"
Expand All @@ -219,7 +239,8 @@
},
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/dist/*.js"
"${workspaceRoot}/dist/*.js",
"${workspaceRoot}/out/test/**/*.js"
],
"preLaunchTask": "buildDev"
},
Expand All @@ -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"
Expand All @@ -243,7 +266,8 @@
},
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/dist/*.js"
"${workspaceRoot}/dist/*.js",
"${workspaceRoot}/out/test/**/*.js"
],
"preLaunchTask": "buildDev"
},
Expand Down
8 changes: 8 additions & 0 deletions test/integrationTests/integrationHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ export interface ActivationResult {
}

export async function activateCSharpExtension(): Promise<ActivationResult> {
// 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<OmnisharpExtensionExports>(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) {
Expand Down