Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"elixir-tools.credo.enable": {
"type": "boolean",
"default": true,
"description": "Whether to start the Credo Language Server."
"markdownDescription": "Whether to start **Credo Language Server**"
},
"elixir-tools.credo.adapter": {
"type": "string",
Expand All @@ -44,17 +44,22 @@
"tcp"
],
"default": "stdio",
"description": "Which adapter to use when connecting to credo-language-server"
"markdownDescription": "Which adapter to use when connecting to **Credo Language Server**."
},
"elixir-tools.credo.port": {
"type": "integer",
"default": 9000,
"description": "If adapter is `tcp`, use this port to connect."
"markdownDescription": "If adapter is `tcp`, use this port to connect."
},
"elixir-tools.credo.version": {
"type": "string",
"default": "latest",
"markdownDescription": "Specifies the version of **Credo Language Server**.\n\nDefaults to `latest`."
},
"elixir-tools.nextls.enable": {
"type": "boolean",
"default": false,
"description": "Whether to start NextLS."
"markdownDescription": "Whether to start **Next LS**."
},
"elixir-tools.nextls.adapter": {
"type": "string",
Expand All @@ -63,12 +68,17 @@
"tcp"
],
"default": "stdio",
"description": "Which adapter to use when connecting to NextLS"
"markdownDescription": "Which adapter to use when connecting to **Next LS**."
},
"elixir-tools.nextls.port": {
"type": "integer",
"default": 9000,
"description": "If adapter is `tcp`, use this port to connect."
"markdownDescription": "If adapter is `tcp`, use this port to connect."
},
"elixir-tools.nextls.version": {
"type": "string",
"default": "latest",
"markdownDescription": "Specifies the version of **Next LS**.\n\nDefaults to `latest`."
}
}
},
Expand Down
18 changes: 14 additions & 4 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,16 @@ async function activateCredo(

switch (config.get("adapter")) {
case "stdio":
let version = config.get("version");

if (version === "latest") {
version = await latestRelease("credo-language-server");
}

serverOptions = {
options: {
env: Object.assign({}, process.env, {
["CREDO_LSP_VERSION"]: await latestRelease(
"credo-language-server"
),
["CREDO_LSP_VERSION"]: version,
}),
},
command: context.asAbsolutePath("./bin/credo-language-server"),
Expand Down Expand Up @@ -96,10 +100,16 @@ async function activateNextLS(

switch (config.get("adapter")) {
case "stdio":
let version = config.get("version");

if (version === "latest") {
version = await latestRelease("next-ls");
}

serverOptions = {
options: {
env: Object.assign({}, process.env, {
["NEXTLS_VERSION"]: await latestRelease("next-ls"),
["NEXTLS_VERSION"]: version,
}),
},
command: context.asAbsolutePath("./bin/nextls"),
Expand Down