anyenv 2.0.4__tar.gz → 2.0.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {anyenv-2.0.4 → anyenv-2.0.7}/PKG-INFO +1 -1
- {anyenv-2.0.4 → anyenv-2.0.7}/pyproject.toml +1 -1
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/language_formatters/_base.py +1 -1
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/lsp_servers/__init__.py +10 -0
- anyenv-2.0.7/src/anyenv/lsp_servers/_servers/__init__.py +121 -0
- anyenv-2.0.7/src/anyenv/lsp_servers/_servers/c_lsps.py +28 -0
- anyenv-2.0.7/src/anyenv/lsp_servers/_servers/c_sharp_lsps.py +17 -0
- anyenv-2.0.7/src/anyenv/lsp_servers/_servers/dart_lsps.py +16 -0
- anyenv-2.0.7/src/anyenv/lsp_servers/_servers/elixir_lsps.py +14 -0
- anyenv-2.0.7/src/anyenv/lsp_servers/_servers/go_lsps.py +56 -0
- anyenv-2.0.7/src/anyenv/lsp_servers/_servers/java_lsps.py +22 -0
- anyenv-2.0.7/src/anyenv/lsp_servers/_servers/js_ts_lsps.py +286 -0
- anyenv-2.0.7/src/anyenv/lsp_servers/_servers/lua_lsps.py +30 -0
- anyenv-2.0.7/src/anyenv/lsp_servers/_servers/php_lsps.py +20 -0
- anyenv-2.0.7/src/anyenv/lsp_servers/_servers/python_lsps.py +384 -0
- anyenv-2.0.7/src/anyenv/lsp_servers/_servers/ruby_lsps.py +14 -0
- anyenv-2.0.7/src/anyenv/lsp_servers/_servers/rust_lsps.py +64 -0
- anyenv-2.0.7/src/anyenv/lsp_servers/_servers/swift_lsps.py +16 -0
- anyenv-2.0.7/src/anyenv/lsp_servers/_servers/yaml_lsps.py +26 -0
- anyenv-2.0.7/src/anyenv/lsp_servers/_servers/zig_lsps.py +19 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/os_commands/__init__.py +3 -0
- anyenv-2.0.7/src/anyenv/os_commands/batch.py +232 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/os_commands/find.py +118 -20
- anyenv-2.0.4/src/anyenv/lsp_servers/_servers.py +0 -657
- {anyenv-2.0.4 → anyenv-2.0.7}/LICENSE +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/README.md +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/__init__.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/anypath.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/as_generated.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/async_run.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/calling/__init__.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/calling/async_executor.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/calling/multieventhandler.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/calling/threadgroup.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/download/__init__.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/download/aiohttp_backend/__init__.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/download/aiohttp_backend/backend.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/download/base.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/download/exceptions.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/download/functional.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/download/http_types.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/download/httpx_backend/__init__.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/download/httpx_backend/backend.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/download/httpx_backend/js_transport.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/download/middleware.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/download/pyodide_backend/__init__.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/download/pyodide_backend/backend.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/helpers.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/json_tools/__init__.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/json_tools/base.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/json_tools/msgspec_provider/__init__.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/json_tools/msgspec_provider/provider.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/json_tools/orjson_provider/__init__.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/json_tools/orjson_provider/provider.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/json_tools/pydantic_provider/__init__.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/json_tools/pydantic_provider/provider.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/json_tools/stdlib_provider/__init__.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/json_tools/stdlib_provider/provider.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/json_tools/utils.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/language_formatters/__init__.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/language_formatters/_elixir.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/language_formatters/_jvm.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/language_formatters/_python.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/language_formatters/_r.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/language_formatters/_registry.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/language_formatters/_ruby.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/language_formatters/_systems.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/language_formatters/_toml.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/language_formatters/_web.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/log.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/lsp_servers/_base.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/lsp_servers/_registry.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/lsp_servers/_runner.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/os_commands/base.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/os_commands/base64_encode.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/os_commands/copy_path.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/os_commands/create_directory.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/os_commands/env_var.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/os_commands/exists.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/os_commands/file_info.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/os_commands/is_directory.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/os_commands/is_file.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/os_commands/list_directory.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/os_commands/models.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/os_commands/providers.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/os_commands/pwd.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/os_commands/remove_path.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/os_commands/which.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/package_install/__init__.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/package_install/base.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/package_install/functional.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/package_install/micropip_install.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/package_install/pip_install.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/parse_errors.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/parse_time.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/process_manager/__init__.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/process_manager/models.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/process_manager/process.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/process_manager/process_manager.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/process_manager/protocol.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/processes.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/py.typed +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/signals/__init__.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/signals/core.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/signals/examples.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/signals/review.md +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/task_runners/__init__.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/task_runners/_base.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/task_runners/_cargo.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/task_runners/_just.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/task_runners/_makefile.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/task_runners/_npm.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/task_runners/_python.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/task_runners/_task.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/testing.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/text_sharing/__init__.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/text_sharing/base.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/text_sharing/github_gist.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/text_sharing/opencode.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/text_sharing/paste_rs.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/text_sharing/pastebin.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/toml_tools/__init__.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/toml_tools/base.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/toml_tools/pytomlpp_provider/__init__.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/toml_tools/pytomlpp_provider/provider.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/toml_tools/rtoml_provider/__init__.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/toml_tools/rtoml_provider/provider.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/toml_tools/toml_rs_provider/__init__.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/toml_tools/toml_rs_provider/provider.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/toml_tools/tomllib_provider/__init__.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/toml_tools/tomllib_provider/provider.py +0 -0
- {anyenv-2.0.4 → anyenv-2.0.7}/src/anyenv/validate.py +0 -0
|
@@ -73,7 +73,7 @@ class LanguageFormatter(ABC):
|
|
|
73
73
|
if isinstance(execution_env, str):
|
|
74
74
|
from exxec import get_environment
|
|
75
75
|
|
|
76
|
-
self._execution_env: ExecutionEnvironment = get_environment(execution_env)
|
|
76
|
+
self._execution_env: ExecutionEnvironment = get_environment(execution_env)
|
|
77
77
|
else:
|
|
78
78
|
self._execution_env = execution_env
|
|
79
79
|
|
|
@@ -24,6 +24,7 @@ from anyenv.lsp_servers._servers import (
|
|
|
24
24
|
ALL_SERVERS,
|
|
25
25
|
ASTRO,
|
|
26
26
|
BASEDPYRIGHT,
|
|
27
|
+
BIOME,
|
|
27
28
|
CLANGD,
|
|
28
29
|
CSHARP_LS,
|
|
29
30
|
DART,
|
|
@@ -34,16 +35,20 @@ from anyenv.lsp_servers._servers import (
|
|
|
34
35
|
JDTLS,
|
|
35
36
|
LUA_LS,
|
|
36
37
|
MYPY,
|
|
38
|
+
OXLINT,
|
|
37
39
|
PHP_INTELEPHENSE,
|
|
40
|
+
PYREFLY,
|
|
38
41
|
PYRIGHT,
|
|
39
42
|
RUBOCOP,
|
|
40
43
|
RUST_ANALYZER,
|
|
41
44
|
SOURCEKIT_LSP,
|
|
42
45
|
SVELTE,
|
|
46
|
+
TY,
|
|
43
47
|
TYPESCRIPT,
|
|
44
48
|
VUE,
|
|
45
49
|
YAML_LS,
|
|
46
50
|
ZLS,
|
|
51
|
+
ZUBAN,
|
|
47
52
|
# Custom server classes
|
|
48
53
|
AstroServer,
|
|
49
54
|
GoplsServer,
|
|
@@ -57,6 +62,7 @@ __all__ = [
|
|
|
57
62
|
"ALL_SERVERS",
|
|
58
63
|
"ASTRO",
|
|
59
64
|
"BASEDPYRIGHT",
|
|
65
|
+
"BIOME",
|
|
60
66
|
"CLANGD",
|
|
61
67
|
"CSHARP_LS",
|
|
62
68
|
"DART",
|
|
@@ -67,16 +73,20 @@ __all__ = [
|
|
|
67
73
|
"JDTLS",
|
|
68
74
|
"LUA_LS",
|
|
69
75
|
"MYPY",
|
|
76
|
+
"OXLINT",
|
|
70
77
|
"PHP_INTELEPHENSE",
|
|
78
|
+
"PYREFLY",
|
|
71
79
|
"PYRIGHT",
|
|
72
80
|
"RUBOCOP",
|
|
73
81
|
"RUST_ANALYZER",
|
|
74
82
|
"SOURCEKIT_LSP",
|
|
75
83
|
"SVELTE",
|
|
84
|
+
"TY",
|
|
76
85
|
"TYPESCRIPT",
|
|
77
86
|
"VUE",
|
|
78
87
|
"YAML_LS",
|
|
79
88
|
"ZLS",
|
|
89
|
+
"ZUBAN",
|
|
80
90
|
"AstroServer",
|
|
81
91
|
"CLIDiagnosticConfig",
|
|
82
92
|
"CargoInstall",
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"""LSP server definitions."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import TYPE_CHECKING
|
|
6
|
+
|
|
7
|
+
from .js_ts_lsps import (
|
|
8
|
+
DENO,
|
|
9
|
+
TYPESCRIPT,
|
|
10
|
+
VUE,
|
|
11
|
+
SVELTE,
|
|
12
|
+
ASTRO,
|
|
13
|
+
ESLINT,
|
|
14
|
+
OXLINT,
|
|
15
|
+
BIOME,
|
|
16
|
+
AstroServer,
|
|
17
|
+
TypeScriptServer,
|
|
18
|
+
)
|
|
19
|
+
from .python_lsps import TY, ZUBAN, PYREFLY, PYRIGHT, BASEDPYRIGHT, MYPY, PyrightServer, MypyServer
|
|
20
|
+
from .rust_lsps import RUST_ANALYZER, RustAnalyzerServer
|
|
21
|
+
from .go_lsps import GOPLS, GoplsServer
|
|
22
|
+
from .c_lsps import CLANGD
|
|
23
|
+
from .zig_lsps import ZLS
|
|
24
|
+
from .ruby_lsps import RUBOCOP
|
|
25
|
+
from .lua_lsps import LUA_LS
|
|
26
|
+
from .swift_lsps import SOURCEKIT_LSP
|
|
27
|
+
from .elixir_lsps import ELIXIR_LS
|
|
28
|
+
from .php_lsps import PHP_INTELEPHENSE
|
|
29
|
+
from .dart_lsps import DART
|
|
30
|
+
from .yaml_lsps import YAML_LS
|
|
31
|
+
from .c_sharp_lsps import CSHARP_LS
|
|
32
|
+
from .java_lsps import JDTLS
|
|
33
|
+
|
|
34
|
+
if TYPE_CHECKING:
|
|
35
|
+
from anyenv.lsp_servers._base import LSPServerInfo
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
__all__ = [
|
|
39
|
+
# Server instances
|
|
40
|
+
"ALL_SERVERS",
|
|
41
|
+
"ASTRO",
|
|
42
|
+
"BASEDPYRIGHT",
|
|
43
|
+
"BIOME",
|
|
44
|
+
"CLANGD",
|
|
45
|
+
"CSHARP_LS",
|
|
46
|
+
"DART",
|
|
47
|
+
"DENO",
|
|
48
|
+
"ELIXIR_LS",
|
|
49
|
+
"ESLINT",
|
|
50
|
+
"GOPLS",
|
|
51
|
+
"JDTLS",
|
|
52
|
+
"LUA_LS",
|
|
53
|
+
"MYPY",
|
|
54
|
+
"OXLINT",
|
|
55
|
+
"PHP_INTELEPHENSE",
|
|
56
|
+
"PYREFLY",
|
|
57
|
+
"PYRIGHT",
|
|
58
|
+
"RUBOCOP",
|
|
59
|
+
"RUST_ANALYZER",
|
|
60
|
+
"SOURCEKIT_LSP",
|
|
61
|
+
"SVELTE",
|
|
62
|
+
"TY",
|
|
63
|
+
"TYPESCRIPT",
|
|
64
|
+
"VUE",
|
|
65
|
+
"YAML_LS",
|
|
66
|
+
"ZLS",
|
|
67
|
+
"ZUBAN",
|
|
68
|
+
# Server classes
|
|
69
|
+
"AstroServer",
|
|
70
|
+
"GoplsServer",
|
|
71
|
+
"MypyServer",
|
|
72
|
+
"PyrightServer",
|
|
73
|
+
"RustAnalyzerServer",
|
|
74
|
+
"TypeScriptServer",
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
# All servers
|
|
78
|
+
ALL_SERVERS: list[LSPServerInfo] = [
|
|
79
|
+
# JavaScript/TypeScript
|
|
80
|
+
OXLINT,
|
|
81
|
+
BIOME,
|
|
82
|
+
DENO,
|
|
83
|
+
TYPESCRIPT,
|
|
84
|
+
VUE,
|
|
85
|
+
SVELTE,
|
|
86
|
+
ASTRO,
|
|
87
|
+
ESLINT,
|
|
88
|
+
# Python
|
|
89
|
+
TY,
|
|
90
|
+
ZUBAN,
|
|
91
|
+
PYREFLY,
|
|
92
|
+
PYRIGHT,
|
|
93
|
+
BASEDPYRIGHT,
|
|
94
|
+
MYPY,
|
|
95
|
+
# Go
|
|
96
|
+
GOPLS,
|
|
97
|
+
# Rust
|
|
98
|
+
RUST_ANALYZER,
|
|
99
|
+
# Zig
|
|
100
|
+
ZLS,
|
|
101
|
+
# C/C++
|
|
102
|
+
CLANGD,
|
|
103
|
+
# C#
|
|
104
|
+
CSHARP_LS,
|
|
105
|
+
# Ruby
|
|
106
|
+
RUBOCOP,
|
|
107
|
+
# Elixir
|
|
108
|
+
ELIXIR_LS,
|
|
109
|
+
# Swift
|
|
110
|
+
SOURCEKIT_LSP,
|
|
111
|
+
# Java
|
|
112
|
+
JDTLS,
|
|
113
|
+
# YAML
|
|
114
|
+
YAML_LS,
|
|
115
|
+
# Lua
|
|
116
|
+
LUA_LS,
|
|
117
|
+
# PHP
|
|
118
|
+
PHP_INTELEPHENSE,
|
|
119
|
+
# Dart
|
|
120
|
+
DART,
|
|
121
|
+
]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""LSP server definitions for C / C++."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from anyenv.lsp_servers._base import GitHubRelease, LSPServerInfo, RootDetection
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
CLANGD = LSPServerInfo(
|
|
9
|
+
id="clangd",
|
|
10
|
+
extensions=[".c", ".cpp", ".cc", ".cxx", ".c++", ".h", ".hpp", ".hh", ".hxx", ".h++"],
|
|
11
|
+
root_detection=RootDetection(
|
|
12
|
+
include_patterns=[
|
|
13
|
+
"compile_commands.json",
|
|
14
|
+
"compile_flags.txt",
|
|
15
|
+
".clangd",
|
|
16
|
+
"CMakeLists.txt",
|
|
17
|
+
"Makefile",
|
|
18
|
+
],
|
|
19
|
+
),
|
|
20
|
+
command="clangd",
|
|
21
|
+
args=["--background-index", "--clang-tidy"],
|
|
22
|
+
github_release=GitHubRelease(
|
|
23
|
+
repo="clangd/clangd",
|
|
24
|
+
asset_pattern="clangd-{platform}-{version}.{ext}",
|
|
25
|
+
binary_name="clangd",
|
|
26
|
+
extract_subdir="clangd_{version}/bin",
|
|
27
|
+
),
|
|
28
|
+
)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""LSP server definitions for C#."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from anyenv.lsp_servers._base import DotnetInstall, LSPServerInfo, RootDetection
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
CSHARP_LS = LSPServerInfo(
|
|
9
|
+
id="csharp-ls",
|
|
10
|
+
extensions=[".cs"],
|
|
11
|
+
root_detection=RootDetection(
|
|
12
|
+
include_patterns=[".sln", ".csproj", "global.json"],
|
|
13
|
+
),
|
|
14
|
+
command="csharp-ls",
|
|
15
|
+
args=[],
|
|
16
|
+
dotnet_install=DotnetInstall(package="csharp-ls"),
|
|
17
|
+
)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""LSP server definitions for Dart."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from anyenv.lsp_servers._base import LSPServerInfo, RootDetection
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
DART = LSPServerInfo(
|
|
9
|
+
id="dart",
|
|
10
|
+
extensions=[".dart"],
|
|
11
|
+
root_detection=RootDetection(
|
|
12
|
+
include_patterns=["pubspec.yaml", "analysis_options.yaml"],
|
|
13
|
+
),
|
|
14
|
+
command="dart",
|
|
15
|
+
args=["language-server", "--lsp"],
|
|
16
|
+
)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""LSP server definitions for various languages."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from anyenv.lsp_servers._base import LSPServerInfo, RootDetection
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
ELIXIR_LS = LSPServerInfo(
|
|
9
|
+
id="elixir-ls",
|
|
10
|
+
extensions=[".ex", ".exs"],
|
|
11
|
+
root_detection=RootDetection(include_patterns=["mix.exs", "mix.lock"]),
|
|
12
|
+
command="elixir-ls",
|
|
13
|
+
args=[],
|
|
14
|
+
)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"""LSP server definitions for various languages."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass
|
|
6
|
+
import posixpath
|
|
7
|
+
from typing import TYPE_CHECKING
|
|
8
|
+
|
|
9
|
+
from anyenv.lsp_servers._base import GoInstall, LSPServerInfo, RootDetection
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
if TYPE_CHECKING:
|
|
13
|
+
from fsspec.asyn import AsyncFileSystem # type: ignore[import-untyped]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@dataclass
|
|
17
|
+
class GoplsServer(LSPServerInfo):
|
|
18
|
+
"""Go language server with go.work priority."""
|
|
19
|
+
|
|
20
|
+
async def resolve_root(
|
|
21
|
+
self,
|
|
22
|
+
file_path: str,
|
|
23
|
+
project_root: str,
|
|
24
|
+
fs: AsyncFileSystem,
|
|
25
|
+
) -> str | None:
|
|
26
|
+
"""Prefer go.work over go.mod for workspace support."""
|
|
27
|
+
# First check for go.work
|
|
28
|
+
work_root = await self._find_nearest(
|
|
29
|
+
posixpath.dirname(file_path),
|
|
30
|
+
["go.work"],
|
|
31
|
+
project_root,
|
|
32
|
+
fs,
|
|
33
|
+
)
|
|
34
|
+
if work_root:
|
|
35
|
+
return posixpath.dirname(work_root)
|
|
36
|
+
|
|
37
|
+
# Fall back to go.mod
|
|
38
|
+
mod_root = await self._find_nearest(
|
|
39
|
+
posixpath.dirname(file_path),
|
|
40
|
+
["go.mod", "go.sum"],
|
|
41
|
+
project_root,
|
|
42
|
+
fs,
|
|
43
|
+
)
|
|
44
|
+
return posixpath.dirname(mod_root) if mod_root else project_root
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
GOPLS = GoplsServer(
|
|
48
|
+
id="gopls",
|
|
49
|
+
extensions=[".go"],
|
|
50
|
+
root_detection=RootDetection(
|
|
51
|
+
include_patterns=["go.work", "go.mod", "go.sum"],
|
|
52
|
+
),
|
|
53
|
+
command="gopls",
|
|
54
|
+
args=[],
|
|
55
|
+
go_install=GoInstall(package="golang.org/x/tools/gopls@latest"),
|
|
56
|
+
)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""LSP server definitions for Java."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from anyenv.lsp_servers._base import LSPServerInfo, RootDetection
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
JDTLS = LSPServerInfo(
|
|
9
|
+
id="jdtls",
|
|
10
|
+
extensions=[".java"],
|
|
11
|
+
root_detection=RootDetection(
|
|
12
|
+
include_patterns=[
|
|
13
|
+
"pom.xml",
|
|
14
|
+
"build.gradle",
|
|
15
|
+
"build.gradle.kts",
|
|
16
|
+
".project",
|
|
17
|
+
".classpath",
|
|
18
|
+
],
|
|
19
|
+
),
|
|
20
|
+
command="jdtls",
|
|
21
|
+
args=[],
|
|
22
|
+
)
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
"""LSP server definitions for JS/TS."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass
|
|
6
|
+
import posixpath
|
|
7
|
+
from typing import TYPE_CHECKING, Any
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
if TYPE_CHECKING:
|
|
11
|
+
from fsspec.asyn import AsyncFileSystem # type: ignore[import-untyped]
|
|
12
|
+
|
|
13
|
+
from anyenv.lsp_servers._base import (
|
|
14
|
+
CLIDiagnosticConfig,
|
|
15
|
+
Diagnostic,
|
|
16
|
+
LSPServerInfo,
|
|
17
|
+
NpmInstall,
|
|
18
|
+
RootDetection,
|
|
19
|
+
severity_from_string,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@dataclass
|
|
24
|
+
class TypeScriptServer(LSPServerInfo):
|
|
25
|
+
"""TypeScript language server with tsserver path detection."""
|
|
26
|
+
|
|
27
|
+
async def resolve_initialization(self, root: str, fs: AsyncFileSystem) -> dict[str, Any]:
|
|
28
|
+
"""Detect tsserver.js path."""
|
|
29
|
+
init = await super().resolve_initialization(root, fs)
|
|
30
|
+
tsserver = posixpath.join(root, "node_modules", "typescript", "lib", "tsserver.js")
|
|
31
|
+
try:
|
|
32
|
+
if await fs._exists(tsserver): # noqa: SLF001
|
|
33
|
+
init["tsserver"] = {"path": tsserver}
|
|
34
|
+
except Exception: # noqa: BLE001
|
|
35
|
+
pass
|
|
36
|
+
|
|
37
|
+
return init
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@dataclass
|
|
41
|
+
class AstroServer(LSPServerInfo):
|
|
42
|
+
"""Astro language server with TypeScript SDK detection."""
|
|
43
|
+
|
|
44
|
+
async def resolve_initialization(self, root: str, fs: AsyncFileSystem) -> dict[str, Any]:
|
|
45
|
+
"""Detect TypeScript SDK path for Astro."""
|
|
46
|
+
init = await super().resolve_initialization(root, fs)
|
|
47
|
+
tsserver = posixpath.join(root, "node_modules", "typescript", "lib", "tsserver.js")
|
|
48
|
+
try:
|
|
49
|
+
if await fs._exists(tsserver): # noqa: SLF001
|
|
50
|
+
init["typescript"] = {"tsdk": posixpath.dirname(tsserver)}
|
|
51
|
+
except Exception: # noqa: BLE001
|
|
52
|
+
pass
|
|
53
|
+
|
|
54
|
+
return init
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
@dataclass
|
|
58
|
+
class OxlintServer(LSPServerInfo):
|
|
59
|
+
"""Oxlint (oxc) linter with JSON diagnostic parsing."""
|
|
60
|
+
|
|
61
|
+
def _parse_json_diagnostics(self, output: str) -> list[Diagnostic]:
|
|
62
|
+
"""Parse oxlint JSON output."""
|
|
63
|
+
import anyenv
|
|
64
|
+
|
|
65
|
+
diagnostics: list[Diagnostic] = []
|
|
66
|
+
|
|
67
|
+
try:
|
|
68
|
+
data = anyenv.load_json(output, return_type=dict)
|
|
69
|
+
for diag in data.get("diagnostics", []):
|
|
70
|
+
# Get location from labels
|
|
71
|
+
labels = diag.get("labels", [])
|
|
72
|
+
if labels:
|
|
73
|
+
span = labels[0].get("span", {})
|
|
74
|
+
line = span.get("line", 1)
|
|
75
|
+
column = span.get("column", 1)
|
|
76
|
+
else:
|
|
77
|
+
line, column = 1, 1
|
|
78
|
+
|
|
79
|
+
diagnostics.append(
|
|
80
|
+
Diagnostic(
|
|
81
|
+
file=diag.get("filename", ""),
|
|
82
|
+
line=line,
|
|
83
|
+
column=column,
|
|
84
|
+
severity=severity_from_string(diag.get("severity", "warning")),
|
|
85
|
+
message=diag.get("message", ""),
|
|
86
|
+
code=diag.get("code"),
|
|
87
|
+
source=self.id,
|
|
88
|
+
)
|
|
89
|
+
)
|
|
90
|
+
except anyenv.JsonLoadError:
|
|
91
|
+
pass
|
|
92
|
+
|
|
93
|
+
return diagnostics
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
@dataclass
|
|
97
|
+
class BiomeServer(LSPServerInfo):
|
|
98
|
+
"""Biome linter/formatter with JSON diagnostic parsing."""
|
|
99
|
+
|
|
100
|
+
def _parse_json_diagnostics(self, output: str) -> list[Diagnostic]:
|
|
101
|
+
"""Parse biome JSON output."""
|
|
102
|
+
import anyenv
|
|
103
|
+
|
|
104
|
+
diagnostics: list[Diagnostic] = []
|
|
105
|
+
|
|
106
|
+
try:
|
|
107
|
+
# Find JSON in output (biome may print extra text)
|
|
108
|
+
json_start = output.find("{")
|
|
109
|
+
if json_start == -1:
|
|
110
|
+
return diagnostics
|
|
111
|
+
|
|
112
|
+
data = anyenv.load_json(output[json_start:], return_type=dict)
|
|
113
|
+
for diag in data.get("diagnostics", []):
|
|
114
|
+
location = diag.get("location", {})
|
|
115
|
+
span = location.get("span", [0, 0])
|
|
116
|
+
# Biome uses byte offsets, not line/column directly
|
|
117
|
+
# For now, use offset as approximation (would need source to convert)
|
|
118
|
+
path_info = location.get("path", {})
|
|
119
|
+
file_path = path_info.get("file", "") if isinstance(path_info, dict) else ""
|
|
120
|
+
|
|
121
|
+
diagnostics.append(
|
|
122
|
+
Diagnostic(
|
|
123
|
+
file=file_path,
|
|
124
|
+
line=1, # Would need source text to calculate
|
|
125
|
+
column=span[0] if span else 1,
|
|
126
|
+
severity=severity_from_string(diag.get("severity", "error")),
|
|
127
|
+
message=diag.get("description", ""),
|
|
128
|
+
code=diag.get("category"),
|
|
129
|
+
source=self.id,
|
|
130
|
+
)
|
|
131
|
+
)
|
|
132
|
+
except anyenv.JsonLoadError:
|
|
133
|
+
pass
|
|
134
|
+
|
|
135
|
+
return diagnostics
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
DENO = LSPServerInfo(
|
|
139
|
+
id="deno",
|
|
140
|
+
extensions=[".ts", ".tsx", ".js", ".jsx", ".mjs"],
|
|
141
|
+
root_detection=RootDetection(include_patterns=["deno.json", "deno.jsonc"]),
|
|
142
|
+
command="deno",
|
|
143
|
+
args=["lsp"],
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
TYPESCRIPT = TypeScriptServer(
|
|
147
|
+
id="typescript",
|
|
148
|
+
extensions=[".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts"],
|
|
149
|
+
root_detection=RootDetection(
|
|
150
|
+
include_patterns=[
|
|
151
|
+
"package-lock.json",
|
|
152
|
+
"bun.lockb",
|
|
153
|
+
"bun.lock",
|
|
154
|
+
"pnpm-lock.yaml",
|
|
155
|
+
"yarn.lock",
|
|
156
|
+
],
|
|
157
|
+
exclude_patterns=["deno.json", "deno.jsonc"],
|
|
158
|
+
),
|
|
159
|
+
command="typescript-language-server",
|
|
160
|
+
args=["--stdio"],
|
|
161
|
+
npm_install=NpmInstall(
|
|
162
|
+
package="typescript-language-server",
|
|
163
|
+
entry_path="typescript-language-server/lib/cli.mjs",
|
|
164
|
+
),
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
VUE = LSPServerInfo(
|
|
168
|
+
id="vue",
|
|
169
|
+
extensions=[".vue"],
|
|
170
|
+
root_detection=RootDetection(
|
|
171
|
+
include_patterns=[
|
|
172
|
+
"package-lock.json",
|
|
173
|
+
"bun.lockb",
|
|
174
|
+
"bun.lock",
|
|
175
|
+
"pnpm-lock.yaml",
|
|
176
|
+
"yarn.lock",
|
|
177
|
+
],
|
|
178
|
+
),
|
|
179
|
+
command="vue-language-server",
|
|
180
|
+
args=["--stdio"],
|
|
181
|
+
npm_install=NpmInstall(
|
|
182
|
+
package="@vue/language-server",
|
|
183
|
+
entry_path="@vue/language-server/bin/vue-language-server.js",
|
|
184
|
+
),
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
SVELTE = LSPServerInfo(
|
|
188
|
+
id="svelte",
|
|
189
|
+
extensions=[".svelte"],
|
|
190
|
+
root_detection=RootDetection(
|
|
191
|
+
include_patterns=[
|
|
192
|
+
"package-lock.json",
|
|
193
|
+
"bun.lockb",
|
|
194
|
+
"bun.lock",
|
|
195
|
+
"pnpm-lock.yaml",
|
|
196
|
+
"yarn.lock",
|
|
197
|
+
],
|
|
198
|
+
),
|
|
199
|
+
command="svelteserver",
|
|
200
|
+
args=["--stdio"],
|
|
201
|
+
npm_install=NpmInstall(
|
|
202
|
+
package="svelte-language-server",
|
|
203
|
+
entry_path="svelte-language-server/bin/server.js",
|
|
204
|
+
),
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
ASTRO = AstroServer(
|
|
208
|
+
id="astro",
|
|
209
|
+
extensions=[".astro"],
|
|
210
|
+
root_detection=RootDetection(
|
|
211
|
+
include_patterns=[
|
|
212
|
+
"package-lock.json",
|
|
213
|
+
"bun.lockb",
|
|
214
|
+
"bun.lock",
|
|
215
|
+
"pnpm-lock.yaml",
|
|
216
|
+
"yarn.lock",
|
|
217
|
+
],
|
|
218
|
+
),
|
|
219
|
+
command="astro-ls",
|
|
220
|
+
args=["--stdio"],
|
|
221
|
+
npm_install=NpmInstall(
|
|
222
|
+
package="@astrojs/language-server",
|
|
223
|
+
entry_path="@astrojs/language-server/bin/nodeServer.js",
|
|
224
|
+
),
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
ESLINT = LSPServerInfo(
|
|
228
|
+
id="eslint",
|
|
229
|
+
extensions=[".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts", ".vue"],
|
|
230
|
+
root_detection=RootDetection(
|
|
231
|
+
include_patterns=[
|
|
232
|
+
"package-lock.json",
|
|
233
|
+
"bun.lockb",
|
|
234
|
+
"bun.lock",
|
|
235
|
+
"pnpm-lock.yaml",
|
|
236
|
+
"yarn.lock",
|
|
237
|
+
],
|
|
238
|
+
),
|
|
239
|
+
command="vscode-eslint-language-server",
|
|
240
|
+
args=["--stdio"],
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
OXLINT = OxlintServer(
|
|
244
|
+
id="oxlint",
|
|
245
|
+
extensions=[".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts", ".vue"],
|
|
246
|
+
root_detection=RootDetection(
|
|
247
|
+
include_patterns=[
|
|
248
|
+
"package-lock.json",
|
|
249
|
+
"bun.lockb",
|
|
250
|
+
"bun.lock",
|
|
251
|
+
"pnpm-lock.yaml",
|
|
252
|
+
"yarn.lock",
|
|
253
|
+
".oxlintrc.json",
|
|
254
|
+
],
|
|
255
|
+
),
|
|
256
|
+
command="oxlint", # No LSP server mode, CLI only
|
|
257
|
+
args=[],
|
|
258
|
+
cli_diagnostics=CLIDiagnosticConfig(
|
|
259
|
+
command="oxlint",
|
|
260
|
+
args=["--format", "json", "{files}"],
|
|
261
|
+
output_format="json",
|
|
262
|
+
),
|
|
263
|
+
)
|
|
264
|
+
|
|
265
|
+
BIOME = BiomeServer(
|
|
266
|
+
id="biome",
|
|
267
|
+
extensions=[".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts", ".json", ".jsonc"],
|
|
268
|
+
root_detection=RootDetection(
|
|
269
|
+
include_patterns=[
|
|
270
|
+
"biome.json",
|
|
271
|
+
"biome.jsonc",
|
|
272
|
+
"package-lock.json",
|
|
273
|
+
"bun.lockb",
|
|
274
|
+
"bun.lock",
|
|
275
|
+
"pnpm-lock.yaml",
|
|
276
|
+
"yarn.lock",
|
|
277
|
+
],
|
|
278
|
+
),
|
|
279
|
+
command="biome",
|
|
280
|
+
args=["lsp-proxy"],
|
|
281
|
+
cli_diagnostics=CLIDiagnosticConfig(
|
|
282
|
+
command="biome",
|
|
283
|
+
args=["lint", "--reporter=json", "{files}"],
|
|
284
|
+
output_format="json",
|
|
285
|
+
),
|
|
286
|
+
)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""LSP server definitions for Lua."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from anyenv.lsp_servers._base import GitHubRelease, LSPServerInfo, RootDetection
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
LUA_LS = LSPServerInfo(
|
|
9
|
+
id="lua-ls",
|
|
10
|
+
extensions=[".lua"],
|
|
11
|
+
root_detection=RootDetection(
|
|
12
|
+
include_patterns=[
|
|
13
|
+
".luarc.json",
|
|
14
|
+
".luarc.jsonc",
|
|
15
|
+
".luacheckrc",
|
|
16
|
+
".stylua.toml",
|
|
17
|
+
"stylua.toml",
|
|
18
|
+
"selene.toml",
|
|
19
|
+
"selene.yml",
|
|
20
|
+
],
|
|
21
|
+
),
|
|
22
|
+
command="lua-language-server",
|
|
23
|
+
args=[],
|
|
24
|
+
github_release=GitHubRelease(
|
|
25
|
+
repo="LuaLS/lua-language-server",
|
|
26
|
+
asset_pattern="lua-language-server-{version}-{platform}-{arch}.{ext}",
|
|
27
|
+
binary_name="lua-language-server",
|
|
28
|
+
extract_subdir="bin",
|
|
29
|
+
),
|
|
30
|
+
)
|