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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Changelog

### `jupyter-lsp (next)`

- features:
- add auto-detection of Pyrefly language server ([#1136](https://github.com/jupyter-lsp/jupyterlab-lsp/issues/1136))

### `@jupyter-lsp/jupyterlab-lsp 5.2.0`

- enhancements:
Expand Down
2 changes: 2 additions & 0 deletions python_packages/jupyter_lsp/jupyter_lsp/specs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from .julia_language_server import JuliaLanguageServer
from .pyls import PalantirPythonLanguageServer
from .pyright import PyrightLanguageServer
from .pyrefly import PyreflyLanguageServer
from .python_lsp_server import PythonLSPServer
from .r_languageserver import RLanguageServer
from .sql_language_server import SQLLanguageServer
Expand All @@ -31,6 +32,7 @@
md = UnifiedLanguageServer()
py_palantir = PalantirPythonLanguageServer()
py_lsp_server = PythonLSPServer()
pyrefly = PyreflyLanguageServer()
pyright = PyrightLanguageServer()
r = RLanguageServer()
tex = Texlab()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ These are configuration schemas extracted from canonical upstreams:
- [dockerfile-language-server-nodejs](https://github.com/microsoft/vscode-docker/blob/master/package.json)
- [yaml-language-server](https://github.com/redhat-developer/vscode-yaml/blob/master/package.json)
- [pyright](https://github.com/microsoft/pyright/blob/main/packages/vscode-pyright/package.json)
- [pyrefly](https://github.com/facebook/pyrefly/blob/main/lsp/package.json)

> All of the configurations are sent to the Language Server, but only some of them
> are actually acted upon, but we don't know which is which, yet.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Pyrefly Language Server Configuration",
"type": "object",
"properties": {
"python.pyrefly.disableTypeErrors": {
"type": "boolean",
"default": false,
"description": "If true, pyrefly will not provide typecheck squiggles in the IDE. To control other IDE services, see `python.pyrefly.disableLanguageServices`",
"scope": "resource"
},
"python.pyrefly.disableLanguageServices": {
"type": "boolean",
"default": false,
"description": "If true, pyrefly will not provide other IDE services like completions, hover, definition, etc. To control type errors, see `python.pyrefly.disableTypeErrors`",
"scope": "resource"
}
}
}
23 changes: 23 additions & 0 deletions python_packages/jupyter_lsp/jupyter_lsp/specs/pyrefly.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from .config import load_config_schema
from .utils import ShellSpec


class PyreflyLanguageServer(ShellSpec):
key = cmd = "pyrefly"
args = ["lsp"]
languages = ["python"]
spec = dict(
display_name="Pyrefly",
mime_types=["text/python", "text/x-ipython"],
urls=dict(
home="https://github.com/facebook/pyrefly",
issues="https://github.com/facebook/pyrefly/issues",
),
install=dict(
pip="pip install pyrefly",
uv="uv add pyrefly",
conda="conda install -c conda-forge pyrefly",
),
config_schema=load_config_schema(key),
requires_documents_on_disk=False
)
1 change: 1 addition & 0 deletions python_packages/jupyter_lsp/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jupyter_lsp_spec_v1 =
julia-language-server = jupyter_lsp.specs:julia
python-language-server = jupyter_lsp.specs:py_palantir
python-lsp-server = jupyter_lsp.specs:py_lsp_server
pyrefly = jupyter_lsp.specs:pyrefly
pyright = jupyter_lsp.specs:pyright
r-languageserver = jupyter_lsp.specs:r
texlab = jupyter_lsp.specs:tex
Expand Down
Loading