SynPat.Named(range=range) -> range doesn't include accessibility modifier (public, internal,public)
Repro steps
let private value = 42
// ^^^^^^^^^^^^^ SynPat.Named(ident="value"; accessibility=Some(Private))
// ^^^^^ range of SynPat.Named
Ast:
Named(
SynIdent (value, None),
false,
Some Private,
tmp.fsx (1,12-1,17)
)
-> Range covers columns 12 to 17 -> just value but not private
Expected behavior
Range of SynPat.Named includes private
Actual behavior
Range just covers identifier
Known workarounds
None?
SynAccess doesn't provide its range -> cannot combine ranges of elements inside SynPat.Named to get full range.
Maybe possible to infer by looking at parent and its SynPat.Named hole?
Or via source text: extract word in front of Named/its ident
Related information
SynPat.LongIdent includes SynAccess range:
let (private Some _) = None
// ^^^^^^^^^^^^^^ SynPat.LongIdent
// ^^^^^^^^^^^^^^ range of SynPat.LongIdent
(AST)
dotnet --version: 6.0.202
- FCS:
41.0.4-preview.22181.2 & 41.0.3 & current dotnet/fsharp main branch (91fb779)
SynPat.Named(range=range)-> range doesn't includeaccessibilitymodifier (public,internal,public)Repro steps
Ast:
-> Range covers columns
12to17-> justvaluebut notprivateExpected behavior
Range of
SynPat.NamedincludesprivateActual behavior
Range just covers identifier
Known workarounds
None?
SynAccessdoesn't provide its range -> cannot combine ranges of elements insideSynPat.Namedto get full range.Maybe possible to infer by looking at parent and its
SynPat.Namedhole?Or via source text: extract word in front of
Named/its identRelated information
SynPat.LongIdentincludesSynAccessrange:(AST)
dotnet --version:6.0.20241.0.4-preview.22181.2&41.0.3& currentdotnet/fsharpmainbranch (91fb779)