All Projects → microsoft → Python Language Server

microsoft / Python Language Server

Licence: apache-2.0
Microsoft Language Server for Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Python Language Server

Php Language Server
PHP Implementation of the VS Code Language Server Protocol 🆚↔🖥
Stars: ✭ 1,019 (+30.98%)
Mutual labels:  language-server-protocol, language-server, code-analysis
Pylance Release
Documentation and issues for Pylance
Stars: ✭ 782 (+0.51%)
Mutual labels:  language-server-protocol, language-server, code-analysis
Monaco Languageclient
NPM module to connect Monaco editor with language servers
Stars: ✭ 419 (-46.14%)
Mutual labels:  language-server-protocol, language-server
LanguageServer.NET
A .NET Standard server-side implementation of Language Server Protocol 2.0/3.x infrastructure library.
Stars: ✭ 78 (-89.97%)
Mutual labels:  language-server, language-server-protocol
language-server
Generic Language Server
Stars: ✭ 21 (-97.3%)
Mutual labels:  language-server, language-server-protocol
Intelephense
Intellisense for PHP
Stars: ✭ 212 (-72.75%)
Mutual labels:  language-server-protocol, language-server
Lua Lsp
A Lua language server
Stars: ✭ 219 (-71.85%)
Mutual labels:  language-server-protocol, language-server
typescript-language-server
TypeScript & JavaScript Language Server
Stars: ✭ 1,118 (+43.7%)
Mutual labels:  language-server, language-server-protocol
Dockerfile Language Server Nodejs
A language server for Dockerfiles powered by Node.js, TypeScript, and VSCode technologies.
Stars: ✭ 170 (-78.15%)
Mutual labels:  language-server-protocol, language-server
toy-language-server
Example language server (LSP) implementation for a toy language
Stars: ✭ 54 (-93.06%)
Mutual labels:  language-server, language-server-protocol
stardog-language-servers
Language Servers for Stardog Languages
Stars: ✭ 19 (-97.56%)
Mutual labels:  language-server, language-server-protocol
camel-language-server
The Apache Camel LSP server implementation
Stars: ✭ 31 (-96.02%)
Mutual labels:  language-server, language-server-protocol
Typescript Language Server
TypeScript & JavaScript Language Server
Stars: ✭ 462 (-40.62%)
Mutual labels:  language-server-protocol, language-server
Fsautocomplete
F# language server using Language Server Protocol
Stars: ✭ 208 (-73.26%)
Mutual labels:  language-server-protocol, language-server
Csharp Language Server Protocol
Language Server Protocol in C#
Stars: ✭ 230 (-70.44%)
Mutual labels:  language-server-protocol, language-server
Langserver Swift
A Swift implementation of the open Language Server Protocol.
Stars: ✭ 171 (-78.02%)
Mutual labels:  language-server-protocol, language-server
groovy-language-server
A language server for Groovy
Stars: ✭ 132 (-83.03%)
Mutual labels:  language-server, language-server-protocol
Erlang ls
The Erlang Language Server
Stars: ✭ 363 (-53.34%)
Mutual labels:  language-server-protocol, language-server
Lsp4intellij
This language client library provides language server protocol support for IntelliJ IDEA and other Jetbrains IDEs.
Stars: ✭ 121 (-84.45%)
Mutual labels:  language-server-protocol, language-server
Elm Language Client Vscode
Improving your Elm experience since 2019
Stars: ✭ 162 (-79.18%)
Mutual labels:  language-server-protocol, language-server

Microsoft Python Language Server

Microsoft Python Language Server implements the Language Server Protocol.

Its primary clients are the Python extension for VS Code and Python Tools for Visual Studio.

Feel free to file issues or ask questions on our issue tracker, and we welcome code contributions.

Build/contributing instructions

See CONTRIBUTING.md

Troubleshooting and known issues

See TROUBLESHOOTING.md.

Linting options (diagnostics)

The language server implements diagnostics (or linting), which runs on user code. The following diagnostics are supported:

Code Description
inherit-non-class Attempted to inherit something that is not a class.
too-many-function-arguments Too many arguments have been provided to a function call.
too-many-positional-arguments-before-star Too many arguments have been provided before a starred argument.
no-cls-argument First parameter in a class method must be cls
no-method-argument Method has no arguments
no-self-argument First parameter in a method must be self
parameter-already-specified A argument with this name has already been specified.
parameter-missing A required positional argument is missing.
positional-argument-after-keyword A positional argument has been provided after a keyword argument.
positional-only-named A positional-only argument (3.8+) has been named in a function call.
return-in-init Encountered an explicit return in __init__ function.
typing-generic-arguments An error occurred while constructing Generic.
typing-newtype-arguments An error occurred while constructing NewType.
typing-typevar-arguments An error occurred while constructing TypeVar.
unknown-parameter-name The keyword argument name provided is unknown.
unresolved-import An import cannot be resolved, and may be missing.
undefined-variable A variable has been used that has not yet been defined.
variable-not-defined-globally A variable is not defined in the global scope.
variable-not-defined-nonlocal A variable is not defined in non-local scopes.

A full list can be seen in the source code.

Linting can be controlled via the user configuration. In VS Code, this is settings.json, but other clients would send this via workspace/didChangeConfiguration.

If python.linting.enabled is set to false in the user configuration, then no diagnostics will be collected other than syntax errors and unresolved imports.

To control the visibility and severity of the diagnotics, there are a number of lists that can be set in the user configuration which make use of each diagnostic's error code.

Setting Description
python.analysis.errors Diagnostics which should be shown as errors.
python.analysis.warnings Diagnostics which should be shown as warnings.
python.analysis.information Diagnostics which should be shown as informational.
python.analysis.disabled Diagnotics which should not be shown at all.

An example of a user configuration which sets these options:

{
    "python.analysis.errors": ["undefined-variable"],
    "python.analysis.warnings": ["unknown-parameter-name"],
    "python.analysis.information": ["unresolved-import"],
    "python.analysis.disabled": ["too-many-function-arguments", "parameter-missing"],
}

Linting can also be controlled on an individual line basis with a generalized #noqa. Lines with #noqa will have their diagnostic output suppressed.

An example usage:

from python import language_server  # noqa will suppress the linting message for this line

Cache location

During analysis language server produces Python code from compiled modules and builtins which is similar to Python module stubs. It may also produce database files holding module analysis for faster retrieval later. Cache location is at

Windows

"%LOCALAPPDATA%\Microsoft\Python Language Server" (which is Environment.SpecialFolder.LocalApplicationData). Typically "C:\Users\\%USER_NAME%\AppData\Local\Microsoft\Python Language Server"

Linux

"$XDG_CACHE_HOME/Microsoft/Python Language Server", or if XDG_CACHE_HOME is not set, "$HOME/.cache/Microsoft/Python Language Server"

macOS

"$HOME/Library/Caches/Microsoft/Python Language Server"

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].