@yaegassy/coc-ty 0.1.4 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/lib/index.js +9 -4
- package/package.json +13 -22
package/README.md
CHANGED
|
@@ -21,12 +21,12 @@ Plug 'yaegassy/coc-ty', {'do': 'yarn install --frozen-lockfile'}
|
|
|
21
21
|
## Configuration options
|
|
22
22
|
|
|
23
23
|
- `ty.enable`: Enable coc-ty extension, default: `true`
|
|
24
|
+
- `ty.path`: Custom path for the `ty` binary. If no value is set, the `ty` command will be detected from the runtime environment, , default: `""`
|
|
25
|
+
- `ty.disableCompletion`: Disable completion only, default: `false`
|
|
24
26
|
- `ty.disableDiagnostics`: Disable diagnostics only, default: `false`
|
|
25
27
|
- `ty.disableHover`: Disable hover only, default: `false`
|
|
26
28
|
- `ty.disableInlayHint`: Disable inlayHint only, default: `false`
|
|
27
29
|
- `ty.disableTypeDefinition`: Disable typeDefinition only, default: `false`
|
|
28
|
-
- `ty.useDetectTyCommand`: Automatically detects the ty command in the execution environment and sets `ty.path`, default: `true`
|
|
29
|
-
- `ty.binaryPath`: Custom path for the `ty` binary. If no value is set, the `ty` command will be detected from the runtime environment, , default: `""`
|
|
30
30
|
- `ty.trace.server`: Traces the communication between coc.nvim and the ty language server, default: `"off"`
|
|
31
31
|
|
|
32
32
|
Other settings have the same configuration as [ty-vscode](https://github.com/astral-sh/ty-vscode).
|
package/lib/index.js
CHANGED
|
@@ -291,6 +291,8 @@ function getInitializationOptions() {
|
|
|
291
291
|
}
|
|
292
292
|
function getLanguageClientDisabledFeatures() {
|
|
293
293
|
const r = [];
|
|
294
|
+
if (getConfigDisableCompletion())
|
|
295
|
+
r.push("completion");
|
|
294
296
|
if (getConfigDisableHover())
|
|
295
297
|
r.push("hover");
|
|
296
298
|
if (getConfigDisableInlayHintHover())
|
|
@@ -303,6 +305,12 @@ function getLanguageClientDisabledFeatures() {
|
|
|
303
305
|
}
|
|
304
306
|
return r;
|
|
305
307
|
}
|
|
308
|
+
function getConfigDisableCompletion() {
|
|
309
|
+
return import_coc.workspace.getConfiguration("ty").get("disableCompletion", false);
|
|
310
|
+
}
|
|
311
|
+
function getConfigDisableDiagnostics() {
|
|
312
|
+
return import_coc.workspace.getConfiguration("ty").get("disableDiagnostics", false);
|
|
313
|
+
}
|
|
306
314
|
function getConfigDisableHover() {
|
|
307
315
|
return import_coc.workspace.getConfiguration("ty").get("disableHover", false);
|
|
308
316
|
}
|
|
@@ -312,9 +320,6 @@ function getConfigDisableInlayHintHover() {
|
|
|
312
320
|
function getConfigDisableTypeDefinition() {
|
|
313
321
|
return import_coc.workspace.getConfiguration("ty").get("disableTypeDefinition", false);
|
|
314
322
|
}
|
|
315
|
-
function getConfigDisableDiagnostics() {
|
|
316
|
-
return import_coc.workspace.getConfiguration("ty").get("disableDiagnostics", false);
|
|
317
|
-
}
|
|
318
323
|
|
|
319
324
|
// src/commands/restart.ts
|
|
320
325
|
var import_coc2 = require("coc.nvim");
|
|
@@ -348,7 +353,7 @@ async function register2(context, client2) {
|
|
|
348
353
|
var import_coc4 = require("coc.nvim");
|
|
349
354
|
var import_which = __toESM(require_lib());
|
|
350
355
|
async function getTyBinaryPath() {
|
|
351
|
-
let tyBinaryPath = import_coc4.workspace.getConfiguration("ty").get("
|
|
356
|
+
let tyBinaryPath = import_coc4.workspace.getConfiguration("ty").get("path", "");
|
|
352
357
|
if (!tyBinaryPath) {
|
|
353
358
|
tyBinaryPath = import_which.default.sync("ty", { nothrow: true }) || "";
|
|
354
359
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yaegassy/coc-ty",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "coc.nvim extension with support for the ty type checker and language server.",
|
|
5
5
|
"author": "yaegassy <yosstools@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -80,6 +80,11 @@
|
|
|
80
80
|
"default": true,
|
|
81
81
|
"description": "Enable coc-ty extension"
|
|
82
82
|
},
|
|
83
|
+
"ty.disableCompletion": {
|
|
84
|
+
"type": "boolean",
|
|
85
|
+
"default": false,
|
|
86
|
+
"description": "Disable completion only."
|
|
87
|
+
},
|
|
83
88
|
"ty.disableDiagnostics": {
|
|
84
89
|
"type": "boolean",
|
|
85
90
|
"default": false,
|
|
@@ -100,25 +105,11 @@
|
|
|
100
105
|
"default": false,
|
|
101
106
|
"description": "Disable typeDefinition only."
|
|
102
107
|
},
|
|
103
|
-
"ty.
|
|
104
|
-
"type": "boolean",
|
|
105
|
-
"default": true,
|
|
106
|
-
"description": "Automatically detects the ty command in the execution environment and sets `ty.path`."
|
|
107
|
-
},
|
|
108
|
-
"ty.binaryPath": {
|
|
108
|
+
"ty.path": {
|
|
109
109
|
"type": "string",
|
|
110
110
|
"default": "",
|
|
111
111
|
"description": "Custom path for the `ty` binary when using the native server. If no value is set, the `ty` command will be detected from the runtime environment."
|
|
112
112
|
},
|
|
113
|
-
"ty.path": {
|
|
114
|
-
"default": [],
|
|
115
|
-
"markdownDescription": "Path to a custom `ty` executable, e.g., `[\"/path/to/ty\"]`.",
|
|
116
|
-
"scope": "resource",
|
|
117
|
-
"items": {
|
|
118
|
-
"type": "string"
|
|
119
|
-
},
|
|
120
|
-
"type": "array"
|
|
121
|
-
},
|
|
122
113
|
"ty.diagnosticMode": {
|
|
123
114
|
"default": "openFilesOnly",
|
|
124
115
|
"markdownDescription": "Analysis scope for showing diagnostics.",
|
|
@@ -139,12 +130,6 @@
|
|
|
139
130
|
"scope": "window",
|
|
140
131
|
"type": "boolean"
|
|
141
132
|
},
|
|
142
|
-
"ty.experimental.autoImport": {
|
|
143
|
-
"default": false,
|
|
144
|
-
"markdownDescription": "Enable experimental support for auto-import code completions in ty.",
|
|
145
|
-
"scope": "window",
|
|
146
|
-
"type": "boolean"
|
|
147
|
-
},
|
|
148
133
|
"ty.importStrategy": {
|
|
149
134
|
"default": "fromEnvironment",
|
|
150
135
|
"markdownDescription": "Strategy for loading the `ty` executable. `fromEnvironment` picks up ty from the environment, falling back to the bundled version if needed. `useBundled` uses the version bundled with the extension.",
|
|
@@ -171,6 +156,12 @@
|
|
|
171
156
|
"scope": "window",
|
|
172
157
|
"type": "boolean"
|
|
173
158
|
},
|
|
159
|
+
"ty.completions.autoImport": {
|
|
160
|
+
"default": true,
|
|
161
|
+
"markdownDescription": "Whether to include auto-import code completions in ty.",
|
|
162
|
+
"scope": "window",
|
|
163
|
+
"type": "boolean"
|
|
164
|
+
},
|
|
174
165
|
"ty.interpreter": {
|
|
175
166
|
"default": [],
|
|
176
167
|
"markdownDescription": "Path to a Python interpreter to use to find the `ty` executable.",
|