Skip to content

Commit

Permalink
add config property to provide lua version
Browse files Browse the repository at this point in the history
  • Loading branch information
bratekarate committed Sep 26, 2020
1 parent 63cf8f6 commit b86ec54
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
},
"lua.commandPath": {
"type": "string"
},
"lua.version": {
"type": "string"
}
}
},
Expand Down
10 changes: 7 additions & 3 deletions src/utils/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ export async function installLuaLsp(force = false): Promise<void> {
return
}
const baseDir = await configDir('tools')
let installCmd = `luarocks install --tree ${baseDir} --server=http://luarocks.org/dev lua-lsp`

await workspace.runTerminalCommand(
`luarocks install --tree ${baseDir} --server=http://luarocks.org/dev lua-lsp`
)
const luaVersion = workspace.getConfiguration().get('lua', {})['version']
if(luaVersion) {
installCmd += ` --lua-version=${luaVersion}`
}

await workspace.runTerminalCommand(installCmd)
}

export async function luaLspBin(): Promise<string> {
Expand Down

0 comments on commit b86ec54

Please sign in to comment.