Complete BLOCK_LIST/ADDR_LIST completions and format comment spacing #45
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/45/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 editor completion for the special keywords
BLOCK_LISTandADDR_LISTand tweaks comment formatting to ensure a space after a single#when appropriate.The primary user-visible outcomes:
LSP completion behavior for symbol-list keywords
BLOCK_Lnow offers theBLOCK_LISTkeyword as an incomplete completion item that triggers further suggestions (it useseditor.action.triggerSuggest).BLOCK_LIST, addresses forADDR_LIST).filter_textprefixed with the keyword (e.g.BLOCK_LIST"steady_rest") so suggesting the keyword remains visible while additional typing narrows the list.$BLOCK_LIST) or other word contexts (e.g.MY_BLOCK_LISTor plainsteady)._symbol_list_completion(...)and integration points inon_completionand_on_completioninserver/src/lsp_server.py. The file importsline_prefix_at_positionand uses a small regex to detect the word before the cursor.Comment formatting
NxFormatter.format_comment(inserver/src/tools/formatter.py) now inserts a single space after a#for comments like#Comment→# Comment, while leaving#,##...separators,#!shebang-like comments, and comments that already start with whitespace unchanged. Inline comments after code (set x 1 ;#inline) are likewise formatted to;# inline.Files touched (high-level):
server/src/lsp_server.py: add_symbol_list_completion, integrate with completion flow, and merge symbol-list items when suggestions are re-requested.server/src/tools/formatter.py: addformat_commenttoNxFormatter.server/tests/python_tests/:test_def_symbols.py: new tests forBLOCK_LIST/ADDR_LISTcompletion behavior.test_formatter.py: renamed fromtest_format_uplevel.pyand extended withtest_comment_gets_space_after_hash.Testing
No test execution results were provided.
Recommended checks for reviewers:
server/tests/python_tests/(e.g.pytest server/tests/python_tests/ -k def_symbolsand-k formatter) to exercise the new tests locally.BLOCK_Land confirm the completion list showsBLOCK_LISTas an incomplete item and that selecting or continuing typing triggers the full list.BLOCK_LIST(orADDR_LIST) in a call site and confirm the completions are the quoted names (e.g."steady_rest","SPOS") and that the replacement inserts quotes.#Commentbecome# Commentand that## heading,#\tTabbed,#, and#!somethingremain unchanged.Compatibility / Risk notes
LSP_SERVER.block_template_items()andLSP_SERVER.address_items()to return the available names; reviewers should confirm these functions behave as expected in the running environment.If you want I can point to the specific changed blocks in
lsp_server.pyandformatter.pyfor a targeted review of the new helpers and their interaction with existing completion ranking logic.