Add a new module that parses PostConfigurator COMMANDBLOCK values (CONF_* set ...)
to extract the first word of braced list elements as procedure names with precise
line/column spans.
- server/src/tools/stored_procs.py: implement stored_command_names(command)
which returns (name, line, column) for static/braced list elements.
- Integrate into navigation (build_file_symbol_index) to index these names as
non-definitions so Go To Definition / Find References can resolve them.
- Integrate into semantic highlighting to mark known stored procedures as
functions when appropriate.
- Add tests (server/tests/python_tests/test_stored_procs.py) covering parsing,
goto-definition, references, and highlighting behavior.
- Update CHANGELOG to note the new capability.
Notes/constraints:
- Only static/braced COMMANDBLOCK values (BracedWord) are considered.
- Names must match the command-name pattern and are taken from the first word
of each list element.
Add diagnostics that warn when a literal NX command argument names a block
template or address that no loaded .def file declares (diagnostic codes
unknown-block-template and unknown-address). Names computed at runtime
(e.g. $var or "CYCLE_$x") are not checked, and kinds whose .def file is
not loaded are skipped.
The server now recomputes and refreshes diagnostics when .def documents
change (clears cached diagnostics and requests a workspace diagnostic
refresh if the client supports it). Tests cover positive, negative and
invalidated-cache cases.
Add a Gitea workflow that runs on pull requests and pushes to main. It defines two jobs:
- Python: sets up Python 3.12, installs pytest, and runs language-server tests under server/tests/python_tests with PYTHONPATH=libs.
- Node: sets up Node 20, installs npm deps (root and client), runs extension tests (node --test test/) and builds the extension (npm run package).
Workflow file added at .gitea/workflows/tests.yml.
Add a new def_flow analysis module that follows .def block template
and address names through local variables and proc parameters, and a
wrapper-table builder to resolve proc arguments that forward .def names.
Derived names are resolved only for hover/definition (not for rename).
Integrate this into the LSP:
- lsp_server: add _word_at and _tcl_def_symbol helpers; fallback to
derived_def_symbol when direct NX-argument navigation fails for hover,
goto-definition and references; return proper ranges for hover.
- lsp_tclserver: cache and expose a def_wrapper_table built from index
def_flows (with cache invalidation on index generation).
Also add unit tests for def_flow and update CHANGELOG to note hover/
definition and completion preview improvements for derived names.
Enable completion item resolution so selecting a completion can populate
documentation with a preview of the corresponding .def declaration.
- Turn on resolve_provider in the completion options.
- Implement on_completion_resolve to attach Markdown documentation
computed by def_hover_markdown when the completion item's data
contains a ("def" -> [kind, name]) payload.
- Include that "def" payload when generating def-related completion items.
- Add tests that verify block-template and address-list items resolve to
Markdown previews.
Before: def-related completion items had no documentation on resolve.
After: selecting such items will return a Markdown preview of the .def entry.
Adjust tests to match current completion item labels and clean up formatting:
- Expect "nocomplain" (no leading dash) for the unset option case instead of {"-nocomplain", "--"}.
- Reflow several multi-line source literals into single-line/f-string forms.
- Normalize various assertions and generator expressions onto single lines.
- Reformat TextDocumentItem construction for readability.
These changes are limited to test code and reflect the updated shape/labels of completion items and stylistic cleanup; no production logic is modified.
Add tools/def_navigation.py providing utilities to locate .def symbols
and occurrences, produce definition/reference locations, build hover
Markdown for addresses (property table with format links and modality
labels), and compute workspace edits for renames (only when a
declaration exists). Helpers include def_symbol_at, def_definition_locations,
def_reference_locations, tcl_def_occurrences, all_def_target_locations,
def_rename_edits and def_hover_markdown, plus small formatting helpers.
Also add server/tests/python_tests/test_def_navigation.py exercising
go-to-definition, hover, references and rename behavior between Tcl and
.def files, including use of unsaved text and ensuring undeclared names
are not renamed. Tests assert address property ordering, modality labels,
and correct edit ordering for workspace edits.
Add client and server support to navigate, inspect, reference, and rename block
template and address symbols declared in PSC .def files:
- Client: register language providers for .def (definition, hover, references,
prepare/provide rename) and send the current document text with each request.
- Server: parse .def files into DefDocument/DefDeclaration/DefReference, expose
def-specific LSP endpoints (definition/hover/references/prepareRename/rename),
and integrate .def lookups into existing Tcl hover/definition/references/rename
flows so Tcl calls jump to .def declarations.
- Tcl server keeps a snapshot API for .def documents (current editor content can
replace file on request); only declared names in loaded .def files can be
renamed. Name validation uses DEF_NAME_RE.
Update README and CHANGELOG to document navigation features.
Add static value suggestions for MOM_do_template's second argument (CREATE, BUFFER)
and a dynamic completion rule marking that position as a VALUE.
Also add dynamic completion rules to provide ADDRESS completions for
MOM_disable_address (positions 1–32) and for repeated address arguments of
MOM_enable_address.
Before: these arguments had no completion assistance.
After: the CLI completion subsystem will offer appropriate VALUE/ADDRESS suggestions.
Populate CHANGELOG with detailed release entries up to 2026.9.700 and tidy historical notes. The new content documents recent features and fixes (notably DEF block template/address handling, the BLOCK_LIST/ADDR_LIST completion keywords, comment spacing/formatting changes, and the persistent workspace index), and cleans up formatting and older release headings for readability.
Update the README and CHANGELOG to describe newly documented language-server behaviors and editor UX details.
- Read BLOCK_TEMPLATE and ADDRESS names from .def files listed under <DefinedEvents> in PSC layers and refresh on PSC/DEF changes; completion suggestions for MOM_do_template, MOM_ask_address_value, MOM_force, and MOM_suppress
- Insert quoted block templates/addresses and Always|Once|Off modes (replace auto-closed/typed quotes instead of doubling) and insert variables with a leading `$`
- Add BLOCK_LIST and ADDR_LIST completion keywords to list all loaded block templates or addresses
- Document formatting/linting of uplevel bodies as Tcl and normalization of comment spacing (#Comment → # Comment) while preserving ##, #!, and already spaced comments
- Note that the Python debug bootstrap now stops with a clear error instead of hanging when no debugpy listener or only a stale one is available
These changes are reflected under "Unreleased" in the changelog and in the README section about DEF block templates and addresses.
Add keyword-driven completions for BLOCK_LIST and ADDR_LIST in the LSP server.
- While typing a prefix of these keywords the server returns the keyword(s)
as incomplete snippet suggestions that trigger a re-request.
- Once the keyword is typed the server replaces it with a full list of the
corresponding loaded block templates or addresses (quoted), and sets each
item's filter_text to include the keyword so further typing narrows results.
- Integrate this flow into on_completion and factor the symbol-list logic
into a helper that returns either incomplete keyword suggestions or the
completed symbol list.
Also implement NxFormatter.format_comment to ensure a single space after a
leading '#' for comments that don't already start with whitespace, while
leaving sequences of '#' (separators), shebangs, and already-spaced comments
unchanged. This affects both standalone and inline comments.
Add/rename tests to cover the new completions and comment-spacing behavior.
- Pass extension storage path to the server (client/ changes) so the
server can persist a workspace index.
- Introduce IndexCache (server/tools/index_cache.py) and load/save it on
initialization and after background indexing. Index entries are stored
only when the file's stat hasn't changed while being read.
- Add incremental reparse logic (server/tools/incremental_parse.py) and
use a per-file _last_parse cache in the language server to reparse only
the top-level Tcl commands touched by an edit, falling back to a full
parse when necessary.
- Use a new _FileIndex dataclass and _build_file_index helper to unify
what is stored/loaded for a file; update update_poco_completion_for_file
to use the persistent cache for disk-read files (from_disk/source_stat).
- Keep background indexing non-blocking and persist the index at the
end of the run. Add basic unit tests for incremental parse and index cache.
Before: edits and background work always required full parsing of files
and no persistent cross-restart index. After: some edits reuse previous
ASTs and files read from disk can use a persisted index to skip
re-indexing across restarts.
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.
Treat braced lappend arguments that match custom or standard procedure names as
function tokens for semantic highlighting. This applies the same visual
highlighting as calls but does not treat the literal as executable Tcl. Previously
such braced stored-proc names were not highlighted.
Accept "INVALID" as a valid token in the CATEGORY grammar rule (both the initial
and repeated entries). Also compacted several JSON objects (pattern includes
and "captures" entries) in syntaxes/cdl.tmLanguage.json; these formatting
changes are non-functional.
Record parameters marked with "TOGGLE Off" by adding an optional
toggleOffParameterNames field and including an extra <var>_defined global
for each such parameter in createCdlEventHandlerSnippet.
To support this, the parser was changed from a brace-delta approach to a
token-based scanner so nesting and the association between a PARAM and its
TOGGLE can be tracked reliably. Added unit tests that verify detection,
case-insensitivity, and ignoring TOGGLE occurrences inside comments/strings
or other events.
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.
This adds tooling to statically extract Tcl variable names from syntax
trees without evaluating substitutions, enabling better completions
for array elements and plain variables. The new helpers are wired
into the completion and navigation flows and are supported by tests
covering array keys and substitutions.
- Introduce variable_names.py with variable_name() and array_key_parts()
- Wire static name extraction into completion and symbol indexing
- Add tests for array key completion with substitutions