@yaegassy/coc-ty 0.1.2 → 0.1.4
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/lib/index.js +7 -20
- package/package.json +35 -3
package/lib/index.js
CHANGED
|
@@ -193,7 +193,7 @@ var require_lib = __commonJS({
|
|
|
193
193
|
const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "";
|
|
194
194
|
return prefix + join(pathPart, cmd);
|
|
195
195
|
};
|
|
196
|
-
var
|
|
196
|
+
var which2 = async (cmd, opt = {}) => {
|
|
197
197
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
198
198
|
const found = [];
|
|
199
199
|
for (const envPart of pathEnv) {
|
|
@@ -241,8 +241,8 @@ var require_lib = __commonJS({
|
|
|
241
241
|
}
|
|
242
242
|
throw getNotFoundError(cmd);
|
|
243
243
|
};
|
|
244
|
-
module2.exports =
|
|
245
|
-
|
|
244
|
+
module2.exports = which2;
|
|
245
|
+
which2.sync = whichSync;
|
|
246
246
|
}
|
|
247
247
|
});
|
|
248
248
|
|
|
@@ -261,7 +261,6 @@ var import_coc = require("coc.nvim");
|
|
|
261
261
|
var SERVER_SUBCOMMAND = "server";
|
|
262
262
|
|
|
263
263
|
// src/client.ts
|
|
264
|
-
var import_which = __toESM(require_lib());
|
|
265
264
|
function createServerClient(command) {
|
|
266
265
|
const newEnv = { ...process.env };
|
|
267
266
|
const args = [SERVER_SUBCOMMAND];
|
|
@@ -281,25 +280,13 @@ function createServerClient(command) {
|
|
|
281
280
|
function convertFromWorkspaceConfigToInitializationOptions() {
|
|
282
281
|
const settings = import_coc.workspace.getConfiguration("ty");
|
|
283
282
|
const initializationOptions = {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
interpreter: settings.get("interpreter"),
|
|
287
|
-
importStrategy: settings.get(`importStrategy`) ?? "fromEnvironment",
|
|
288
|
-
logLevel: settings.get("logLevel"),
|
|
289
|
-
logFile: settings.get("logFile"),
|
|
290
|
-
experimental: settings.get("experimental")
|
|
291
|
-
}
|
|
283
|
+
logLevel: settings.get("logLevel"),
|
|
284
|
+
logFile: settings.get("logFile")
|
|
292
285
|
};
|
|
293
286
|
return initializationOptions;
|
|
294
287
|
}
|
|
295
288
|
function getInitializationOptions() {
|
|
296
289
|
const initializationOptions = convertFromWorkspaceConfigToInitializationOptions();
|
|
297
|
-
if (import_coc.workspace.getConfiguration("ty").get("useDetectTyCommand", true)) {
|
|
298
|
-
const envTyCommandPath = import_which.default.sync("ty", { nothrow: true });
|
|
299
|
-
if (envTyCommandPath) {
|
|
300
|
-
initializationOptions.settings.path = [envTyCommandPath];
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
290
|
return initializationOptions;
|
|
304
291
|
}
|
|
305
292
|
function getLanguageClientDisabledFeatures() {
|
|
@@ -359,11 +346,11 @@ async function register2(context, client2) {
|
|
|
359
346
|
|
|
360
347
|
// src/tool.ts
|
|
361
348
|
var import_coc4 = require("coc.nvim");
|
|
362
|
-
var
|
|
349
|
+
var import_which = __toESM(require_lib());
|
|
363
350
|
async function getTyBinaryPath() {
|
|
364
351
|
let tyBinaryPath = import_coc4.workspace.getConfiguration("ty").get("binaryPath", "");
|
|
365
352
|
if (!tyBinaryPath) {
|
|
366
|
-
tyBinaryPath =
|
|
353
|
+
tyBinaryPath = import_which.default.sync("ty", { nothrow: true }) || "";
|
|
367
354
|
}
|
|
368
355
|
return tyBinaryPath;
|
|
369
356
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yaegassy/coc-ty",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
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",
|
|
@@ -119,9 +119,29 @@
|
|
|
119
119
|
},
|
|
120
120
|
"type": "array"
|
|
121
121
|
},
|
|
122
|
-
"ty.
|
|
122
|
+
"ty.diagnosticMode": {
|
|
123
|
+
"default": "openFilesOnly",
|
|
124
|
+
"markdownDescription": "Analysis scope for showing diagnostics.",
|
|
125
|
+
"enum": [
|
|
126
|
+
"openFilesOnly",
|
|
127
|
+
"workspace"
|
|
128
|
+
],
|
|
129
|
+
"enumDescriptions": [
|
|
130
|
+
"Analyzes and reports errors on only open files.",
|
|
131
|
+
"Analyzes and reports errors on all files in the workspace."
|
|
132
|
+
],
|
|
133
|
+
"scope": "resource",
|
|
134
|
+
"type": "string"
|
|
135
|
+
},
|
|
136
|
+
"ty.experimental.rename": {
|
|
123
137
|
"default": false,
|
|
124
|
-
"markdownDescription": "
|
|
138
|
+
"markdownDescription": "Enable experimental support for renaming symbols in ty.",
|
|
139
|
+
"scope": "window",
|
|
140
|
+
"type": "boolean"
|
|
141
|
+
},
|
|
142
|
+
"ty.experimental.autoImport": {
|
|
143
|
+
"default": false,
|
|
144
|
+
"markdownDescription": "Enable experimental support for auto-import code completions in ty.",
|
|
125
145
|
"scope": "window",
|
|
126
146
|
"type": "boolean"
|
|
127
147
|
},
|
|
@@ -139,6 +159,18 @@
|
|
|
139
159
|
"scope": "window",
|
|
140
160
|
"type": "string"
|
|
141
161
|
},
|
|
162
|
+
"ty.inlayHints.variableTypes": {
|
|
163
|
+
"default": true,
|
|
164
|
+
"markdownDescription": "Whether to enable inlay hints for variable types.",
|
|
165
|
+
"scope": "window",
|
|
166
|
+
"type": "boolean"
|
|
167
|
+
},
|
|
168
|
+
"ty.inlayHints.callArgumentNames": {
|
|
169
|
+
"default": true,
|
|
170
|
+
"markdownDescription": "Whether to enable inlay hints for call argument names.",
|
|
171
|
+
"scope": "window",
|
|
172
|
+
"type": "boolean"
|
|
173
|
+
},
|
|
142
174
|
"ty.interpreter": {
|
|
143
175
|
"default": [],
|
|
144
176
|
"markdownDescription": "Path to a Python interpreter to use to find the `ty` executable.",
|