forked from angular/angular
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(language-service): determine index types accessed using dot notation
Commit 53fc2ed added support for determining index types accessed using index signatures, but did not include support for index types accessed using dot notation: ```typescript const obj<T>: { [key: string]: T }; obj['stringKey']. // gets `T.` completions obj.stringKey. // did not peviously get `T.` completions ``` This adds support for determining an index type accessed via dot notation by rigging an object's symbol table to return the string index signature type a property access refers to, if that property does not explicitly exist on the object. This is very similar to @ivanwonder's work in angular#29811. `SymbolWrapper` now takes an additional parameter to explicitly set the type of the symbol wrapped. This is done because `SymbolTableWrapper#get` only has access to the symbol of the index type, _not_ the index signature symbol itself. An attempt to get the type of the index type will give an error. Closes angular#29811 Closes angular/vscode-ng-language-service#126
- Loading branch information
Showing
3 changed files
with
89 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters