Add persistent index, incremental reparse, and .def language support #44
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/44/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This change adds persistent workspace indexing, incremental reparsing of edited documents, and first-class support for .def files in the client and server. It also hardens the debugpy attach logic for the Python debug helper and adds Linux-focused VS Code launch/tasks to work around js-debug attach probing.
Summary of important behavior changes
Client
**/*.{tcl,psc,def}(was{tcl,psc}) so .def file changes are observed by the server.indexCachePath(when available) so the server can persist its index cache between restarts.Server / indexing
IndexCache(load/save) and wires it into background indexing. The cache is loaded duringinitializedand saved at the end of background indexing._last_parse) so the server can reparse only the edited parts of a document when possible instead of reparsing whole files.may_contain_classesgates class/method highlighting) so some flows skip work when the file contents or class information make it irrelevant..def files and completions
tools/def_symbolsparser to read BLOCK_TEMPLATE/ADDRESS/value candidates from .def files and exposes them to the server.def_symbols) for use in completions..defsymbol completions and variable candidates for argument contexts where a .def name or a variable is allowed. A helper_quoted_itemproduces insert edits that insert quoted strings or replace already-typed quotes.Debug helper and VS Code configurations
server/src/_debug_server.py) no longer loops retryingdebugpy.connect. Instead it attempts a single connect in a background thread and bounds the wait withjoin(timeout). The helper prints a clear error and exits (os._exit(1)) when a stale adapter accepts connections but never attaches, or when no listener is present.127.0.0.1:9333and a variant that setsUSE_DEBUGPY/NXPS_DEBUG_HOST/NXPS_DEBUG_PORTto make it easier to attach both the extension host and debugpy on Linux where js-debug probeslocalhostand::1in parallel.Miscellaneous
package-lock.jsonversion..defcompletions, uplevel formatting, and for the debugpy attach behavior (tests changed/added in the diff). No test execution output is included in this change.Testing
.defcompletions and uplevel formatting; debug-related tests updated. No test execution results were provided.Recommended quick checks for reviewers
indexCachePath(the client usescontext.storageUri?.fsPath)..deffile and confirm the server refreshes def symbols (watcher triggered) and completion requests in affected TCL files return.def-derived candidates. Also verify quoted insertion behavior for name arguments.127.0.0.1:9333and the Python debug helper on127.0.0.1:5678to exercise the new debug helper behavior.Compatibility, migration, and reviewer notes
indexCachePathonly whencontext.storageUriexists. Workspaces without storage will continue to operate without persistence.indexCachePath. Reviewers should consider whether the storage location and lifecycle are acceptable for the extension's persisted files.If you want, I can point to specific changed files for each area (e.g.
server/src/lsp_server.py,server/src/lsp_tclserver.py,server/src/_debug_server.py,client/src/common/server.ts,.vscode/launch.json,.vscode/tasks.json, andtools/def_symbols.py) to help review particular implementations.