jedi-language-server


Namejedi-language-server JSON
Version 0.41.4 PyPI version JSON
download
home_pagehttps://github.com/pappasam/jedi-language-server
SummaryA language server for Jedi!
upload_time2024-04-16 23:47:20
maintainerNone
docs_urlNone
authorSam Roeca
requires_python<4.0,>=3.8
licenseMIT
keywords python completion refactoring vim neovim lsp language-server-protocol
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # Jedi Language Server

[![image-version](https://img.shields.io/pypi/v/jedi-language-server.svg)](https://python.org/pypi/jedi-language-server)
[![image-license](https://img.shields.io/pypi/l/jedi-language-server.svg)](https://python.org/pypi/jedi-language-server)
[![image-python-versions](https://img.shields.io/badge/python->=3.8-blue)](https://python.org/pypi/jedi-language-server)
[![image-pypi-downloads](https://static.pepy.tech/badge/jedi-language-server)](https://pepy.tech/projects/jedi-language-server)
[![github-action-testing](https://github.com/pappasam/jedi-language-server/actions/workflows/testing.yaml/badge.svg)](https://github.com/pappasam/jedi-language-server/actions/workflows/testing.yaml)
[![poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)

A [Python](https://www.python.org/) [Language Server](https://microsoft.github.io/language-server-protocol/) powered by the latest version of [Jedi](https://jedi.readthedocs.io/en/latest/).

## Installation

Some frameworks, like coc-jedi and vscode-python, will install and manage `jedi-language-server` for you. If you're setting up manually, you can run the following from your command line (bash / zsh):

```bash
pip install -U jedi-language-server
```

Alternatively (and preferably), use [pipx](https://github.com/pipxproject/pipx) to keep `jedi-language-server` and its dependencies isolated from your other Python dependencies. Don't worry, jedi is smart enough to figure out which Virtual environment you're currently using!

## Editor Setup

The following instructions show how to use `jedi-language-server` with your development tooling. The instructions assume you have already installed `jedi-language-server`.

### Vim / Neovim

Users may choose 1 of the following options:

- [Neovim's native LSP client](https://neovim.io/doc/user/lsp.html). See [here](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#jedi_language_server) for an example configuration.
- [coc.nvim](https://github.com/neoclide/coc.nvim) with [coc-jedi](https://github.com/pappasam/coc-jedi).
- [ALE](https://github.com/dense-analysis/ale).
- [vim-lsp](https://github.com/prabirshrestha/vim-lsp).

Note: this list is non-exhaustive. If you know of a great choice not included in this list, please submit a PR!

### Emacs

Users may choose one of the following options:

- [lsp-jedi](https://github.com/fredcamps/lsp-jedi).
- [eglot](https://github.com/joaotavora/eglot)

Note: this list is non-exhaustive. If you know of a great choice not included in this list, please submit a PR!

### Visual Studio Code (vscode)

Starting from the [October 2021 release](https://github.com/microsoft/vscode-python/releases/tag/2021.10.1317843341), set the `python.languageServer` setting to `Jedi` to use `jedi-language-server`.

See: <https://github.com/pappasam/jedi-language-server/issues/50#issuecomment-781101169>

## Configuration

`jedi-language-server` supports the following [initializationOptions](https://microsoft.github.io/language-server-protocol/specification#initialize):

```json
{
  "initializationOptions": {
    "codeAction": {
      "nameExtractVariable": "jls_extract_var",
      "nameExtractFunction": "jls_extract_def"
    },
    "completion": {
      "disableSnippets": false,
      "resolveEagerly": false,
      "ignorePatterns": []
    },
    "diagnostics": {
      "enable": false,
      "didOpen": true,
      "didChange": true,
      "didSave": true
    },
    "hover": {
      "enable": true,
      "disable": {
        "class": { "all": false, "names": [], "fullNames": [] },
        "function": { "all": false, "names": [], "fullNames": [] },
        "instance": { "all": false, "names": [], "fullNames": [] },
        "keyword": { "all": false, "names": [], "fullNames": [] },
        "module": { "all": false, "names": [], "fullNames": [] },
        "param": { "all": false, "names": [], "fullNames": [] },
        "path": { "all": false, "names": [], "fullNames": [] },
        "property": { "all": false, "names": [], "fullNames": [] },
        "statement": { "all": false, "names": [], "fullNames": [] }
      }
    },
    "jediSettings": {
      "autoImportModules": [],
      "caseInsensitiveCompletion": true,
      "debug": false
    },
    "markupKindPreferred": "markdown",
    "workspace": {
      "extraPaths": [],
      "environmentPath": "/path/to/venv/bin/python",
      "symbols": {
        "ignoreFolders": [".nox", ".tox", ".venv", "__pycache__", "venv"],
        "maxSymbols": 20
      }
    }
  }
}
```

The different sections of the InitializationOptions are explained below, in detail. Section headers use a `.` to separate nested JSON-object keys.

### markupKindPreferred

The preferred MarkupKind for all `jedi-language-server` messages that take [MarkupContent](https://microsoft.github.io/language-server-protocol/specification#markupContent).

- type: `string`
- accepted values: `"markdown"`, `"plaintext"`

If omitted, `jedi-language-server` defaults to the client-preferred configuration. If there is no client-preferred configuration, jedi language server users `"plaintext"`.

### jediSettings.autoImportModules

Modules that jedi will directly import without analyzing. Improves autocompletion but loses goto definition.

- type: `string[]`
- default: `[]`

If you're noticing that modules like `numpy` and `pandas` are taking a super long time to load, and you value completions / signatures over goto definition, I recommend using this option like this:

```json
{
  "jediSettings": {
    "autoImportModules": ["numpy", "pandas"]
  }
}
```

### jediSettings.caseInsensitiveCompletion

Completions are by default case-insensitive. Set to `false` to make completions case-sensitive.

- type: `boolean`
- default: `true`

```json
{
  "jediSettings": {
    "caseInsensitiveCompletion": false
  }
}
```

### jediSettings.debug

Print jedi debugging messages to stderr.

- type: `boolean`
- default: `false`

```json
{
  "jediSettings": {
    "debug": false
  }
}
```

### codeAction.nameExtractFunction

Function name generated by the 'extract_function' codeAction.

- type: `string`
- default: `"jls_extract_def"`

### codeAction.nameExtractVariable

Variable name generated by the 'extract_variable' codeAction.

- type: `string`
- default: `"jls_extract_var"`

### completion.disableSnippets

If your language client supports `CompletionItem` snippets but you don't like them, disable them by setting this option to `true`.

- type: `boolean`
- default: `false`

### completion.resolveEagerly

Return all completion results in initial completion request. Set to `true` if your language client does not support `completionItem/resolve`.

- type: `boolean`
- default: `false`

### completion.ignorePatterns

A list of regular expressions. If any regular expression in ignorePatterns matches a completion's name, that completion item is not returned to the client.

- type: `string[]`
- default: `[]`

In general, you should prefer the default value for this option. Jedi is very good at filtering values for end users. That said, there are situations where IDE developers, or some programmers in some code bases, may want to filter some completions by name. This flexible interface is provided to accommodate these advanced use cases. If you have one of these advanced use cases, see below for some example patterns (and their corresponding regular expression).

#### All Private Names

| Matches             | Non-Matches  |
| ------------------- | ------------ |
| `_hello`, `__world` | `__dunder__` |

Regular Expression:

```re
^_{1,3}$|^_[^_].*$|^__.*(?<!__)$
```

#### Only private mangled names

| Matches   | Non-Matches            |
| --------- | ---------------------- |
| `__world` | `_hello`, `__dunder__` |

Regular Expression:

```re
^_{2,3}$|^__.*(?<!__)$
```

#### Only dunder names

| Matches      | Non-Matches         |
| ------------ | ------------------- |
| `__dunder__` | `_hello`, `__world` |

Regular Expression:

```re
^__.*?__$
```

#### All names beginning with underscore

| Matches                           | Non-Matches |
| --------------------------------- | ----------- |
| `_hello`, `__world`, `__dunder__` | `regular`   |

Regular Expression:

```re
^_.*$
```

### diagnostics.enable

Enables (or disables) diagnostics provided by Jedi.

- type: `boolean`
- default: `true`

### diagnostics.didOpen

When diagnostics are enabled, run on document open

- type: `boolean`
- default: `true`

### diagnostics.didChange

When diagnostics are enabled, run on in-memory document change (eg, while you're editing, without needing to save to disk)

- type: `boolean`
- default: `true`

### diagnostics.didSave

When diagnostics are enabled, run on document save (to disk)

- type: `boolean`
- default: `true`

### hover.enable

Enable (or disable) all hover text. If set to `false`, will cause the hover method not to be registered to the language server.

- type: `boolean`
- default: `true`

### hover.disable.\*

The following options are available under this prefix:

- hover.disable.class.all
- hover.disable.class.names
- hover.disable.class.fullNames
- hover.disable.function.all
- hover.disable.function.names
- hover.disable.function.fullNames
- hover.disable.instance.all
- hover.disable.instance.names
- hover.disable.instance.fullNames
- hover.disable.keyword.all
- hover.disable.keyword.names
- hover.disable.keyword.fullNames
- hover.disable.module.all
- hover.disable.module.names
- hover.disable.module.fullNames
- hover.disable.param.all
- hover.disable.param.names
- hover.disable.param.fullNames
- hover.disable.path.all
- hover.disable.path.names
- hover.disable.path.fullNames
- hover.disable.property.all
- hover.disable.property.names
- hover.disable.property.fullNames
- hover.disable.statement.all
- hover.disable.statement.names
- hover.disable.statement.fullNames

#### hover.disable.\[jedi-type\].all

Disable all hover text of jedi-type specified.

- type: `bool`
- default: `false`

#### hover.disable.\[jedi-type\].names

Disable hover text identified by name in list of jedi-type specified.

- type: `string[]`
- default: `[]`

#### hover.disable.\[jedi-type\].fullNames

Disable hover text identified by the fully qualified name in list of jedi-type specified. If no fully qualified name can be found, `jedi-language-server` will default to the name to prevent any unexpected behavior for users (relevant for jedi types like keywords that don't have full names).

- type: `string[]`
- default: `[]`

### workspace.extraPaths

Add additional paths for Jedi's analysis. Useful with vendor directories, packages in a non-standard location, etc. You probably won't need to use this, but you'll be happy it's here when you need it!

- type: `string[]`
- default: `[]`

Non-absolute paths are relative to your project root. For example, let's say your Python project is structured like this:

```
├── funky
│   └── haha.py
├── poetry.lock
├── pyproject.toml
├── test.py
```

Assume that `funky/haha.py` contains 1 line, `x = 12`, and your build system does some wizardry that makes `haha` importable just like `os` or `pathlib`. In this example, if you want to have this same non-standard behavior with `jedi-language-server`, put the following in your `coc-settings.json`:

```json
{
  "workspace": {
    "extraPaths": ["funky"]
  }
}
```

When editing `test.py`, you'll get completions, goto definition, and all other lsp features for the line `from haha import ...`.

Again, you probably don't need this.

### workspace.environmentPath

The Python executable path, typically the path of a virtual environment.

- type: `string`

If omitted, defaults to the active Python environment.

### workspace.symbols.maxSymbols

Maximum number of symbols returned by a call to `workspace/symbols`.

- type: `number`
- default: 20

```json
{
  "workspace": {
    "symbols": {
      "maxSymbols": 20
    }
  }
}
```

A value less than or equal to zero removes the maximum and allows `jedi-language-server` to return all workplace symbols found by jedi.

### workspace.symbols.ignoreFolders

Performance optimization that sets names of folders that are ignored for `workspace/symbols`.

- type: `string[]`
- default: `[".nox", ".tox", ".venv", "__pycache__", "venv"]`

```json
{
  "workspace": {
    "symbols": {
      "ignoreFolders": ["hello", "world"]
    }
  }
}
```

If you manually set this option, it overrides the default. Setting it to an empty array will result in no ignored folders.

## Diagnostics

Diagnostics are provided by Python's built-in `compile` function.

If you would like additional diagnostics, we recommend using other tools (like [diagnostic-language-server](https://github.com/iamcco/diagnostic-languageserver)) to complement `jedi-language-server`.

## Code Formatting

Again, we recommend that you use [diagnostic-language-server](https://github.com/iamcco/diagnostic-languageserver). It also supports code formatting.

## Command line usage

`jedi-language-server` can be run directly from the command line.

```console
$ jedi-language-server --help
usage: jedi-language-server [-h] [--version] [--tcp] [--ws] [--host HOST] [--port PORT] [--log-file LOG_FILE] [-v]
```

If testing sending requests over stdio manually from the command line, you must include Windows-style line endings: `\r\n`. For an example, from within this project, run the following:

```console
$ jedi-language-server -v < ./example-initialization-request.txt
INFO:pygls.server:Starting IO server
...
```

If testing interactively, be sure to manually insert carriage returns. Although this may differ between shell environments, within most bash terminals, you can explicitly insert the required line endings by typing `<C-v><C-m>`, which will insert a `^M`. See:

```console
$ jedi-language-server 2>logs
Content-Length: 1062^M
^M
...
```

## Technical capabilities

jedi-language-server aims to support Jedi's capabilities and expose them through the Language Server Protocol. It supports the following Language Server capabilities:

### Language Features

- [completionItem/resolve](https://microsoft.github.io/language-server-protocol/specification#completionItem_resolve)
- [textDocument/codeAction](https://microsoft.github.io/language-server-protocol/specification#textDocument_codeAction) (refactor.inline, refactor.extract)
- [textDocument/completion](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_completion)
- [textDocument/declaration](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_declaration)
- [textDocument/definition](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition)
- [textDocument/documentHighlight](https://microsoft.github.io/language-server-protocol/specification#textDocument_documentHighlight)
- [textDocument/documentSymbol](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_documentSymbol)
- [textDocument/typeDefinition](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_typeDefinition)
- [textDocument/hover](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_hover)
- [textDocument/publishDiagnostics](https://microsoft.github.io/language-server-protocol/specification#textDocument_publishDiagnostics)
- [textDocument/references](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references)
- [textDocument/rename](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_rename)
- [textDocument/signatureHelp](https://microsoft.github.io/language-server-protocol/specification#textDocument_signatureHelp)
- [workspace/symbol](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_symbol)

### Text Synchronization (for diagnostics)

- [textDocument/didChange](https://microsoft.github.io/language-server-protocol/specification#textDocument_didChange)
- [textDocument/didOpen](https://microsoft.github.io/language-server-protocol/specification#textDocument_didOpen)
- [textDocument/didSave](https://microsoft.github.io/language-server-protocol/specification#textDocument_didSave)

## Local Development

To build and run this project from source:

### Dependencies

Install the following tools manually:

- [Poetry](https://github.com/sdispater/poetry#installation)
- [GNU Make](https://www.gnu.org/software/make/)

#### Recommended

- [asdf](https://github.com/asdf-vm/asdf)

### Get source code

[Fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) this repository and clone the fork to your development machine:

```bash
git clone https://github.com/<YOUR-USERNAME>/jedi-language-server
cd jedi-language-server
```

### Set up development environment

```bash
make setup
```

### Automatically format files

```bash
make fix
```

### Run tests

```bash
make lint
make typecheck
make tests
```

## Inspiration

Palantir's [python-language-server](https://github.com/palantir/python-language-server) inspired this project. In fact, for consistency's sake, many of python-language-server's CLI options are used as-is in `jedi-language-server`.

Unlike python-language-server, `jedi-language-server`:

- Uses [pygls](https://github.com/openlawlibrary/pygls) instead of creating its own low-level Language Server Protocol bindings
- Supports one powerful 3rd party static analysis / completion / refactoring library: Jedi. By only supporting Jedi, we can focus on supporting all Jedi features without exposing ourselves to too many broken 3rd party dependencies (I'm looking at you, [rope](https://github.com/python-rope/rope)).
- Is supremely simple because of its scope constraints. Leave complexity to the Jedi [master](https://github.com/davidhalter). If the force is strong with you, please submit a PR!

## Articles

- [Python in VS Code Improves Jedi Language Server Support](https://visualstudiomagazine.com/articles/2021/03/17/vscode-jedi.aspx)

## Written by

[Samuel Roeca](https://samroeca.com/)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pappasam/jedi-language-server",
    "name": "jedi-language-server",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "python, completion, refactoring, vim, neovim, lsp, language-server-protocol",
    "author": "Sam Roeca",
    "author_email": "samuel.roeca@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/34/f9/c24a60c08624c042600ef3c115ff744829491a0ab5631eba0377c2ca1882/jedi_language_server-0.41.4.tar.gz",
    "platform": null,
    "description": "# Jedi Language Server\n\n[![image-version](https://img.shields.io/pypi/v/jedi-language-server.svg)](https://python.org/pypi/jedi-language-server)\n[![image-license](https://img.shields.io/pypi/l/jedi-language-server.svg)](https://python.org/pypi/jedi-language-server)\n[![image-python-versions](https://img.shields.io/badge/python->=3.8-blue)](https://python.org/pypi/jedi-language-server)\n[![image-pypi-downloads](https://static.pepy.tech/badge/jedi-language-server)](https://pepy.tech/projects/jedi-language-server)\n[![github-action-testing](https://github.com/pappasam/jedi-language-server/actions/workflows/testing.yaml/badge.svg)](https://github.com/pappasam/jedi-language-server/actions/workflows/testing.yaml)\n[![poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)\n\nA [Python](https://www.python.org/) [Language Server](https://microsoft.github.io/language-server-protocol/) powered by the latest version of [Jedi](https://jedi.readthedocs.io/en/latest/).\n\n## Installation\n\nSome frameworks, like coc-jedi and vscode-python, will install and manage `jedi-language-server` for you. If you're setting up manually, you can run the following from your command line (bash / zsh):\n\n```bash\npip install -U jedi-language-server\n```\n\nAlternatively (and preferably), use [pipx](https://github.com/pipxproject/pipx) to keep `jedi-language-server` and its dependencies isolated from your other Python dependencies. Don't worry, jedi is smart enough to figure out which Virtual environment you're currently using!\n\n## Editor Setup\n\nThe following instructions show how to use `jedi-language-server` with your development tooling. The instructions assume you have already installed `jedi-language-server`.\n\n### Vim / Neovim\n\nUsers may choose 1 of the following options:\n\n- [Neovim's native LSP client](https://neovim.io/doc/user/lsp.html). See [here](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#jedi_language_server) for an example configuration.\n- [coc.nvim](https://github.com/neoclide/coc.nvim) with [coc-jedi](https://github.com/pappasam/coc-jedi).\n- [ALE](https://github.com/dense-analysis/ale).\n- [vim-lsp](https://github.com/prabirshrestha/vim-lsp).\n\nNote: this list is non-exhaustive. If you know of a great choice not included in this list, please submit a PR!\n\n### Emacs\n\nUsers may choose one of the following options:\n\n- [lsp-jedi](https://github.com/fredcamps/lsp-jedi).\n- [eglot](https://github.com/joaotavora/eglot)\n\nNote: this list is non-exhaustive. If you know of a great choice not included in this list, please submit a PR!\n\n### Visual Studio Code (vscode)\n\nStarting from the [October 2021 release](https://github.com/microsoft/vscode-python/releases/tag/2021.10.1317843341), set the `python.languageServer` setting to `Jedi` to use `jedi-language-server`.\n\nSee: <https://github.com/pappasam/jedi-language-server/issues/50#issuecomment-781101169>\n\n## Configuration\n\n`jedi-language-server` supports the following [initializationOptions](https://microsoft.github.io/language-server-protocol/specification#initialize):\n\n```json\n{\n  \"initializationOptions\": {\n    \"codeAction\": {\n      \"nameExtractVariable\": \"jls_extract_var\",\n      \"nameExtractFunction\": \"jls_extract_def\"\n    },\n    \"completion\": {\n      \"disableSnippets\": false,\n      \"resolveEagerly\": false,\n      \"ignorePatterns\": []\n    },\n    \"diagnostics\": {\n      \"enable\": false,\n      \"didOpen\": true,\n      \"didChange\": true,\n      \"didSave\": true\n    },\n    \"hover\": {\n      \"enable\": true,\n      \"disable\": {\n        \"class\": { \"all\": false, \"names\": [], \"fullNames\": [] },\n        \"function\": { \"all\": false, \"names\": [], \"fullNames\": [] },\n        \"instance\": { \"all\": false, \"names\": [], \"fullNames\": [] },\n        \"keyword\": { \"all\": false, \"names\": [], \"fullNames\": [] },\n        \"module\": { \"all\": false, \"names\": [], \"fullNames\": [] },\n        \"param\": { \"all\": false, \"names\": [], \"fullNames\": [] },\n        \"path\": { \"all\": false, \"names\": [], \"fullNames\": [] },\n        \"property\": { \"all\": false, \"names\": [], \"fullNames\": [] },\n        \"statement\": { \"all\": false, \"names\": [], \"fullNames\": [] }\n      }\n    },\n    \"jediSettings\": {\n      \"autoImportModules\": [],\n      \"caseInsensitiveCompletion\": true,\n      \"debug\": false\n    },\n    \"markupKindPreferred\": \"markdown\",\n    \"workspace\": {\n      \"extraPaths\": [],\n      \"environmentPath\": \"/path/to/venv/bin/python\",\n      \"symbols\": {\n        \"ignoreFolders\": [\".nox\", \".tox\", \".venv\", \"__pycache__\", \"venv\"],\n        \"maxSymbols\": 20\n      }\n    }\n  }\n}\n```\n\nThe different sections of the InitializationOptions are explained below, in detail. Section headers use a `.` to separate nested JSON-object keys.\n\n### markupKindPreferred\n\nThe preferred MarkupKind for all `jedi-language-server` messages that take [MarkupContent](https://microsoft.github.io/language-server-protocol/specification#markupContent).\n\n- type: `string`\n- accepted values: `\"markdown\"`, `\"plaintext\"`\n\nIf omitted, `jedi-language-server` defaults to the client-preferred configuration. If there is no client-preferred configuration, jedi language server users `\"plaintext\"`.\n\n### jediSettings.autoImportModules\n\nModules that jedi will directly import without analyzing. Improves autocompletion but loses goto definition.\n\n- type: `string[]`\n- default: `[]`\n\nIf you're noticing that modules like `numpy` and `pandas` are taking a super long time to load, and you value completions / signatures over goto definition, I recommend using this option like this:\n\n```json\n{\n  \"jediSettings\": {\n    \"autoImportModules\": [\"numpy\", \"pandas\"]\n  }\n}\n```\n\n### jediSettings.caseInsensitiveCompletion\n\nCompletions are by default case-insensitive. Set to `false` to make completions case-sensitive.\n\n- type: `boolean`\n- default: `true`\n\n```json\n{\n  \"jediSettings\": {\n    \"caseInsensitiveCompletion\": false\n  }\n}\n```\n\n### jediSettings.debug\n\nPrint jedi debugging messages to stderr.\n\n- type: `boolean`\n- default: `false`\n\n```json\n{\n  \"jediSettings\": {\n    \"debug\": false\n  }\n}\n```\n\n### codeAction.nameExtractFunction\n\nFunction name generated by the 'extract_function' codeAction.\n\n- type: `string`\n- default: `\"jls_extract_def\"`\n\n### codeAction.nameExtractVariable\n\nVariable name generated by the 'extract_variable' codeAction.\n\n- type: `string`\n- default: `\"jls_extract_var\"`\n\n### completion.disableSnippets\n\nIf your language client supports `CompletionItem` snippets but you don't like them, disable them by setting this option to `true`.\n\n- type: `boolean`\n- default: `false`\n\n### completion.resolveEagerly\n\nReturn all completion results in initial completion request. Set to `true` if your language client does not support `completionItem/resolve`.\n\n- type: `boolean`\n- default: `false`\n\n### completion.ignorePatterns\n\nA list of regular expressions. If any regular expression in ignorePatterns matches a completion's name, that completion item is not returned to the client.\n\n- type: `string[]`\n- default: `[]`\n\nIn general, you should prefer the default value for this option. Jedi is very good at filtering values for end users. That said, there are situations where IDE developers, or some programmers in some code bases, may want to filter some completions by name. This flexible interface is provided to accommodate these advanced use cases. If you have one of these advanced use cases, see below for some example patterns (and their corresponding regular expression).\n\n#### All Private Names\n\n| Matches             | Non-Matches  |\n| ------------------- | ------------ |\n| `_hello`, `__world` | `__dunder__` |\n\nRegular Expression:\n\n```re\n^_{1,3}$|^_[^_].*$|^__.*(?<!__)$\n```\n\n#### Only private mangled names\n\n| Matches   | Non-Matches            |\n| --------- | ---------------------- |\n| `__world` | `_hello`, `__dunder__` |\n\nRegular Expression:\n\n```re\n^_{2,3}$|^__.*(?<!__)$\n```\n\n#### Only dunder names\n\n| Matches      | Non-Matches         |\n| ------------ | ------------------- |\n| `__dunder__` | `_hello`, `__world` |\n\nRegular Expression:\n\n```re\n^__.*?__$\n```\n\n#### All names beginning with underscore\n\n| Matches                           | Non-Matches |\n| --------------------------------- | ----------- |\n| `_hello`, `__world`, `__dunder__` | `regular`   |\n\nRegular Expression:\n\n```re\n^_.*$\n```\n\n### diagnostics.enable\n\nEnables (or disables) diagnostics provided by Jedi.\n\n- type: `boolean`\n- default: `true`\n\n### diagnostics.didOpen\n\nWhen diagnostics are enabled, run on document open\n\n- type: `boolean`\n- default: `true`\n\n### diagnostics.didChange\n\nWhen diagnostics are enabled, run on in-memory document change (eg, while you're editing, without needing to save to disk)\n\n- type: `boolean`\n- default: `true`\n\n### diagnostics.didSave\n\nWhen diagnostics are enabled, run on document save (to disk)\n\n- type: `boolean`\n- default: `true`\n\n### hover.enable\n\nEnable (or disable) all hover text. If set to `false`, will cause the hover method not to be registered to the language server.\n\n- type: `boolean`\n- default: `true`\n\n### hover.disable.\\*\n\nThe following options are available under this prefix:\n\n- hover.disable.class.all\n- hover.disable.class.names\n- hover.disable.class.fullNames\n- hover.disable.function.all\n- hover.disable.function.names\n- hover.disable.function.fullNames\n- hover.disable.instance.all\n- hover.disable.instance.names\n- hover.disable.instance.fullNames\n- hover.disable.keyword.all\n- hover.disable.keyword.names\n- hover.disable.keyword.fullNames\n- hover.disable.module.all\n- hover.disable.module.names\n- hover.disable.module.fullNames\n- hover.disable.param.all\n- hover.disable.param.names\n- hover.disable.param.fullNames\n- hover.disable.path.all\n- hover.disable.path.names\n- hover.disable.path.fullNames\n- hover.disable.property.all\n- hover.disable.property.names\n- hover.disable.property.fullNames\n- hover.disable.statement.all\n- hover.disable.statement.names\n- hover.disable.statement.fullNames\n\n#### hover.disable.\\[jedi-type\\].all\n\nDisable all hover text of jedi-type specified.\n\n- type: `bool`\n- default: `false`\n\n#### hover.disable.\\[jedi-type\\].names\n\nDisable hover text identified by name in list of jedi-type specified.\n\n- type: `string[]`\n- default: `[]`\n\n#### hover.disable.\\[jedi-type\\].fullNames\n\nDisable hover text identified by the fully qualified name in list of jedi-type specified. If no fully qualified name can be found, `jedi-language-server` will default to the name to prevent any unexpected behavior for users (relevant for jedi types like keywords that don't have full names).\n\n- type: `string[]`\n- default: `[]`\n\n### workspace.extraPaths\n\nAdd additional paths for Jedi's analysis. Useful with vendor directories, packages in a non-standard location, etc. You probably won't need to use this, but you'll be happy it's here when you need it!\n\n- type: `string[]`\n- default: `[]`\n\nNon-absolute paths are relative to your project root. For example, let's say your Python project is structured like this:\n\n```\n\u251c\u2500\u2500 funky\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 haha.py\n\u251c\u2500\u2500 poetry.lock\n\u251c\u2500\u2500 pyproject.toml\n\u251c\u2500\u2500 test.py\n```\n\nAssume that `funky/haha.py` contains 1 line, `x = 12`, and your build system does some wizardry that makes `haha` importable just like `os` or `pathlib`. In this example, if you want to have this same non-standard behavior with `jedi-language-server`, put the following in your `coc-settings.json`:\n\n```json\n{\n  \"workspace\": {\n    \"extraPaths\": [\"funky\"]\n  }\n}\n```\n\nWhen editing `test.py`, you'll get completions, goto definition, and all other lsp features for the line `from haha import ...`.\n\nAgain, you probably don't need this.\n\n### workspace.environmentPath\n\nThe Python executable path, typically the path of a virtual environment.\n\n- type: `string`\n\nIf omitted, defaults to the active Python environment.\n\n### workspace.symbols.maxSymbols\n\nMaximum number of symbols returned by a call to `workspace/symbols`.\n\n- type: `number`\n- default: 20\n\n```json\n{\n  \"workspace\": {\n    \"symbols\": {\n      \"maxSymbols\": 20\n    }\n  }\n}\n```\n\nA value less than or equal to zero removes the maximum and allows `jedi-language-server` to return all workplace symbols found by jedi.\n\n### workspace.symbols.ignoreFolders\n\nPerformance optimization that sets names of folders that are ignored for `workspace/symbols`.\n\n- type: `string[]`\n- default: `[\".nox\", \".tox\", \".venv\", \"__pycache__\", \"venv\"]`\n\n```json\n{\n  \"workspace\": {\n    \"symbols\": {\n      \"ignoreFolders\": [\"hello\", \"world\"]\n    }\n  }\n}\n```\n\nIf you manually set this option, it overrides the default. Setting it to an empty array will result in no ignored folders.\n\n## Diagnostics\n\nDiagnostics are provided by Python's built-in `compile` function.\n\nIf you would like additional diagnostics, we recommend using other tools (like [diagnostic-language-server](https://github.com/iamcco/diagnostic-languageserver)) to complement `jedi-language-server`.\n\n## Code Formatting\n\nAgain, we recommend that you use [diagnostic-language-server](https://github.com/iamcco/diagnostic-languageserver). It also supports code formatting.\n\n## Command line usage\n\n`jedi-language-server` can be run directly from the command line.\n\n```console\n$ jedi-language-server --help\nusage: jedi-language-server [-h] [--version] [--tcp] [--ws] [--host HOST] [--port PORT] [--log-file LOG_FILE] [-v]\n```\n\nIf testing sending requests over stdio manually from the command line, you must include Windows-style line endings: `\\r\\n`. For an example, from within this project, run the following:\n\n```console\n$ jedi-language-server -v < ./example-initialization-request.txt\nINFO:pygls.server:Starting IO server\n...\n```\n\nIf testing interactively, be sure to manually insert carriage returns. Although this may differ between shell environments, within most bash terminals, you can explicitly insert the required line endings by typing `<C-v><C-m>`, which will insert a `^M`. See:\n\n```console\n$ jedi-language-server 2>logs\nContent-Length: 1062^M\n^M\n...\n```\n\n## Technical capabilities\n\njedi-language-server aims to support Jedi's capabilities and expose them through the Language Server Protocol. It supports the following Language Server capabilities:\n\n### Language Features\n\n- [completionItem/resolve](https://microsoft.github.io/language-server-protocol/specification#completionItem_resolve)\n- [textDocument/codeAction](https://microsoft.github.io/language-server-protocol/specification#textDocument_codeAction) (refactor.inline, refactor.extract)\n- [textDocument/completion](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_completion)\n- [textDocument/declaration](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_declaration)\n- [textDocument/definition](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition)\n- [textDocument/documentHighlight](https://microsoft.github.io/language-server-protocol/specification#textDocument_documentHighlight)\n- [textDocument/documentSymbol](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_documentSymbol)\n- [textDocument/typeDefinition](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_typeDefinition)\n- [textDocument/hover](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_hover)\n- [textDocument/publishDiagnostics](https://microsoft.github.io/language-server-protocol/specification#textDocument_publishDiagnostics)\n- [textDocument/references](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references)\n- [textDocument/rename](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_rename)\n- [textDocument/signatureHelp](https://microsoft.github.io/language-server-protocol/specification#textDocument_signatureHelp)\n- [workspace/symbol](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_symbol)\n\n### Text Synchronization (for diagnostics)\n\n- [textDocument/didChange](https://microsoft.github.io/language-server-protocol/specification#textDocument_didChange)\n- [textDocument/didOpen](https://microsoft.github.io/language-server-protocol/specification#textDocument_didOpen)\n- [textDocument/didSave](https://microsoft.github.io/language-server-protocol/specification#textDocument_didSave)\n\n## Local Development\n\nTo build and run this project from source:\n\n### Dependencies\n\nInstall the following tools manually:\n\n- [Poetry](https://github.com/sdispater/poetry#installation)\n- [GNU Make](https://www.gnu.org/software/make/)\n\n#### Recommended\n\n- [asdf](https://github.com/asdf-vm/asdf)\n\n### Get source code\n\n[Fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) this repository and clone the fork to your development machine:\n\n```bash\ngit clone https://github.com/<YOUR-USERNAME>/jedi-language-server\ncd jedi-language-server\n```\n\n### Set up development environment\n\n```bash\nmake setup\n```\n\n### Automatically format files\n\n```bash\nmake fix\n```\n\n### Run tests\n\n```bash\nmake lint\nmake typecheck\nmake tests\n```\n\n## Inspiration\n\nPalantir's [python-language-server](https://github.com/palantir/python-language-server) inspired this project. In fact, for consistency's sake, many of python-language-server's CLI options are used as-is in `jedi-language-server`.\n\nUnlike python-language-server, `jedi-language-server`:\n\n- Uses [pygls](https://github.com/openlawlibrary/pygls) instead of creating its own low-level Language Server Protocol bindings\n- Supports one powerful 3rd party static analysis / completion / refactoring library: Jedi. By only supporting Jedi, we can focus on supporting all Jedi features without exposing ourselves to too many broken 3rd party dependencies (I'm looking at you, [rope](https://github.com/python-rope/rope)).\n- Is supremely simple because of its scope constraints. Leave complexity to the Jedi [master](https://github.com/davidhalter). If the force is strong with you, please submit a PR!\n\n## Articles\n\n- [Python in VS Code Improves Jedi Language Server Support](https://visualstudiomagazine.com/articles/2021/03/17/vscode-jedi.aspx)\n\n## Written by\n\n[Samuel Roeca](https://samroeca.com/)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A language server for Jedi!",
    "version": "0.41.4",
    "project_urls": {
        "Changelog": "https://github.com/pappasam/jedi-language-server/blob/main/CHANGELOG.md",
        "Homepage": "https://github.com/pappasam/jedi-language-server",
        "Issues": "https://github.com/pappasam/jedi-language-server/issues",
        "Repository": "https://github.com/pappasam/jedi-language-server"
    },
    "split_keywords": [
        "python",
        " completion",
        " refactoring",
        " vim",
        " neovim",
        " lsp",
        " language-server-protocol"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a6a4956ef96a52e1735ee1d494e30f274f6d3cd2b7fd18397731e6fd11035d8b",
                "md5": "335435bf5201ca01c81782586bb41696",
                "sha256": "53c6ce0eae5e332e5f6d76acf8d8c9cf33eae8191d31cc37913773127cd09f28"
            },
            "downloads": -1,
            "filename": "jedi_language_server-0.41.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "335435bf5201ca01c81782586bb41696",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 27614,
            "upload_time": "2024-04-16T23:47:18",
            "upload_time_iso_8601": "2024-04-16T23:47:18.280015Z",
            "url": "https://files.pythonhosted.org/packages/a6/a4/956ef96a52e1735ee1d494e30f274f6d3cd2b7fd18397731e6fd11035d8b/jedi_language_server-0.41.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "34f9c24a60c08624c042600ef3c115ff744829491a0ab5631eba0377c2ca1882",
                "md5": "6f16be2d89389042442b2fdb7d8dafb3",
                "sha256": "af010173f9f62dfcd3b3f4e2ea0ea3020fb4285c9b6b18b481aa978f28b5a36a"
            },
            "downloads": -1,
            "filename": "jedi_language_server-0.41.4.tar.gz",
            "has_sig": false,
            "md5_digest": "6f16be2d89389042442b2fdb7d8dafb3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 29128,
            "upload_time": "2024-04-16T23:47:20",
            "upload_time_iso_8601": "2024-04-16T23:47:20.313393Z",
            "url": "https://files.pythonhosted.org/packages/34/f9/c24a60c08624c042600ef3c115ff744829491a0ab5631eba0377c2ca1882/jedi_language_server-0.41.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-16 23:47:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pappasam",
    "github_project": "jedi-language-server",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "jedi-language-server"
}
        
Elapsed time: 1.87125s