Uh oh!
There was an error while loading. Please reload this page.
Pass only narrow terminal-identifier range from name resolution - #19818
Conversation
|
45a6bcf to
4f5da6fCompareT-Gro
commented
May 28, 2026
(this adds on a recent PR, release notes were part of it already) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This is unexpected change and adds inconsistency with the breakpoints that tooling uses. We should try to keep the debugger info as is here. I think sequence points should use the whole expression ranges? Or do they rely on typed tree ranges that are now narrowed down? |
T-Gro
commented
May 28, 2026
@auduchinok : It comes from the range on When stepping, why do you think it's wrong to highlight only the narrow item? Or is there another concern? |
auduchinok
commented
May 28, 2026
The debugger sequence points normally cover the whole "statements" that include complete calls, arguments, and so on. Narrowing it here would create inconsistency in debugger experience. It would also be inconsistent with breakpoint ranges we provide in the tooling.
A guess: could it be because |
T-Gro
commented
May 28, 2026
The narrowing only strips module/namespace/type prefixes from the sequence point:
But System.Console.WriteLine("hello") still gets a sequence point covering the entire call including "hello", because mWholeExpr unions the method range with the argument ranges. So I think OK? |
I really think we should not change sequence point ranges. I think we have to stay consistent with the rest of the language and C# and other languages debugging experience. Unfortunately, it seems we have to pass the two ranges to places like |
auduchinok
commented
May 28, 2026
I also think we should keep the typed tree ranges closer to the syntax tree, so if some IDE feature work with this tree, they could also rely on these ranges. And we've been working hard on making syntax tree ranges correct 🙂 |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Simplifies the type-checking pipeline by removing the wide (module-qualified)
range from resolved-item returns. Only the narrow terminal-identifier range
flows through TcItemThen and downstream functions.
Affected features: error/warning squiggles now point at the member name
(e.g. 'Member') rather than the full qualified path ('Module.Member').
IDE hover, go-to-definition, and find-all-references use the narrow range
from NameResolution sinks (unchanged). No impact on IL emission or
binary compatibility — all changed APIs are internal.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>Revert to pre-#19505 patterns: use '_ as res' in TcNameOfExpr and pass-through binding in TcLongIdentThen instead of destructuring and reconstructing the 5-tuple. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ow mItemIdent for diagnostics Restore itemRange (wide) alongside itemIdentRange (narrow) in name resolution return tuples. Thread mItemIdent through all TcItemThen handlers for attribute checks, error messages, and diagnostic squigglies while keeping mItem for expression construction and PDB sequence points. Revert test baselines for type unification and expression-range diagnostics to their original wide ranges. Update baselines for property/field access errors and other handler-specific diagnostics to their new narrow ranges. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- CheckRecdFieldMutation in static field path: mItem -> mItemIdent (parity with instance path) - nonStandardEventError in TcEventItemThen: mItem -> mItemIdent (parity with sibling event diagnostics) - Restore section comments in TcLookupItemThen for scanability Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Rename mDiag -> mItemIdent in ApplyUnionCaseOrExn for naming consistency - Add clarifying comment at m m call site in TcUnionCaseOrExnField - Restore explanatory comments for duplicate diagnostics in OverloadResolutionErrorRangeTests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
auduchinok
commented
Jun 2, 2026
Thanks! |
The fsharp suite migrated tests (neg10, neg15, neg17, neg90, neg91) use .bsl baselines that were not updated for the narrowed mItemIdent ranges. - neg10: Property 'not readable' diagnostics now point at property name - neg15: Union case/field access errors point at terminal identifier - neg17: Union case type accessibility error points at case name - neg90: RequireQualifiedAccess deprecation points at case name - neg91: Value accessibility/obsolete errors on assignment point at value Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…omment cleanup - Rename synTypeLeadingIdentRange -> synTypeTerminalIdentRange and return the terminal identifier's range (per #19818), so qualified type names are not over-painted; trim its docstring. - UnusedOpens.recordByDeclaringEntity: also record FSharpField declaring entities, so 'open type' whose imported member is a static field (e.g. System.Math.PI) is no longer flagged unused. Add a regression test. - Trim verbose semantic-classification comments and drop VS-specific wording. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Narrow diagnostic ranges to terminal identifiers
Follow-up to #19505 per review feedback.
Diagnostic ranges narrowed to terminal identifiers. Error/warning squiggles now point at the member name (
Red) rather than the full qualified path (Color.Red). The narrow range is computed once inComputeItemRangeand threaded asmItemIdentthrough allTc*ItemThenhandlers.TypedTree expression ranges preserved. Expression construction, type unification, PDB sequence points and debug stepping continue to use the wide
mItemrange — unaffected.Only code with qualified identifiers (
Module.Member,obj.Property,Namespace.Type.Member) sees narrower squiggles. Single-identifier code is unchanged.Unchanged: IDE hover · go-to-definition · find-all-references · IL emission · PDB sequence points · binary compatibility. No new/removed diagnostics, no severity changes.
Baseline changes — 24 ranges across 8 test files
All strictly narrower (start column shifts right, end column unchanged):
rec.fieldr1.foo→fooobj.Propertythis.GetInit→GetInitType.MemberColor.Red→RedClass.FieldClass.ObsoleteField→ObsoleteFieldClass.EventClass.ObsoleteEvent→ObsoleteEvent_.id(dot-lambda)_.id→idM.Svc.OldMethodOldMethod