Skip to content

Commit 6f90b31

Browse files
author
Andy
authored
Make safelist an instance field of ProjectService (#17307)
1 parent 61c6ecb commit 6f90b31

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/server/editorServices.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ namespace ts.server {
370370
private readonly throttledOperations: ThrottledOperations;
371371

372372
private readonly hostConfiguration: HostConfiguration;
373-
private static safelist: SafeList = defaultTypeSafeList;
373+
private safelist: SafeList = defaultTypeSafeList;
374374

375375
private changedFiles: ScriptInfo[];
376376

@@ -1620,7 +1620,7 @@ namespace ts.server {
16201620
}
16211621

16221622
resetSafeList(): void {
1623-
ProjectService.safelist = defaultTypeSafeList;
1623+
this.safelist = defaultTypeSafeList;
16241624
}
16251625

16261626
loadSafeList(fileName: string): void {
@@ -1630,7 +1630,7 @@ namespace ts.server {
16301630
raw[k].match = new RegExp(raw[k].match as {} as string, "i");
16311631
}
16321632
// raw is now fixed and ready
1633-
ProjectService.safelist = raw;
1633+
this.safelist = raw;
16341634
}
16351635

16361636
applySafeList(proj: protocol.ExternalProject): void {
@@ -1641,8 +1641,8 @@ namespace ts.server {
16411641

16421642
const normalizedNames = rootFiles.map(f => normalizeSlashes(f.fileName));
16431643

1644-
for (const name of Object.keys(ProjectService.safelist)) {
1645-
const rule = ProjectService.safelist[name];
1644+
for (const name of Object.keys(this.safelist)) {
1645+
const rule = this.safelist[name];
16461646
for (const root of normalizedNames) {
16471647
if (rule.match.test(root)) {
16481648
this.logger.info(`Excluding files based on rule ${name}`);

0 commit comments

Comments
 (0)