Skip to content

Commit b577b96

Browse files
Jonas(Jiajie) JingJonas(Jiajie) Jing
authored andcommitted
fix: workspace init fail
1 parent 13a0fb7 commit b577b96

File tree

3 files changed

+36
-28
lines changed

3 files changed

+36
-28
lines changed

server/package-lock.json

Lines changed: 25 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/src/python/PyrightLanguageProvider.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright © 2022-2024, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
13
import {
24
CallHierarchyIncomingCallsParams,
35
CallHierarchyItem,
@@ -203,6 +205,7 @@ export class PyrightLanguageProvider extends PyrightServer {
203205
}
204206

205207
public onInitialized(): void {
208+
this.updateSettingsForAllWorkspaces();
206209
super.onInitialized();
207210
}
208211

@@ -241,7 +244,7 @@ export class PyrightLanguageProvider extends PyrightServer {
241244
}
242245

243246
public async onDidCloseTextDocument(params: DidCloseTextDocumentParams) {
244-
// delete this.docOffsetMap[params.textDocument.uri];
247+
delete this.docChangeRecords[params.textDocument.uri];
245248
await super.onDidCloseTextDocument(params);
246249
}
247250

server/src/server.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import { CollectionResult } from "pyright-internal-lsp/dist/packages/pyright-int
3232
import { ParseFileResults } from "pyright-internal-lsp/dist/packages/pyright-internal/src/parser/parser";
3333

3434
import { PyrightLanguageProvider } from "./python/PyrightLanguageProvider";
35+
import { CodeZoneManager } from "./sas/CodeZoneManager";
3536
import { CompletionProvider } from "./sas/CompletionProvider";
3637
import { LanguageServiceProvider, legend } from "./sas/LanguageServiceProvider";
3738
import type { LibCompleteItem } from "./sas/SyntaxDataProvider";
@@ -61,7 +62,6 @@ export const init = (conn: Connection): void => {
6162
) {
6263
supportSASGetLibList = true;
6364
}
64-
6565
_pyrightLanguageProvider.initialize(params, [], []);
6666

6767
const result: InitializeResult = {
@@ -523,6 +523,7 @@ const dispatch = async <Ret>(
523523
},
524524
) => {
525525
const languageService = getLanguageService(params.textDocument.uri);
526+
const codeZoneManager = languageService.getCodeZoneManager();
526527
const pos = params.position;
527528
const symbols: DocumentSymbol[] = languageService.getDocumentSymbols();
528529
for (const symbol of symbols) {
@@ -534,7 +535,11 @@ const dispatch = async <Ret>(
534535
(end.line > pos.line ||
535536
(end.line === pos.line && end.character >= pos.character))
536537
) {
537-
if (symbol.name?.toUpperCase() === "PROC PYTHON") {
538+
if (
539+
symbol.name?.toUpperCase() === "PROC PYTHON" &&
540+
codeZoneManager.getCurrentZone(pos.line, pos.character) ===
541+
CodeZoneManager.ZONE_TYPE.EMBEDDED_LANG
542+
) {
538543
if (callbacks.python) {
539544
return await callbacks.python(_pyrightLanguageProvider);
540545
} else {

0 commit comments

Comments
 (0)