Skip to content

Commit 5ec1965

Browse files
zulusakurtakov
authored andcommitted
Update @vue/language-server to 2.0.19, use @vue/typescript-plugin
1 parent 6634438 commit 5ec1965

File tree

5 files changed

+35
-33
lines changed

5 files changed

+35
-33
lines changed

org.eclipse.wildwebdeveloper/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
"@angular/language-server": "17.3.2",
44
"firefox-debugadapter": "2.9.9",
55
"typescript": "5.4.5",
6-
"typescript-language-server": "4.0.0",
6+
"typescript-language-server": "4.3.3",
77
"typescript-lit-html-plugin": "0.9.0",
88
"typescript-plugin-css-modules": "5.1.0",
99
"yaml-language-server": "1.14.0",
1010
"vscode-languageserver-types": "3.17.5",
1111
"vscode-css-languageservice": "6.2.14",
1212
"vscode-html-languageservice": "5.2.0",
1313
"vscode-json-languageservice": "5.3.11",
14-
"@vue/language-server" : "1.8.27",
14+
"@vue/language-server" : "2.0.19",
15+
"@vue/typescript-plugin" : "2.0.19",
1516
"fsevents" : "2.3.3",
1617
"vscode-css-languageserver": "file:target/vscode-css-languageserver-1.0.0.tgz",
1718
"vscode-html-languageserver": "file:target/vscode-html-languageserver-1.0.0.tgz",

org.eclipse.wildwebdeveloper/plugin.xml

+5-10
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,11 @@
510510
contentType="org.eclipse.wildwebdeveloper.tsx"
511511
id="org.eclipse.wildwebdeveloper.jsts">
512512
</contentTypeMapping>
513+
<contentTypeMapping
514+
languageId="vue"
515+
contentType="org.eclipse.wildwebdeveloper.vue"
516+
id="org.eclipse.wildwebdeveloper.jsts">
517+
</contentTypeMapping>
513518
<server
514519
class="org.eclipse.wildwebdeveloper.eslint.ESLintLanguageServer"
515520
id="org.eclipse.wildwebdeveloper.eslint"
@@ -714,16 +719,6 @@
714719
label="VUE Language Server"/>
715720
<contentTypeMapping contentType="org.eclipse.wildwebdeveloper.vue" languageId="vue" id="org.eclipse.wildwebdeveloper.vue"/>
716721
</extension>
717-
<extension point="org.eclipse.lsp4e.languageServer">
718-
<server
719-
class="org.eclipse.wildwebdeveloper.vue.VueLanguageServer"
720-
clientImpl="org.eclipse.wildwebdeveloper.vue.VueClientImpl"
721-
serverInterface="org.eclipse.wildwebdeveloper.vue.VueLanguageServerAPI"
722-
id="org.eclipse.wildwebdeveloper.vue.syntax"
723-
singleton="true"
724-
label="VUE Language Server Syntax"/>
725-
<contentTypeMapping contentType="org.eclipse.wildwebdeveloper.vue" languageId="vue" id="org.eclipse.wildwebdeveloper.vue.syntax"/>
726-
</extension>
727722
<extension
728723
point="org.eclipse.tm4e.registry.grammars">
729724
<grammar

org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/jsts/JSTSLanguageServer.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ public JSTSLanguageServer() {
5959
commands.add(new File(url.getPath()).getAbsolutePath());
6060
commands.add("--stdio");
6161
setCommands(commands);
62-
URL nodeDependencies = FileLocator.toFileURL(getClass().getResource("/"));
63-
setWorkingDirectory(nodeDependencies.getPath()); // Required for typescript-eslint-language-service to find
62+
//URL nodeDependencies = FileLocator.toFileURL(getClass().getResource("/"));
63+
//setWorkingDirectory(nodeDependencies.getPath()); // Required for typescript-eslint-language-service to find
6464
// it's dependencies
6565

6666
} catch (IOException e) {
@@ -77,13 +77,15 @@ public Object getInitializationOptions(URI rootUri) {
7777
// plugins.add(new TypeScriptPlugin("@angular/language-service"));
7878
plugins.add(new TypeScriptPlugin("typescript-plugin-css-modules"));
7979
plugins.add(new TypeScriptPlugin("typescript-lit-html-plugin"));
80+
plugins.add(new TypeScriptPlugin("@vue/typescript-plugin", new String[] {"vue"}));
8081
options.put("plugins", plugins.stream().map(TypeScriptPlugin::toMap).toArray());
8182

8283
// If the tsserver path is not explicitly specified, tsserver will use the local
8384
// TypeScript version installed as part of the project's dependencies, if found.
8485
if (!TYPESCRIPT_PREFERENCES_TSSERVER_TYPESCRIPT_VERSION_PROJECT.equals(getTypeScriptVersion())) {
8586
Map<String, String> tsServer = new HashMap<>();
8687
tsServer.put("path", tsserverPath);
88+
tsServer.put("nodePath", NodeJSManager.getNodeJsLocation().getAbsolutePath());
8789
options.put("tsserver", tsServer);
8890
}
8991
} catch (IOException e) {
@@ -93,6 +95,11 @@ public Object getInitializationOptions(URI rootUri) {
9395
if (maxTsServerMemory != null) {
9496
options.put("maxTsServerMemory", maxTsServerMemory);
9597
}
98+
99+
options.put("disableAutomaticTypingAcquisition", true); // not working on mac/linux
100+
options.put("hostInfo", "Eclipse");
101+
options.put("watchOptions", new HashMap<>());
102+
96103
return options;
97104
}
98105

org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/jsts/TypeScriptPlugin.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,24 @@
2323
public class TypeScriptPlugin {
2424
private String pluginName;
2525
private String pluginProbeLocation;
26+
private String[] pluginLanguages;
2627

2728
public TypeScriptPlugin(String name) throws IOException {
29+
this(name, null);
30+
}
31+
32+
public TypeScriptPlugin(String name, String[] languages) throws IOException {
2833
pluginName = name;
2934
URL fileURL = FileLocator.toFileURL(getClass().getResource("/node_modules/" + name));
3035
pluginProbeLocation = new File(fileURL.getPath()).getAbsolutePath();
36+
pluginLanguages = languages;
3137
}
3238

33-
public Map<String, String> toMap() {
34-
Map<String, String> tsPlugin = new HashMap<>();
39+
public Map<String, Object> toMap() {
40+
Map<String, Object> tsPlugin = new HashMap<>();
3541
tsPlugin.put("name", pluginName);
3642
tsPlugin.put("location", pluginProbeLocation);
43+
tsPlugin.put("languages", pluginLanguages);
3744
return tsPlugin;
3845
}
3946
}

org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/vue/VueLanguageServer.java

+9-17
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,14 @@
2222
import java.util.List;
2323
import java.util.Map;
2424

25-
import org.eclipse.core.runtime.CoreException;
2625
import org.eclipse.core.runtime.FileLocator;
27-
import org.eclipse.core.runtime.IConfigurationElement;
28-
import org.eclipse.core.runtime.IExecutableExtension;
2926
import org.eclipse.core.runtime.ILog;
3027
import org.eclipse.lsp4e.server.ProcessStreamConnectionProvider;
3128
import org.eclipse.wildwebdeveloper.embedder.node.NodeJSManager;
3229

33-
public class VueLanguageServer extends ProcessStreamConnectionProvider implements IExecutableExtension {
30+
public class VueLanguageServer extends ProcessStreamConnectionProvider {
3431
private static String tsserverPath = null;
3532
private static String vuePath = null;
36-
private int mode = 1;
3733

3834
public VueLanguageServer() {
3935

@@ -74,16 +70,19 @@ public Object getInitializationOptions(URI rootUri) {
7470
setWorkingDirectory(rootUri.getRawPath());
7571

7672
options.put("typescript", Collections.singletonMap("tsdk", tsserverPath));
77-
options.put("fullCompletionList", false);
78-
options.put("serverMode", mode);
79-
options.put("diagnosticModel", 1);
73+
options.put("diagnosticModel", 0);
8074
options.put("additionalExtensions", new String[] {});
8175

8276
Map<String, Object> legend = new HashMap<>();
83-
legend.put("tokenTypes", new String[] {"compontent"} );
77+
legend.put("tokenTypes", new String[] {"component"} );
8478
legend.put("tokenModifiers", new String[] {} );
8579
options.put("semanticTokensLegend", legend);
8680

81+
Map<String, Object> vue = new HashMap<>();
82+
vue.put("hybridMode", false);
83+
84+
options.put("vue", vue);
85+
8786
return options;
8887
}
8988

@@ -92,12 +91,5 @@ public String toString() {
9291
return "VUE Language Server: " + super.toString();
9392
}
9493

95-
@Override
96-
public void setInitializationData(IConfigurationElement config, String propertyName, Object data)
97-
throws CoreException {
98-
if (config.getAttribute("id").contains("syntax")) {
99-
mode = 2;
100-
}
101-
102-
}
94+
10395
}

0 commit comments

Comments
 (0)