Skip to content
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
46 changes: 23 additions & 23 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/dist/*.js"],
"outFiles": ["${workspaceRoot}/dist/*.{js,mjs}"],
"preLaunchTask": "packageDev"
},
{
Expand All @@ -24,7 +24,7 @@
"csharp-test-profile",
"${workspaceRoot}/test/untrustedWorkspace/integrationTests/testAssets/empty/.vscode/empty.code-workspace",
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/out/test/untrustedWorkspace/integrationTests",
"--extensionTestsPath=${workspaceRoot}/out/test/untrustedWorkspace/integrationTests/index.js",
"--log",
"ms-dotnettools.csharp:trace"
],
Expand All @@ -33,7 +33,7 @@
},
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/dist/*.js",
"${workspaceRoot}/dist/*.{js,mjs}",
"${workspaceRoot}/out/test/**/*.js"
],
"resolveSourceMapLocations": [
Expand All @@ -56,7 +56,7 @@
"csharp-test-profile",
"${workspaceRoot}/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/slnWithCsproj.code-workspace",
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/out/test/lsptoolshost/integrationTests",
"--extensionTestsPath=${workspaceRoot}/out/test/lsptoolshost/integrationTests/index.js",
"--log",
"ms-dotnettools.csharp:trace"
],
Expand All @@ -66,7 +66,7 @@
"RoslynWaiterEnabled": "true"
},
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/dist/*.js", "${workspaceRoot}/out/test/**/*.js"],
"outFiles": ["${workspaceRoot}/dist/*.{js,mjs}", "${workspaceRoot}/out/test/**/*.js"],
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"],
"preLaunchTask": "packageDev",
"internalConsoleOptions": "openOnSessionStart"
Expand All @@ -84,7 +84,7 @@
"csharp-test-profile",
"${workspaceRoot}/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/devkit_slnWithCsproj.code-workspace",
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/out/test/lsptoolshost/integrationTests",
"--extensionTestsPath=${workspaceRoot}/out/test/lsptoolshost/integrationTests/index.js",
"--log",
"ms-dotnettools.csharp:trace"
],
Expand All @@ -94,7 +94,7 @@
"RoslynWaiterEnabled": "true"
},
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/dist/*.js", "${workspaceRoot}/out/test/**/*.js"],
"outFiles": ["${workspaceRoot}/dist/*.{js,mjs}", "${workspaceRoot}/out/test/**/*.js"],
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"],
"preLaunchTask": "packageDev",
"internalConsoleOptions": "openOnSessionStart"
Expand All @@ -112,7 +112,7 @@
"csharp-test-profile",
"${workspaceRoot}/test/razor/razorIntegrationTests/testAssets/RazorApp/.vscode/RazorApp.code-workspace",
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/out/test/razor/razorIntegrationTests",
"--extensionTestsPath=${workspaceRoot}/out/test/razor/razorIntegrationTests/index.js",
"--log",
"ms-dotnettools.csharp:trace"
],
Expand All @@ -121,7 +121,7 @@
"TEST_FILE_FILTER": "${file}"
},
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/dist/*.js", "${workspaceRoot}/out/test/**/*.js"],
"outFiles": ["${workspaceRoot}/dist/*.{js,mjs}", "${workspaceRoot}/out/test/**/*.js"],
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"],
"preLaunchTask": "packageDev",
"internalConsoleOptions": "openOnSessionStart"
Expand All @@ -139,15 +139,15 @@
"csharp-test-profile",
"${workspaceRoot}/test/omnisharp/omnisharpIntegrationTests/testAssets/${input:omnisharpAssetName}/.vscode/omnisharp_${input:omnisharpAssetName}.code-workspace",
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/out/test/omnisharp/omnisharpIntegrationTests"
"--extensionTestsPath=${workspaceRoot}/out/test/omnisharp/omnisharpIntegrationTests/index.js"
],
"env": {
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
"OSVC_SUITE": "${input:omnisharpAssetName}",
"TEST_FILE_FILTER": "${file}"
},
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/dist/*.js", "${workspaceRoot}/out/test/**/*.js"],
"outFiles": ["${workspaceRoot}/dist/*.{js,mjs}", "${workspaceRoot}/out/test/**/*.js"],
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"],
"preLaunchTask": "packageDev"
},
Expand All @@ -164,15 +164,15 @@
"csharp-test-profile",
"${workspaceRoot}/test/omnisharp/omnisharpIntegrationTests/testAssets/${input:omnisharpAssetName}/.vscode/omnisharp_lsp_${input:omnisharpAssetName}.code-workspace",
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/out/test/omnisharp/omnisharpIntegrationTests"
"--extensionTestsPath=${workspaceRoot}/out/test/omnisharp/omnisharpIntegrationTests/index.js"
],
"env": {
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
"OSVC_SUITE": "${input:omnisharpAssetName}",
"TEST_FILE_FILTER": "${file}"
},
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/dist/*.js", "${workspaceRoot}/out/test/**/*.js"],
"outFiles": ["${workspaceRoot}/dist/*.{js,mjs}", "${workspaceRoot}/out/test/**/*.js"],
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"],
"preLaunchTask": "packageDev"
},
Expand All @@ -181,17 +181,17 @@
"request": "launch",
"name": "Debug task",
"preLaunchTask": "build",
"program": "${workspaceFolder}/node_modules/ts-node/dist/bin.js",
"args": ["tasks/${input:taskScript}"],
"runtimeArgs": ["--import", "tsx"],
"program": "${workspaceFolder}/tasks/${input:taskScript}",
"cwd": "${workspaceFolder}"
},
{
"type": "node",
"request": "launch",
"name": "Update OmniSharp package dependencies",
"preLaunchTask": "build",
"program": "${workspaceFolder}/node_modules/ts-node/dist/bin.js",
"args": ["tasks/debugger/updatePackageDependencies.ts"],
"runtimeArgs": ["--import", "tsx"],
"program": "${workspaceFolder}/tasks/debugger/updatePackageDependencies.ts",
"env": {
"NEW_DEPS_ID": "OmniSharp",
"NEW_DEPS_URLS": "https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-linux-x64.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-linux-x86.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-linux-arm64.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-osx.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-win-x64.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-win-arm64.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-linux-musl-x64-net6.0.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-linux-musl-arm64-net6.0.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-linux-x64-net6.0.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-linux-arm64-net6.0.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-osx-x64-net6.0.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-osx-arm64-net6.0.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-win-x64-net6.0.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-win-arm64-net6.0.zip",
Expand All @@ -205,8 +205,8 @@
"request": "launch",
"name": "Update razor telemetry package dependencies",
"preLaunchTask": "build",
"program": "${workspaceFolder}/node_modules/ts-node/dist/bin.js",
"args": ["tasks/debugger/updatePackageDependencies.ts"],
"runtimeArgs": ["--import", "tsx"],
"program": "${workspaceFolder}/tasks/debugger/updatePackageDependencies.ts",
"env": {
"NEW_DEPS_URLS": "https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/704e369c5905f9ece819ebce77fb78d8/devkittelemetry-linux-arm64-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/4049a66147717a53860bbc969bf32faa/devkittelemetry-linux-musl-arm64-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/c75e84ff813be5c9833d96dc2066a364/devkittelemetry-linux-musl-x64-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/f58cf629939f0df77d142be881f9e233/devkittelemetry-linux-x64-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/1c912419ea45c8d95cfa28a8a04640dc/devkittelemetry-osx-arm64-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/36545ba0998f1fc380e877e38b2f35f1/devkittelemetry-osx-x64-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/0a32698e8ba1ab93489d79f34f8ae8d0/devkittelemetry-platformagnostic-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/4f16ff826fedd33ad80d265c5409588b/devkittelemetry-win-arm64-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/5a98d8f4e481dbb7ae3cdb3695b75c46/devkittelemetry-win-x64-7.0.0-preview.24178.4.zip",
"NEW_DEPS_VERSION": "7.0.0-preview.24178.4",
Expand All @@ -219,17 +219,17 @@
"request": "launch",
"name": "Generate debugger options schema",
"preLaunchTask": "build",
"program": "${workspaceFolder}/node_modules/ts-node/dist/bin.js",
"args": ["tasks/debugger/generateOptionsSchema.ts"],
"runtimeArgs": ["--import", "tsx"],
"program": "${workspaceFolder}/tasks/debugger/generateOptionsSchema.ts",
"cwd": "${workspaceFolder}"
},
{
"type": "node",
"request": "launch",
"name": "Razor Cohost integration tests",
"preLaunchTask": "build",
"program": "${workspaceFolder}/node_modules/ts-node/dist/bin.js",
"args": ["tasks/tests/testIntegrationRazorCohost.ts"],
"runtimeArgs": ["--import", "tsx"],
"program": "${workspaceFolder}/tasks/tests/testIntegrationRazorCohost.ts",
"cwd": "${workspaceFolder}"
}
],
Expand Down
2 changes: 1 addition & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ package-lock.json
tsconfig.json
version.json
wallaby.js
esbuild.js
esbuild.mjs
!src/razor/language-configuration.json
!src/razor/syntaxes/*

Expand Down
6 changes: 3 additions & 3 deletions __mocks__/vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import * as vscodeAdapter from '../src/vscodeAdapter';
import { getFakeVsCode } from '../test/fakes';
import * as vscodeAdapter from '../src/vscodeAdapter.ts';
import { getFakeVsCode } from '../test/fakes.ts';

// This module creates a manual mock for the vscode module for running in unit tests.
// Jest will automatically pick this up as it is in the __mocks__ directory next to node_modules.

// We can consider switching to an actual jest mock (instead of this manual fake) once we entirely
// remove the old test framework (mocha/chai).
const vscode: vscodeAdapter.vscode = getFakeVsCode();
module.exports = vscode;
export const { commands, languages, window, workspace, extensions, Uri, version, env, l10n } = vscode;
37 changes: 37 additions & 0 deletions baseJestConfig.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { fileURLToPath } from 'node:url';
import { createDefaultEsmPreset, createDefaultPreset } from 'ts-jest';

const tsconfigPath = fileURLToPath(new URL('./tsconfig.json', import.meta.url));
const jestTsconfigPath = fileURLToPath(new URL('./tsconfig.jest.json', import.meta.url));
const commonProjectConfig = {
testEnvironment: 'node',
transformIgnorePatterns: ['/dist/.+\\.js'],
};

/**
* Defines a base project config that we can re-use across the project specific jest configs.
* We do this because jest generally does not inherit project configuration settings.
*/
/** @type {import('jest').Config} */
export const baseProjectConfig = {
...createDefaultEsmPreset({ tsconfig: tsconfigPath }),
...commonProjectConfig,
moduleNameMapper: {
// TypeScript rewrites source .ts specifiers to .js before Jest resolves the source module.
'^(\\.{1,2}/.*)\\.js$': '$1',
},
};

// VS Code's packaged extension host strips the Node flag required by Jest's VM-module ESM runtime.
export const baseIntegrationProjectConfig = {
...createDefaultPreset({ tsconfig: jestTsconfigPath }),
...commonProjectConfig,
moduleNameMapper: {
// TypeScript rewrites source .ts specifiers to .js before Jest resolves the source module.
'^(\\.{1,2}/.*)\\.js$': '$1',
},
};
15 changes: 0 additions & 15 deletions baseJestConfig.ts

This file was deleted.

76 changes: 0 additions & 76 deletions esbuild.js

This file was deleted.

Loading
Loading