Integrate mq-check crate and type checker options#1373
Conversation
- Add mq-check to workspace and dependencies - Implement type checker options in mq-check and mq-lsp - Pass type checker config from CLI to LSP server - Enable type error diagnostics in LSP when type checking is enabled - Add and update tests for type checker options in LSP Closes #XXX (replace with actual issue if applicable)
There was a problem hiding this comment.
Pull request overview
This PR integrates the mq-check type-checking crate into the mq-lsp language server, exposing new CLI options to enable type checking and configure its behavior (strict arrays, tuple mode). When type checking is enabled and there are no parse errors, the LSP server runs the type checker and emits LSP diagnostics for detected type errors. The TypeCheckerOptions struct is also updated to derive Copy to eliminate unnecessary .clone() calls.
Changes:
mq-checkis added to the workspace and as a dependency ofmq-lspTypeCheckerOptionsderivesCopy;.clone()calls inmq-check/src/main.rsare replaced with direct copy- New CLI flags (
-T,--strict-array,--tuple) are added tomq-lsp/src/main.rs;LspConfig::newgains two new parameters and type checking logic is added to thediagnosticsmethod inserver.rs
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
Cargo.toml |
Adds mq-check as a workspace dependency |
Cargo.lock |
Adds mq-check to mq-lsp resolved dependencies |
crates/mq-check/src/lib.rs |
Adds Copy to TypeCheckerOptions derive |
crates/mq-check/src/main.rs |
Replaces .clone() with copy for TypeCheckerOptions |
crates/mq-lsp/Cargo.toml |
Adds mq-check as a dependency |
crates/mq-lsp/src/main.rs |
Adds TypeCheckArgs CLI struct and wires to LspConfig |
crates/mq-lsp/src/server.rs |
Adds config field to Backend, implements type-error diagnostics, adds tests |
Co-authored-by: Copilot <[email protected]>
…response with type information
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
@copilot |
…error Co-authored-by: harehare <[email protected]>
fix(mq-lsp): remove useless `.into()` conversion causing clippy failure
… and Zed - Neovim: add enable_type_check, strict_array, tuple, and enable_inlay_hints config options - Neovim: pass type-checking flags to mq-lsp and enable inlay hints on buffer attach - Zed: read enableTypeCheck/strictArray/tuple from initialization_options to build LSP args - Zed: support custom binary path via LspSettings - Zed: add serde_json dependency for parsing initialization options - Docs: update both editor READMEs with type checking and inlay hints usage examples
… reference symbols
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 25 out of 26 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)
crates/mq-lsp/src/lib.rs:15
- The
crates/mq-lsp/README.mddoes not document the new inlay hints capability or the new CLI flags (--enable-type-checking,--strict-array,--tuple). The codebase guidelines require documentation to be updated for new features in the crate README.
//! - **Hover**: Provides hover information for symbols, including type information when type checking is enabled.
//! - **Inlay Hints**: Shows inferred type annotations inline in the editor when type checking is enabled.
//! - **Completion**: Offers code completion suggestions.
//! - **Go To Definition**: Allows navigation to the definition of symbols.
//! - **References**: Finds all references to a symbol.
//! - **Document Symbols**: Lists all symbols in a document.
//! - **Semantic Tokens**: Provides semantic tokens for syntax highlighting.
//! - **Formatting**: Formats the document according to the MDQ language formatting rules.
//!
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.