Add FORMAT_LIST completion and format preview for Tcl files #70
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
state: Done
state: New
type: Bug
type: Feature
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Christoph/nx_post_support!70
Loading…
Reference in a new issue
No description provided.
Delete branch "format-list"
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?
Summary
This change introduces a
FORMAT_LISTcompletion keyword for Tcl files and adds hover/markdown previews for FORMAT declarations. Typing or selectingFORMAT_LISTlists all FORMAT names from loaded .def documents; the completion detail shows the unquoted FORMAT specification and the source filename, and resolving a selected item produces a Markdown description with example values.Key changes
Completion
FORMAT_LISTtoSYMBOL_LIST_KEYWORDSso the keyword appears alongsideBLOCK_LISTandADDR_LIST.TclLanguageServer.format_items()which returns completion items for FORMAT declarations. Each item:label,CompletionItemKind.TypeParameteraskind,detailto the unquotedFORMATspecification plus the.deffilename (seeunquoteusage),datato{ "def": [FORMAT, declaration.name] }so the item can be resolved to its definition.FORMAT_LIST(in addition toBLOCK_LIST/ADDR_LIST)."Tcode"and an edit range).Completion resolve / hover
on_completion_resolvenow recognizes FORMAT items (based on theFORMATtag) and callsdef_format_markdown(...)to build a Markdown description with example values, instead of the block/address hover.def_format_markdownwas added intools/def_navigation.pythat delegates to the existing_format_markdownimplementation.Tests and docs
server/tests/python_tests/test_def_symbols.py:test_format_list_shows_all_formats_with_previewverifies listing, details, insertion edit, and resolved markdown content.test_format_list_prefix_offers_keywordverifies theFORMAT_LISTkeyword appears while typing a prefix.README.mdandCHANGELOG.mdto documentFORMAT_LIST.Files touched (high-level)
server/src/lsp_server.py,server/src/lsp_tclserver.pyserver/src/tools/def_navigation.pyserver/tests/python_tests/test_def_symbols.pyREADME.md,CHANGELOG.mdTesting
No test execution results were provided.
Recommended checks for reviewers:
service.defin the workspace, then:FORMAT_LIST(or a prefix likeFORM) and confirm the completion shows format names.Notes for reviewer
_format_markdown) and only adds a small wrapper and completion plumbing.TclLanguageServer.format_items()for howdetailis constructed andon_completion_resolvefor the FORMAT dispatch.