Conversation
This reverts commit d758118.
…completion support
1. They are resolved in strings & comments 2. Nested expressions(?) didn't resolve
…dule for VSCode extension
…and prevent crashes on inaccessible directories
Member
Author
yeah, no we spoke too soon |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR merges the LSP implementation into master, wiring HybroidLS into the CLI and extending the compiler/walker pipeline to expose richer semantic data (scopes, references, parameter names) needed for editor features.
Changes:
- Adds an integrated Language Server (HybroidLS) with diagnostics, completion, hover, signature help, definition, references, and rename, plus extensive regression/concurrency/leak tests.
- Extends the
walkerto track scope ranges and symbol references, and enriches function types with parameter names for better signature help/hover output. - Hardens compiler UX and stability (parser error anchoring, lexer unterminated-string location repair, alert snippet bounds clamping) and updates docs/tooling for LSP API docs generation.
Reviewed changes
Copilot reviewed 77 out of 80 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| wasm/README.md | Adds a short README describing the WASM module. |
| walker/z_crash_test.go | Adds a regression test that exercises lsp.Analyze on a crashy input. |
| walker/walker.go | Adds scope-range tracking, reference tracking, environment import metadata, and reset helpers. |
| walker/values.go | Adds parameter-name tracking to FunctionVal and updates constructors accordingly. |
| walker/types.go | Extends FunctionType to include parameter names and updates string formatting. |
| walker/statements.go | Registers scopes for control-flow constructs and records use references/imported libraries. |
| walker/scope.go | Adds Scope.GetVariable to resolve vars across parents, imports, and explicitly-imported libs. |
| walker/misc.go | Switches variable resolution to ImportedLibraries and ensures library envs are initialized. |
| walker/expressions.go | Avoids AST mutation for enum mapping; records references during identifier/access resolution. |
| walker/declarations.go | Registers scopes for class/entity/functions; adds parameter-name capture for declared functions. |
| walker/builtin_api.go | Adds parameter names to builtin function type definitions. |
| walker/api_table.go | Adds parameter names to Table API function signatures. |
| walker/api_string.go | Adds parameter names to String API function signatures and updates callback type construction. |
| walker/api_math.go | Adds parameter names to Math API function signatures. |
| walker/api_fmath.gen.go | Regenerates Fmath API Go bindings with parameter names. |
| utils/generate_api.py | Generates LSP hover docs (lsp/api_docs.gen.go) alongside existing API/docs generation. |
| utils/api/pewpew.py | Adds LSP docs generation for Pewpew functions/enums. |
| utils/api/fmath.py | Adds LSP docs generation for Fmath functions. |
| utils/api/api.py | Updates Go API generation to include parameter names; adds LSP doc entry generators. |
| spec.md | Updates/removes portions of the language spec content. |
| parser/misc.go | Improves diagnostics anchoring when ) is missing in function argument lists. |
| lsp/wire_format_test.go | Adds URI encode/decode round-trip regression tests. |
| lsp/timer_test.go | Adds debounce-timer stop/cancel regression coverage. |
| lsp/single_file_edge_test.go | Adds tests around project-root discovery and single-file vs project mode behavior. |
| lsp/README.md | Updates LSP README with supported features list. |
| lsp/pre_analyze_edge_test.go | Adds readiness/hang and nil-params validation regression tests. |
| lsp/metadata.go | Implements symbol metadata lookup for hover/resolve, including generated API docs integration. |
| lsp/memory_leak_test.go | Adds tests to detect file-map/goroutine/evaluator cleanup leaks across open/close cycles. |
| lsp/lsp.go | Expands LSP wire types and capabilities (signature help, references, rename) and aligns JSON tags. |
| lsp/logpath.go | Adds debug log path resolution + safe fallback configuration. |
| lsp/logpath_test.go | Adds tests for log path resolution and configure behavior/fallbacks. |
| lsp/init.go | Wires debug logging, sets core.IsDebug, and initializes library environments. |
| lsp/helpers.go | Adds editor-facing helpers (word extraction, URI location conversion, path helpers, builtin env resolution). |
| lsp/handler.go | Re-enables and implements didOpen/didChange/didClose/hover/definition/references/rename/signatureHelp, plus readiness and debounce orchestration. |
| lsp/handler_test_helpers_test.go | Adds fake notifier connection + project/test scaffolding for LSP tests. |
| lsp/handler_did_open_test.go | Adds a large suite of didOpen behavior tests (single-file fallback, root discovery, storage). |
| lsp/handle_text_document_did_close.go | Implements didClose cleanup + clears diagnostics and drops evaluator state for the file. |
| lsp/handle_text_document_did_change.go | Implements didOpen/didChange and debounced analyze/publish pipeline. |
| lsp/handle_signature_help.go | Implements signature help using walker scopes + parameter-name metadata. |
| lsp/handle_shutdown.go | Adjusts shutdown handling to accept shutdown without closing transport immediately. |
| lsp/handle_rename.go | Implements rename by reusing reference search and returning WorkspaceEdit. |
| lsp/handle_references.go | Implements references via walker reference maps and definition inference. |
| lsp/handle_initialize.go | Implements initialize, capabilities, root handling, and async workspace pre-analysis. |
| lsp/handle_hover.go | Implements hover with metadata + numeric literal computed-value hover. |
| lsp/handle_definition.go | Implements go-to-definition across locals, imports, and builtin libraries. |
| lsp/handle_completion_item_resolve.go | Adds completion resolve that enriches items with metadata/docs. |
| lsp/find_project_root.go | Adds project root discovery via marker walk (hybconfig.toml). |
| lsp/find_project_root_fuzz_test.go | Adds fuzz + deterministic tests for project-root discovery invariants. |
| lsp/cross_file_diagnostics_test.go | Adds tests ensuring diagnostics are republished across all open files and close clears correctly. |
| lsp/concurrency_test.go | Adds deadlock regression tests for didChange vs hover/timer/eval locks and markReady idempotence. |
| lsp/analysis.go | Adds Analyze pipeline and alert-to-diagnostic conversion for LSP consumption. |
| lsp/alerts_to_diagnostics_test.go | Adds tests validating severity mapping, message formatting, and defensive position clamping. |
| lsp/api_docs.gen.go | Adds generated API docs map consumed by hover/resolve (new generated artifact). |
| lsp/AGENTS.md | Adds internal implementation notes/documentation for the LSP code. |
| LICENSE | Updates copyright year. |
| lexer/lexer.go | Fixes unterminated string token location handling to avoid snippet slicing panics. |
| examples/level/level.hyb | Updates example tick syntax usage. |
| evaluator/z_remove_file_test.go | Adds tests for evaluator per-file cleanup via RemoveFile. |
| evaluator/z_eval_repro_test.go | Adds a repro test for parser alerts persisting through RunAnalysis. |
| evaluator/test/statements/test.lua | Updates expected formatting in statement tests (generator output changes). |
| evaluator/test/statements/test.hyb | Adjusts test expectations for match-expression returns/yields. |
| evaluator/test/statements/expected.lua | Updates expected Lua output for statement tests. |
| evaluator/test/expressions/test.lua | Updates expected formatting/cleanup in expression tests (incl. entity destroy cleanup). |
| evaluator/test/expressions/test.hyb | Minor test source formatting change. |
| evaluator/test/expressions/expected.lua | Updates expected Lua output for expression tests. |
| evaluator/build_panic_test.go | Adds end-to-end regression tests preventing build panics from malformed token locations. |
| core/logging.go | Introduces debug-gated logging (core.DebugLog) for the LSP/server. |
| cli/commands/lsp.go | Adds hybroid-live language-server command with --debug flag. |
| cli/app.go | Enables the LSP command in the CLI and updates copyright string. |
| ast/expressions.go | Extends LiteralExpr with IsEnvPath to avoid unsafe AST mutation side effects. |
| alerts/snippet.go | Clamps snippet column ranges to avoid slice-out-of-range panics. |
| alerts/printer.go | Exposes AllAlerts() for full alert retrieval/introspection. |
| AGENTS.md | Updates top-level agent docs with LSP fallback, release notes, and log path conventions. |
| .gitmodules | Adds vscode-ext submodule for the VS Code extension repo. |
| .gitignore | Adds .DS_Store and hybroid binary ignore entries. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
SKPG-Tech
approved these changes
Jun 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Making the PR so that github action starts working
The branch is
still notnow ready for merging