mirror of
https://github.com/angular/angular.git
synced 2026-11-22 22:55:25 -05:00
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:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user