From ffeea63f43e6a7fd46be4a8cd5a5d254c98dea08 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Wed, 30 Jun 2021 15:30:48 -0700 Subject: [PATCH] fix(language-service): Do not override TS LS methods not supported by VE NgLS (#42727) Historically, our Language Service was built with the potential to be a drop-in replacement for the TypeScript Language Service with the added benefit of being able to provide Angular-specific information as well. While our VSCode extension does not use the Language Service in this way, it appears that other community-contributed plugins do. We don't really officially support this use-case but there's not real reason for us to override the TypeScript Language Service's implementation in the VE Angular Language Service so that it returns `undefined`. As with other non-implemented methods, we can just allow this to be deferred to TSLS. fixes #42715 PR Close #42727 --- packages/language-service/src/ts_plugin.ts | 28 ---------------------- 1 file changed, 28 deletions(-) diff --git a/packages/language-service/src/ts_plugin.ts b/packages/language-service/src/ts_plugin.ts index d6050d7465..0c26ec7fa9 100644 --- a/packages/language-service/src/ts_plugin.ts +++ b/packages/language-service/src/ts_plugin.ts @@ -119,30 +119,6 @@ export function create(info: tss.server.PluginCreateInfo): NgLanguageService { return ngLS.getDefinitionAndBoundSpan(fileName, position); } - function getTypeDefinitionAtPosition(fileName: string, position: number) { - // Not implemented in VE Language Service - return undefined; - } - - function getReferencesAtPosition(fileName: string, position: number) { - // Not implemented in VE Language Service - return undefined; - } - - function findRenameLocations( - fileName: string, position: number, findInStrings: boolean, findInComments: boolean, - providePrefixAndSuffixTextForRename?: boolean): readonly ts.RenameLocation[]|undefined { - // not implemented in VE Language Service - return undefined; - } - - function getSignatureHelpItems( - fileName: string, position: number, - options: ts.SignatureHelpItemsOptions|undefined): ts.SignatureHelpItems|undefined { - // not implemented in VE Language Service - return undefined; - } - function getTcb(fileName: string, position: number) { // Not implemented in VE Language Service return undefined; @@ -162,10 +138,6 @@ export function create(info: tss.server.PluginCreateInfo): NgLanguageService { getSemanticDiagnostics, getDefinitionAtPosition, getDefinitionAndBoundSpan, - getTypeDefinitionAtPosition, - getReferencesAtPosition, - getSignatureHelpItems, - findRenameLocations, getTcb, getComponentLocationsForTemplate, };