Treat ] before dot like ) in QuickParse completion#19934
Conversation
Tests fail on current code: 'a.[0].Data.' wrongly returns QualifyingIdents=[\"Data\"]. Sprint 02 will apply the one-char fix in QuickParse.fs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Completion on 'a.[0].Data.', 'a[0].Data.', '[1;2].Length.' previously fed 'Data'/'Length' back as a qualifying ident, producing unrelated global completions. Extending the existing ')' special case at QuickParse.fs:410 to also include ']' makes the completer fall back to expression-typings, matching the behaviour for 'f(x).Name.'. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
❗ Release notes requiredYou can open this PR in browser to add release notes: open in github.dev
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
T-Gro
left a comment
There was a problem hiding this comment.
Review: Approve ✅
Clean, minimal fix with good test coverage.
Code change: The one-line addition || lineStr[pos - 1] = ']' is the correct analog of the existing ')' check. When the character before a trigger-dot is ] (closing an indexer expression), the token sequence is an expression tail, not part of a qualifying long-ident. The throwAwayNext = true discard logic is exactly what's needed.
Tests: Good theory-based coverage — positive cases for ] (legacy explicit-dot, modern indexer, list literal, nested), regression guard for existing ) handling, and negative cases verifying plain long identifiers aren't over-discarded.
Minor suggestion (non-blocking): The comment on lines 411–414 could mention the ] case alongside someCall(args).Name (e.g. add a.[0].Data.Name) to match the now-broader condition, but this is cosmetic.
Release notes: Well-phrased with correct issue/PR links.
Fixes #4966
a.[0].Data.,a[0].Data.,[1;2].Length.now trigger expression-typingsinstead of incorrectly feeding
Data/Lengthback as qualifying idents.