Skip to content

Commit 30bc8f9

Browse files
[main] Source code updates from dotnet/fsharp (#1765)
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
1 parent 273762a commit 30bc8f9

35 files changed

+310
-289
lines changed

src/fsharp/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@
2828
* `SynExprRecordField` now includes a `range` field ([PR #18617](https://github.com/dotnet/fsharp/pull/18617))
2929
* Mark `Range.Zero` as obsolete in favor of `Range.range0` ([PR #18664](https://github.com/dotnet/fsharp/pull/18664))
3030
* Use `Synbinding` to model `and!` ([PR #18805](https://github.com/dotnet/fsharp/pull/18805))
31+
* Redesign #line processing. The original positions (unaffected by #line directives) are now kept in the AST, and `__LINE__` and `__SOURCE_LINE__` show the original line numbers / file names. However, all diagnostics and debug information stays the same (shows the position transformed by the #line directives). ([Issue #18553](https://github.com/dotnet/fsharp/issues/18553), [PR #18699](https://github.com/dotnet/fsharp/pull/18699))
Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,53 @@
1-
<!-- will get filled in the next backflow -->
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
This file is auto-generated by the Maestro dependency flow system.
4+
Do not edit it manually, as it will get overwritten by automation.
5+
This file should be imported by eng/Versions.props
6+
-->
7+
<Project>
8+
<PropertyGroup>
9+
<!-- dotnet/msbuild dependencies -->
10+
<MicrosoftBuildPackageVersion>17.15.0-preview-25278-01</MicrosoftBuildPackageVersion>
11+
<MicrosoftBuildFrameworkPackageVersion>17.15.0-preview-25278-01</MicrosoftBuildFrameworkPackageVersion>
12+
<MicrosoftBuildTasksCorePackageVersion>17.15.0-preview-25278-01</MicrosoftBuildTasksCorePackageVersion>
13+
<MicrosoftBuildUtilitiesCorePackageVersion>17.15.0-preview-25278-01</MicrosoftBuildUtilitiesCorePackageVersion>
14+
<!-- dotnet/runtime dependencies -->
15+
<SystemComponentModelCompositionPackageVersion>9.0.0</SystemComponentModelCompositionPackageVersion>
16+
<SystemCompositionPackageVersion>9.0.0</SystemCompositionPackageVersion>
17+
<SystemCollectionsImmutablePackageVersion>9.0.0</SystemCollectionsImmutablePackageVersion>
18+
<SystemDiagnosticsDiagnosticSourcePackageVersion>9.0.0</SystemDiagnosticsDiagnosticSourcePackageVersion>
19+
<SystemReflectionMetadataPackageVersion>9.0.0</SystemReflectionMetadataPackageVersion>
20+
<SystemThreadingTasksDataflowPackageVersion>9.0.0</SystemThreadingTasksDataflowPackageVersion>
21+
<!-- dotnet/arcade dependencies -->
22+
<MicrosoftDotNetArcadeSdkPackageVersion>10.0.0-beta.25401.2</MicrosoftDotNetArcadeSdkPackageVersion>
23+
<!-- _git/dotnet-optimization dependencies -->
24+
<optimizationlinuxarm64MIBCRuntimePackageVersion>1.0.0-prerelease.25374.3</optimizationlinuxarm64MIBCRuntimePackageVersion>
25+
<optimizationlinuxx64MIBCRuntimePackageVersion>1.0.0-prerelease.25374.3</optimizationlinuxx64MIBCRuntimePackageVersion>
26+
<optimizationwindows_ntarm64MIBCRuntimePackageVersion>1.0.0-prerelease.25374.3</optimizationwindows_ntarm64MIBCRuntimePackageVersion>
27+
<optimizationwindows_ntx64MIBCRuntimePackageVersion>1.0.0-prerelease.25374.3</optimizationwindows_ntx64MIBCRuntimePackageVersion>
28+
<optimizationwindows_ntx86MIBCRuntimePackageVersion>1.0.0-prerelease.25374.3</optimizationwindows_ntx86MIBCRuntimePackageVersion>
29+
</PropertyGroup>
30+
<!--Property group for alternate package version names-->
31+
<PropertyGroup>
32+
<!-- dotnet/msbuild dependencies -->
33+
<MicrosoftBuildVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildVersion>
34+
<MicrosoftBuildFrameworkVersion>$(MicrosoftBuildFrameworkPackageVersion)</MicrosoftBuildFrameworkVersion>
35+
<MicrosoftBuildTasksCoreVersion>$(MicrosoftBuildTasksCorePackageVersion)</MicrosoftBuildTasksCoreVersion>
36+
<MicrosoftBuildUtilitiesCoreVersion>$(MicrosoftBuildUtilitiesCorePackageVersion)</MicrosoftBuildUtilitiesCoreVersion>
37+
<!-- dotnet/runtime dependencies -->
38+
<SystemComponentModelCompositionVersion>$(SystemComponentModelCompositionPackageVersion)</SystemComponentModelCompositionVersion>
39+
<SystemCompositionVersion>$(SystemCompositionPackageVersion)</SystemCompositionVersion>
40+
<SystemCollectionsImmutableVersion>$(SystemCollectionsImmutablePackageVersion)</SystemCollectionsImmutableVersion>
41+
<SystemDiagnosticsDiagnosticSourceVersion>$(SystemDiagnosticsDiagnosticSourcePackageVersion)</SystemDiagnosticsDiagnosticSourceVersion>
42+
<SystemReflectionMetadataVersion>$(SystemReflectionMetadataPackageVersion)</SystemReflectionMetadataVersion>
43+
<SystemThreadingTasksDataflowVersion>$(SystemThreadingTasksDataflowPackageVersion)</SystemThreadingTasksDataflowVersion>
44+
<!-- dotnet/arcade dependencies -->
45+
<MicrosoftDotNetArcadeSdkVersion>$(MicrosoftDotNetArcadeSdkPackageVersion)</MicrosoftDotNetArcadeSdkVersion>
46+
<!-- _git/dotnet-optimization dependencies -->
47+
<optimizationlinuxarm64MIBCRuntimeVersion>$(optimizationlinuxarm64MIBCRuntimePackageVersion)</optimizationlinuxarm64MIBCRuntimeVersion>
48+
<optimizationlinuxx64MIBCRuntimeVersion>$(optimizationlinuxx64MIBCRuntimePackageVersion)</optimizationlinuxx64MIBCRuntimeVersion>
49+
<optimizationwindows_ntarm64MIBCRuntimeVersion>$(optimizationwindows_ntarm64MIBCRuntimePackageVersion)</optimizationwindows_ntarm64MIBCRuntimeVersion>
50+
<optimizationwindows_ntx64MIBCRuntimeVersion>$(optimizationwindows_ntx64MIBCRuntimePackageVersion)</optimizationwindows_ntx64MIBCRuntimeVersion>
51+
<optimizationwindows_ntx86MIBCRuntimeVersion>$(optimizationwindows_ntx86MIBCRuntimePackageVersion)</optimizationwindows_ntx86MIBCRuntimeVersion>
52+
</PropertyGroup>
53+
</Project>

src/fsharp/eng/Version.Details.xml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@
2222
<Uri>https://github.com/dotnet/runtime</Uri>
2323
<Sha>9d5a6a9aa463d6d10b0b0ba6d5982cc82f363dc3</Sha>
2424
</Dependency>
25+
<Dependency Name="System.ComponentModel.Composition" Version="9.0.0">
26+
<Uri>https://github.com/dotnet/runtime</Uri>
27+
<Sha>9d5a6a9aa463d6d10b0b0ba6d5982cc82f363dc3</Sha>
28+
</Dependency>
29+
<Dependency Name="System.Composition" Version="9.0.0">
30+
<Uri>https://github.com/dotnet/runtime</Uri>
31+
<Sha>9d5a6a9aa463d6d10b0b0ba6d5982cc82f363dc3</Sha>
32+
</Dependency>
2533
<Dependency Name="System.Collections.Immutable" Version="9.0.0">
2634
<Uri>https://github.com/dotnet/runtime</Uri>
2735
<Sha>9d5a6a9aa463d6d10b0b0ba6d5982cc82f363dc3</Sha>
@@ -36,9 +44,9 @@
3644
</Dependency>
3745
</ProductDependencies>
3846
<ToolsetDependencies>
39-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.25374.4">
47+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.25401.2">
4048
<Uri>https://github.com/dotnet/arcade</Uri>
41-
<Sha>e2fed65f9c524d12c64876194ae4ce177b935bb3</Sha>
49+
<Sha>40693ae2ee51e447f6ca96d07bc1ba779dcb9b9c</Sha>
4250
</Dependency>
4351
<Dependency Name="optimization.windows_nt-x64.MIBC.Runtime" Version="1.0.0-prerelease.25374.3">
4452
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>

src/fsharp/eng/Versions.props

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<Project>
2+
<Import Project="Version.Details.props" Condition="Exists('Version.Details.props')" />
23
<PropertyGroup>
34
<!-- opt-out properties -->
45
<UsingToolXUnit>false</UsingToolXUnit>
@@ -90,14 +91,7 @@
9091
<!-- System.* packages -->
9192
<!-- If a System.* package is stuck on version 4.3.x, targets .NET Standard 1.x and hasn't been
9293
updated in years, you most likely DON'T need it, please exercise caution when adding it to the list. -->
93-
<SystemPackageVersionVersion>9.0.0</SystemPackageVersionVersion>
94-
<SystemCollectionsImmutableVersion>$(SystemPackageVersionVersion)</SystemCollectionsImmutableVersion>
95-
<SystemComponentModelCompositionVersion>$(SystemPackageVersionVersion)</SystemComponentModelCompositionVersion>
96-
<SystemCompositionVersion>$(SystemPackageVersionVersion)</SystemCompositionVersion>
97-
<SystemDiagnosticsDiagnosticSourceVersion>$(SystemPackageVersionVersion)</SystemDiagnosticsDiagnosticSourceVersion>
9894
<SystemReflectionEmitVersion>4.7.0</SystemReflectionEmitVersion>
99-
<SystemReflectionMetadataVersion>$(SystemPackageVersionVersion)</SystemReflectionMetadataVersion>
100-
<SystemThreadingTasksDataflow>$(SystemPackageVersionVersion)</SystemThreadingTasksDataflow>
10195
<MicrosoftDiaSymReaderPortablePdbVersion>1.6.0</MicrosoftDiaSymReaderPortablePdbVersion>
10296
<!-- Versions for package groups -->
10397
<RoslynVersion>5.0.0-1.25276.102</RoslynVersion>
@@ -106,7 +100,6 @@
106100
<VisualStudioProjectSystemPackagesVersion>17.14.79</VisualStudioProjectSystemPackagesVersion>
107101
<VisualStudioShellProjectsPackages>17.14.40254</VisualStudioShellProjectsPackages>
108102
<MicrosoftVisualStudioThreadingPackagesVersion>17.14.15</MicrosoftVisualStudioThreadingPackagesVersion>
109-
<MicrosoftBuildVersion>17.15.0-preview-25278-01</MicrosoftBuildVersion>
110103
<!-- Roslyn packages -->
111104
<MicrosoftCodeAnalysisFeaturesVersion>$(RoslynVersion)</MicrosoftCodeAnalysisFeaturesVersion>
112105
<MicrosoftCodeAnalysisEditorFeaturesVersion>$(RoslynVersion)</MicrosoftCodeAnalysisEditorFeaturesVersion>
@@ -142,11 +135,6 @@
142135
<MicrosoftVisualStudioShellImmutable110Version>11.0.50727</MicrosoftVisualStudioShellImmutable110Version>
143136
<MicrosoftVisualStudioShellImmutable150Version>15.0.25123-Dev15Preview</MicrosoftVisualStudioShellImmutable150Version>
144137
<!-- -->
145-
<!-- Microsoft Build packages -->
146-
<MicrosoftBuildFrameworkVersion>17.15.0-preview-25278-01</MicrosoftBuildFrameworkVersion>
147-
<MicrosoftBuildTasksCoreVersion>17.15.0-preview-25278-01</MicrosoftBuildTasksCoreVersion>
148-
<MicrosoftBuildUtilitiesCoreVersion>17.15.0-preview-25278-01</MicrosoftBuildUtilitiesCoreVersion>
149-
<!-- -->
150138
<!-- Visual Studio Editor packages -->
151139
<MicrosoftVisualStudioCoreUtilityVersion>$(VisualStudioEditorPackagesVersion)</MicrosoftVisualStudioCoreUtilityVersion>
152140
<MicrosoftVisualStudioEditorVersion>$(VisualStudioEditorPackagesVersion)</MicrosoftVisualStudioEditorVersion>
@@ -192,7 +180,6 @@
192180
<FsCheckVersion>2.16.5</FsCheckVersion>
193181
<FSharpDataTypeProvidersVersion>4.3.0.0</FSharpDataTypeProvidersVersion>
194182
<MicrosoftCompositionVersion>1.0.31</MicrosoftCompositionVersion>
195-
<MicrosoftMSXMLVersion>$(SystemPackageVersionVersion)</MicrosoftMSXMLVersion>
196183
<MicrosoftNetCompilersVersion>4.3.0-1.22220.8</MicrosoftNetCompilersVersion>
197184
<MicrosoftNETCoreAppRefVersion>3.1.0</MicrosoftNETCoreAppRefVersion>
198185
<MicrosoftNETCoreILDAsmVersion>5.0.0-preview.7.20364.11</MicrosoftNETCoreILDAsmVersion>
@@ -207,11 +194,5 @@
207194
<XunitXmlTestLoggerVersion>3.1.17</XunitXmlTestLoggerVersion>
208195
<HumanizerCoreVersion>2.2.0</HumanizerCoreVersion>
209196
<!-- -->
210-
<!-- MIBC profile packages -->
211-
<optimizationwindows_ntx64MIBCRuntimeVersion>1.0.0-prerelease.25374.3</optimizationwindows_ntx64MIBCRuntimeVersion>
212-
<optimizationwindows_ntx86MIBCRuntimeVersion>1.0.0-prerelease.25374.3</optimizationwindows_ntx86MIBCRuntimeVersion>
213-
<optimizationwindows_ntarm64MIBCRuntimeVersion>1.0.0-prerelease.25374.3</optimizationwindows_ntarm64MIBCRuntimeVersion>
214-
<optimizationlinuxx64MIBCRuntimeVersion>1.0.0-prerelease.25374.3</optimizationlinuxx64MIBCRuntimeVersion>
215-
<optimizationlinuxarm64MIBCRuntimeVersion>1.0.0-prerelease.25374.3</optimizationlinuxarm64MIBCRuntimeVersion>
216197
</PropertyGroup>
217198
</Project>

src/fsharp/global.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "10.0.100-preview.5.25277.114",
3+
"version": "10.0.100-preview.7.25322.101",
44
"allowPrerelease": true,
55
"paths": [
66
".dotnet",
@@ -9,7 +9,7 @@
99
"errorMessage": "The .NET SDK could not be found, please run ./eng/common/dotnet.sh."
1010
},
1111
"tools": {
12-
"dotnet": "10.0.100-preview.5.25277.114",
12+
"dotnet": "10.0.100-preview.7.25322.101",
1313
"vs": {
1414
"version": "17.8",
1515
"components": [
@@ -22,7 +22,7 @@
2222
"perl": "5.38.2.2"
2323
},
2424
"msbuild-sdks": {
25-
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25374.4",
25+
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25401.2",
2626
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2"
2727
}
2828
}

src/fsharp/src/Compiler/Checking/PatternMatchCompilation.fs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,11 +1069,12 @@ let CompilePatternBasic
10691069
mkCompGenSequential mMatch e (mkDefault (mMatch, resultTy))
10701070

10711071
| ThrowIncompleteMatchException ->
1072+
let mmMatch = mMatch.ApplyLineDirectives()
10721073
mkThrow mMatch resultTy
10731074
(mkExnExpr(g.MatchFailureException_tcr,
1074-
[ mkString g mMatch mMatch.FileName
1075-
mkInt g mMatch mMatch.StartLine
1076-
mkInt g mMatch mMatch.StartColumn], mMatch))
1075+
[ mkString g mMatch mmMatch.FileName
1076+
mkInt g mMatch mmMatch.StartLine
1077+
mkInt g mMatch mmMatch.StartColumn], mMatch))
10771078

10781079
| IgnoreWithWarning ->
10791080
mkUnit g mMatch

src/fsharp/src/Compiler/Checking/QuotationTranslator.fs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,20 +214,21 @@ let (|ObjectInitializationCheck|_|) g expr =
214214
isUnitTy g resultTy -> ValueSome()
215215
| _ -> ValueNone
216216

217-
let rec EmitDebugInfoIfNecessary cenv env m astExpr : ExprData =
217+
let rec EmitDebugInfoIfNecessary cenv env (m: range) astExpr : ExprData =
218218
// do not emit debug info if emitDebugInfoInQuotations = false or it was already written for the given expression
219219
if cenv.emitDebugInfoInQuotations && not (QP.isAttributedExpression astExpr) then
220220
cenv.emitDebugInfoInQuotations <- false
221221
try
222222
let mk_tuple g m es = mkRefTupled g m es (List.map (tyOfExpr g) es)
223223

224224
let rangeExpr =
225+
let mm = m.ApplyLineDirectives() // LineDirectives: map ranges for the debugger
225226
mk_tuple cenv.g m
226-
[ mkString cenv.g m m.FileName
227-
mkInt cenv.g m m.StartLine
228-
mkInt cenv.g m m.StartColumn
229-
mkInt cenv.g m m.EndLine
230-
mkInt cenv.g m m.EndColumn ]
227+
[ mkString cenv.g m mm.FileName
228+
mkInt cenv.g m mm.StartLine
229+
mkInt cenv.g m mm.StartColumn
230+
mkInt cenv.g m mm.EndLine
231+
mkInt cenv.g m mm.EndColumn ]
231232
let attrExpr =
232233
mk_tuple cenv.g m
233234
[ mkString cenv.g m "DebugRange"

src/fsharp/src/Compiler/CodeGen/IlxGen.fs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,6 +1849,8 @@ let AddIncrementalLocalAssemblyFragmentToIlxGenEnv (cenv: cenv, isIncrementalFra
18491849

18501850
/// Generate IL debugging information.
18511851
let GenILSourceMarker (g: TcGlobals) (m: range) =
1852+
let m = m.ApplyLineDirectives()
1853+
18521854
ILDebugPoint.Create(
18531855
document = g.memoize_file m.FileIndex,
18541856
line = m.StartLine,
@@ -2512,7 +2514,7 @@ type CodeGenBuffer(m: range, mgbuf: AssemblyBuilder, methodName, alreadyUsedArgs
25122514
// Add a nop to make way for the first debug point.
25132515
do
25142516
if mgbuf.cenv.options.generateDebugSymbols then
2515-
let doc = g.memoize_file m.FileIndex
2517+
let doc = g.memoize_file (m.ApplyLineDirectives().FileIndex)
25162518
let i = FeeFeeInstr mgbuf.cenv doc
25172519
codebuf.Add i // for the FeeFee or a better debug point
25182520

@@ -2599,7 +2601,7 @@ type CodeGenBuffer(m: range, mgbuf: AssemblyBuilder, methodName, alreadyUsedArgs
25992601
// Emit FeeFee breakpoints for hidden code, see https://blogs.msdn.microsoft.com/jmstall/2005/06/19/line-hidden-and-0xfeefee-sequence-points/
26002602
member cgbuf.EmitStartOfHiddenCode() =
26012603
if mgbuf.cenv.options.generateDebugSymbols then
2602-
let doc = g.memoize_file m.FileIndex
2604+
let doc = g.memoize_file (m.ApplyLineDirectives().FileIndex)
26032605
let i = FeeFeeInstr mgbuf.cenv doc
26042606
hasDebugPoints <- true
26052607

src/fsharp/src/Compiler/Driver/CompilerDiagnostics.fs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2063,6 +2063,7 @@ let FormatDiagnosticLocation (tcConfig: TcConfig) (m: Range) : FormattedDiagnost
20632063
File = ""
20642064
}
20652065
else
2066+
let m = m.ApplyLineDirectives()
20662067
let file = m.FileName
20672068

20682069
let file =
@@ -2194,6 +2195,8 @@ let CollectFormattedDiagnostics (tcConfig: TcConfig, severity: FSharpDiagnosticS
21942195
| DiagnosticStyle.Rich ->
21952196
match diagnostic.Range with
21962197
| Some m ->
2198+
let m = m.ApplyLineDirectives()
2199+
21972200
let content =
21982201
m.FileName
21992202
|> FileSystem.GetFullFilePathInDirectoryShim tcConfig.implicitIncludeDir
@@ -2279,6 +2282,7 @@ type PhasedDiagnostic with
22792282
match diagnostic.Range with
22802283
| None -> ()
22812284
| Some m ->
2285+
let m = m.ApplyLineDirectives()
22822286
let fileName = m.FileName
22832287
let lineA = m.StartLine
22842288
let lineB = m.EndLine

src/fsharp/src/Compiler/Driver/ParseAndCheckInputs.fs

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -215,24 +215,24 @@ let PostParseModuleSpec (_i, defaultNamespace, isLastCompiland, fileName, intf)
215215

216216
SynModuleOrNamespaceSig(lid, isRecursive, kind, decls, xmlDoc, attributes, None, range, trivia)
217217

218-
let private collectCodeComments (lexbuf: UnicodeLexing.Lexbuf) =
219-
let tripleSlashComments = XmlDocStore.ReportInvalidXmlDocPositions(lexbuf)
220-
221-
[
222-
yield! CommentStore.GetComments(lexbuf)
223-
yield! (List.map CommentTrivia.LineComment tripleSlashComments)
224-
]
225-
|> List.sortBy (function
226-
| CommentTrivia.LineComment r
227-
| CommentTrivia.BlockComment r -> r.StartLine, r.StartColumn)
228-
229-
let private collectParsedInputTrivia lexbuf diagnosticOptions isScript submoduleRanges =
218+
let private finishPreprocessing lexbuf diagnosticOptions isScript submoduleRanges =
230219
WarnScopes.MergeInto diagnosticOptions isScript submoduleRanges lexbuf
220+
LineDirectives.add lexbuf.StartPos.FileIndex (LineDirectiveStore.GetLineDirectives lexbuf)
231221

222+
let private collectParsedInputTrivia lexbuf =
232223
{
233224
ConditionalDirectives = IfdefStore.GetTrivia(lexbuf)
234225
WarnDirectives = WarnScopes.getDirectiveTrivia (lexbuf)
235-
CodeComments = collectCodeComments lexbuf
226+
CodeComments =
227+
let tripleSlashComments = XmlDocStore.ReportInvalidXmlDocPositions(lexbuf)
228+
229+
[
230+
yield! CommentStore.GetComments(lexbuf)
231+
yield! List.map CommentTrivia.LineComment tripleSlashComments
232+
]
233+
|> List.sortBy (function
234+
| CommentTrivia.LineComment r
235+
| CommentTrivia.BlockComment r -> r.StartLine, r.StartColumn)
236236
}
237237

238238
let private getImplSubmoduleRanges (impls: ParsedImplFileFragment list) =
@@ -276,8 +276,9 @@ let PostParseModuleImpls
276276

277277
let isScript = IsScript fileName
278278

279-
let trivia =
280-
collectParsedInputTrivia lexbuf diagnosticOptions isScript (getImplSubmoduleRanges impls)
279+
finishPreprocessing lexbuf diagnosticOptions isScript (getImplSubmoduleRanges impls)
280+
281+
let trivia = collectParsedInputTrivia lexbuf
281282

282283
let othersWithSameName =
283284
impls
@@ -309,8 +310,9 @@ let PostParseModuleSpecs
309310
identifiers: Set<string>
310311
) =
311312

312-
let trivia =
313-
collectParsedInputTrivia lexbuf diagnosticOptions false (getSpecSubmoduleRanges specs)
313+
finishPreprocessing lexbuf diagnosticOptions false (getSpecSubmoduleRanges specs)
314+
315+
let trivia = collectParsedInputTrivia lexbuf
314316

315317
let othersWithSameName =
316318
specs

0 commit comments

Comments
 (0)