Skip to content

Commit

Permalink
refactor!: reorganize configuration settings (#41)
Browse files Browse the repository at this point in the history
Co-authored-by: Mitchell Hanberg <[email protected]>
  • Loading branch information
zachallaun and mhanberg authored Sep 18, 2023
1 parent 5a65f88 commit fc3154d
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 77 deletions.
159 changes: 84 additions & 75 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "elixir-tools",
"displayName": "elixir-tools.vscode",
"displayName": "elixir-tools",
"homepage": "https://github.com/elixir-tools/elixir-tools.vscode",
"description": "Elixir extension for VSCode.",
"description": "Elixir extension with support for Next LS and Credo Language Server",
"publisher": "elixir-tools",
"version": "0.8.0",
"repository": {
Expand Down Expand Up @@ -37,81 +37,90 @@
],
"main": "./dist/extension.js",
"contributes": {
"configuration": {
"title": "elixir-tools",
"properties": {
"elixir-tools.credo.enable": {
"type": "boolean",
"default": false,
"markdownDescription": "Whether to start **Credo Language Server**"
},
"elixir-tools.credo.adapter": {
"type": "string",
"enum": [
"stdio",
"tcp"
],
"default": "stdio",
"markdownDescription": "Which adapter to use when connecting to **Credo Language Server**."
},
"elixir-tools.credo.port": {
"type": "integer",
"default": 9000,
"markdownDescription": "If adapter is `tcp`, use this port to connect to a running server.\n\nYou can start the server with `path/to/credo-language-server --port <port>`."
},
"elixir-tools.credo.version": {
"type": "string",
"default": "latest",
"markdownDescription": "Specifies the version of **Credo Language Server**.\n\nDefaults to `latest`."
},
"elixir-tools.credo.trace.server": {
"type": "string",
"scope": "window",
"enum": [
"off",
"messages",
"verbose"
],
"default": "off",
"description": "Traces the communication between VS Code and the Next LS."
},
"elixir-tools.nextls.enable": {
"type": "boolean",
"default": true,
"markdownDescription": "Whether to start **Next LS**."
},
"elixir-tools.nextls.adapter": {
"type": "string",
"enum": [
"stdio",
"tcp"
],
"default": "stdio",
"markdownDescription": "Which adapter to use when connecting to **Next LS**."
},
"elixir-tools.nextls.port": {
"type": "integer",
"default": 9000,
"markdownDescription": "If adapter is `tcp`, use this port to connect to a running server.\n\nYou can start the server with `path/to/nextls --port <port>`."
},
"elixir-tools.nextls.installationDirectory": {
"type": "string",
"default": "~/.cache/elixir-tools/nextls/bin/",
"markdownDescription": "Overrides the default installation directory for the **Next LS** server binary."
},
"elixir-tools.nextls.trace.server": {
"type": "string",
"scope": "window",
"enum": [
"off",
"messages",
"verbose"
],
"default": "off",
"description": "Traces the communication between VS Code and the Next LS."
"configuration": [
{
"title": "Next LS",
"properties": {
"elixir-tools.nextLS.enable": {
"type": "boolean",
"default": true,
"markdownDescription": "Whether to start **Next LS**.",
"order": 1
},
"elixir-tools.nextLS.adapter": {
"type": "string",
"enum": [
"stdio",
"tcp"
],
"default": "stdio",
"markdownDescription": "Which adapter to use when connecting to **Next LS**."
},
"elixir-tools.nextLS.port": {
"type": "integer",
"default": 9000,
"markdownDescription": "If adapter is `tcp`, use this port to connect to a running server.\n\nYou can start the server with `path/to/nextls --port <port>`."
},
"elixir-tools.nextLS.installationDirectory": {
"type": "string",
"default": "~/.cache/elixir-tools/nextls/bin/",
"markdownDescription": "Overrides the default installation directory for the **Next LS** server binary."
},
"elixir-tools.nextLS.trace.server": {
"type": "string",
"scope": "window",
"enum": [
"off",
"messages",
"verbose"
],
"default": "off",
"description": "Traces the communication between VS Code and the Next LS."
}
}
},
{
"title": "Credo Language Server",
"properties": {
"elixir-tools.credo.enable": {
"type": "boolean",
"default": false,
"markdownDescription": "Whether to start **Credo Language Server**",
"order": 1
},
"elixir-tools.credo.adapter": {
"type": "string",
"enum": [
"stdio",
"tcp"
],
"default": "stdio",
"markdownDescription": "Which adapter to use when connecting to **Credo Language Server**."
},
"elixir-tools.credo.port": {
"type": "integer",
"default": 9000,
"markdownDescription": "If adapter is `tcp`, use this port to connect to a running server.\n\nYou can start the server with `path/to/credo-language-server --port <port>`."
},
"elixir-tools.credo.version": {
"type": "string",
"default": "latest",
"markdownDescription": "Specifies the version of **Credo Language Server**.\n\nDefaults to `latest`."
},
"elixir-tools.credo.trace.server": {
"type": "string",
"scope": "window",
"enum": [
"off",
"messages",
"verbose"
],
"default": "off",
"description": "Traces the communication between VS Code and the Next LS."
}
}
}
},
],
"languages": [
{
"id": "elixir",
Expand Down
4 changes: 2 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ async function activateNextLS(
context: vscode.ExtensionContext,
_mixfile: vscode.Uri
) {
let config = vscode.workspace.getConfiguration("elixir-tools.nextls");
let config = vscode.workspace.getConfiguration("elixir-tools.nextLS");

const command = "elixir-tools.uninstall-nextls";

Expand Down Expand Up @@ -177,7 +177,7 @@ async function activateNextLS(
};

nextLSClient = new LanguageClient(
"elixir-tools.nextls",
"elixir-tools.nextLS",
"NextLS",
serverOptions,
clientOptions
Expand Down

0 comments on commit fc3154d

Please sign in to comment.