mirror of https://github.com/mtshiba/pylyzer
update extension version
This commit is contained in:
parent
5c36232696
commit
cf9361e97e
|
|
@ -60,6 +60,8 @@ pylyzer as a language server supports various features, such as completion and r
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
## [VSCode extension](https://github.com/mtshiba/pylyzer/blob/main/extension)
|
||||||
|
|
||||||
## How it works
|
## How it works
|
||||||
|
|
||||||
pylyzer uses the type checker of [the Erg programming language](https://erg-lang.org) internally.
|
pylyzer uses the type checker of [the Erg programming language](https://erg-lang.org) internally.
|
||||||
|
|
|
||||||
|
|
@ -15,3 +15,18 @@ or
|
||||||
```console
|
```console
|
||||||
cargo install pylyzer
|
cargo install pylyzer
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
|
||||||
|
| Command | Description |
|
||||||
|
| - | - |
|
||||||
|
| pylyzer.restartLanguageServer | Restart the language server |
|
||||||
|
|
||||||
|
## Settings
|
||||||
|
|
||||||
|
| Setting | Description | Default |
|
||||||
|
| - | - | - |
|
||||||
|
| pylyzer.diagnostics | Enable diagnostics | true |
|
||||||
|
| pylyzer.inlayHints | Enable inlay hints (this feature is unstable) | false |
|
||||||
|
| pylyzer.smartCompletion | Enable smart completion (see [ELS features](https://github.com/erg-lang/erg/blob/main/crates/els/doc/features.md))| true |
|
||||||
|
| pylyzer.checkOnType | Perform checking each time any character is entered. This improves the accuracy of completion, etc., but may slow down the execution | false |
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "pylyzer",
|
"name": "pylyzer",
|
||||||
"version": "0.1.3",
|
"version": "0.1.4",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "pylyzer",
|
"name": "pylyzer",
|
||||||
"version": "0.1.3",
|
"version": "0.1.4",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"vscode-languageclient": "^8.0.2"
|
"vscode-languageclient": "^8.0.2"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
"displayName": "pylyzer",
|
"displayName": "pylyzer",
|
||||||
"description": "A fast Python static code analyzer & language server for VSCode",
|
"description": "A fast Python static code analyzer & language server for VSCode",
|
||||||
"publisher": "pylyzer",
|
"publisher": "pylyzer",
|
||||||
"version": "0.1.3",
|
"version": "0.1.4",
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.70.0"
|
"vscode": "^1.70.0"
|
||||||
},
|
},
|
||||||
|
|
@ -43,6 +43,11 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "pylyzer",
|
"title": "pylyzer",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"pylyzer.diagnostics": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true,
|
||||||
|
"markdownDescription": "Enable diagnostics"
|
||||||
|
},
|
||||||
"pylyzer.inlayHints": {
|
"pylyzer.inlayHints": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": false,
|
"default": false,
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ async function startLanguageClient(context: ExtensionContext) {
|
||||||
.get<string>("executablePath", "");
|
.get<string>("executablePath", "");
|
||||||
return executablePath === "" ? "pylyzer" : executablePath;
|
return executablePath === "" ? "pylyzer" : executablePath;
|
||||||
})();
|
})();
|
||||||
|
const enableDiagnostics = workspace.getConfiguration("pylyzer").get<boolean>("diagnostics", true);
|
||||||
const enableInlayHints = workspace.getConfiguration("pylyzer").get<boolean>("inlayHints", false);
|
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", true);
|
||||||
const enableHover = workspace.getConfiguration("pylyzer").get<boolean>("hover", true);
|
const enableHover = workspace.getConfiguration("pylyzer").get<boolean>("hover", true);
|
||||||
|
|
@ -23,9 +24,13 @@ async function startLanguageClient(context: ExtensionContext) {
|
||||||
/* optional features */
|
/* optional features */
|
||||||
const checkOnType = workspace.getConfiguration("pylyzer").get<boolean>("checkOnType", false);
|
const checkOnType = workspace.getConfiguration("pylyzer").get<boolean>("checkOnType", false);
|
||||||
let args = ["--server"];
|
let args = ["--server"];
|
||||||
if (!(enableInlayHints && enableSemanticTokens && enableHover && smartCompletion) || checkOnType) {
|
if (!(enableDiagnostics && enableSemanticTokens && enableHover && smartCompletion) || (checkOnType || enableInlayHints)) {
|
||||||
args.push("--");
|
args.push("--");
|
||||||
}
|
}
|
||||||
|
if (!enableDiagnostics) {
|
||||||
|
args.push("--disable");
|
||||||
|
args.push("diagnostic");
|
||||||
|
}
|
||||||
if (!enableInlayHints) {
|
if (!enableInlayHints) {
|
||||||
args.push("--disable");
|
args.push("--disable");
|
||||||
args.push("inlayHints");
|
args.push("inlayHints");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue