diff --git a/src/vscode-bicep/package-lock.json b/src/vscode-bicep/package-lock.json index c133e89e023..0474616ad1c 100644 --- a/src/vscode-bicep/package-lock.json +++ b/src/vscode-bicep/package-lock.json @@ -19,7 +19,7 @@ "@vscode/codicons": "^0.0.45", "fs-extra": "^11.3.5", "triple-beam": "^1.4.1", - "vscode-languageclient": "^9.0.1", + "vscode-languageclient": "^10.0.0", "vscode-nls": "^5.2.0", "winston": "^3.17.0", "winston-transport": "^4.9.0" @@ -4834,6 +4834,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, "license": "MIT" }, "node_modules/base64-js": { @@ -12345,63 +12346,85 @@ } }, "node_modules/vscode-jsonrpc": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", - "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-9.0.0.tgz", + "integrity": "sha512-+VvMmQPJhtvJ+8O+zu2JKIRiLxXF8NW7krWgyMGeOHrp4Cn23T5hc0v2LknNeopDOB70wghHAds7mKtcZ0I4Sg==", "license": "MIT", "engines": { "node": ">=14.0.0" } }, "node_modules/vscode-languageclient": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-9.0.1.tgz", - "integrity": "sha512-JZiimVdvimEuHh5olxhxkht09m3JzUGwggb5eRUkzzJhZ2KjCN0nh55VfiED9oez9DyF8/fz1g1iBV3h+0Z2EA==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-10.0.0.tgz", + "integrity": "sha512-3yRHFkktZQCCg8ehHnD2Z4DZ4mZ17FNo8bxM4OFt8wtpxNBAOZGHmpbIflZSkicvCxi+ozuWntbdeWiY0gP77w==", "license": "MIT", "dependencies": { - "minimatch": "^5.1.0", - "semver": "^7.3.7", - "vscode-languageserver-protocol": "3.17.5" + "minimatch": "^10.2.5", + "semver": "^7.8.1", + "vscode-languageserver-protocol": "3.18.0", + "vscode-languageserver-textdocument": "1.0.13" }, "engines": { - "vscode": "^1.82.0" + "vscode": "^1.91.0" + } + }, + "node_modules/vscode-languageclient/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" } }, "node_modules/vscode-languageclient/node_modules/brace-expansion": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.1.tgz", - "integrity": "sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", + "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0" + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" } }, "node_modules/vscode-languageclient/node_modules/minimatch": { - "version": "5.1.9", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", - "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", - "license": "ISC", + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", + "license": "BlueOak-1.0.0", "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^5.0.5" }, "engines": { - "node": ">=10" + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/vscode-languageserver-protocol": { - "version": "3.17.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", - "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", + "version": "3.18.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.18.0.tgz", + "integrity": "sha512-Zdz+kJ12Iz6tc11xfZyEo501bBATHXrCjmMfnaR3pMnf1CoqZBKIynba3P+/bi9VEdrMbNtAVKYpKhbODvqy+Q==", "license": "MIT", "dependencies": { - "vscode-jsonrpc": "8.2.0", - "vscode-languageserver-types": "3.17.5" + "vscode-jsonrpc": "9.0.0", + "vscode-languageserver-types": "3.18.0" } }, + "node_modules/vscode-languageserver-textdocument": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.13.tgz", + "integrity": "sha512-nx0ZHwMGIsVkzFG3/VLeJYBLTaFBRuNdGDvevvjuoayU5EOS2fEYazOhtCM3PI9ClMMg5igc0uwXtAq4tJj+Dw==", + "license": "MIT" + }, "node_modules/vscode-languageserver-types": { - "version": "3.17.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", - "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==", + "version": "3.18.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.18.0.tgz", + "integrity": "sha512-8TsGPNMIMiiBdkORgRSvLjuiEIiAFtO+KssmYWxQ+uSVvlf7RjK8YKCOjPzZ+YA04jXEV7+7LvkSmHkhpNS99g==", "license": "MIT" }, "node_modules/vscode-nls": { diff --git a/src/vscode-bicep/package.json b/src/vscode-bicep/package.json index f90ae598837..04741dc0124 100644 --- a/src/vscode-bicep/package.json +++ b/src/vscode-bicep/package.json @@ -800,7 +800,7 @@ "@vscode/codicons": "^0.0.45", "fs-extra": "^11.3.5", "triple-beam": "^1.4.1", - "vscode-languageclient": "^9.0.1", + "vscode-languageclient": "^10.0.0", "vscode-nls": "^5.2.0", "winston": "^3.17.0", "winston-transport": "^4.9.0" diff --git a/src/vscode-bicep/src/azure/azureClients.ts b/src/vscode-bicep/src/azure/azureClients.ts index d2019180202..a4bf3ebc41c 100644 --- a/src/vscode-bicep/src/azure/azureClients.ts +++ b/src/vscode-bicep/src/azure/azureClients.ts @@ -3,16 +3,24 @@ import { ManagementGroupsAPI } from "@azure/arm-managementgroups"; import { ResourceManagementClient } from "@azure/arm-resources"; import { SubscriptionClient } from "@azure/arm-resources-subscriptions"; +import { TokenCredential } from "@azure/core-auth"; import { AzExtClientContext, - createAzureClient, createAzureSubscriptionClient, + parseClientContext, } from "@microsoft/vscode-azext-azureutils"; // Lazy-load @azure packages to improve startup performance. export async function createResourceManagementClient(context: AzExtClientContext): Promise { - return createAzureClient(context, (await import("@azure/arm-resources")).ResourceManagementClient); + const parsedContext = parseClientContext(context); + return new ResourceManagementClient( + parsedContext.credentials as TokenCredential, + parsedContext.subscriptionId, + { + endpoint: parsedContext.environment.resourceManagerEndpointUrl, + }, + ); } export async function createSubscriptionClient(context: AzExtClientContext): Promise { diff --git a/src/vscode-bicep/src/language/client.ts b/src/vscode-bicep/src/language/client.ts index c5e5e2081dd..79033096dab 100644 --- a/src/vscode-bicep/src/language/client.ts +++ b/src/vscode-bicep/src/language/client.ts @@ -89,7 +89,7 @@ export async function createLanguageService( enableRegistryContent: true, }, progressOnInitialization: true, - outputChannel, + outputChannelName: outputChannel.name, synchronize: { configurationSection: "bicep", fileEvents: [ diff --git a/src/vscode-bicep/src/visualizer/viewManager.ts b/src/vscode-bicep/src/visualizer/viewManager.ts index 1bdacc4fb59..b7d6c4c75ea 100644 --- a/src/vscode-bicep/src/visualizer/viewManager.ts +++ b/src/vscode-bicep/src/visualizer/viewManager.ts @@ -19,7 +19,7 @@ export class BicepVisualizerViewManager extends Disposable implements vscode.Web super(); this.register(vscode.window.registerWebviewPanelSerializer(BicepVisualizerView.viewType, this)); - + const existingMiddleware = languageClient.clientOptions.middleware?.handleDiagnostics; this.languageClient.clientOptions.middleware = { diff --git a/src/vscode-bicep/tsconfig.json b/src/vscode-bicep/tsconfig.json index 2b7a36cdf0d..f40f0c87245 100644 --- a/src/vscode-bicep/tsconfig.json +++ b/src/vscode-bicep/tsconfig.json @@ -2,8 +2,8 @@ "compilerOptions": { "target": "es6", "lib": ["dom", "dom.iterable", "es2020", "ES2021.String", "ES2022.Error"], - "module": "commonjs", - "moduleResolution": "node", + "module": "Node16", + "moduleResolution": "node16", "esModuleInterop": true, "outDir": "out", "sourceMap": true, diff --git a/src/vscode-bicep/webpack.config.ts b/src/vscode-bicep/webpack.config.ts index b34360a60fc..a2a5a26acf9 100644 --- a/src/vscode-bicep/webpack.config.ts +++ b/src/vscode-bicep/webpack.config.ts @@ -91,7 +91,7 @@ const extensionConfig: webpack.Configuration = { ], resolve: { extensions: [".ts", ".js"], - conditionNames: ["import", "require"], + conditionNames: ["node", "import", "require", "..."], }, };