Skip to content

Commit

Permalink
Configuration option for pyls executable (python-lsp#513)
Browse files Browse the repository at this point in the history
* vscode: pyls executable path can be configured via "pyls.executable" parameter.

* vscode: fixed identation
  • Loading branch information
tonich-sh authored and gatesn committed Mar 9, 2019
1 parent 18f3c3f commit 7e911dc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 1 addition & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ Develop against VS Code

The Python language server can be developed against a local instance of Visual Studio Code.

1. Install `VSCode for Mac <http://code.visualstudio.com/docs/?dv=osx>`_
2. From within VSCode View -> Command Palette, then type *shell* and run ``install 'code' command in PATH``
1. Install `VSCode <https://code.visualstudio.com/download`_

.. code-block:: bash
Expand Down
9 changes: 7 additions & 2 deletions vscode-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vscode-client",
"description": "VSCode extension for running multiple language servers",
"name": "pyls",
"description": "Python language server",
"author": "Sourcegraph",
"repository": "https://github.com/Microsoft/vscode-languageserver-node",
"license": "MIT",
Expand All @@ -20,6 +20,11 @@
"title": "Python Language Server Configuration",
"type": "object",
"properties": {
"pyls.executable": {
"type": "string",
"default": "pyls",
"description": "Language server executable"
},
"pyls.configurationSources": {
"type": "array",
"default": ["pycodestyle"],
Expand Down
3 changes: 2 additions & 1 deletion vscode-client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ function startLangServerTCP(addr: number, documentSelector: string[]): Disposabl
}

export function activate(context: ExtensionContext) {
context.subscriptions.push(startLangServer("pyls", ["-vv"], ["python"]));
const executable = workspace.getConfiguration("pyls").get<string>("executable");
context.subscriptions.push(startLangServer(executable, ["-vv"], ["python"]));
// For TCP server needs to be started seperately
// context.subscriptions.push(startLangServerTCP(2087, ["python"]));
}
Expand Down

0 comments on commit 7e911dc

Please sign in to comment.