dotnet / dotnet/fsharp

Range of empty signature module expends to last comment

Open
#11,382 3 comments 0 reactions 0 assignees View on GitHub
Area-LangService-API Feature Request
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

Please provide a succinct description of the issue.

Consider the following code in a signature file:

```fsharp
module foo

// bar
// baz
```

Matching AST:
```fsharp
SigFile
(ParsedSigFileInput
("tmp.fsi", QualifiedNameOfFile foo, [], [],
[SynModuleOrNamespaceSig
([foo], false, NamedModule, [],
PreXmlDoc ((1,6), FSharp.Compiler.XmlDoc+XmlDocCollector), [], None,
tmp.fsi (1,0--4,6) IsSynthetic=false)]))
```

**Expected behavior**

`SynModuleOrNamespaceSig` should span from line 1 to line 1.

**Actual behavior**

The last comment is included in the range of the `SynModuleOrNamespaceSig`.
This is not the case for the implementation file.

**Known workarounds**

Calculate the range using the name of the module/namespace.

**Related information**

FCS 39.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.