Show better symbolKinds for workspace symbols
This commit is contained in:
parent
feb42fad54
commit
9d25faad7f
7 changed files with 19 additions and 13 deletions
|
@ -216,7 +216,7 @@ class MyCompletionItem extends vscode.CompletionItem {
|
||||||
case PConst.Kind.function:
|
case PConst.Kind.function:
|
||||||
case PConst.Kind.localFunction:
|
case PConst.Kind.localFunction:
|
||||||
return vscode.CompletionItemKind.Function;
|
return vscode.CompletionItemKind.Function;
|
||||||
case PConst.Kind.memberFunction:
|
case PConst.Kind.method:
|
||||||
case PConst.Kind.constructSignature:
|
case PConst.Kind.constructSignature:
|
||||||
case PConst.Kind.callSignature:
|
case PConst.Kind.callSignature:
|
||||||
case PConst.Kind.indexSignature:
|
case PConst.Kind.indexSignature:
|
||||||
|
@ -272,7 +272,7 @@ class MyCompletionItem extends vscode.CompletionItem {
|
||||||
case PConst.Kind.memberVariable:
|
case PConst.Kind.memberVariable:
|
||||||
case PConst.Kind.class:
|
case PConst.Kind.class:
|
||||||
case PConst.Kind.function:
|
case PConst.Kind.function:
|
||||||
case PConst.Kind.memberFunction:
|
case PConst.Kind.method:
|
||||||
case PConst.Kind.keyword:
|
case PConst.Kind.keyword:
|
||||||
case PConst.Kind.parameter:
|
case PConst.Kind.parameter:
|
||||||
commitCharacters.push('.', ',', ';');
|
commitCharacters.push('.', ',', ';');
|
||||||
|
|
|
@ -16,7 +16,7 @@ const getSymbolKind = (kind: string): vscode.SymbolKind => {
|
||||||
case PConst.Kind.class: return vscode.SymbolKind.Class;
|
case PConst.Kind.class: return vscode.SymbolKind.Class;
|
||||||
case PConst.Kind.enum: return vscode.SymbolKind.Enum;
|
case PConst.Kind.enum: return vscode.SymbolKind.Enum;
|
||||||
case PConst.Kind.interface: return vscode.SymbolKind.Interface;
|
case PConst.Kind.interface: return vscode.SymbolKind.Interface;
|
||||||
case PConst.Kind.memberFunction: return vscode.SymbolKind.Method;
|
case PConst.Kind.method: return vscode.SymbolKind.Method;
|
||||||
case PConst.Kind.memberVariable: return vscode.SymbolKind.Property;
|
case PConst.Kind.memberVariable: return vscode.SymbolKind.Property;
|
||||||
case PConst.Kind.memberGetAccessor: return vscode.SymbolKind.Property;
|
case PConst.Kind.memberGetAccessor: return vscode.SymbolKind.Property;
|
||||||
case PConst.Kind.memberSetAccessor: return vscode.SymbolKind.Property;
|
case PConst.Kind.memberSetAccessor: return vscode.SymbolKind.Property;
|
||||||
|
|
|
@ -75,7 +75,7 @@ export default class TypeScriptImplementationsCodeLensProvider extends TypeScrip
|
||||||
return getSymbolRange(document, item);
|
return getSymbolRange(document, item);
|
||||||
|
|
||||||
case PConst.Kind.class:
|
case PConst.Kind.class:
|
||||||
case PConst.Kind.memberFunction:
|
case PConst.Kind.method:
|
||||||
case PConst.Kind.memberVariable:
|
case PConst.Kind.memberVariable:
|
||||||
case PConst.Kind.memberGetAccessor:
|
case PConst.Kind.memberGetAccessor:
|
||||||
case PConst.Kind.memberSetAccessor:
|
case PConst.Kind.memberSetAccessor:
|
||||||
|
|
|
@ -94,7 +94,7 @@ export class TypeScriptReferencesCodeLensProvider extends TypeScriptBaseCodeLens
|
||||||
case PConst.Kind.enum:
|
case PConst.Kind.enum:
|
||||||
return getSymbolRange(document, item);
|
return getSymbolRange(document, item);
|
||||||
|
|
||||||
case PConst.Kind.memberFunction:
|
case PConst.Kind.method:
|
||||||
case PConst.Kind.memberGetAccessor:
|
case PConst.Kind.memberGetAccessor:
|
||||||
case PConst.Kind.memberSetAccessor:
|
case PConst.Kind.memberSetAccessor:
|
||||||
case PConst.Kind.constructorImplementation:
|
case PConst.Kind.constructorImplementation:
|
||||||
|
|
|
@ -9,15 +9,21 @@ import { ITypeScriptServiceClient } from '../typescriptService';
|
||||||
import * as fileSchemes from '../utils/fileSchemes';
|
import * as fileSchemes from '../utils/fileSchemes';
|
||||||
import { doesResourceLookLikeAJavaScriptFile, doesResourceLookLikeATypeScriptFile } from '../utils/languageDescription';
|
import { doesResourceLookLikeAJavaScriptFile, doesResourceLookLikeATypeScriptFile } from '../utils/languageDescription';
|
||||||
import * as typeConverters from '../utils/typeConverters';
|
import * as typeConverters from '../utils/typeConverters';
|
||||||
|
import * as PConst from '../protocol.const';
|
||||||
|
|
||||||
function getSymbolKind(item: Proto.NavtoItem): vscode.SymbolKind {
|
function getSymbolKind(item: Proto.NavtoItem): vscode.SymbolKind {
|
||||||
switch (item.kind) {
|
switch (item.kind) {
|
||||||
case 'method': return vscode.SymbolKind.Method;
|
case PConst.Kind.method: return vscode.SymbolKind.Method;
|
||||||
case 'enum': return vscode.SymbolKind.Enum;
|
case PConst.Kind.enum: return vscode.SymbolKind.Enum;
|
||||||
case 'function': return vscode.SymbolKind.Function;
|
case PConst.Kind.enumMember: return vscode.SymbolKind.EnumMember;
|
||||||
case 'class': return vscode.SymbolKind.Class;
|
case PConst.Kind.function: return vscode.SymbolKind.Function;
|
||||||
case 'interface': return vscode.SymbolKind.Interface;
|
case PConst.Kind.class: return vscode.SymbolKind.Class;
|
||||||
case 'var': return vscode.SymbolKind.Variable;
|
case PConst.Kind.interface: return vscode.SymbolKind.Interface;
|
||||||
|
case PConst.Kind.type: return vscode.SymbolKind.Class;
|
||||||
|
case PConst.Kind.memberVariable: return vscode.SymbolKind.Field;
|
||||||
|
case PConst.Kind.memberGetAccessor: return vscode.SymbolKind.Field;
|
||||||
|
case PConst.Kind.memberSetAccessor: return vscode.SymbolKind.Field;
|
||||||
|
case PConst.Kind.variable: return vscode.SymbolKind.Variable;
|
||||||
default: return vscode.SymbolKind.Variable;
|
default: return vscode.SymbolKind.Variable;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ export class Kind {
|
||||||
public static readonly let = 'let';
|
public static readonly let = 'let';
|
||||||
public static readonly localFunction = 'local function';
|
public static readonly localFunction = 'local function';
|
||||||
public static readonly localVariable = 'local var';
|
public static readonly localVariable = 'local var';
|
||||||
public static readonly memberFunction = 'method';
|
public static readonly method = 'method';
|
||||||
public static readonly memberGetAccessor = 'getter';
|
public static readonly memberGetAccessor = 'getter';
|
||||||
public static readonly memberSetAccessor = 'setter';
|
public static readonly memberSetAccessor = 'setter';
|
||||||
public static readonly memberVariable = 'property';
|
public static readonly memberVariable = 'property';
|
||||||
|
|
|
@ -107,7 +107,7 @@ export namespace SymbolKind {
|
||||||
case PConst.Kind.interface: return vscode.SymbolKind.Interface;
|
case PConst.Kind.interface: return vscode.SymbolKind.Interface;
|
||||||
case PConst.Kind.indexSignature: return vscode.SymbolKind.Method;
|
case PConst.Kind.indexSignature: return vscode.SymbolKind.Method;
|
||||||
case PConst.Kind.callSignature: return vscode.SymbolKind.Method;
|
case PConst.Kind.callSignature: return vscode.SymbolKind.Method;
|
||||||
case PConst.Kind.memberFunction: return vscode.SymbolKind.Method;
|
case PConst.Kind.method: return vscode.SymbolKind.Method;
|
||||||
case PConst.Kind.memberVariable: return vscode.SymbolKind.Property;
|
case PConst.Kind.memberVariable: return vscode.SymbolKind.Property;
|
||||||
case PConst.Kind.memberGetAccessor: return vscode.SymbolKind.Property;
|
case PConst.Kind.memberGetAccessor: return vscode.SymbolKind.Property;
|
||||||
case PConst.Kind.memberSetAccessor: return vscode.SymbolKind.Property;
|
case PConst.Kind.memberSetAccessor: return vscode.SymbolKind.Property;
|
||||||
|
|
Loading…
Reference in a new issue