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.
This commit is contained in:
Kam
2026-05-27 10:52:49 -07:00
committed by Alex Rickabaugh
parent fdf0bf9a62
commit d808866f89
@@ -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');
}