anyenv 2.0.3__tar.gz → 2.0.4__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.
Files changed (115) hide show
  1. {anyenv-2.0.3 → anyenv-2.0.4}/PKG-INFO +1 -1
  2. {anyenv-2.0.3 → anyenv-2.0.4}/pyproject.toml +1 -1
  3. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/lsp_servers/__init__.py +9 -1
  4. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/lsp_servers/_base.py +1 -6
  5. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/lsp_servers/_runner.py +64 -11
  6. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/lsp_servers/_servers.py +16 -17
  7. {anyenv-2.0.3 → anyenv-2.0.4}/LICENSE +0 -0
  8. {anyenv-2.0.3 → anyenv-2.0.4}/README.md +0 -0
  9. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/__init__.py +0 -0
  10. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/anypath.py +0 -0
  11. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/as_generated.py +0 -0
  12. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/async_run.py +0 -0
  13. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/calling/__init__.py +0 -0
  14. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/calling/async_executor.py +0 -0
  15. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/calling/multieventhandler.py +0 -0
  16. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/calling/threadgroup.py +0 -0
  17. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/download/__init__.py +0 -0
  18. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/download/aiohttp_backend/__init__.py +0 -0
  19. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/download/aiohttp_backend/backend.py +0 -0
  20. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/download/base.py +0 -0
  21. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/download/exceptions.py +0 -0
  22. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/download/functional.py +0 -0
  23. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/download/http_types.py +0 -0
  24. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/download/httpx_backend/__init__.py +0 -0
  25. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/download/httpx_backend/backend.py +0 -0
  26. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/download/httpx_backend/js_transport.py +0 -0
  27. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/download/middleware.py +0 -0
  28. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/download/pyodide_backend/__init__.py +0 -0
  29. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/download/pyodide_backend/backend.py +0 -0
  30. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/helpers.py +0 -0
  31. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/json_tools/__init__.py +0 -0
  32. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/json_tools/base.py +0 -0
  33. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/json_tools/msgspec_provider/__init__.py +0 -0
  34. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/json_tools/msgspec_provider/provider.py +0 -0
  35. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/json_tools/orjson_provider/__init__.py +0 -0
  36. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/json_tools/orjson_provider/provider.py +0 -0
  37. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/json_tools/pydantic_provider/__init__.py +0 -0
  38. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/json_tools/pydantic_provider/provider.py +0 -0
  39. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/json_tools/stdlib_provider/__init__.py +0 -0
  40. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/json_tools/stdlib_provider/provider.py +0 -0
  41. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/json_tools/utils.py +0 -0
  42. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/language_formatters/__init__.py +0 -0
  43. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/language_formatters/_base.py +0 -0
  44. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/language_formatters/_elixir.py +0 -0
  45. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/language_formatters/_jvm.py +0 -0
  46. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/language_formatters/_python.py +0 -0
  47. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/language_formatters/_r.py +0 -0
  48. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/language_formatters/_registry.py +0 -0
  49. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/language_formatters/_ruby.py +0 -0
  50. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/language_formatters/_systems.py +0 -0
  51. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/language_formatters/_toml.py +0 -0
  52. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/language_formatters/_web.py +0 -0
  53. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/log.py +0 -0
  54. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/lsp_servers/_registry.py +0 -0
  55. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/os_commands/__init__.py +0 -0
  56. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/os_commands/base.py +0 -0
  57. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/os_commands/base64_encode.py +0 -0
  58. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/os_commands/copy_path.py +0 -0
  59. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/os_commands/create_directory.py +0 -0
  60. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/os_commands/env_var.py +0 -0
  61. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/os_commands/exists.py +0 -0
  62. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/os_commands/file_info.py +0 -0
  63. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/os_commands/find.py +0 -0
  64. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/os_commands/is_directory.py +0 -0
  65. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/os_commands/is_file.py +0 -0
  66. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/os_commands/list_directory.py +0 -0
  67. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/os_commands/models.py +0 -0
  68. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/os_commands/providers.py +0 -0
  69. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/os_commands/pwd.py +0 -0
  70. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/os_commands/remove_path.py +0 -0
  71. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/os_commands/which.py +0 -0
  72. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/package_install/__init__.py +0 -0
  73. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/package_install/base.py +0 -0
  74. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/package_install/functional.py +0 -0
  75. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/package_install/micropip_install.py +0 -0
  76. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/package_install/pip_install.py +0 -0
  77. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/parse_errors.py +0 -0
  78. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/parse_time.py +0 -0
  79. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/process_manager/__init__.py +0 -0
  80. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/process_manager/models.py +0 -0
  81. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/process_manager/process.py +0 -0
  82. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/process_manager/process_manager.py +0 -0
  83. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/process_manager/protocol.py +0 -0
  84. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/processes.py +0 -0
  85. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/py.typed +0 -0
  86. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/signals/__init__.py +0 -0
  87. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/signals/core.py +0 -0
  88. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/signals/examples.py +0 -0
  89. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/signals/review.md +0 -0
  90. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/task_runners/__init__.py +0 -0
  91. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/task_runners/_base.py +0 -0
  92. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/task_runners/_cargo.py +0 -0
  93. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/task_runners/_just.py +0 -0
  94. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/task_runners/_makefile.py +0 -0
  95. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/task_runners/_npm.py +0 -0
  96. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/task_runners/_python.py +0 -0
  97. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/task_runners/_task.py +0 -0
  98. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/testing.py +0 -0
  99. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/text_sharing/__init__.py +0 -0
  100. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/text_sharing/base.py +0 -0
  101. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/text_sharing/github_gist.py +0 -0
  102. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/text_sharing/opencode.py +0 -0
  103. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/text_sharing/paste_rs.py +0 -0
  104. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/text_sharing/pastebin.py +0 -0
  105. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/toml_tools/__init__.py +0 -0
  106. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/toml_tools/base.py +0 -0
  107. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/toml_tools/pytomlpp_provider/__init__.py +0 -0
  108. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/toml_tools/pytomlpp_provider/provider.py +0 -0
  109. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/toml_tools/rtoml_provider/__init__.py +0 -0
  110. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/toml_tools/rtoml_provider/provider.py +0 -0
  111. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/toml_tools/toml_rs_provider/__init__.py +0 -0
  112. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/toml_tools/toml_rs_provider/provider.py +0 -0
  113. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/toml_tools/tomllib_provider/__init__.py +0 -0
  114. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/toml_tools/tomllib_provider/provider.py +0 -0
  115. {anyenv-2.0.3 → anyenv-2.0.4}/src/anyenv/validate.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: anyenv
3
- Version: 2.0.3
3
+ Version: 2.0.4
4
4
  Summary: Compatibility layer for some basic operations to allow painless operation in PyOdide and Python pre-releases
5
5
  Keywords:
6
6
  Author: Philipp Temminghoff
@@ -2,7 +2,7 @@
2
2
 
3
3
  [project]
4
4
  name = "anyenv"
5
- version = "2.0.3"
5
+ version = "2.0.4"
6
6
  description = "Compatibility layer for some basic operations to allow painless operation in PyOdide and Python pre-releases"
7
7
  readme = "README.md"
8
8
  requires-python = ">=3.13"
@@ -14,7 +14,12 @@ from anyenv.lsp_servers._base import (
14
14
  RootDetection,
15
15
  )
16
16
  from anyenv.lsp_servers._registry import LSPServerRegistry
17
- from anyenv.lsp_servers._runner import DiagnosticRunner
17
+ from anyenv.lsp_servers._runner import (
18
+ CommandExecutor,
19
+ CommandResult,
20
+ DiagnosticRunner,
21
+ SimpleCommandResult,
22
+ )
18
23
  from anyenv.lsp_servers._servers import (
19
24
  ALL_SERVERS,
20
25
  ASTRO,
@@ -75,6 +80,8 @@ __all__ = [
75
80
  "AstroServer",
76
81
  "CLIDiagnosticConfig",
77
82
  "CargoInstall",
83
+ "CommandExecutor",
84
+ "CommandResult",
78
85
  "Diagnostic",
79
86
  "DiagnosticRunner",
80
87
  "DiagnosticsResult",
@@ -90,5 +97,6 @@ __all__ = [
90
97
  "PyrightServer",
91
98
  "RootDetection",
92
99
  "RustAnalyzerServer",
100
+ "SimpleCommandResult",
93
101
  "TypeScriptServer",
94
102
  ]
@@ -3,6 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  from dataclasses import dataclass, field
6
+ import posixpath
6
7
  from typing import TYPE_CHECKING, Any, Literal
7
8
 
8
9
 
@@ -158,16 +159,12 @@ class LSPServerInfo:
158
159
  dotnet_install: DotnetInstall | None = None
159
160
  gem_install: GemInstall | None = None
160
161
  github_release: GitHubRelease | None = None
161
-
162
162
  # LSP initialization settings (static)
163
163
  initialization: dict[str, Any] = field(default_factory=dict)
164
-
165
164
  # Environment variables
166
165
  env: dict[str, str] = field(default_factory=dict)
167
-
168
166
  # If True, single global instance (not per-project)
169
167
  global_server: bool = False
170
-
171
168
  # CLI diagnostic fallback
172
169
  cli_diagnostics: CLIDiagnosticConfig | None = None
173
170
 
@@ -212,8 +209,6 @@ class LSPServerInfo:
212
209
  Returns:
213
210
  The resolved root directory, or None if this LSP shouldn't be used
214
211
  """
215
- import posixpath
216
-
217
212
  if self.root_detection.exclude_patterns:
218
213
  excluded = await self._find_nearest(
219
214
  posixpath.dirname(file_path),
@@ -1,33 +1,86 @@
1
- """Diagnostic runner using ExecutionEnvironment."""
1
+ """Diagnostic runner for LSP servers."""
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ import asyncio
6
+ from dataclasses import dataclass
5
7
  import posixpath
6
- from typing import TYPE_CHECKING
8
+ import time
9
+ from typing import TYPE_CHECKING, Protocol
7
10
 
8
11
  from anyenv.lsp_servers._base import DiagnosticsResult
9
12
 
10
13
 
11
14
  if TYPE_CHECKING:
12
- from exxec import ExecutionEnvironment
13
-
14
15
  from anyenv.lsp_servers._base import Diagnostic, LSPServerInfo
15
16
 
16
17
 
18
+ class CommandResult(Protocol):
19
+ """Protocol for command execution results."""
20
+
21
+ @property
22
+ def stdout(self) -> str | None: ...
23
+
24
+ @property
25
+ def stderr(self) -> str | None: ...
26
+
27
+ @property
28
+ def exit_code(self) -> int | None: ...
29
+
30
+ @property
31
+ def duration(self) -> float: ...
32
+
33
+
34
+ @dataclass
35
+ class SimpleCommandResult:
36
+ """Simple implementation of CommandResult."""
37
+
38
+ stdout: str | None
39
+ stderr: str | None
40
+ exit_code: int | None
41
+ duration: float
42
+
43
+
44
+ class CommandExecutor(Protocol):
45
+ """Protocol for command execution."""
46
+
47
+ async def __call__(self, command: str) -> CommandResult:
48
+ """Execute a command and return the result."""
49
+ ...
50
+
51
+
52
+ async def _default_executor(command: str) -> SimpleCommandResult:
53
+ """Default executor using asyncio subprocess."""
54
+ start = time.perf_counter()
55
+ proc = await asyncio.create_subprocess_shell(
56
+ command,
57
+ stdout=asyncio.subprocess.PIPE,
58
+ stderr=asyncio.subprocess.PIPE,
59
+ )
60
+ stdout, stderr = await proc.communicate()
61
+ duration = time.perf_counter() - start
62
+ return SimpleCommandResult(
63
+ stdout=stdout.decode() if stdout else "",
64
+ stderr=stderr.decode() if stderr else "",
65
+ exit_code=proc.returncode,
66
+ duration=duration,
67
+ )
68
+
69
+
17
70
  class DiagnosticRunner:
18
- """Run diagnostics via ExecutionEnvironment.
71
+ """Run diagnostics using CLI tools.
19
72
 
20
- Works with any ExecutionEnvironment (local, Docker, SSH, etc.) to run
73
+ Works with any command executor (local subprocess, Docker, SSH, etc.) to run
21
74
  CLI diagnostic tools and parse their output.
22
75
  """
23
76
 
24
- def __init__(self, env: ExecutionEnvironment) -> None:
25
- """Initialize with an execution environment.
77
+ def __init__(self, executor: CommandExecutor | None = None) -> None:
78
+ """Initialize with an optional command executor.
26
79
 
27
80
  Args:
28
- env: The execution environment to run commands in
81
+ executor: Callable to execute commands. Defaults to local subprocess.
29
82
  """
30
- self.env = env
83
+ self._executor = executor or _default_executor
31
84
  self._servers: list[LSPServerInfo] = []
32
85
 
33
86
  def register(self, server: LSPServerInfo) -> None:
@@ -74,7 +127,7 @@ class DiagnosticRunner:
74
127
  return DiagnosticsResult(diagnostics=[], success=False, duration=0.0, error=msg)
75
128
 
76
129
  command = server.build_diagnostic_command(files)
77
- result = await self.env.execute_command(command)
130
+ result = await self._executor(command)
78
131
  diagnostics = server.parse_diagnostics(result.stdout or "", result.stderr or "")
79
132
  # Parsing succeeded, even if there are errors
80
133
  return DiagnosticsResult(diagnostics=diagnostics, success=True, duration=result.duration)
@@ -3,7 +3,6 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  from dataclasses import dataclass
6
- import json
7
6
  import os
8
7
  import posixpath
9
8
  from typing import TYPE_CHECKING, Any
@@ -26,6 +25,13 @@ from anyenv.lsp_servers._base import (
26
25
 
27
26
 
28
27
  # Custom server classes for complex behaviors
28
+ def get_python_venv_candidates(root: str) -> list[str]:
29
+ paths = [
30
+ os.environ.get("VIRTUAL_ENV"),
31
+ posixpath.join(root, ".venv"),
32
+ posixpath.join(root, "venv"),
33
+ ]
34
+ return [i for i in paths if i is not None]
29
35
 
30
36
 
31
37
  @dataclass
@@ -75,15 +81,7 @@ class PyrightServer(LSPServerInfo):
75
81
  """Detect virtualenv and set pythonPath."""
76
82
  init = await super().resolve_initialization(root, fs)
77
83
 
78
- venv_candidates = [
79
- os.environ.get("VIRTUAL_ENV"),
80
- posixpath.join(root, ".venv"),
81
- posixpath.join(root, "venv"),
82
- ]
83
-
84
- for venv_path in venv_candidates:
85
- if venv_path is None:
86
- continue
84
+ for venv_path in get_python_venv_candidates(root):
87
85
  if os.name == "nt":
88
86
  python = posixpath.join(venv_path, "Scripts", "python.exe")
89
87
  else:
@@ -99,6 +97,8 @@ class PyrightServer(LSPServerInfo):
99
97
 
100
98
  def _parse_json_diagnostics(self, output: str) -> list[Diagnostic]:
101
99
  """Parse pyright JSON output."""
100
+ import anyenv
101
+
102
102
  diagnostics: list[Diagnostic] = []
103
103
 
104
104
  try:
@@ -106,7 +106,7 @@ class PyrightServer(LSPServerInfo):
106
106
  json_start = output.find("{")
107
107
  if json_start == -1:
108
108
  return diagnostics
109
- data = json.loads(output[json_start:])
109
+ data = anyenv.load_json(output[json_start:], return_type=dict)
110
110
 
111
111
  for diag in data.get("generalDiagnostics", []):
112
112
  range_info = diag.get("range", {})
@@ -126,7 +126,7 @@ class PyrightServer(LSPServerInfo):
126
126
  source=self.id,
127
127
  )
128
128
  )
129
- except json.JSONDecodeError:
129
+ except anyenv.JsonLoadError:
130
130
  pass
131
131
 
132
132
  return diagnostics
@@ -138,14 +138,15 @@ class MypyServer(LSPServerInfo):
138
138
 
139
139
  def _parse_json_diagnostics(self, output: str) -> list[Diagnostic]:
140
140
  """Parse mypy JSON output (one JSON object per line)."""
141
- diagnostics: list[Diagnostic] = []
141
+ import anyenv
142
142
 
143
+ diagnostics: list[Diagnostic] = []
143
144
  for line in output.strip().splitlines():
144
145
  line = line.strip()
145
146
  if not line or not line.startswith("{"):
146
147
  continue
147
148
  try:
148
- data = json.loads(line)
149
+ data = anyenv.load_json(line, return_type=dict)
149
150
  diagnostics.append(
150
151
  Diagnostic(
151
152
  file=data.get("file", ""),
@@ -157,7 +158,7 @@ class MypyServer(LSPServerInfo):
157
158
  source=self.id,
158
159
  )
159
160
  )
160
- except json.JSONDecodeError:
161
+ except anyenv.JsonLoadError:
161
162
  continue
162
163
 
163
164
  return diagnostics
@@ -170,7 +171,6 @@ class TypeScriptServer(LSPServerInfo):
170
171
  async def resolve_initialization(self, root: str, fs: AsyncFileSystem) -> dict[str, Any]:
171
172
  """Detect tsserver.js path."""
172
173
  init = await super().resolve_initialization(root, fs)
173
-
174
174
  tsserver = posixpath.join(root, "node_modules", "typescript", "lib", "tsserver.js")
175
175
  try:
176
176
  if await fs._exists(tsserver): # noqa: SLF001
@@ -188,7 +188,6 @@ class AstroServer(LSPServerInfo):
188
188
  async def resolve_initialization(self, root: str, fs: AsyncFileSystem) -> dict[str, Any]:
189
189
  """Detect TypeScript SDK path for Astro."""
190
190
  init = await super().resolve_initialization(root, fs)
191
-
192
191
  tsserver = posixpath.join(root, "node_modules", "typescript", "lib", "tsserver.js")
193
192
  try:
194
193
  if await fs._exists(tsserver): # noqa: SLF001
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes