Commit Graph
307 Commits
Author SHA1 Message Date
Christoph a1eccf90f4 Merge pull request 'Complete BLOCK_LIST/ADDR_LIST completions and format comment spacing' (#45) from dynamic_snippets into main
build_and_puplish.yml / build_and_publish (release) Successful in 29s
2026.9.700
2026-09-24 12:27:55 +00:00
Christoph da9091fa38 feat: complete BLOCK_LIST/ADDR_LIST keywords and space comments
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.
2026-09-24 13:57:19 +02:00
Christoph 439c700226 Update version to 2026.9.600 2026-09-24 05:57:44 +00:00
Christoph fa13531668 Merge pull request 'Add persistent index, incremental reparse, and .def language support' (#44) from performance into main
build_and_puplish.yml / build_and_publish (release) Successful in 34s
2026.9.600
2026-09-24 05:54:10 +00:00
Christoph 4f11ed7ecf chore(vscode): add Linux debug launch configurations and tasks, update lockfile 2026-09-24 07:53:15 +02:00
Christoph c1355970bf test(server): add tests for .def completions and uplevel formatting 2026-09-24 07:53:15 +02:00
Christoph 3167c18bea fix(server/debug): robust debugpy attach with bounded wait and tests update 2026-09-24 07:53:15 +02:00
Christoph 0666a87d15 feat(client/server): watch .def files in the client file watcher 2026-09-24 07:53:15 +02:00
Christoph ca7c23a0f6 feat(tools/parser): parse uplevel bodies for formatting and linting 2026-09-24 07:53:15 +02:00
Christoph 5d23df8da7 feat(server/lsp_server): include .def file changes and offer quoted def/variable completions 2026-09-24 07:53:15 +02:00
Christoph de310a6604 feat(tools/tcl_command_completion): support def symbols and value completions 2026-09-24 07:53:15 +02:00
Christoph abf32a5e50 feat(server/lsp_tclserver): index .def symbols and provide completion items 2026-09-24 07:53:15 +02:00
Christoph aa0780dd51 feat(tools/file_sourcing): read PSC DefinedEvents and expose .def resolution 2026-09-24 07:53:15 +02:00
Christoph b2656599b2 feat(tools/def_symbols): add parser for .def block templates and addresses 2026-09-24 07:53:15 +02:00
Christoph Brandau 01e8670cc1 feat(indexing): add persistent index cache and incremental reparse
- 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.
2026-09-23 13:20:09 +02:00
Christoph Brandau b2e6e9d250 perf(server): avoid unnecessary reparses and cache navigation definitions
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.
2026-09-23 12:04:36 +02:00
Christoph d9d619c1dc Update version to 2026.9.501 2026-09-21 19:14:25 +00:00
Christoph b6228503fc Merge pull request 'Highlight braced stored-proc names in lappend arguments' (#42) from #41 into main
build_and_puplish.yml / build_and_publish (release) Successful in 32s
2026.9.501
2026-09-21 19:13:31 +00:00
Christoph Brandau 4de05caac7 fix(semantic_tokens): highlight braced stored-proc names in lappend
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.
2026-09-21 21:12:47 +02:00
Christoph 5c3ebc4c82 Update version to 2026.9.500 2026-09-21 18:54:48 +00:00
Christoph 5e5c7dcc42 Merge pull request 'Index PSC scripts and add TclOO cross-file navigation/completions; handle CDL TOGGLE Off' (#40) from add_class_support into main
build_and_puplish.yml / build_and_publish (release) Successful in 38s
2026.9.500
2026-09-21 18:53:52 +00:00
Christoph Brandau 84821d2852 feat(cdl): allow INVALID in CATEGORY pattern
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.
2026-09-21 20:52:53 +02:00
Christoph Brandau 547da644ce feat(cdlEventHandler): detect TOGGLE Off and emit *_defined globals
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.
2026-09-21 20:51:02 +02:00
Christoph Brandau 757b885f28 feat(server): index PSC scripts and provide cross-file TclOO navigation/completions
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.
2026-09-21 20:47:51 +02:00
Christoph 3762a01d40 Update version to 2026.9.400 2026-09-11 21:40:33 +00:00
Christoph 91b86f29cb Merge pull request 'Add TclOO class completions, signature help and inlay hints' (#39) from add_class_support into main
build_and_puplish.yml / build_and_publish (release) Successful in 39s
2026.9.400
2026-09-11 21:39:34 +00:00
Christoph Brandau f88a50d4ab feat(tcloo): add document-local TclOO completions, signature help and hints
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.
2026-09-11 23:38:42 +02:00
Christoph c28836933c Update version to 2026.9.300 2026-09-10 08:31:25 +00:00
Christoph 91c8c4aff3 Merge pull request 'Check Array Paramter' (#38) from #150 into main
build_and_puplish.yml / build_and_publish (release) Successful in 34s
2026.9.300
2026-09-10 08:29:22 +00:00
Christoph Brandau d8611d7aea feat(tcl): add static variable name extraction and array key completion
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
2026-09-10 09:07:18 +02:00
Christoph Brandau 7e9a4359cd feat(cdl): include args in generated event handler snippet
The generated event handler snippet now declares the proc with an args block.
This enables parameters to be referenced within the handler body.
The change makes the snippet compatible with events that pass arguments.

- Include an args block in the proc declaration for event handlers.
2026-09-10 08:45:25 +02:00
Christoph b7f28ab1a3 Update version to 2026.9.220 2026-09-08 19:22:31 +00:00
Christoph 9b368ba761 Merge pull request 'fix(completion): scan nested commands in unfinished braced args' (#37) from #36 into main
build_and_puplish.yml / build_and_publish (release) Successful in 34s
Reviewed-on: #37
2026.9.220
2026-09-08 19:21:49 +00:00
Christoph 82e13cf7ce fix(completion): scan nested commands in unfinished braced args
Make the completion parser inspect nested command segments when an
unfinished braced argument is the active context, instead of treating the
entire braced body as opaque. This resolves cases where inner commands
(e.g. command substitutions) were ignored and improves suggestion
accuracy. Tests were added to cover nested commands inside braced
conditions and to ensure closed braced arguments do not change context.
Also add Linux-specific launch and task configurations to IDE settings
to simplify local extension development and debugging.

- Recursively scan inner context when a braced body is unfinished
- Add tests for nested commands and closed-brace behavior
- Add Linux launch/task entries for easier development
2026-09-08 21:16:58 +02:00
Christoph d104906508 Update version to 2026.9.210 2026-09-04 11:46:55 +00:00
Christoph a5ff3b55ff Merge pull request 'feat(syntax): add escaped-quoted-strings token to def syntax' (#35) from new_completions into main
build_and_puplish.yml / build_and_publish (release) Successful in 7m35s
Reviewed-on: #35
2026.9.210
2026-09-04 11:39:08 +00:00
Christoph Brandau 26225eb8ed feat(syntax): add escaped-quoted-strings token to def syntax
Introduces an escaped-quoted-strings pattern for the def syntax.
It enables proper highlighting of strings with escapes and vars.
The change adds the new pattern to the syntax and fixes the EOF newline.

- Adds escaped-quoted-strings for escapes and embedded vars
- Registers new pattern in repository for proper highlighting
- Ensures trailing newline in the file
2026-09-04 08:39:46 +02:00
Christoph 844138b383 Update version to 2026.9.200
build_and_puplish.yml / build_and_publish (release) Canceled after 33s
2026-09-03 08:39:22 +00:00
Christoph d7eb72f417 Merge pull request 'New completions' (#34) from new_completions into main
build_and_puplish.yml / build_and_publish (release) Successful in 27s
Reviewed-on: #34
2026.9.200
2026-09-03 08:36:00 +00:00
Christoph Brandau af5acfc946 feat(tcl): add dynamic argument completion and snippets
The changes add dynamic, semantic argument completion for Tcl
commands and snippet support.

- Introduces DynamicCompletionKind, TclArgumentCompletion, and dynamic rules
  for Tcl to provide variable, procedure, namespace, and path suggestions.
- Adds snippet-backed commands and arguments for Tcl blocks and paths.
- Refactors tcl_argument_completion and updates the LSP to use dynamic path,
  variable, and namespace completions with snippet kinds.
2026-09-03 10:35:39 +02:00
Christoph Brandau 20f76b6a20 feat(lsp): add Tcl command-aware completion and integration
- Introduced a Tcl command-aware completion engine and wired to LSP.
- Added a new module with Tcl commands, options, and contextual matching.
- Updated completion to favor command-aware items and args.
2026-09-03 10:17:16 +02:00
Christoph 081b488fe3 Update version to 2026.9.100 2026-09-03 07:38:12 +00:00
Christoph b37eea43d9 Merge pull request 'New features' (#33) from new_features into main
build_and_puplish.yml / build_and_publish (release) Successful in 34s
Reviewed-on: #33
2026.9.100
2026-09-03 07:37:09 +00:00
Christoph Brandau 89add18273 feat(lsp): add context-aware completion ranking and document highlights
Adds context-aware completion ranking and document highlights for Tcl.
Adds completion_context to distinguish variables and commands.
Wires per-file completion snapshots and ranking into the flow.
Adds document_highlight provider support and tests for highlights.

- Context-aware ranking of completion items using per-file snapshots
- Document highlight provider wired into initialization and tests
- Tests for completion context, ranking, and document highlights
2026-09-03 09:19:50 +02:00
Christoph e47c3bda69 Merge pull request 'Update pygls' (#32) from update_pygls into main
Reviewed-on: #32
2026-09-03 06:52:54 +00:00
Christoph Brandau 41d117fe2c feat(lsp): add call hierarchy support for TCL and MOM
Adds LSP call hierarchy support for TCL procedures and MOM events.
A symbol index and identity logic underpin incoming and outgoing calls.
LSP call hierarchy features are wired and changelog/README updated.

- Implement data encoding for call hierarchy items and identity restoration
- Wire LSP server to expose prepare_call_hierarchy, incoming_calls, and outgoing_calls
- Add tests for cross-file calls and edge cases
2026-09-03 08:52:03 +02:00
Christoph Brandau 53ebc5d055 chore(lsprotocol): migrate to 2025.0.0 and cleanup artifacts
The changes align the project with the 2025.0.0 lsprotocol
release, removing the old backport and updating type hints
in the protocol hooks to use Sequence where appropriate. The
dist-info and packaging metadata for older lsprotocol
versions are replaced with the new 2025.0.0 artifacts.

- Remove exceptiongroup backport used on Python <3.11
- Use Sequence instead of List in LS protocol hooks
- Replace old dist-info with 2025.0.0 metadata
2026-09-03 08:39:12 +02:00
Christoph Brandau a0a0d38fe5 docs(readme): remove development/debugging section and license note
This change removes outdated development and debugging guidance
from the README and streamlines the licensing note. It also deletes
the embedded debugger license file and relies on the main LICENSE
file for terms.

- Remove outdated debugging guidance from README
- Delete embedded debugger license file and rely on LICENSE
2026-09-03 07:49:10 +02:00
Christoph 52b81b3dcf Update version to 2026.8.300 2026-08-28 20:42:34 +00:00
Christoph Brandau c3d5116885 feat(debugger): integrate NX Tcl Remote Debugger into NX Postprocessor
build_and_puplish.yml / build_and_publish (release) Successful in 35s
Embed the NX Tcl Remote Debugger into the NX Postprocessor extension.
Add a new debugging client, protocol, and adapter logic to
drive attach/launch, breakpoints, stepping, and evaluation
via the runtime adapter.

- Introduced a client debugger with a new adapter and protocol
- Wired attach/launch, breakpoints, stepping, and evaluation
- Updated docs and licensing to reflect the embedded debugger
2026.8.300
2026-08-28 22:36:18 +02:00