diff --git a/pkg/analysis_server/.vscode/launch.json b/pkg/analysis_server/.vscode/launch.json index e3a65a462f6..d8a6bb38c9d 100644 --- a/pkg/analysis_server/.vscode/launch.json +++ b/pkg/analysis_server/.vscode/launch.json @@ -12,6 +12,22 @@ "request": "launch", "type": "dart", "program": "test/test_all.dart", + }, + { + "name": "Dart - Integration Tests", + "type": "dart", + "request": "launch", + // By specifying "templateFor", this config acts as a template when launching things inside the "integration_test" folder + // from the CodeLens links and from the VS Code test runner. + "templateFor": "integration_test", + // Run the task to pre-compile the analysis server into the .dart_tool folder. + "preLaunchTask": "dart: compile analysis server", + // Pass the path of that snapshot in the `TEST_SERVER_SNAPSHOT` env variable so + // that the integration tests will use this instead of the one in the current + // SDK. + "env": { + "TEST_SERVER_SNAPSHOT": ".dart_tool/integration_tests_analysis_server.dart.snapshot" + }, } ] -} \ No newline at end of file +} diff --git a/pkg/analysis_server/.vscode/tasks.json b/pkg/analysis_server/.vscode/tasks.json index 243f0cd813c..714fe432d7f 100644 --- a/pkg/analysis_server/.vscode/tasks.json +++ b/pkg/analysis_server/.vscode/tasks.json @@ -6,6 +6,24 @@ "type": "shell", "command": "tool/spec/generate_files", "problemMatcher": [] + }, + { + // This task compiles the analysis server to a kernel snapshot + // in the .dart_tool folder. It is used as a "preLaunchTask" for + // the "Dart - Integration Tests" template which is invoked when + // executing integration tests. + "type": "dart", + "command": "dart", + "args": [ + "compile", + "kernel", + "bin/server.dart", + "-o", + ".dart_tool/integration_tests_analysis_server.dart.snapshot" + ], + "problemMatcher": [], + "label": "dart: compile analysis server", + "detail": "Compiles the analysis server into .dart_tool for use by integration tests" } ] -} \ No newline at end of file +}