lean-lsp-mcp 0.13.0__tar.gz → 0.13.1__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.
- {lean_lsp_mcp-0.13.0/src/lean_lsp_mcp.egg-info → lean_lsp_mcp-0.13.1}/PKG-INFO +3 -3
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/pyproject.toml +3 -3
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/src/lean_lsp_mcp/instructions.py +1 -1
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/src/lean_lsp_mcp/server.py +3 -2
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1/src/lean_lsp_mcp.egg-info}/PKG-INFO +3 -3
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/src/lean_lsp_mcp.egg-info/requires.txt +2 -2
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/tests/test_diagnostic_line_range.py +38 -0
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/LICENSE +0 -0
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/README.md +0 -0
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/setup.cfg +0 -0
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/src/lean_lsp_mcp/__init__.py +0 -0
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/src/lean_lsp_mcp/__main__.py +0 -0
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/src/lean_lsp_mcp/client_utils.py +0 -0
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/src/lean_lsp_mcp/file_utils.py +0 -0
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/src/lean_lsp_mcp/search_utils.py +0 -0
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/src/lean_lsp_mcp/utils.py +0 -0
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/src/lean_lsp_mcp.egg-info/SOURCES.txt +0 -0
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/src/lean_lsp_mcp.egg-info/dependency_links.txt +0 -0
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/src/lean_lsp_mcp.egg-info/entry_points.txt +0 -0
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/src/lean_lsp_mcp.egg-info/top_level.txt +0 -0
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/tests/test_editor_tools.py +0 -0
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/tests/test_file_caching.py +0 -0
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/tests/test_logging.py +0 -0
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/tests/test_misc_tools.py +0 -0
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/tests/test_project_tools.py +0 -0
- {lean_lsp_mcp-0.13.0 → lean_lsp_mcp-0.13.1}/tests/test_search_tools.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lean-lsp-mcp
|
|
3
|
-
Version: 0.13.
|
|
3
|
+
Version: 0.13.1
|
|
4
4
|
Summary: Lean Theorem Prover MCP
|
|
5
5
|
Author-email: Oliver Dressler <hey@oli.show>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -8,8 +8,8 @@ Project-URL: Repository, https://github.com/oOo0oOo/lean-lsp-mcp
|
|
|
8
8
|
Requires-Python: >=3.10
|
|
9
9
|
Description-Content-Type: text/markdown
|
|
10
10
|
License-File: LICENSE
|
|
11
|
-
Requires-Dist: leanclient==0.5.
|
|
12
|
-
Requires-Dist: mcp[cli]==1.21.
|
|
11
|
+
Requires-Dist: leanclient==0.5.3
|
|
12
|
+
Requires-Dist: mcp[cli]==1.21.1
|
|
13
13
|
Requires-Dist: orjson>=3.11.1
|
|
14
14
|
Provides-Extra: lint
|
|
15
15
|
Requires-Dist: ruff>=0.2.0; extra == "lint"
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "lean-lsp-mcp"
|
|
3
|
-
version = "0.13.
|
|
3
|
+
version = "0.13.1"
|
|
4
4
|
description = "Lean Theorem Prover MCP"
|
|
5
5
|
authors = [{name="Oliver Dressler", email="hey@oli.show"}]
|
|
6
6
|
readme = "README.md"
|
|
7
7
|
requires-python = ">=3.10"
|
|
8
8
|
license = "MIT"
|
|
9
9
|
dependencies = [
|
|
10
|
-
"leanclient==0.5.
|
|
11
|
-
"mcp[cli]==1.21.
|
|
10
|
+
"leanclient==0.5.3",
|
|
11
|
+
"mcp[cli]==1.21.1",
|
|
12
12
|
"orjson>=3.11.1",
|
|
13
13
|
]
|
|
14
14
|
|
|
@@ -7,7 +7,7 @@ INSTRUCTIONS = """## General Rules
|
|
|
7
7
|
## Key Tools
|
|
8
8
|
- lean_local_search: Confirm declarations (theorems/lemmas/defs/etc.) exist. VERY USEFUL AND FAST!
|
|
9
9
|
- lean_goal: Check proof state. USE OFTEN!
|
|
10
|
-
- lean_diagnostic_messages: Understand current proof situation
|
|
10
|
+
- lean_diagnostic_messages: Understand current proof situation.
|
|
11
11
|
- lean_hover_info: Documentation about terms and lean syntax.
|
|
12
12
|
- lean_leansearch: Search theorems using natural language or Lean terms.
|
|
13
13
|
- lean_loogle: Search definitions and theorems by name, type, or subexpression.
|
|
@@ -289,6 +289,7 @@ def diagnostic_messages(
|
|
|
289
289
|
declaration_name (str, optional): Name of a specific theorem/lemma/definition.
|
|
290
290
|
If provided, only returns diagnostics within that declaration.
|
|
291
291
|
Takes precedence over start_line/end_line.
|
|
292
|
+
Slow, requires waiting for full file analysis.
|
|
292
293
|
|
|
293
294
|
Returns:
|
|
294
295
|
List[str] | str: Diagnostic msgs or error msg
|
|
@@ -314,7 +315,7 @@ def diagnostic_messages(
|
|
|
314
315
|
rel_path,
|
|
315
316
|
start_line=start_line_0,
|
|
316
317
|
end_line=end_line_0,
|
|
317
|
-
inactivity_timeout=
|
|
318
|
+
inactivity_timeout=15.0,
|
|
318
319
|
)
|
|
319
320
|
|
|
320
321
|
return format_diagnostics(diagnostics)
|
|
@@ -672,7 +673,7 @@ def run_code(ctx: Context, code: str) -> List[str] | str:
|
|
|
672
673
|
client.open_file(rel_path)
|
|
673
674
|
opened_file = True
|
|
674
675
|
diagnostics = format_diagnostics(
|
|
675
|
-
client.get_diagnostics(rel_path, inactivity_timeout=
|
|
676
|
+
client.get_diagnostics(rel_path, inactivity_timeout=15.0)
|
|
676
677
|
)
|
|
677
678
|
finally:
|
|
678
679
|
if opened_file:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lean-lsp-mcp
|
|
3
|
-
Version: 0.13.
|
|
3
|
+
Version: 0.13.1
|
|
4
4
|
Summary: Lean Theorem Prover MCP
|
|
5
5
|
Author-email: Oliver Dressler <hey@oli.show>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -8,8 +8,8 @@ Project-URL: Repository, https://github.com/oOo0oOo/lean-lsp-mcp
|
|
|
8
8
|
Requires-Python: >=3.10
|
|
9
9
|
Description-Content-Type: text/markdown
|
|
10
10
|
License-File: LICENSE
|
|
11
|
-
Requires-Dist: leanclient==0.5.
|
|
12
|
-
Requires-Dist: mcp[cli]==1.21.
|
|
11
|
+
Requires-Dist: leanclient==0.5.3
|
|
12
|
+
Requires-Dist: mcp[cli]==1.21.1
|
|
13
13
|
Requires-Dist: orjson>=3.11.1
|
|
14
14
|
Provides-Extra: lint
|
|
15
15
|
Requires-Dist: ruff>=0.2.0; extra == "lint"
|
|
@@ -317,3 +317,41 @@ async def test_diagnostic_messages_declaration_name_takes_precedence(
|
|
|
317
317
|
# Should get diagnostics for firstTheorem, not lines 1-3
|
|
318
318
|
# (which would only include imports)
|
|
319
319
|
assert len(diag_text) > 0
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
@pytest.fixture()
|
|
323
|
+
def kernel_error_file(test_project_path: Path) -> Path:
|
|
324
|
+
"""File with kernel error as first error (issue #63)."""
|
|
325
|
+
path = test_project_path / "KernelErrorTest.lean"
|
|
326
|
+
content = textwrap.dedent(
|
|
327
|
+
"""
|
|
328
|
+
import Mathlib.Data.Real.Basic
|
|
329
|
+
|
|
330
|
+
structure test where
|
|
331
|
+
x : ℝ
|
|
332
|
+
deriving Repr
|
|
333
|
+
|
|
334
|
+
lemma test_lemma : False := by rfl
|
|
335
|
+
"""
|
|
336
|
+
).strip()
|
|
337
|
+
path.write_text(content + "\n", encoding="utf-8")
|
|
338
|
+
return path
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
@pytest.mark.asyncio
|
|
342
|
+
async def test_diagnostic_messages_detects_kernel_errors(
|
|
343
|
+
mcp_client_factory: Callable[[], AsyncContextManager[MCPClient]],
|
|
344
|
+
kernel_error_file: Path,
|
|
345
|
+
) -> None:
|
|
346
|
+
"""Test kernel errors detected when first in file (issue #63)."""
|
|
347
|
+
async with mcp_client_factory() as client:
|
|
348
|
+
diagnostics = await client.call_tool(
|
|
349
|
+
"lean_diagnostic_messages",
|
|
350
|
+
{"file_path": str(kernel_error_file)},
|
|
351
|
+
)
|
|
352
|
+
diag_text = result_text(diagnostics)
|
|
353
|
+
|
|
354
|
+
# Detect kernel error and regular error
|
|
355
|
+
assert "kernel" in diag_text.lower() or "unsafe" in diag_text.lower()
|
|
356
|
+
assert "rfl" in diag_text.lower() or "failed" in diag_text.lower()
|
|
357
|
+
assert diag_text.count("severity") >= 2
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|