mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-28 05:35:08 +00:00
more tests
This commit is contained in:
@@ -30,8 +30,11 @@ export function getSemanticTokens(jsLanguageService: ts.LanguageService, current
|
||||
if (symbol) {
|
||||
let typeIdx = tokenFromDeclarationMapping[symbol.valueDeclaration.kind];
|
||||
let modifierSet = 0;
|
||||
if (node.parent && (<ts.NamedDeclaration>node.parent).name === node) {
|
||||
modifierSet = TokenModifier.declaration;
|
||||
if (node.parent) {
|
||||
const parentTypeIdx = tokenFromDeclarationMapping[node.parent.kind];
|
||||
if (parentTypeIdx === typeIdx && (<ts.NamedDeclaration>node.parent).name === node) {
|
||||
modifierSet = TokenModifier.declaration;
|
||||
}
|
||||
}
|
||||
if (typeIdx !== undefined) {
|
||||
resultTokens.push({ offset: node.getStart(), length: node.getWidth(), typeIdx, modifierSet });
|
||||
@@ -130,5 +133,7 @@ const tokenFromDeclarationMapping: { [name: string]: TokenType } = {
|
||||
[ts.SyntaxKind.EnumDeclaration]: TokenType.enum,
|
||||
[ts.SyntaxKind.EnumMember]: TokenType.property,
|
||||
[ts.SyntaxKind.ClassDeclaration]: TokenType.property,
|
||||
[ts.SyntaxKind.MethodDeclaration]: TokenType.function
|
||||
[ts.SyntaxKind.MethodDeclaration]: TokenType.member,
|
||||
[ts.SyntaxKind.FunctionDeclaration]: TokenType.function,
|
||||
[ts.SyntaxKind.MethodSignature]: TokenType.member,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user