Skip to content

Commit 0e69f84

Browse files
committed
Add Pyrefly LSP specification
1 parent eb44f58 commit 0e69f84

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

python_packages/jupyter_lsp/jupyter_lsp/specs/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from .julia_language_server import JuliaLanguageServer
1111
from .pyls import PalantirPythonLanguageServer
1212
from .pyright import PyrightLanguageServer
13+
from .pyrefly import PyreflyLanguageServer
1314
from .python_lsp_server import PythonLSPServer
1415
from .r_languageserver import RLanguageServer
1516
from .sql_language_server import SQLLanguageServer
@@ -31,6 +32,7 @@
3132
md = UnifiedLanguageServer()
3233
py_palantir = PalantirPythonLanguageServer()
3334
py_lsp_server = PythonLSPServer()
35+
pyrefly = PyreflyLanguageServer()
3436
pyright = PyrightLanguageServer()
3537
r = RLanguageServer()
3638
tex = Texlab()
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Pyrefly Language Server Configuration",
4+
"type": "object",
5+
"properties": {
6+
"python.pyrefly.disableTypeErrors": {
7+
"type": "boolean",
8+
"default": false,
9+
"description": "If true, pyrefly will not provide typecheck squiggles in the IDE. To control other IDE services, see `python.pyrefly.disableLanguageServices`",
10+
"scope": "resource"
11+
},
12+
"python.pyrefly.disableLanguageServices": {
13+
"type": "boolean",
14+
"default": false,
15+
"description": "If true, pyrefly will not provide other IDE services like completions, hover, definition, etc. To control type errors, see `python.pyrefly.disableTypeErrors`",
16+
"scope": "resource"
17+
}
18+
}
19+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from .config import load_config_schema
2+
from .utils import ShellSpec
3+
4+
5+
class PyreflyLanguageServer(ShellSpec):
6+
key = cmd = "pyrefly"
7+
args = ["lsp"]
8+
languages = ["python"]
9+
spec = dict(
10+
display_name="Pyrefly",
11+
mime_types=["text/python", "text/x-ipython"],
12+
urls=dict(
13+
home="https://github.com/facebook/pyrefly",
14+
issues="https://github.com/facebook/pyrefly/issues",
15+
),
16+
install=dict(
17+
pip="pip install pyrefly",
18+
uv="uv add pyrefly",
19+
conda="conda install -c conda-forge pyrefly",
20+
),
21+
config_schema=load_config_schema(key),
22+
requires_documents_on_disk=False
23+
)

python_packages/jupyter_lsp/setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jupyter_lsp_spec_v1 =
4444
julia-language-server = jupyter_lsp.specs:julia
4545
python-language-server = jupyter_lsp.specs:py_palantir
4646
python-lsp-server = jupyter_lsp.specs:py_lsp_server
47+
pyrefly = jupyter_lsp.specs:pyrefly
4748
pyright = jupyter_lsp.specs:pyright
4849
r-languageserver = jupyter_lsp.specs:r
4950
texlab = jupyter_lsp.specs:tex

0 commit comments

Comments
 (0)