Skip to content

Attributes not included in the range of the parent node #11486

@nojaf

Description

@nojaf

Following up on previous AST related issues.
I still found some constructs where the range of the attributes is not included in the parent node.

[<Foo>] // SynModuleDecl.Let / SynBinding
let a = 0

[<Foo2>] // SynTypeDefn
type Bar =
    [<Foo4>] // SynMemberDefn.LetBindings / SynBinding
    let x = 8
    [<Foo2>]  // SynMemberDefn.Member / SynBinding
    member this.Something () = ()

[<Foo5>] // SynModuleDecl.NestedModule
module Nested =
    ()

See AST Viewer.

Expected behaviour

Attributes are included.

Actual behaviour

They are not.

Known workarounds

Parse the tree to construct a correct range.

Related information

FCS 39.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions