Skip to content

Commit 49e3dc5

Browse files
committed
Fixes #375
1 parent 082bc56 commit 49e3dc5

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## [2.7.4] - 2025-XX-XX
44
- Fix issue [#373](https://github.com/intersystems/language-server/issues/373): Add go to definition and hover support for `UrlMap` Call and Forward attribute values
55
- Fix issue [#374](https://github.com/intersystems/language-server/issues/374): `undefined` items appearing in completion lists for XML XData
6+
- Fix issue [#375](https://github.com/intersystems/language-server/issues/375): Retrieve password from Server Manager case-sensitively
67

78
## [2.7.3] - 2025-05-05
89
- Fix issue [#366](https://github.com/intersystems/language-server/issues/366): Language Server can return invalid DocumentSymbols in some rare circumstances

client/src/extension.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import {
88
workspace,
99
commands,
1010
languages,
11-
authentication
11+
authentication,
12+
AuthenticationSession
1213
} from 'vscode';
1314

1415
import * as Cache from 'vscode-cache';
@@ -78,6 +79,12 @@ type MakeRESTRequestParams = {
7879
params?: any;
7980
};
8081

82+
83+
interface ServerManagerAuthSession extends AuthenticationSession {
84+
serverName: string;
85+
userName: string;
86+
}
87+
8188
export async function activate(context: ExtensionContext) {
8289
// Get the main extension exported API
8390
const objectScriptExt = extensions.getExtension("intersystems-community.vscode-objectscript");
@@ -193,12 +200,12 @@ export async function activate(context: ExtensionContext) {
193200
const scopes = [serverSpec.serverName, serverSpec.username];
194201
try {
195202
const account = serverManagerApi?.getAccount ? serverManagerApi.getAccount({ name: serverSpec.serverName, ...serverSpec }) : undefined;
196-
let session = await authentication.getSession(serverManager.AUTHENTICATION_PROVIDER, scopes, { silent: true, account });
203+
let session = <ServerManagerAuthSession>await authentication.getSession(serverManager.AUTHENTICATION_PROVIDER, scopes, { silent: true, account });
197204
if (!session) {
198-
session = await authentication.getSession(serverManager.AUTHENTICATION_PROVIDER, scopes, { createIfNone: true, account });
205+
session = <ServerManagerAuthSession>await authentication.getSession(serverManager.AUTHENTICATION_PROVIDER, scopes, { createIfNone: true, account });
199206
}
200207
if (session) {
201-
serverSpec.username = session.scopes[1];
208+
serverSpec.username = session.userName;
202209
serverSpec.password = session.accessToken;
203210
}
204211
} catch (error) {

0 commit comments

Comments
 (0)