Skip to content

Treat ] before dot like ) in QuickParse completion#19934

Open
T-Gro wants to merge 3 commits into
mainfrom
fix/issue-4966
Open

Treat ] before dot like ) in QuickParse completion#19934
T-Gro wants to merge 3 commits into
mainfrom
fix/issue-4966

Conversation

@T-Gro

@T-Gro T-Gro commented Jun 11, 2026

Copy link
Copy Markdown
Member

Fixes #4966

a.[0].Data., a[0].Data., [1;2].Length. now trigger expression-typings
instead of incorrectly feeding Data/Length back as qualifying idents.

Copilot and others added 2 commits June 11, 2026 08:07
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>
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

❗ Release notes required

You can open this PR in browser to add release notes: open in github.dev


✅ Found changes and release notes in following paths:

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/11.0.100.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the AI-Tooling-Check-Bypassed Tooling check: non-fork PR, not diff-analyzed label Jun 11, 2026

@T-Gro T-Gro left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@T-Gro T-Gro added the AI-reviewed PR reviewed by AI review council label Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-reviewed PR reviewed by AI review council AI-Tooling-Check-Bypassed Tooling check: non-fork PR, not diff-analyzed

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

autocomplete gives wrong completion on dot on generic type

1 participant