Lint redundant implied clauses (e.g. default moving) in the LSP #64

Open
opened 2026-07-04 21:21:55 +00:00 by toph · 0 comments
Owner

Statements often carry a clause that is already the default, so it adds noise without changing behavior. The clearest case: @map .c onto .b moving .cmoving .c is the default (folding the mapped side is implied for map point onto …), verified byte-identical FOLD with and without it. Same shape for mountain vs the valley default, and any future implied selectors (e.g. toward when there is a single solution).

An LSP diagnostic (hint severity) could flag these and offer a "remove redundant clause" quick-fix: if the written clause equals the value the evaluator would infer by default, it is redundant. Needs the evaluator's default-resolution reachable from the LSP.

Scope: diagnostics + quick-fix only; language semantics unchanged. Related: #42 / #60 (live preview), #58 (LSP stub).

For discussion — not urgent.

Statements often carry a clause that is already the default, so it adds noise without changing behavior. The clearest case: `@map .c onto .b moving .c` — `moving .c` is the default (folding the mapped side is implied for `map point onto …`), verified byte-identical FOLD with and without it. Same shape for `mountain` vs the valley default, and any future implied selectors (e.g. `toward` when there is a single solution). An LSP diagnostic (hint severity) could flag these and offer a "remove redundant clause" quick-fix: if the written clause equals the value the evaluator would infer by default, it is redundant. Needs the evaluator's default-resolution reachable from the LSP. Scope: diagnostics + quick-fix only; language semantics unchanged. Related: #42 / #60 (live preview), #58 (LSP stub). For discussion — not urgent.
Sign in to join this conversation.
No labels
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
toph/beloch#64
No description provided.