diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f98667..bb49ec1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## [2.6.4] - 2024-11-13 +- Fix issue [#355](https://github.com/intersystems/language-server/issues/355): Prevent overprompting for Server Manager permission and account information + ## [2.6.3] - 2024-10-25 - Fix issue [#352](https://github.com/intersystems/language-server/issues/352): Hide Deprecated classes and class members from completion lists by default - Fix issue [#353](https://github.com/intersystems/language-server/issues/353): Fix keyword completion for ClassMethods diff --git a/client/package-lock.json b/client/package-lock.json index 4aa9095..1f617a2 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -1,25 +1,32 @@ { "name": "language-server-client", - "version": "2.6.0-SNAPSHOT", + "version": "2.6.4-SNAPSHOT", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "language-server-client", - "version": "2.6.0-SNAPSHOT", + "version": "2.6.4-SNAPSHOT", "dependencies": { - "axios": "^1.7.5", + "axios": "^1.7.7", "vscode-cache": "^0.3.0", "vscode-languageclient": "^9.0.1" }, "devDependencies": { + "@intersystems-community/intersystems-servermanager": "^3.8.0", "@types/semver": "^7.5.8", - "@types/vscode": "1.82.0" + "@types/vscode": "1.93.0" }, "engines": { - "vscode": "^1.82.0" + "vscode": "^1.93.0" } }, + "node_modules/@intersystems-community/intersystems-servermanager": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@intersystems-community/intersystems-servermanager/-/intersystems-servermanager-3.8.0.tgz", + "integrity": "sha512-D3/LoQXOsApLo07BLHipuibUYIQLz5MK57GWLtmtYIiNa2gJ0Igaz0Fv5SuZ+gdPL3tlN1g88iQ4vJ7E+arRiQ==", + "dev": true + }, "node_modules/@types/semver": { "version": "7.5.8", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", @@ -27,9 +34,9 @@ "dev": true }, "node_modules/@types/vscode": { - "version": "1.82.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.82.0.tgz", - "integrity": "sha512-VSHV+VnpF8DEm8LNrn8OJ8VuUNcBzN3tMvKrNpbhhfuVjFm82+6v44AbDhLvVFgCzn6vs94EJNTp7w8S6+Q1Rw==", + "version": "1.93.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.93.0.tgz", + "integrity": "sha512-kUK6jAHSR5zY8ps42xuW89NLcBpw1kOabah7yv38J8MyiYuOHxLQBi0e7zeXbQgVefDy/mZZetqEFC+Fl5eIEQ==", "dev": true }, "node_modules/asynckit": { @@ -38,9 +45,9 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "node_modules/axios": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.5.tgz", - "integrity": "sha512-fZu86yCo+svH3uqJ/yTdQ0QHpQu5oL+/QE+QPSv6BZSkDAoky9vytxp7u5qk83OJFS3kEBcesWni9WTZAv3tSw==", + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -218,6 +225,12 @@ } }, "dependencies": { + "@intersystems-community/intersystems-servermanager": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@intersystems-community/intersystems-servermanager/-/intersystems-servermanager-3.8.0.tgz", + "integrity": "sha512-D3/LoQXOsApLo07BLHipuibUYIQLz5MK57GWLtmtYIiNa2gJ0Igaz0Fv5SuZ+gdPL3tlN1g88iQ4vJ7E+arRiQ==", + "dev": true + }, "@types/semver": { "version": "7.5.8", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", @@ -225,9 +238,9 @@ "dev": true }, "@types/vscode": { - "version": "1.82.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.82.0.tgz", - "integrity": "sha512-VSHV+VnpF8DEm8LNrn8OJ8VuUNcBzN3tMvKrNpbhhfuVjFm82+6v44AbDhLvVFgCzn6vs94EJNTp7w8S6+Q1Rw==", + "version": "1.93.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.93.0.tgz", + "integrity": "sha512-kUK6jAHSR5zY8ps42xuW89NLcBpw1kOabah7yv38J8MyiYuOHxLQBi0e7zeXbQgVefDy/mZZetqEFC+Fl5eIEQ==", "dev": true }, "asynckit": { @@ -236,9 +249,9 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "axios": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.5.tgz", - "integrity": "sha512-fZu86yCo+svH3uqJ/yTdQ0QHpQu5oL+/QE+QPSv6BZSkDAoky9vytxp7u5qk83OJFS3kEBcesWni9WTZAv3tSw==", + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", "requires": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", diff --git a/client/package.json b/client/package.json index b12da6c..9b6d34b 100644 --- a/client/package.json +++ b/client/package.json @@ -4,15 +4,16 @@ "version": "2.6.4-SNAPSHOT", "private": true, "engines": { - "vscode": "^1.82.0" + "vscode": "^1.93.0" }, "dependencies": { - "axios": "^1.7.5", + "axios": "^1.7.7", "vscode-cache": "^0.3.0", "vscode-languageclient": "^9.0.1" }, "devDependencies": { + "@intersystems-community/intersystems-servermanager": "^3.8.0", "@types/semver": "^7.5.8", - "@types/vscode": "1.82.0" + "@types/vscode": "1.93.0" } } diff --git a/client/src/extension.ts b/client/src/extension.ts index 9661880..632b58a 100644 --- a/client/src/extension.ts +++ b/client/src/extension.ts @@ -21,6 +21,7 @@ import { } from 'vscode-languageclient/node'; import { gt, lte } from "semver"; +import * as serverManager from "@intersystems-community/intersystems-servermanager"; import { ObjectScriptEvaluatableExpressionProvider } from './evaluatableExpressionProvider'; import { @@ -41,6 +42,8 @@ export let client: LanguageClient; */ export let cookiesCache: Cache; +let serverManagerApi: serverManager.ServerManagerAPI; + type MakeRESTRequestParams = { method: "GET"|"POST"; api: number; @@ -131,7 +134,7 @@ export async function activate(context: ExtensionContext) { const serverManagerExt = extensions.getExtension("intersystems-community.servermanager"); if (serverManagerExt !== undefined) { // The server manager extension is installed - const serverManagerApi = serverManagerExt.isActive ? serverManagerExt.exports : await serverManagerExt.activate(); + serverManagerApi = serverManagerExt.isActive ? serverManagerExt.exports : await serverManagerExt.activate(); serverManagerApi.onDidChangePassword()((serverName: string) => { client.sendNotification("intersystems/server/passwordChange",serverName); }); @@ -157,12 +160,12 @@ export async function activate(context: ExtensionContext) { ) { // The main extension didn't provide a password, so we must // get it from the server manager's authentication provider. - const AUTHENTICATION_PROVIDER = "intersystems-server-credentials"; const scopes = [serverSpec.serverName, serverSpec.username]; try { - let session = await authentication.getSession(AUTHENTICATION_PROVIDER, scopes, { silent: true }); + const account = serverManagerApi.getAccount ? serverManagerApi.getAccount(serverSpec) : undefined; + let session = await authentication.getSession(serverManager.AUTHENTICATION_PROVIDER, scopes, { silent: true, account }); if (!session) { - session = await authentication.getSession(AUTHENTICATION_PROVIDER, scopes, { createIfNone: true }); + session = await authentication.getSession(serverManager.AUTHENTICATION_PROVIDER, scopes, { createIfNone: true, account }); } if (session) { serverSpec.username = session.scopes[1]; @@ -171,7 +174,7 @@ export async function activate(context: ExtensionContext) { } catch (error) { // The user did not consent to sharing authentication information if (error instanceof Error) { - client.warn(`${AUTHENTICATION_PROVIDER}: ${error.message}`); + client.warn(`${serverManager.AUTHENTICATION_PROVIDER}: ${error.message}`); } } } diff --git a/package-lock.json b/package-lock.json index 42bf0bb..1b83532 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "language-server", - "version": "2.6.0-SNAPSHOT", + "version": "2.6.4-SNAPSHOT", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "language-server", - "version": "2.6.0-SNAPSHOT", + "version": "2.6.4-SNAPSHOT", "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE.txt", "devDependencies": { diff --git a/server/package-lock.json b/server/package-lock.json index b26e0fe..106946b 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -1,12 +1,12 @@ { "name": "language-server-server", - "version": "2.6.0-SNAPSHOT", + "version": "2.6.4-SNAPSHOT", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "language-server-server", - "version": "2.6.0-SNAPSHOT", + "version": "2.6.4-SNAPSHOT", "dependencies": { "node-html-parser": "^6.1.13", "turndown": "^7.2.0",