From 942a02e409b9451814048298b45cb9d8d7c9cad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Paku=C5=82a?= Date: Wed, 10 Apr 2024 15:25:00 +0200 Subject: [PATCH] Update @vue/language-server to 2.0.19, use @vue/typescript-plugin --- org.eclipse.wildwebdeveloper/package.json | 5 ++-- org.eclipse.wildwebdeveloper/plugin.xml | 15 ++++------- .../jsts/JSTSLanguageServer.java | 11 ++++++-- .../jsts/TypeScriptPlugin.java | 11 ++++++-- .../vue/VueLanguageServer.java | 26 +++++++------------ 5 files changed, 35 insertions(+), 33 deletions(-) diff --git a/org.eclipse.wildwebdeveloper/package.json b/org.eclipse.wildwebdeveloper/package.json index 9fdb63b6a7..3f85a743e1 100644 --- a/org.eclipse.wildwebdeveloper/package.json +++ b/org.eclipse.wildwebdeveloper/package.json @@ -3,7 +3,7 @@ "@angular/language-server": "17.3.2", "firefox-debugadapter": "2.9.9", "typescript": "5.4.5", - "typescript-language-server": "4.0.0", + "typescript-language-server": "4.3.3", "typescript-lit-html-plugin": "0.9.0", "typescript-plugin-css-modules": "5.1.0", "yaml-language-server": "1.14.0", @@ -11,7 +11,8 @@ "vscode-css-languageservice": "6.2.14", "vscode-html-languageservice": "5.2.0", "vscode-json-languageservice": "5.3.11", - "@vue/language-server" : "1.8.27", + "@vue/language-server" : "2.0.19", + "@vue/typescript-plugin" : "2.0.19", "fsevents" : "2.3.3", "vscode-css-languageserver": "file:target/vscode-css-languageserver-1.0.0.tgz", "vscode-html-languageserver": "file:target/vscode-html-languageserver-1.0.0.tgz", diff --git a/org.eclipse.wildwebdeveloper/plugin.xml b/org.eclipse.wildwebdeveloper/plugin.xml index 9cccb63813..e3a1a7813f 100644 --- a/org.eclipse.wildwebdeveloper/plugin.xml +++ b/org.eclipse.wildwebdeveloper/plugin.xml @@ -510,6 +510,11 @@ contentType="org.eclipse.wildwebdeveloper.tsx" id="org.eclipse.wildwebdeveloper.jsts"> + + - - - - tsServer = new HashMap<>(); tsServer.put("path", tsserverPath); + tsServer.put("nodePath", NodeJSManager.getNodeJsLocation().getAbsolutePath()); options.put("tsserver", tsServer); } } catch (IOException e) { @@ -93,6 +95,11 @@ public Object getInitializationOptions(URI rootUri) { if (maxTsServerMemory != null) { options.put("maxTsServerMemory", maxTsServerMemory); } + + options.put("disableAutomaticTypingAcquisition", true); // not working on mac/linux + options.put("hostInfo", "Eclipse"); + options.put("watchOptions", new HashMap<>()); + return options; } diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/jsts/TypeScriptPlugin.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/jsts/TypeScriptPlugin.java index b9164df766..0da4f830af 100644 --- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/jsts/TypeScriptPlugin.java +++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/jsts/TypeScriptPlugin.java @@ -23,17 +23,24 @@ public class TypeScriptPlugin { private String pluginName; private String pluginProbeLocation; + private String[] pluginLanguages; public TypeScriptPlugin(String name) throws IOException { + this(name, null); + } + + public TypeScriptPlugin(String name, String[] languages) throws IOException { pluginName = name; URL fileURL = FileLocator.toFileURL(getClass().getResource("/node_modules/" + name)); pluginProbeLocation = new File(fileURL.getPath()).getAbsolutePath(); + pluginLanguages = languages; } - public Map toMap() { - Map tsPlugin = new HashMap<>(); + public Map toMap() { + Map tsPlugin = new HashMap<>(); tsPlugin.put("name", pluginName); tsPlugin.put("location", pluginProbeLocation); + tsPlugin.put("languages", pluginLanguages); return tsPlugin; } } diff --git a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/vue/VueLanguageServer.java b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/vue/VueLanguageServer.java index 28d1d56fa1..0486e64d66 100644 --- a/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/vue/VueLanguageServer.java +++ b/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/vue/VueLanguageServer.java @@ -22,18 +22,14 @@ import java.util.List; import java.util.Map; -import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExecutableExtension; import org.eclipse.core.runtime.ILog; import org.eclipse.lsp4e.server.ProcessStreamConnectionProvider; import org.eclipse.wildwebdeveloper.embedder.node.NodeJSManager; -public class VueLanguageServer extends ProcessStreamConnectionProvider implements IExecutableExtension { +public class VueLanguageServer extends ProcessStreamConnectionProvider { private static String tsserverPath = null; private static String vuePath = null; - private int mode = 1; public VueLanguageServer() { @@ -74,16 +70,19 @@ public Object getInitializationOptions(URI rootUri) { setWorkingDirectory(rootUri.getRawPath()); options.put("typescript", Collections.singletonMap("tsdk", tsserverPath)); - options.put("fullCompletionList", false); - options.put("serverMode", mode); - options.put("diagnosticModel", 1); + options.put("diagnosticModel", 0); options.put("additionalExtensions", new String[] {}); Map legend = new HashMap<>(); - legend.put("tokenTypes", new String[] {"compontent"} ); + legend.put("tokenTypes", new String[] {"component"} ); legend.put("tokenModifiers", new String[] {} ); options.put("semanticTokensLegend", legend); + Map vue = new HashMap<>(); + vue.put("hybridMode", false); + + options.put("vue", vue); + return options; } @@ -92,12 +91,5 @@ public String toString() { return "VUE Language Server: " + super.toString(); } - @Override - public void setInitializationData(IConfigurationElement config, String propertyName, Object data) - throws CoreException { - if (config.getAttribute("id").contains("syntax")) { - mode = 2; - } - - } + }