fix(language-service): reinstate getExternalFiles() (#37750)
`getExternalFiles()` is an API that could optionally be provided by a tsserver plugin to notify the server of any additional files that should belong to a particular project. This API was removed in https://github.com/angular/angular/pull/34260 mainly due to performance reasons. However, with the introduction of "solution-style" tsconfig in typescript 3.9, the Angular extension could no longer reliably detect the owning Project solely based on the ancestor tsconfig.json. In order to support this use case, we have to reinstate `getExternalFiles()`. Fixes https://github.com/angular/vscode-ng-language-service/issues/824 PR Close #37750
This commit is contained in:

committed by
Andrew Kushnir

parent
6341a837c1
commit
c942662d79
@ -8,7 +8,7 @@
|
||||
|
||||
import * as ts from 'typescript';
|
||||
|
||||
import {create} from '../src/ts_plugin';
|
||||
import {create, getExternalFiles} from '../src/ts_plugin';
|
||||
import {CompletionKind} from '../src/types';
|
||||
|
||||
import {MockTypescriptHost} from './test_utils';
|
||||
@ -129,6 +129,13 @@ describe('plugin', () => {
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it('should return external templates when getExternalFiles() is called', () => {
|
||||
const externalTemplates = getExternalFiles(mockProject);
|
||||
expect(externalTemplates).toEqual([
|
||||
'/app/test.ng',
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe(`with config 'angularOnly = true`, () => {
|
||||
|
Reference in New Issue
Block a user