Introduce several changes to reduce full-document reparses, lock contention and
redundant work when handling TclOO analysis and navigation:
- Add a cheap may_contain_classes pre-check and several cursor/receiver
heuristics so completions, signature help and tcloo definitions skip the
expensive marker reparse when the document cannot contain useful OO info.
- Allow passing an existing parsed tree into tcloo completion/signature/definition
helpers; update callers to use the server's cached tree when available.
- Use a thread-local parser for request-time parse_source to avoid blocking the
shared parser during background indexing, and add navigation_state() which
returns cached definition identities (invalidated on index generation changes).
- Add a cheap name pre-filter (_may_resolve_to) for symbol matching and only
run class highlighting when classes may exist.
These changes reduce contention and repeated parsing, improve responsiveness for
requests during background indexing, and cache navigation definition identities.
Tests were added/updated to assert caching and non-blocking behavior.
Add PSC (.psc) indexing and share TclOO class metadata across files so class
definitions discovered via PSC layers can be used for completions, signature
help, inlay hints, and "go to definition". Key behavior changes:
- Client file watcher now includes *.psc and .vscode launch paths/tests updated
to use the postprocessor test folder; .gitignore updated to ignore that folder.
- Server watches .psc changes and refreshes a PSC script index; new
tools/tcloo_navigation.py exposes tcloo_definition used by the language server
to resolve cross-file class/constructor/method definitions.
- Language server uses class_snapshot(document.path) when producing TclOO
completions, signature help, and inlay hints so resolved class metadata is
available across files.
Also includes related docs/changelog updates, minor code formatting cleanups,
and added tests for PSC/TclOO behavior.
Add conservative, document-local TclOO type inference and tooling so the server
can offer method completions, signature help, and inlay parameter hints for
statically resolvable TclOO receivers (including `new`/`create`, `my`, and
simple return-chains). Also surface class names as completion items and emit
semantic tokens for class declarations/references.
Notable changes:
- New tcloo_* tools: completion, symbols, and argument parsing; integrated into
on_completion, signature_help, inlay hint generation and semantic token
highlighting. Completions are returned early when an OO receiver context is
detected.
- Use a completion-friendly parser fallback when the main AST fails (TclSyntaxError)
so editing-in-progress code still yields useful completions.
- Add CompletionItemKind.Class to command kinds, exclude class items from the
poco completion name cache, and include new unit tests for the TclOO helpers.