笔记软件在2023/4/1 12:20:32推送该笔记
定义命令(package.json)
"activationEvents": [
"onLanguage:soildity"
],
"main": "./extension.js",
"contributes": {
"languages": [{
"id": "soildity",
"aliases": ["soildity", "sol"],
"extensions": [".sol"],
"configuration": "./language-configuration.json"
}],
"grammars": [{
"language": "soildity",
"scopeName": "source.soildity",
"path": "./syntaxes/soildity.tmLanguage.json"
}]
},
activate下添加(extension.js)
const {CompletionItemKind,TextDocument,Position,CancellationToken,CompletionContext} = vscode
vscode.languages.registerCompletionItemProvider('soildity', {
provideCompletionItems(document, position, token, context) {
return [
{
detail: "我很好看",
kind: CompletionItemKind.Constant,
label: "reason"
},{
detail: "我不好看",
kind: CompletionItemKind.Constant,
label: "reason"
},{
detail: "我很好看",
kind: CompletionItemKind.Constant,
label: "reason"
}
]
}
}," ",);
标签:kind,提示,代码,CompletionItemKind,soildity,detail,实现,json,label From: https://www.cnblogs.com/myfriend/p/implement-code-prompt-zp6ycw.html