0xMiden / 0xMiden/miden-lsp

Improve diagnostic messages

Abierto
#5 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Rust
Estrellas
1
Forks
1
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### What should be done?

The current tree-sitter-based parsing has limitations for producing useful diagnostics, diagnostics have several shortcomings that make it hard for users to understand and fix their code:

- **Generic "syntax error" messages** - there is no detail about what actually went wrong. We should have say things like "expected `end` to close `if` block" or "unknown instruction `pushh`".
- **Wrong line highlighted** - in some cases the error span points to the wrong line, making it confusing to locate the actual problem.
- **Misleading error for unresolved imports** - when an import cannot be resolved, the error shown is "callee stack effects are indeterminate" instead of something like "unresolved import: module `foo::bar` not found".
- **Missing `end` not detected** - missing `end` for `if`, `while`, `repeat`, `proc`, etc. produces a generic syntax error instead of a targeted message like "missing `end` to close `proc` started on line N".
- **No unused/missing import warnings** — unused imports and calls to non-imported modules are not flagged.
- **No typo suggestions** — no "did you mean X?" when an instruction or module name is misspelled.

### How should it be done?

Once the new MASM parser (https://github.com/0xMiden/miden-vm/pull/2907) lands, replace the tree-sitter-based parsing with it and map richer error output to LSP diagnostics.

### When is this task done?

Many of these improvements are blocked on or will be simplified by the new MASM parser designed for IDE use — see [0xMiden/miden-vm#2907](https://github.com/0xMiden/miden-vm/pull/2907).

### Additional context

_No response_

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.