From 80b38fd757d63658d12b05f2bfaaa7d04c55251c Mon Sep 17 00:00:00 2001 From: Kam Date: Sun, 24 May 2026 19:57:22 +0300 Subject: [PATCH] refactor(language-server): drop duplicate isAngularCore helpers in session session.ts defined isAngularCore, isExternalAngularCore, and isInternalAngularCore as byte-identical copies of the already-exported versions in utils.ts. Only isAngularCore was used locally; the other two were dead. handlers/template_info.ts already imports the utils version. Remove the duplicates and import isAngularCore from utils. --- .../server/src/session.ts | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/vscode-ng-language-service/server/src/session.ts b/vscode-ng-language-service/server/src/session.ts index 1f4c5b57808f..4c4adff1a931 100644 --- a/vscode-ng-language-service/server/src/session.ts +++ b/vscode-ng-language-service/server/src/session.ts @@ -34,6 +34,7 @@ import {tsDiagnosticToLspDiagnostic} from './diagnostic'; import {ServerHost} from './server_host'; import { filePathToUri, + isAngularCore, isConfiguredProject, isDebugMode, lspRangeToTsPositions, @@ -782,23 +783,6 @@ export class Session { } } -function isAngularCore(path: string): boolean { - return isExternalAngularCore(path) || isInternalAngularCore(path); -} - -function isExternalAngularCore(path: string): boolean { - return /@angular\/core\/.+\.d\.ts$/.test(path); -} - -function isInternalAngularCore(path: string): boolean { - // path in g3 - return ( - path.endsWith('angular2/rc/packages/core/index.d.ts') || - // angular/angular repository direct sources - path.includes('angular/packages/core/src') - ); -} - function isTypeScriptFile(path: string): boolean { return path.endsWith('.ts'); }