mirror of
https://github.com/mtshiba/pylyzer.git
synced 2025-08-04 14:28:24 +00:00
chore: add settings for the extension
This commit is contained in:
parent
c1f37108a0
commit
00e0ae46f2
3 changed files with 943 additions and 288 deletions
1165
extension/package-lock.json
generated
1165
extension/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -3,7 +3,7 @@
|
|||
"displayName": "pylyzer",
|
||||
"description": "A fast Python static code analyzer & language server for VSCode",
|
||||
"publisher": "pylyzer",
|
||||
"version": "0.1.8",
|
||||
"version": "0.1.9",
|
||||
"engines": {
|
||||
"vscode": "^1.70.0"
|
||||
},
|
||||
|
@ -31,7 +31,7 @@
|
|||
{
|
||||
"id": "python",
|
||||
"aliases": ["Python", "python"],
|
||||
"extensions": [".py"]
|
||||
"extensions": [".py", ".pyi"]
|
||||
}
|
||||
],
|
||||
"configuration": {
|
||||
|
@ -48,10 +48,45 @@
|
|||
"default": false,
|
||||
"markdownDescription": "Enable inlay hints (this feature is unstable)"
|
||||
},
|
||||
"pylyzer.semanticTokens": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"markdownDescription": "Enable semantic tokens (this feature is unstable)"
|
||||
},
|
||||
"pylyzer.hover": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"markdownDescription": "Enable hover"
|
||||
},
|
||||
"pylyzer.completion": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"markdownDescription": "Enable completion"
|
||||
},
|
||||
"pylyzer.smartCompletion": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"markdownDescription": "Enable smart completion (see [ELS features](https://github.com/erg-lang/erg/blob/main/crates/els/doc/features.md))"
|
||||
},
|
||||
"pylyzer.signatureHelp": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"markdownDescription": "Enable signature help"
|
||||
},
|
||||
"pylyzer.documentLink": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"markdownDescription": "Enable document link"
|
||||
},
|
||||
"pylyzer.codeAction": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"markdownDescription": "Enable code action"
|
||||
},
|
||||
"pylyzer.codeLens": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"markdownDescription": "Enable code lens"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,9 +12,14 @@ async function startLanguageClient(context: ExtensionContext) {
|
|||
})();
|
||||
const enableDiagnostics = workspace.getConfiguration("pylyzer").get<boolean>("diagnostics", true);
|
||||
const enableInlayHints = workspace.getConfiguration("pylyzer").get<boolean>("inlayHints", false);
|
||||
const enableSemanticTokens = workspace.getConfiguration("pylyzer").get<boolean>("semanticTokens", true);
|
||||
const enableSemanticTokens = workspace.getConfiguration("pylyzer").get<boolean>("semanticTokens", false);
|
||||
const enableHover = workspace.getConfiguration("pylyzer").get<boolean>("hover", true);
|
||||
const enableCompletion = workspace.getConfiguration("pylyzer").get<boolean>("completion", true);
|
||||
const smartCompletion = workspace.getConfiguration("pylyzer").get<boolean>("smartCompletion", true);
|
||||
const enableSignatureHelp = workspace.getConfiguration("pylyzer").get<boolean>("signatureHelp", true);
|
||||
const enableDocumentLink = workspace.getConfiguration("pylyzer").get<boolean>("documentLink", true);
|
||||
const enableCodeAction = workspace.getConfiguration("pylyzer").get<boolean>("codeAction", true);
|
||||
const enableCodeLens = workspace.getConfiguration("pylyzer").get<boolean>("codeLens", true);
|
||||
/* optional features */
|
||||
const checkOnType = workspace.getConfiguration("pylyzer").get<boolean>("checkOnType", false);
|
||||
const args = ["--server"];
|
||||
|
@ -35,10 +40,30 @@ async function startLanguageClient(context: ExtensionContext) {
|
|||
args.push("--disable");
|
||||
args.push("hover");
|
||||
}
|
||||
if (!enableCompletion) {
|
||||
args.push("--disable");
|
||||
args.push("completion");
|
||||
}
|
||||
if (!smartCompletion) {
|
||||
args.push("--disable");
|
||||
args.push("smartCompletion");
|
||||
}
|
||||
if (!enableSignatureHelp) {
|
||||
args.push("--disable");
|
||||
args.push("signatureHelp");
|
||||
}
|
||||
if (!enableDocumentLink) {
|
||||
args.push("--disable");
|
||||
args.push("documentLink");
|
||||
}
|
||||
if (!enableCodeAction) {
|
||||
args.push("--disable");
|
||||
args.push("codeAction");
|
||||
}
|
||||
if (!enableCodeLens) {
|
||||
args.push("--disable");
|
||||
args.push("codeLens");
|
||||
}
|
||||
if (checkOnType) {
|
||||
args.push("--enable");
|
||||
args.push("checkOnType");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue