Skip to content

Commit abf70a6

Browse files
committed
Fixed merge
1 parent 6a06a90 commit abf70a6

File tree

9 files changed

+25
-21
lines changed

9 files changed

+25
-21
lines changed

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"name": "FCS Test",
9393
"type": "coreclr",
9494
"request": "launch",
95-
"program": "${workspaceFolder}/artifacts/bin/fcs-test/Debug/net7.0/fcs-test.dll",
95+
"program": "${workspaceFolder}/artifacts/bin/fcs-test/Debug/net8.0/fcs-test.dll",
9696
"args": [],
9797
"cwd": "${workspaceFolder}/fcs/fcs-test",
9898
"console": "internalConsole",

buildtools/AssemblyCheck/AssemblyCheck.fsproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net8.0</TargetFramework>
6-
<TargetFramework>net6.0</TargetFramework>
7-
<TargetFramework>net7.0</TargetFramework>
86
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
97
<UseAppHost Condition="'$(DotNetBuildFromSource)' == 'true'">false</UseAppHost>
108
</PropertyGroup>

buildtools/buildtools.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
BeforeTargets="CoreCompile">
2121

2222
<PropertyGroup>
23-
<FsLexPath Condition="'$(FsLexPath)' == ''">$(ArtifactsDir)\bin\fslex\Release\net7.0\fslex.dll</FsLexPath>
23+
<FsLexPath Condition="'$(FsLexPath)' == ''">$(ArtifactsDir)\bin\fslex\Release\net8.0\fslex.dll</FsLexPath>
2424
</PropertyGroup>
2525

2626
<!-- Create the output directory -->
@@ -44,7 +44,7 @@
4444
BeforeTargets="CoreCompile">
4545

4646
<PropertyGroup>
47-
<FsYaccPath Condition="'$(FsYaccPath)' == ''">$(ArtifactsDir)\bin\fsyacc\Release\net7.0\fsyacc.dll</FsYaccPath>
47+
<FsYaccPath Condition="'$(FsYaccPath)' == ''">$(ArtifactsDir)\bin\fsyacc\Release\net8.0\fsyacc.dll</FsYaccPath>
4848
</PropertyGroup>
4949

5050
<!-- Create the output directory -->

buildtools/fslex/fslex.fsproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net8.0</TargetFramework>
6-
<TargetFramework>net7.0</TargetFramework>
7-
<DefineConstants>INTERNALIZED_FSLEXYACC_RUNTIME;$(DefineConstants)</DefineConstants>
86
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
97
<UseAppHost Condition="'$(DotNetBuildFromSource)' == 'true'">false</UseAppHost>
108
<RollForward Condition="'$(BUILDING_USING_DOTNET)' == 'true'">LatestMajor</RollForward>

buildtools/fsyacc/fsyacc.fsproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net8.0</TargetFramework>
6-
<TargetFramework>net7.0</TargetFramework>
7-
<DefineConstants>INTERNALIZED_FSLEXYACC_RUNTIME;$(DefineConstants)</DefineConstants>
86
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
97
<UseAppHost Condition="'$(DotNetBuildFromSource)' == 'true'">false</UseAppHost>
108
<RollForward Condition="'$(BUILDING_USING_DOTNET)' == 'true'">LatestMajor</RollForward>

fcs/fcs-test/fcs-test.fsproj

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

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
77
</PropertyGroup>
88

@@ -19,9 +19,9 @@
1919
</ItemGroup>
2020

2121
<ItemGroup>
22-
<!-- <PackageReference Include="FSharp.Core" Version="7.0.0" /> -->
23-
<PackageReference Include="Buildalyzer" Version="4.1.6" />
24-
<PackageReference Include="Fable.Core" Version="4.0.0-*" />
22+
<!-- <PackageReference Include="FSharp.Core" Version="8.0.0" /> -->
23+
<PackageReference Include="Buildalyzer" Version="5.0.1" />
24+
<PackageReference Include="Fable.Core" Version="4.1.0" />
2525
<PackageReference Include="Fable.Import.Browser" Version="1.4.0" />
2626
</ItemGroup>
2727
</Project>

fcs/service_slim.fs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,14 @@ module internal ParseAndCheck =
188188
// restore all cached typecheck entries above file
189189
cachedAbove |> Array.iter (fun (key, value) -> compilerState.checkCache.TryAdd(key, value) |> ignore)
190190

191-
let ParseFile (fileName: string, sourceHash: int, source: Lazy<string>, parsingOptions: FSharpParsingOptions, compilerState) =
191+
let ParseFile (fileName: string, sourceHash: int, source: Lazy<string>, parsingOptions: FSharpParsingOptions, compilerState, ct) =
192192
let parseCacheKey = fileName, sourceHash
193193
compilerState.parseCache.GetOrAdd(parseCacheKey, fun _ ->
194194
ClearStaleCache(fileName, parsingOptions, compilerState)
195195
let sourceText = SourceText.ofString source.Value
196-
let parseErrors, parseTreeOpt, anyErrors = ParseAndCheckFile.parseFile (sourceText, fileName, parsingOptions, userOpName, suggestNamesForErrors, captureIdentifiersWhenParsing)
196+
let flatErrors = compilerState.tcConfig.flatErrors
197+
let parseErrors, parseTreeOpt, anyErrors =
198+
ParseAndCheckFile.parseFile (sourceText, fileName, parsingOptions, userOpName, suggestNamesForErrors, flatErrors, captureIdentifiersWhenParsing, ct)
197199
let dependencyFiles = [||] // interactions have no dependencies
198200
FSharpParseFileResults (parseErrors, parseTreeOpt, anyErrors, dependencyFiles) )
199201

@@ -213,7 +215,9 @@ module internal ParseAndCheck =
213215
|> Cancellable.runWithoutCancellation
214216

215217
let fileName = parseResults.FileName
216-
let tcErrors = DiagnosticHelpers.CreateDiagnostics (diagnosticsOptions, false, fileName, (capturingLogger.GetDiagnostics()), suggestNamesForErrors)
218+
let flatErrors = compilerState.tcConfig.flatErrors
219+
let parseDiagnostics = capturingLogger.GetDiagnostics()
220+
let tcErrors = DiagnosticHelpers.CreateDiagnostics (diagnosticsOptions, false, fileName, parseDiagnostics, suggestNamesForErrors, flatErrors, None)
217221
(tcResult, tcErrors), (tcState, moduleNamesDict)
218222

219223
let CheckFile (projectFileName: string, parseResults: FSharpParseFileResults, tcState: TcState, moduleNamesDict: ModuleNamesDict, compilerState) =
@@ -295,17 +299,19 @@ type InteractiveChecker internal (compilerStateCache) =
295299
/// Compile project to file. If project has already been type checked,
296300
/// check results will be taken from the cache.
297301
member _.Compile(fileNames: string[], sourceReader: string -> int * Lazy<string>, outFile: string) = async {
302+
let! ct = Async.CancellationToken
298303
let! compilerState = compilerStateCache.Get()
299304
let parsingOptions = FSharpParsingOptions.FromTcConfig(compilerState.tcConfig, fileNames, false)
300305
let parseResults = fileNames |> Array.map (fun fileName ->
301306
let sourceHash, source = sourceReader fileName
302-
ParseFile(fileName, sourceHash, source, parsingOptions, compilerState))
307+
ParseFile(fileName, sourceHash, source, parsingOptions, compilerState, ct))
303308

304309
let (tcState, topAttrs, tcImplFiles, _tcEnvAtEnd, _moduleNamesDict, _tcErrors) =
305310
TypeCheckClosedInputSet (parseResults, compilerState.tcInitialState, compilerState, None)
306311

307312
let ctok = CompilationThreadToken()
308-
let errors, diagnosticsLogger, _loggerProvider = CompileHelpers.mkCompilationDiagnosticsHandlers()
313+
let flatErrors = compilerState.tcConfig.flatErrors
314+
let errors, diagnosticsLogger, _loggerProvider = CompileHelpers.mkCompilationDiagnosticsHandlers(flatErrors)
309315
let exitCode =
310316
CompileHelpers.tryCompile diagnosticsLogger (fun exiter ->
311317
CompileFromTypedAst (ctok, compilerState.tcGlobals, compilerState.tcImports, tcState.Ccu,
@@ -319,6 +325,7 @@ type InteractiveChecker internal (compilerStateCache) =
319325
/// Already parsed files will be cached so subsequent compilations will be faster.
320326
member _.ParseAndCheckProject (projectFileName: string, fileNames: string[], sourceReader: string -> int * Lazy<string>,
321327
?lastFile: string, ?subscriber: FSharpImplementationFileContents -> unit) = async {
328+
let! ct = Async.CancellationToken
322329
let! compilerState = compilerStateCache.Get()
323330
// parse files
324331
let parsingOptions = FSharpParsingOptions.FromTcConfig(compilerState.tcConfig, fileNames, false)
@@ -332,7 +339,7 @@ type InteractiveChecker internal (compilerStateCache) =
332339

333340
let parseFile fileName =
334341
let sourceHash, source = sourceReader fileName
335-
ParseFile(fileName, sourceHash, source, parsingOptions, compilerState)
342+
ParseFile(fileName, sourceHash, source, parsingOptions, compilerState, ct)
336343

337344
// Don't parallelize if we have cached files, as it would create issues with invalidation
338345
if compilerState.parseCache.Count = 0 then
@@ -358,6 +365,7 @@ type InteractiveChecker internal (compilerStateCache) =
358365
/// up to and including the file requested. Returns parse and typecheck results containing
359366
/// name resolutions and symbol uses for the file requested only, so intellisense etc. works.
360367
member _.ParseAndCheckFileInProject (projectFileName: string, fileNames: string[], sourceReader: string -> int * Lazy<string>, fileName: string) = async {
368+
let! ct = Async.CancellationToken
361369
let! compilerState = compilerStateCache.Get()
362370

363371
// get files before file
@@ -368,7 +376,7 @@ type InteractiveChecker internal (compilerStateCache) =
368376
let parsingOptions = FSharpParsingOptions.FromTcConfig(compilerState.tcConfig, fileNames, false)
369377
let parseFile fileName =
370378
let sourceHash, source = sourceReader fileName
371-
ParseFile (fileName, sourceHash, source, parsingOptions, compilerState)
379+
ParseFile (fileName, sourceHash, source, parsingOptions, compilerState, ct)
372380
let parseResults = fileNamesBeforeFile |> Array.map parseFile
373381

374382
// type check files before file

src/Compiler/Service/service.fs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,15 @@ module CompileHelpers =
157157

158158
diagnostics.ToArray(), result
159159

160+
#if !FABLE_CLI
160161
let setOutputStreams execute =
161162
// Set the output streams, if requested
162163
match execute with
163164
| Some (writer, error) ->
164165
Console.SetOut writer
165166
Console.SetError error
166167
| None -> ()
168+
#endif
167169

168170
type SourceTextHash = int64
169171
type CacheStamp = int64

src/Compiler/Service/service.fsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ open FSharp.Compiler.DiagnosticsLogger
1919
open FSharp.Compiler.Driver
2020

2121
module internal CompileHelpers =
22-
val mkCompilationDiagnosticsHandlers: unit -> ResizeArray<FSharpDiagnostic> * DiagnosticsLogger * IDiagnosticsLoggerProvider
22+
val mkCompilationDiagnosticsHandlers: bool -> ResizeArray<FSharpDiagnostic> * DiagnosticsLogger * IDiagnosticsLoggerProvider
2323
val tryCompile: DiagnosticsLogger -> (StopProcessingExiter -> unit) -> int
2424

2525
[<Experimental "This type is experimental and likely to be removed in the future.">]

0 commit comments

Comments
 (0)