-
Notifications
You must be signed in to change notification settings - Fork 53
Add Eldritch v2 LSP with Autocomplete and Linting #1389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Created `eldritch-lsp` crate in `implants/lib/eldritchv2/` which implements a new LSP server for Eldritch v2. - Implemented autocomplete support using `eldritch-core`'s built-in completion logic. - Implemented a flexible `LintRule` framework for adding linter rules on the AST. - Added a `DeprecationRule` as an example to warn about `os.system` usage. - Exported necessary AST types from `eldritch-core` to support external tooling. - Updated the VS Code extension (`vscode/client`) to use `eldritch-lsp`.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
- Created `eldritch-lsp` crate in `implants/lib/eldritchv2/` implementing LSP for Eldritch v2.
- Implemented autocomplete logic leveraging `eldritch-core`'s built-in completion.
- Implemented AST-based Linter framework with example `DeprecationRule`.
- Updated `eldritch-core` to export AST types (`Expr`, `Stmt`) for external tooling.
- Updated VS Code extension:
- Launch `eldritch-lsp` instead of `eldritch-lang`.
- Activate on `*.eldritch` files (`onLanguage:eldritch`).
- Map `.eldritch` extension to `eldritch` language.
- Updated grammar to inherit from `source.python` to provide Python-style syntax highlighting while preserving Eldritch-specific illegal keyword highlighting.
- Created `eldritch-lsp` crate in `implants/lib/eldritchv2/` implementing LSP for Eldritch v2.
- Implemented autocomplete logic leveraging `eldritch-core`'s built-in completion.
- Implemented AST-based Linter framework with example `DeprecationRule`.
- Updated `eldritch-core` to export AST types (`Expr`, `Stmt`) for external tooling.
- Updated VS Code extension:
- Launch `eldritch-lsp` instead of `eldritch-lang`.
- Activate on `*.eldritch` files (`onLanguage:eldritch`).
- Map `.eldritch` extension to `eldritch` language.
- Updated grammar to inherit from `source.python` to provide Python-style syntax highlighting.
- Added error handling and output channel logging for LSP client.
- Created `eldritch-lsp` crate in `implants/lib/eldritchv2/` implementing LSP for Eldritch v2.
- Implemented autocomplete logic leveraging `eldritch-core`'s built-in completion.
- Implemented AST-based Linter framework with example `DeprecationRule`.
- Updated `eldritch-core` to export AST types (`Expr`, `Stmt`) for external tooling.
- Updated VS Code extension:
- Launch `eldritch-lsp` instead of `eldritch-lang`.
- Activate on `*.eldritch` files (`onLanguage:eldritch`).
- Map `.eldritch` extension to `eldritch` language.
- Updated grammar to inherit from `source.python` to provide Python-style syntax highlighting while preserving Eldritch-specific illegal keyword highlighting.
- Added error handling and output channel logging for LSP client.
- Added `postinstall` script to automatically build `eldritch-lsp` and copy it to `bin/`.
- Created `eldritch-lsp` crate in `implants/lib/eldritchv2/` implementing LSP for Eldritch v2.
- Implemented autocomplete logic leveraging `eldritch-core`'s built-in completion.
- Implemented AST-based Linter framework with example `DeprecationRule`.
- Updated `eldritch-core` to export AST types (`Expr`, `Stmt`) for external tooling.
- Updated VS Code extension:
- Launch `eldritch-lsp` instead of `eldritch-lang`.
- Activate on `*.eldritch` files (`onLanguage:eldritch`).
- Map `.eldritch` extension to `eldritch` language.
- Updated grammar to inherit from `source.python` to provide Python-style syntax highlighting while preserving Eldritch-specific illegal keyword highlighting.
- Added error handling and output channel logging for LSP client.
- Added `postinstall` script to automatically build `eldritch-lsp` and copy it to `bin/`.
- Fixed LSP initialization error by correctly wrapping `ServerCapabilities` in `InitializeResult`.
- Created `eldritch-lsp` crate in `implants/lib/eldritchv2/` implementing LSP for Eldritch v2.
- Implemented autocomplete logic leveraging `eldritch-core`'s built-in completion.
- Implemented AST-based Linter framework with example `DeprecationRule`.
- Updated `eldritch-core` to export AST types (`Expr`, `Stmt`) for external tooling.
- Updated VS Code extension:
- Launch `eldritch-lsp` instead of `eldritch-lang`.
- Activate on `*.eldritch` files (`onLanguage:eldritch`).
- Map `.eldritch` extension to `eldritch` language.
- Updated grammar to inherit from `source.python` to provide Python-style syntax highlighting while preserving Eldritch-specific illegal keyword highlighting.
- Added error handling and output channel logging for LSP client.
- Added `postinstall` script to automatically build `eldritch-lsp` and copy it to `bin/`.
- Fixed LSP initialization error by manually constructing correct JSON response structure for `InitializeResult`.
Summary
Previous Results
Insights
Slowest Tests
🎉 No failed tests detected across all runs. | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 2 runs. Github Test Reporter by CTRF 💚 🔄 This comment has been updated |
- Created `eldritch-lsp` crate in `implants/lib/eldritchv2/` implementing LSP for Eldritch v2.
- Implemented autocomplete logic leveraging `eldritch-core`'s built-in completion.
- Implemented AST-based Linter framework with example `DeprecationRule`.
- Updated `eldritch-core` to export AST types (`Expr`, `Stmt`) for external tooling.
- Updated VS Code extension:
- Launch `eldritch-lsp` instead of `eldritch-lang`.
- Activate on `*.eldritch` files (`onLanguage:eldritch`).
- Map `.eldritch` extension to `eldritch` language.
- Updated grammar to inherit from `source.python` to provide Python-style syntax highlighting while preserving Eldritch-specific illegal keyword highlighting.
- Added error handling and output channel logging for LSP client.
- Added `postinstall` script to automatically build `eldritch-lsp` and copy it to `bin/`.
- Fixed LSP initialization error by correctly constructing `InitializeResult` to prevent `TypeError` on client side.
- Created `eldritch-lsp` crate in `implants/lib/eldritchv2/` implementing LSP for Eldritch v2.
- Implemented autocomplete logic leveraging `eldritch-core`'s built-in completion.
- Implemented AST-based Linter framework with example `DeprecationRule`.
- Updated `eldritch-core` to export AST types (`Expr`, `Stmt`) for external tooling.
- Updated `eldritch-core` `complete` logic to ignore indentation tokens, fixing method completion issues.
- Updated VS Code extension:
- Launch `eldritch-lsp` instead of `eldritch-lang`.
- Activate on `*.eldritch` files (`onLanguage:eldritch`).
- Map `.eldritch` extension to `eldritch` language.
- Updated grammar to inherit from `source.python` to provide Python-style syntax highlighting while preserving Eldritch-specific illegal keyword highlighting.
- Added error handling and output channel logging for LSP client.
- Added `postinstall` script to automatically build `eldritch-lsp` and copy it to `bin/`.
- Fixed LSP initialization error by correctly constructing `InitializeResult`.
- Created `eldritch-lsp` crate in `implants/lib/eldritchv2/` implementing LSP for Eldritch v2.
- Implemented autocomplete logic leveraging `eldritch-core`'s built-in completion.
- Implemented AST-based Linter framework with example `DeprecationRule`.
- Updated `eldritch-core` to export AST types (`Expr`, `Stmt`) for external tooling.
- Updated `eldritch-core` `complete` logic:
- Ignore `Indent`/`Dedent` tokens to fix method completion in blocks.
- Support literal completion for Lists `[]`, Dictionaries `{}`, and Tuples `()`.
- Updated `eldritch-lsp` to register standard libraries (`agent`, `sys`, etc.) for completion using `eldritchv2` facade.
- Updated VS Code extension:
- Launch `eldritch-lsp` instead of `eldritch-lang`.
- Activate on `*.eldritch` files (`onLanguage:eldritch`).
- Map `.eldritch` extension to `eldritch` language.
- Updated grammar to inherit from `source.python` to provide Python-style syntax highlighting while preserving Eldritch-specific illegal keyword highlighting.
- Added error handling and output channel logging for LSP client.
- Added `postinstall` script to automatically build `eldritch-lsp` and copy it to `bin/`.
- Fixed LSP initialization error by correctly constructing `InitializeResult`.
- Created `eldritch-lsp` crate in `implants/lib/eldritchv2/` implementing LSP for Eldritch v2.
- Implemented autocomplete logic leveraging `eldritch-core`'s built-in completion.
- Implemented AST-based Linter framework with example `DeprecationRule`.
- Updated `eldritch-core` to export AST types (`Expr`, `Stmt`) for external tooling.
- Updated `eldritch-core` `complete` logic:
- Ignore `Indent`/`Dedent` tokens to fix method completion in blocks.
- Support literal completion for Lists `[]`, Dictionaries `{}`, and Tuples `()`.
- Updated `eldritch-lsp` to:
- Register standard libraries (`agent`, `sys`, etc.) for completion.
- Accurately map parser/lexer error spans to LSP Diagnostics ranges.
- Use distinct icons for Libraries (`Module`) vs Functions/Variables in autocomplete.
- Updated VS Code extension:
- Launch `eldritch-lsp` instead of `eldritch-lang`.
- Activate on `*.eldritch` files (`onLanguage:eldritch`).
- Map `.eldritch` extension to `eldritch` language.
- Updated grammar to inherit from `source.python` while adding specific highlighting for Eldritch built-ins (`tprint`) and libraries (`agent`, `sys`, etc.).
- Configured file icon to use `images/eldritch.png`.
- Added error handling and output channel logging for LSP client.
- Added `postinstall` script to automatically build `eldritch-lsp` and copy it to `bin/`.
- Fixed LSP initialization error by correctly constructing `InitializeResult`.
- Created `eldritch-lsp` crate providing a language server for Eldritch v2. - Implemented autocomplete, syntax diagnostics, and linting. - Added `SemanticCheckRule` linter to detect unknown methods and signature mismatches. - Updated `eldritch-core` to export AST nodes for LSP consumption. - Configured VS Code extension to build and use the LSP server via `install.js`. - Included debug logging to VS Code Output channel.
|
Jules run |
I have run |
Run `cargo fmt` to format the codebase, specifically `eldritch-lsp` and `eldritch-core`.
…1400) Added `TypeCheckRule` to the LSP linter to validate: - Method existence on objects. - Argument counts and types for method calls. - Binary operation operand types (specifically avoiding List + String). This involved: - Adding `MethodSignature` and `ParameterSignature` structs to `eldritch-core`. - Updating `ForeignValue` trait to expose `get_method_signature`. - Updating `eldritch-macros` to automatically generate signature metadata for libraries. - Implementing the linter rule in `eldritch-lsp`. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Refactor `is_interpreter_type` to use nested `if let` blocks instead of unstable `let_chains` syntax. This resolves build errors on stable Rust toolchains. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Added a new linter rule `UndefinedSymbolRule` to `eldritch-lsp` which checks for usage of undefined variables. The rule respects scoping rules (module, function, loop block scopes). Updated `Linter` to include this new rule. Added unit tests covering basic usage, function parameters, and loop variables. Updated `eldritch-core/lib.rs` to export `FStringSegment` for LSP usage. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: KCarretto <Kcarretto@gmail.com>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: KCarretto <Kcarretto@gmail.com>
…r. (#1410) - Added `doc` field to `MethodSignature` in `eldritch-core`. - Updated `eldritch-macros` to initialize `doc` field. - Implemented `get_native_method_signature` in `eldritch-core` to provide signatures and documentation for built-in methods (List, Dictionary, Set, String). - Updated `eldritch-lsp` to handle `textDocument/hover` requests. - Implemented robust `position_to_offset` and text traversal in `eldritch-lsp` to correctly handle UTF-8 and newlines. - Added support for resolving dotted expressions (e.g., `file.append`) in hover requests. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Separated rules in `implants/lib/eldritchv2/eldritch-lsp/src/linter/mod.rs` into their own files (`deprecation.rs`, `type_check.rs`, `undefined_symbol.rs`) and moved helper methods to `utils.rs` and `visitors.rs`. Verified that all tests still pass. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Update `eldritch-macros` to support `deprecated=true` or `deprecated="reason"` on `#[eldritch_method]`. - Update `eldritch-core` `MethodSignature` to include `deprecated: Option<String>`. - Update `eldritch-lsp` `DeprecationRule` to dynamically check the interpreter for deprecated methods instead of hardcoded `os.system`. - Filter deprecated methods from auto-complete in `eldritch-core`. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
…sp (#1413) - Fix unused variable warnings in `ast.rs` and tests. - Add missing imports for `alloc::format` and `ToString` in `eldritch-core` for `no_std` compliance. - Resolve clippy warnings in `eldritch-lsp` including collapsible matches/ifs and single matches. - Fix broken test in `eldritch-lsp` regarding deprecation warnings. - Run `cargo fmt` on both crates. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
This PR introduces a new Language Server Protocol (LSP) implementation specifically for Eldritch v2. It replaces the previous Starlark-based LSP.
Changes:
eldritch-lspadded toimplantsworkspace.eldritch-lspsupports:textDocument/completion: Autocomplete for built-ins and variables.textDocument/publishDiagnostics: Linting errors and warnings.Lintertrait andDeprecationRule(checks foros.system).eldritch-coreto exportExpr,Stmt, etc. for LSP consumption.eldritch-lsp.PR created automatically by Jules for task 8861086955046603492 started by @KCarretto