Skip to content

Commit a2d46d4

Browse files
committed
ts semantic highlighting: support alias
1 parent e3c320d commit a2d46d4

4 files changed

Lines changed: 10 additions & 7 deletions

File tree

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@
231231
"type": "node",
232232
"request": "launch",
233233
"name": "HTML Unit Tests",
234-
"program": "${workspaceFolder}/extensions/html-language-features/server/node_modules/mocha/bin/_mocha",
234+
"program": "${workspaceFolder}/extensions/html-language-features/server/test/index.js",
235235
"stopOnEntry": false,
236236
"cwd": "${workspaceFolder}/extensions/html-language-features/server",
237237
"outFiles": [

extensions/html-language-features/server/src/modes/javascriptSemanticTokens.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ function collectTokens(jsLanguageService: ts.LanguageService, fileName: string,
3939
return;
4040
}
4141
if (ts.isIdentifier(node)) {
42-
const symbol = typeChecker.getSymbolAtLocation(node);
42+
let symbol = typeChecker.getSymbolAtLocation(node);
4343
if (symbol) {
44+
if (symbol.flags & ts.SymbolFlags.Alias) {
45+
symbol = typeChecker.getAliasedSymbol(symbol);
46+
}
4447
let typeIdx = classifySymbol(symbol);
4548
if (typeIdx !== undefined) {
4649
let modifierSet = 0;

extensions/typescript-language-features/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"jsonc-parser": "^2.1.1",
2020
"rimraf": "^2.6.3",
2121
"semver": "5.5.1",
22-
"typescript-vscode-sh-plugin": "^0.5.0",
22+
"typescript-vscode-sh-plugin": "^0.6.1",
2323
"vscode-extension-telemetry": "0.1.1",
2424
"vscode-nls": "^4.0.0"
2525
},

extensions/typescript-language-features/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -626,10 +626,10 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0:
626626
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
627627
integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=
628628

629-
typescript-vscode-sh-plugin@^0.5.0:
630-
version "0.5.0"
631-
resolved "https://registry.yarnpkg.com/typescript-vscode-sh-plugin/-/typescript-vscode-sh-plugin-0.5.0.tgz#014dd928f2fa5000396147ed00792a2c901d97b9"
632-
integrity sha512-MKqivbdkgllHS3Rab/zvXlGAxwCb1AHzgO/a8vmG6i5kExGIytwjUyXALdnnLUWS03B9eEJmIjzOz4y3MpgliQ==
629+
typescript-vscode-sh-plugin@^0.6.1:
630+
version "0.6.1"
631+
resolved "https://registry.yarnpkg.com/typescript-vscode-sh-plugin/-/typescript-vscode-sh-plugin-0.6.1.tgz#db1a291cbc385a76e33a83fb9233e3ec66ba15ff"
632+
integrity sha512-rqpHjxadpCDuGvYdCojlOLgt/TSCIgruzM/BzA0q8VjDPVh6NOKtiZLPDnzMe1rL77ZGWxYYgKtRg1bexnZrPA==
633633

634634
uri-js@^4.2.2:
635635
version "4.2.2"

0 commit comments

Comments
 (0)