@@ -32,6 +32,7 @@ import { CollectionResult } from "pyright-internal-lsp/dist/packages/pyright-int
3232import { ParseFileResults } from "pyright-internal-lsp/dist/packages/pyright-internal/src/parser/parser" ;
3333
3434import { PyrightLanguageProvider } from "./python/PyrightLanguageProvider" ;
35+ import { CodeZoneManager } from "./sas/CodeZoneManager" ;
3536import { CompletionProvider } from "./sas/CompletionProvider" ;
3637import { LanguageServiceProvider , legend } from "./sas/LanguageServiceProvider" ;
3738import 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