Skip to content

bump 0.7.10#159

Open
fernandolguevara wants to merge 7 commits intopherrymason:mainfrom
fernandolguevara:main
Open

bump 0.7.10#159
fernandolguevara wants to merge 7 commits intopherrymason:mainfrom
fernandolguevara:main

Conversation

@fernandolguevara
Copy link
Copy Markdown

No description provided.

@pherrymason
Copy link
Copy Markdown
Owner

Can you provide a briefing of implemented changes? This PR is huge.

Resolve project roots per document and defer heavy startup indexing when
opening aggregate folders so go-to-definition works in nested C3
projects. Also harden document lookup paths and add typeDefinition
support for editor compatibility.
@DrEverr
Copy link
Copy Markdown
Contributor

DrEverr commented Mar 1, 2026

AI generated (Claude-Opus-4.6)

PR #159 Brief — c3-lsp v0.7.10
Author: Fernando López Guevara (fernandolguevara)
Stats: 93 files changed, ~174k additions / ~151k deletions (bulk is regenerated tree-sitter parser)
Status: No reviews yet.
Key Changes

  1. Stability / Crash Fixes
  • Per-request panic recovery for hover, definition, completion, rename, etc. — a single bad request no longer kills the LSP.
  • Fixed multiple nil-dereference paths in hover, document parsing, cursor position math, and URI/path normalization; safe fallbacks instead of panics.
  1. Tree-sitter Grammar Update
  • Vendored parser regenerated (~320k lines churn in parser.c) to support C3 language changes, including the new constdef and cenum keywords. constdef is normalized during CST parsing for backward compat.
  1. Workspace / Multi-Project Support
  • Aggregate-folder support: resolves nearest project root per active document, defers heavy indexing on non-project roots, indexes subprojects on demand.
  • Diagnostics now run from the active file's project root with per-project config reload.
  1. New LSP Capabilities
  • textDocument/typeDefinition — type definition navigation.
  • textDocument/implementation — find interface implementors and method implementations.
  • textDocument/rename + textDocument/prepareRename — module rename across declarations, imports, and qualified usages.
  • workspace/didChangeConfiguration — runtime settings refresh.
  • Added LSP_SPEC.md checklist tracking LSP 3.17 coverage.
  1. Completion Improvements
  • Ctrl+Space on empty lines now shows in-scope suggestions with scope-aware ranking (locals > modules > keywords).
  • Enriched completion items with labelDetails, signature markdown, and kind hints.
  • Hides @private/@Local symbols outside valid visibility contexts; @Local scoped per module section.
  • Improved callable/struct insertion snippets, method completion strips type qualifiers for instance calls.
  • Better chain completion for obj. contexts with type-inference fallback for stdlib generics.
  • Suppresses struct-construction snippets in generic type-argument positions.
  1. Navigation Fixes
  • Go-to-definition retries 1-2 chars left when cursor lands on trailing punctuation (e.g. name|().
  • Resolves @-prefixed macro symbols and short module paths (types::...) with fallback matching.
  • Ignores literal contexts (e.g. %s in strings) to prevent bogus jumps.
  1. Hover Enhancements
  • Generic type rendering shows concrete type args (e.g. HashMap{String, Feature}).
  • Module generics surface inferred constraints from @require contracts.
  • Module symbols include generic parameters in the signature line.
  1. Stdlib / Internals
  • Cache-format versioning with module rehydration/merge for stdlib reload robustness.
  • Zed editor compatibility: relaxed C3 document detection (case-insensitive language ID + extension fallback).

@DrEverr
Copy link
Copy Markdown
Contributor

DrEverr commented Mar 1, 2026

This single PR bundles parser upgrade, new LSP methods, completion rewrite, workspace model changes, editor compat fixes, and rename support. It would be far easier to review and bisect regressions if split into 3-4 focused PRs

Copy link
Copy Markdown
Contributor

@DrEverr DrEverr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TLDR: fix the Makefile path, add a PR description, and clean up the commit history. Ideally split the parser vendor from the feature work.

No PR description — The body is empty. A 93-file, 6-commit PR with this scope needs a summary explaining intent, testing done, and any breaking changes. The changelog is there but doesn't substitute for PR-level context.

Two of six commits are just "wip" with no meaningful message. This should be squashed or rebased into logical, reviewable units before merge.

There are new tests, but the ratio of new logic (completion rewrite, rename, implementation, workspace root resolution, config reload) to test coverage feels low. Several new handlers (TextDocumentRename, TextDocumentImplementation, TextDocumentTypeDefinition, WorkspaceDidChangeConfiguration) have minimal or basic tests.


Per-request recover() wrappers are a reasonable band-aid, but they mask root causes. The nil-deref fixes are good, but blanket recovery suggests there may be more lurking.
Worth noting in review that this shouldn't be the long-term strategy.

Comment thread Makefile
.PHONY: *

ASSETS_DIR = assets
TREE_SITTER_LOCAL_DIR ?= /Users/f00lg/github/c3/tree-sitter-c3
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should either be removed or set to a sensible default / documented as env-only.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parser.c is 170k+ additions. It's nearly impossible to review meaningfully. The PR should either: vendor it in a separate commit clearly marked as generated, or better, exclude it and rebuild via CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants