-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.js
39 lines (33 loc) · 1007 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const path = require("path")
const { AutoLanguageClient } = require("atom-languageclient")
const { renameGrammarForScopeName } = require("./grammar")
class VueLanguageClient extends AutoLanguageClient {
getGrammarScopes() {
return ["text.html.vue"]
}
getLanguageName() {
return "Vue"
}
getServerName() {
return "Vetur"
}
startServerProcess() {
return super.spawnChildNode(["node_modules/vls/dist/vueServerMain"], {
cwd: path.join(__dirname, ".."),
})
}
preInitialization() {
renameGrammarForScopeName("text.html.vue", "Vue")
}
getInitializeParams(projectPath, process) {
// vue-language-server doesn't handle mising init options well:
// https://github.com/vuejs/vetur/issues/1188
// https://github.com/tomv564/LSP/issues/565
const { initializationOptions } = require("./config")
return {
...super.getInitializeParams(projectPath, process),
initializationOptions,
}
}
}
module.exports = new VueLanguageClient()