Index PSC scripts and add TclOO cross-file navigation/completions; handle CDL TOGGLE Off #40
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/40/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 set adds cross-file TclOO/PSC indexing and navigation/completion support, plus a small CDL event-handler improvement and a few editor/test-path updates.
Summary
Server: index PSC scripts and share TclOO class metadata across files
*.pscalongside*.tcl(createFileSystemWatcher("**/*.{tcl,psc}")) and refreshes the PSC index when.pscfiles change (did_change_watched_files->_refresh_psc_index).LSP_SERVER.refresh_psc_scripts(roots, report=log_warning)to rebuild PSC script metadata.class_snapshot(document.path)is passed intotcloo_completions,method_signature_help,InlayHintGenerator, andhl(highlighter) calls. This enables completions, signature help, and go-to-definition to resolve classes/methods defined in indexed PSC/Tcl files across the workspace.goto_definitionfirst attempts to resolve TclOO declarations viatcloo_definition(document.source, document.uri, params.position, LSP_SERVER.class_snapshot(document.path))and returns that location when found before falling back to the symbol index.CDL event handler: detect "TOGGLE Off" and emit *_defined globals
cdlEventHandlerAtLine) now tokenizes event body braces and tracks PARAM entries and their TOGGLE tokens. When aTOGGLE Offappears for a parameter, that parameter name is recorded intoggleOffParameterNames.createCdlEventHandlerSnippetuses that information to include both the MOM variable and an additional<var>_definedglobal when a parameter hadTOGGLE Off.TOGGLE Offproduced only the MOM variable in the generated snippet; now the snippet also supplies<variable>_defined.Minor editor/test-path and docs updates
.vscode/launch.jsonand.gitignorewere updated to referencetest/postprocessorinstead oftest/test.tcland to ignore/test/postprocessor/.README.mdandCHANGELOG.mdwere updated to mention the PSC/TclOO indexing and Go-to-definition support.INVALIDforTYPEcompletions (categories = ["MILL", "LATHE", "DRILL", "INVALID"]).Notes about scope and why it matters
.pscindexing, a refresh path for PSC changes, and plumbingclass_snapshot(document.path)through the completion/signature/highlight/definition code.TOGGLE Offis present for a PARAM.Testing
No test execution results were provided.
Recommended focused checks for a reviewer or QA:
PSC/TclOO cross-file checks
.tclfile referenced by a PSC layer) in a workspace folder different from the current file..pscfile and confirm the server refreshes the PSC index (file watcher should trigger_refresh_psc_index).CDL event handler checks
PARAMand includeTOGGLE Offfor that parameter.<var>_definedglobals are produced.Misc checks
TYPEsuggestsINVALID.launch.jsonnow points totest/postprocessor).Compatibility / reviewer notes
.pscas an indexed script type; repository watchers and index refresh logic were added to handle.pscchanges. Reviewers should confirm this is expected for any workspace that uses PSC layer scripts.If you want, I can list the exact code paths where
class_snapshotis passed through (completion, signature help, inlay hints, semantic highlighting, goto-definition) or point to the specific files changed for a quick scan.