Skip to content

Commit bfff959

Browse files
authored
Merge branch 'main' into copilot/fix-fsharp-optional-parameter-highlighting
2 parents 5b1c7e3 + 9c5cb49 commit bfff959

34 files changed

+218
-168
lines changed

docs/release-notes/.FSharp.Compiler.Service/10.0.200.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
* Type relations cache: optimize key generation ([Issue #19116](https://github.com/dotnet/fsharp/issues/18767)) ([PR #19120](https://github.com/dotnet/fsharp/pull/19120))
44

5+
### Added
6+
7+
* FSharpDiagnostic: add default severity ([#19152](https://github.com/dotnet/fsharp/pull/19152))
8+
59
### Breaking Changes
610

711
* `SynExpr.LetOrUse` holds `SynLetOrUse`. ([PR #19090](https://github.com/dotnet/fsharp/pull/19090))

docs/release-notes/.FSharp.Compiler.Service/11.0.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* Add FSharpCodeCompletionOptions ([PR #19030](https://github.com/dotnet/fsharp/pull/19030))
2121
* Type checker: recover on checking binding parameter constraints ([#19046](https://github.com/dotnet/fsharp/pull/19046))
2222
* Debugger: provide breakpoint ranges for short lambdas ([#19067](https://github.com/dotnet/fsharp/pull/19067))
23+
* FSharpDiagnostic: add default severity ([#19152](https://github.com/dotnet/fsharp/pull/19152))
2324

2425
### Changed
2526

eng/Version.Details.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ This file should be imported by eng/Versions.props
2727
<MicrosoftCodeAnalysisFeaturesPackageVersion>5.0.0-2.25480.7</MicrosoftCodeAnalysisFeaturesPackageVersion>
2828
<MicrosoftVisualStudioLanguageServicesPackageVersion>5.0.0-2.25480.7</MicrosoftVisualStudioLanguageServicesPackageVersion>
2929
<!-- dotnet/arcade dependencies -->
30-
<MicrosoftDotNetArcadeSdkPackageVersion>11.0.0-beta.25615.1</MicrosoftDotNetArcadeSdkPackageVersion>
30+
<MicrosoftDotNetArcadeSdkPackageVersion>11.0.0-beta.25617.1</MicrosoftDotNetArcadeSdkPackageVersion>
3131
<!-- _git/dotnet-optimization dependencies -->
3232
<optimizationlinuxarm64MIBCRuntimePackageVersion>1.0.0-prerelease.25502.1</optimizationlinuxarm64MIBCRuntimePackageVersion>
3333
<optimizationlinuxx64MIBCRuntimePackageVersion>1.0.0-prerelease.25502.1</optimizationlinuxx64MIBCRuntimePackageVersion>

eng/Version.Details.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Dependencies>
3-
<Source Uri="https://github.com/dotnet/dotnet" Mapping="fsharp" Sha="29eefe27a350eb8b0bcbababa7863a0d1086295d" BarId="293166" />
3+
<Source Uri="https://github.com/dotnet/dotnet" Mapping="fsharp" Sha="5661a2c0a84a3fd32916395b254ce50e5ad7e9fe" BarId="295411" />
44
<ProductDependencies>
55
<Dependency Name="Microsoft.Build" Version="18.1.0-preview-25515-01">
66
<Uri>https://github.com/dotnet/msbuild</Uri>
@@ -76,9 +76,9 @@
7676
</Dependency>
7777
</ProductDependencies>
7878
<ToolsetDependencies>
79-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="11.0.0-beta.25615.1">
79+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="11.0.0-beta.25617.1">
8080
<Uri>https://github.com/dotnet/arcade</Uri>
81-
<Sha>059959b98fc4350c619399ae2bf4c7b854779ecf</Sha>
81+
<Sha>47a8a69721dfea57b82121ac1458d2f5bba6abd2</Sha>
8282
</Dependency>
8383
<Dependency Name="optimization.windows_nt-x64.MIBC.Runtime" Version="1.0.0-prerelease.25502.1">
8484
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>

eng/common/cross/build-rootfs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ __AlpinePackages+=" krb5-dev"
7272
__AlpinePackages+=" openssl-dev"
7373
__AlpinePackages+=" zlib-dev"
7474

75-
__FreeBSDBase="13.4-RELEASE"
75+
__FreeBSDBase="13.5-RELEASE"
7676
__FreeBSDPkg="1.21.3"
7777
__FreeBSDABI="13"
7878
__FreeBSDPackages="libunwind"
@@ -383,7 +383,7 @@ while :; do
383383
;;
384384
freebsd14)
385385
__CodeName=freebsd
386-
__FreeBSDBase="14.2-RELEASE"
386+
__FreeBSDBase="14.3-RELEASE"
387387
__FreeBSDABI="14"
388388
__SkipUnmount=1
389389
;;

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"perl": "5.38.2.2"
2323
},
2424
"msbuild-sdks": {
25-
"Microsoft.DotNet.Arcade.Sdk": "11.0.0-beta.25615.1",
25+
"Microsoft.DotNet.Arcade.Sdk": "11.0.0-beta.25617.1",
2626
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2"
2727
}
2828
}

src/Compiler/Driver/CompilerDiagnostics.fs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,8 @@ type PhasedDiagnostic with
405405
(severity = FSharpDiagnosticSeverity.Info && level > 0)
406406
|| (severity = FSharpDiagnosticSeverity.Warning && level >= x.WarningLevel)
407407

408-
member x.AdjustSeverity(options, severity) =
408+
member x.AdjustSeverity(options) =
409+
let severity = x.Severity
409410
let n = x.Number
410411

411412
let localWarnon () = WarnScopes.IsWarnon options n x.Range
@@ -2007,7 +2008,7 @@ type PhasedDiagnostic with
20072008
x.Exception.Output(buf, suggestNames)
20082009
let message = buf.ToString()
20092010
let exn = DiagnosticWithText(x.Number, message, m)
2010-
{ Exception = exn; Phase = x.Phase }
2011+
{ x with Exception = exn }
20112012
| None -> x
20122013

20132014
let SanitizeFileName fileName implicitIncludeDir =
@@ -2313,15 +2314,15 @@ type DiagnosticsLoggerFilteringByScopedNowarn(diagnosticOptions: FSharpDiagnosti
23132314

23142315
let mutable realErrorPresent = false
23152316

2316-
override _.DiagnosticSink(diagnostic: PhasedDiagnostic, severity) =
2317+
override _.DiagnosticSink(diagnostic: PhasedDiagnostic) =
23172318

2318-
if severity = FSharpDiagnosticSeverity.Error then
2319+
if diagnostic.Severity = FSharpDiagnosticSeverity.Error then
23192320
realErrorPresent <- true
2320-
diagnosticsLogger.DiagnosticSink(diagnostic, severity)
2321+
diagnosticsLogger.DiagnosticSink(diagnostic)
23212322
else
2322-
match diagnostic.AdjustSeverity(diagnosticOptions, severity) with
2323+
match diagnostic.AdjustSeverity(diagnosticOptions) with
23232324
| FSharpDiagnosticSeverity.Hidden -> ()
2324-
| s -> diagnosticsLogger.DiagnosticSink(diagnostic, s)
2325+
| s -> diagnosticsLogger.DiagnosticSink({ diagnostic with Severity = s })
23252326

23262327
override _.ErrorCount = diagnosticsLogger.ErrorCount
23272328

src/Compiler/Driver/CompilerDiagnostics.fsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ type PhasedDiagnostic with
6161
member FormatCore: flattenErrors: bool * suggestNames: bool -> string
6262

6363
/// Compute new severity according to the various diagnostics options
64-
member AdjustSeverity: FSharpDiagnosticOptions * FSharpDiagnosticSeverity -> FSharpDiagnosticSeverity
64+
member AdjustSeverity: FSharpDiagnosticOptions -> FSharpDiagnosticSeverity
6565

6666
/// Output all of a diagnostic to a buffer, including range
6767
member Output: buf: StringBuilder * tcConfig: TcConfig * severity: FSharpDiagnosticSeverity -> unit

src/Compiler/Driver/ScriptClosure.fs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ type LoadClosureInput =
2929
{
3030
FileName: string
3131
SyntaxTree: ParsedInput option
32-
ParseDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list
33-
MetaCommandDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list
32+
ParseDiagnostics: PhasedDiagnostic list
33+
MetaCommandDiagnostics: PhasedDiagnostic list
3434
}
3535

3636
[<RequireQualifiedAccess>]
@@ -64,13 +64,13 @@ type LoadClosure =
6464
OriginalLoadReferences: (range * string * string) list
6565

6666
/// Diagnostics seen while processing resolutions
67-
ResolutionDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list
67+
ResolutionDiagnostics: PhasedDiagnostic list
6868

6969
/// Diagnostics seen while parsing root of closure
70-
AllRootFileDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list
70+
AllRootFileDiagnostics: PhasedDiagnostic list
7171

7272
/// Diagnostics seen while processing the compiler options implied root of closure
73-
LoadClosureRootFileDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list
73+
LoadClosureRootFileDiagnostics: PhasedDiagnostic list
7474
}
7575

7676
[<RequireQualifiedAccess>]
@@ -91,8 +91,8 @@ module ScriptPreprocessClosure =
9191
fileName: string *
9292
range: range *
9393
parsedInput: ParsedInput option *
94-
parseDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list *
95-
metaDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list
94+
parseDiagnostics: PhasedDiagnostic list *
95+
metaDiagnostics: PhasedDiagnostic list
9696

9797
type Observed() =
9898
let seen = Dictionary<_, bool>()
@@ -594,7 +594,7 @@ module ScriptPreprocessClosure =
594594
| None -> true
595595

596596
// Filter out non-root errors and warnings
597-
let allRootDiagnostics = allRootDiagnostics |> List.filter (fst >> isRootRange)
597+
let allRootDiagnostics = allRootDiagnostics |> List.filter isRootRange
598598

599599
{
600600
SourceFiles = List.groupBy fst sourceFiles |> List.map (map2Of2 (List.map snd))

src/Compiler/Driver/ScriptClosure.fsi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ type LoadClosureInput =
2626

2727
SyntaxTree: ParsedInput option
2828

29-
ParseDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list
29+
ParseDiagnostics: PhasedDiagnostic list
3030

31-
MetaCommandDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list }
31+
MetaCommandDiagnostics: PhasedDiagnostic list }
3232

3333
[<RequireQualifiedAccess>]
3434
type LoadClosure =
@@ -61,13 +61,13 @@ type LoadClosure =
6161
OriginalLoadReferences: (range * string * string) list
6262

6363
/// Diagnostics seen while processing resolutions
64-
ResolutionDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list
64+
ResolutionDiagnostics: PhasedDiagnostic list
6565

6666
/// Diagnostics to show for root of closure (used by fsc.fs)
67-
AllRootFileDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list
67+
AllRootFileDiagnostics: PhasedDiagnostic list
6868

6969
/// Diagnostics seen while processing the compiler options implied root of closure
70-
LoadClosureRootFileDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list
70+
LoadClosureRootFileDiagnostics: PhasedDiagnostic list
7171
}
7272

7373
/// Analyze a script text and find the closure of its references.

0 commit comments

Comments
 (0)