Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return typescript.ScriptElementKind.constructorImplementationElement;
case vscode.CompletionItemKind.Field:
case vscode.CompletionItemKind.Variable:
return typescript.ScriptElementKind.variableElement;
case vscode.CompletionItemKind.Class:
return typescript.ScriptElementKind.classElement;
case vscode.CompletionItemKind.Interface:
return typescript.ScriptElementKind.interfaceElement;
case vscode.CompletionItemKind.Module:
return typescript.ScriptElementKind.moduleElement;
case vscode.CompletionItemKind.Property:
return typescript.ScriptElementKind.memberVariableElement;
case vscode.CompletionItemKind.Unit:
case vscode.CompletionItemKind.Value:
return typescript.ScriptElementKind.constElement;
case vscode.CompletionItemKind.Enum:
return typescript.ScriptElementKind.enumElement;
case vscode.CompletionItemKind.Keyword:
return typescript.ScriptElementKind.keyword;
case vscode.CompletionItemKind.Color:
return typescript.ScriptElementKind.constElement;
case vscode.CompletionItemKind.Reference:
return typescript.ScriptElementKind.alias;
case vscode.CompletionItemKind.File:
return typescript.ScriptElementKind.moduleElement;
case vscode.CompletionItemKind.Snippet:
case vscode.CompletionItemKind.Text:
default:
return typescript.ScriptElementKind.unknown;
}
}
function translateSeverity(typescript, severity) {
case vscode.CompletionItemKind.Variable:
return typescript.ScriptElementKind.variableElement;
case vscode.CompletionItemKind.Class:
return typescript.ScriptElementKind.classElement;
case vscode.CompletionItemKind.Interface:
return typescript.ScriptElementKind.interfaceElement;
case vscode.CompletionItemKind.Module:
return typescript.ScriptElementKind.moduleElement;
case vscode.CompletionItemKind.Property:
return typescript.ScriptElementKind.memberVariableElement;
case vscode.CompletionItemKind.Unit:
case vscode.CompletionItemKind.Value:
return typescript.ScriptElementKind.constElement;
case vscode.CompletionItemKind.Enum:
return typescript.ScriptElementKind.enumElement;
case vscode.CompletionItemKind.Keyword:
return typescript.ScriptElementKind.keyword;
case vscode.CompletionItemKind.Color:
return typescript.ScriptElementKind.constElement;
case vscode.CompletionItemKind.Reference:
return typescript.ScriptElementKind.alias;
case vscode.CompletionItemKind.File:
return typescript.ScriptElementKind.moduleElement;
case vscode.CompletionItemKind.Snippet:
case vscode.CompletionItemKind.Text:
default:
return typescript.ScriptElementKind.unknown;
}
}
function translateSeverity(typescript, severity) {
case vscode.CompletionItemKind.Interface:
return typescript.ScriptElementKind.interfaceElement;
case vscode.CompletionItemKind.Module:
return typescript.ScriptElementKind.moduleElement;
case vscode.CompletionItemKind.Property:
return typescript.ScriptElementKind.memberVariableElement;
case vscode.CompletionItemKind.Unit:
case vscode.CompletionItemKind.Value:
return typescript.ScriptElementKind.constElement;
case vscode.CompletionItemKind.Enum:
return typescript.ScriptElementKind.enumElement;
case vscode.CompletionItemKind.Keyword:
return typescript.ScriptElementKind.keyword;
case vscode.CompletionItemKind.Color:
return typescript.ScriptElementKind.constElement;
case vscode.CompletionItemKind.Reference:
return typescript.ScriptElementKind.alias;
case vscode.CompletionItemKind.File:
return typescript.ScriptElementKind.moduleElement;
case vscode.CompletionItemKind.Snippet:
case vscode.CompletionItemKind.Text:
default:
return typescript.ScriptElementKind.unknown;
}
}
case vscode.CompletionItemKind.Method:
return typescript.ScriptElementKind.memberFunctionElement;
case vscode.CompletionItemKind.Function:
return typescript.ScriptElementKind.functionElement;
case vscode.CompletionItemKind.Constructor:
return typescript.ScriptElementKind.constructorImplementationElement;
case vscode.CompletionItemKind.Field:
case vscode.CompletionItemKind.Variable:
return typescript.ScriptElementKind.variableElement;
case vscode.CompletionItemKind.Class:
return typescript.ScriptElementKind.classElement;
case vscode.CompletionItemKind.Interface:
return typescript.ScriptElementKind.interfaceElement;
case vscode.CompletionItemKind.Module:
return typescript.ScriptElementKind.moduleElement;
case vscode.CompletionItemKind.Property:
return typescript.ScriptElementKind.memberVariableElement;
case vscode.CompletionItemKind.Unit:
case vscode.CompletionItemKind.Value:
return typescript.ScriptElementKind.constElement;
case vscode.CompletionItemKind.Enum:
return typescript.ScriptElementKind.enumElement;
case vscode.CompletionItemKind.Keyword:
return typescript.ScriptElementKind.keyword;
case vscode.CompletionItemKind.Color:
return typescript.ScriptElementKind.constElement;
case vscode.CompletionItemKind.Reference:
return typescript.ScriptElementKind.alias;
case vscode.CompletionItemKind.File:
return typescript.ScriptElementKind.moduleElement;
case vscode.CompletionItemKind.Snippet:
case vscode.CompletionItemKind.Text:
function getKindModifiers(item: vscode.CompletionItem): string {
if (item.kind === vscode.CompletionItemKind.Color) {
return 'color';
}
return '';
}
function translateionCompletionItemKind(
typescript: typeof ts,
kind: vscode.CompletionItemKind
): ts.ScriptElementKind {
switch (kind) {
case vscode.CompletionItemKind.Method:
return typescript.ScriptElementKind.memberFunctionElement;
case vscode.CompletionItemKind.Function:
return typescript.ScriptElementKind.functionElement;
case vscode.CompletionItemKind.Constructor:
return typescript.ScriptElementKind.constructorImplementationElement;
case vscode.CompletionItemKind.Field:
case vscode.CompletionItemKind.Variable:
return typescript.ScriptElementKind.variableElement;
case vscode.CompletionItemKind.Class:
return typescript.ScriptElementKind.classElement;
case vscode.CompletionItemKind.Interface:
return typescript.ScriptElementKind.interfaceElement;
case vscode.CompletionItemKind.Module:
return typescript.ScriptElementKind.moduleElement;
case vscode.CompletionItemKind.Property:
return typescript.ScriptElementKind.memberVariableElement;
case vscode.CompletionItemKind.Unit:
case vscode.CompletionItemKind.Value:
return typescript.ScriptElementKind.constElement;
case vscode.CompletionItemKind.Enum:
return typescript.ScriptElementKind.enumElement;
case vscode.CompletionItemKind.Keyword:
case vscode.CompletionItemKind.Module:
return typescript.ScriptElementKind.moduleElement;
case vscode.CompletionItemKind.Property:
return typescript.ScriptElementKind.memberVariableElement;
case vscode.CompletionItemKind.Unit:
case vscode.CompletionItemKind.Value:
return typescript.ScriptElementKind.constElement;
case vscode.CompletionItemKind.Enum:
return typescript.ScriptElementKind.enumElement;
case vscode.CompletionItemKind.Keyword:
return typescript.ScriptElementKind.keyword;
case vscode.CompletionItemKind.Color:
return typescript.ScriptElementKind.constElement;
case vscode.CompletionItemKind.Reference:
return typescript.ScriptElementKind.alias;
case vscode.CompletionItemKind.File:
return typescript.ScriptElementKind.moduleElement;
case vscode.CompletionItemKind.Snippet:
case vscode.CompletionItemKind.Text:
default:
return typescript.ScriptElementKind.unknown;
}
}
function getKindModifiers(item) {
case vscode.CompletionItemKind.Class:
return typescript.ScriptElementKind.classElement;
case vscode.CompletionItemKind.Interface:
return typescript.ScriptElementKind.interfaceElement;
case vscode.CompletionItemKind.Module:
return typescript.ScriptElementKind.moduleElement;
case vscode.CompletionItemKind.Property:
return typescript.ScriptElementKind.memberVariableElement;
case vscode.CompletionItemKind.Unit:
case vscode.CompletionItemKind.Value:
return typescript.ScriptElementKind.constElement;
case vscode.CompletionItemKind.Enum:
return typescript.ScriptElementKind.enumElement;
case vscode.CompletionItemKind.Keyword:
return typescript.ScriptElementKind.keyword;
case vscode.CompletionItemKind.Color:
return typescript.ScriptElementKind.constElement;
case vscode.CompletionItemKind.Reference:
return typescript.ScriptElementKind.alias;
case vscode.CompletionItemKind.File:
return typescript.ScriptElementKind.moduleElement;
case vscode.CompletionItemKind.Snippet:
case vscode.CompletionItemKind.Text:
default:
return typescript.ScriptElementKind.unknown;
}
}
const convertKindToIconName = (completionKind: types.CompletionItemKind) => {
switch (completionKind) {
case types.CompletionItemKind.Class:
return "cube"
case types.CompletionItemKind.Color:
return "paint-brush"
case types.CompletionItemKind.Constructor:
return "building"
case types.CompletionItemKind.Enum:
return "sitemap"
case types.CompletionItemKind.Field:
return "var"
case types.CompletionItemKind.File:
return "file"
case types.CompletionItemKind.Function:
return "cog"
case types.CompletionItemKind.Interface:
return "plug"
case types.CompletionItemKind.Keyword:
return typescript.ScriptElementKind.memberVariableElement;
case vscode.CompletionItemKind.Unit:
case vscode.CompletionItemKind.Value:
return typescript.ScriptElementKind.constElement;
case vscode.CompletionItemKind.Enum:
return typescript.ScriptElementKind.enumElement;
case vscode.CompletionItemKind.Keyword:
return typescript.ScriptElementKind.keyword;
case vscode.CompletionItemKind.Color:
return typescript.ScriptElementKind.constElement;
case vscode.CompletionItemKind.Reference:
return typescript.ScriptElementKind.alias;
case vscode.CompletionItemKind.File:
return typescript.ScriptElementKind.moduleElement;
case vscode.CompletionItemKind.Snippet:
case vscode.CompletionItemKind.Text:
default:
return typescript.ScriptElementKind.unknown;
}
}
function getKindModifiers(item) {