Skip to content

Commit

Permalink
Fixes #355, Prepare 2.6.4 release
Browse files Browse the repository at this point in the history
  • Loading branch information
isc-bsaviano committed Nov 13, 2024
1 parent e28c738 commit 0279df0
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 29 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
47 changes: 30 additions & 17 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
13 changes: 8 additions & 5 deletions client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -41,6 +42,8 @@ export let client: LanguageClient;
*/
export let cookiesCache: Cache;

let serverManagerApi: serverManager.ServerManagerAPI;

type MakeRESTRequestParams = {
method: "GET"|"POST";
api: number;
Expand Down Expand Up @@ -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);
});
Expand All @@ -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];
Expand All @@ -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}`);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0279df0

Please sign in to comment.