@stacksjs/stx-vscode 0.2.355 → 0.2.356
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/dist/contributes.json +1 -1
- package/dist/index.js +27 -0
- package/package.json +1 -1
package/dist/contributes.json
CHANGED
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"stxTypescriptPlugin.enabled": {
|
|
53
53
|
"type": "boolean",
|
|
54
54
|
"default": true,
|
|
55
|
-
"description": "
|
|
55
|
+
"description": "Type-check the TypeScript in stx files (script blocks and template expressions) with the TypeScript server, and offer its hovers, completions and go to definition there"
|
|
56
56
|
},
|
|
57
57
|
"stx.diagnostics.enable": {
|
|
58
58
|
"type": "boolean",
|
package/dist/index.js
CHANGED
|
@@ -6925,8 +6925,35 @@ async function stacksProvidesStx(api) {
|
|
|
6925
6925
|
}
|
|
6926
6926
|
}
|
|
6927
6927
|
|
|
6928
|
+
// ../vscode/src/ts-plugin-config.ts
|
|
6929
|
+
var TS_PLUGIN_NAME = "@stacksjs/stx-typescript-plugin";
|
|
6930
|
+
var TYPESCRIPT_EXTENSION_ID = "vscode.typescript-language-features";
|
|
6931
|
+
var TS_PLUGIN_SETTINGS = "stxTypescriptPlugin";
|
|
6932
|
+
function tsPluginConfiguration(api) {
|
|
6933
|
+
return { enabled: api.workspace.getConfiguration(TS_PLUGIN_SETTINGS).get("enabled", true) };
|
|
6934
|
+
}
|
|
6935
|
+
async function configureTypeScriptPlugin(api, subscriptions) {
|
|
6936
|
+
const extension = api.extensions.getExtension(TYPESCRIPT_EXTENSION_ID);
|
|
6937
|
+
if (!extension)
|
|
6938
|
+
return false;
|
|
6939
|
+
const exports = extension.isActive ? extension.exports : await extension.activate();
|
|
6940
|
+
const typescript = exports?.getAPI?.(0);
|
|
6941
|
+
if (!typescript)
|
|
6942
|
+
return false;
|
|
6943
|
+
const send = () => typescript.configurePlugin(TS_PLUGIN_NAME, tsPluginConfiguration(api));
|
|
6944
|
+
send();
|
|
6945
|
+
subscriptions.push(api.workspace.onDidChangeConfiguration((event) => {
|
|
6946
|
+
if (event.affectsConfiguration(TS_PLUGIN_SETTINGS))
|
|
6947
|
+
send();
|
|
6948
|
+
}));
|
|
6949
|
+
return true;
|
|
6950
|
+
}
|
|
6951
|
+
|
|
6928
6952
|
// ../vscode/src/extension.ts
|
|
6929
6953
|
async function activate(context) {
|
|
6954
|
+
configureTypeScriptPlugin(vscode16, context.subscriptions).catch((error) => {
|
|
6955
|
+
console.error("stx Extension - could not configure the TypeScript plugin:", error);
|
|
6956
|
+
});
|
|
6930
6957
|
if (await stacksProvidesStx(vscode16)) {
|
|
6931
6958
|
console.log(`stx Extension - ${STACKS_EXTENSION_ID} provides stx support in this window; not registering it twice`);
|
|
6932
6959
|
return;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/stx-vscode",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.356",
|
|
5
5
|
"description": "stx language support for VS Code extensions to embed: the hovers, completions, diagnostics, grammar, snippets and language configuration behind the stx extension.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|