Include buffer, marker and placement in event DocumentSymbol detail #77

Merged
Christoph merged 1 commit from 73-buffer-information-in-outline-view into main 2026-10-14 20:36:57 +00:00
Owner

This change updates the document symbol builder so Event symbols include the buffer, marker and any placement information in the detail field rather than only the tag. Parsing regexes were extended to capture optional buffer/marker on the event start line and placement text on the close/name line; the composed detail shows those values formatted and abbreviated when appropriate.

Key changes

  • EVENT_START_RE now optionally captures two tokens after the edit tag; pending_event stores buffer and marker from those groups.
  • EVENT_CLOSE_INLINE_RE and EVENT_NAME_LINE_RE now capture trailing placement text so insert events can include placement like before @OUTPUT/after @DECOMPOSEZUL.
  • build_document_symbols composes detail as Event ({edit_type}) plus a target made from buffer and marker separated by › when present. If marker repeats the buffer prefix, the marker is abbreviated with a leading ellipsis (…) to keep the detail concise. If a placement was parsed, it is appended using · {placement}.
  • The symbol name is unchanged (still the tag); buffer/marker/placement are moved into detail for outline clarity.

Tests

Two tests were added to assert the new detail formatting:

  • test_event_detail_includes_buffer_and_marker verifies the buffer and abbreviated marker appear in the detail.
  • test_insert_event_detail_includes_placement verifies placement is appended for insert edits.

No test execution results were provided.

Recommended checks for reviewers:

  1. Run the document symbol tests (e.g. the document_symbols test module) or pytest -k document_symbols and inspect the produced detail strings.
  2. Smoke-check with sample files opened in the LSP server (or call build_document_symbols with the example sources) to confirm formatting and that other symbol kinds are unaffected.

Notes / risk

  • The change narrows details shown in the outline but does not change symbol name or symbol kinds.
  • The regexes were broadened to capture optional trailing tokens; please review the new regexes to ensure they do not unintentionally match other constructs.

Files changed (summary): server/src/tools/document_symbols.py (parsing and detail composition) and server/tests/python_tests/test_document_symbols.py (added tests).

Closes #73

This change updates the document symbol builder so Event symbols include the buffer, marker and any placement information in the `detail` field rather than only the tag. Parsing regexes were extended to capture optional buffer/marker on the event start line and placement text on the close/name line; the composed `detail` shows those values formatted and abbreviated when appropriate. ## Key changes - `EVENT_START_RE` now optionally captures two tokens after the edit tag; `pending_event` stores `buffer` and `marker` from those groups. - `EVENT_CLOSE_INLINE_RE` and `EVENT_NAME_LINE_RE` now capture trailing placement text so insert events can include placement like `before @OUTPUT`/`after @DECOMPOSEZUL`. - `build_document_symbols` composes `detail` as `Event ({edit_type})` plus a target made from `buffer` and `marker` separated by ` › ` when present. If `marker` repeats the `buffer` prefix, the marker is abbreviated with a leading ellipsis (`…`) to keep the detail concise. If a placement was parsed, it is appended using ` · {placement}`. - The symbol `name` is unchanged (still the tag); buffer/marker/placement are moved into `detail` for outline clarity. ## Tests Two tests were added to assert the new detail formatting: - `test_event_detail_includes_buffer_and_marker` verifies the buffer and abbreviated marker appear in the detail. - `test_insert_event_detail_includes_placement` verifies placement is appended for `insert` edits. No test execution results were provided. Recommended checks for reviewers: 1. Run the document symbol tests (e.g. the document_symbols test module) or `pytest -k document_symbols` and inspect the produced `detail` strings. 2. Smoke-check with sample files opened in the LSP server (or call `build_document_symbols` with the example sources) to confirm formatting and that other symbol kinds are unaffected. ## Notes / risk - The change narrows details shown in the outline but does not change symbol `name` or symbol kinds. - The regexes were broadened to capture optional trailing tokens; please review the new regexes to ensure they do not unintentionally match other constructs. Files changed (summary): `server/src/tools/document_symbols.py` (parsing and detail composition) and `server/tests/python_tests/test_document_symbols.py` (added tests). Closes #73
feat(document_symbols): include buffer, marker and placement in Event detail
All checks were successful
Tests / node (pull_request) Successful in 23s
Tests / python (pull_request) Successful in 40s
f9ec67599a
Previously event symbols showed only the tag and edit type. This change extends parsing to capture optional buffer and marker tokens on the LIB_GE_command_buffer_edit line and any trailing placement text after a closing brace. The symbol detail now includes the buffer and marker as "buffer › marker" (marker is abbreviated with a leading ellipsis when it repeats the buffer prefix) and appends placement (e.g. "before @OUTPUT") for insert events.

- broadened regexes to capture buffer/marker and trailing placement
- store buffer/marker on pending_event and build a richer detail string
- added tests to assert buffer/marker formatting and placement inclusion

Fixes #73
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Christoph/nx_post_support!77
No description provided.