Skip to content

Commit 4c244da

Browse files
auduchinokdsyme
authored andcommitted
Parsing improvements: no reactor, add parsing options, error severity options (#3601)
* Parse without reactor, add parsing options, error severity options * Revert parsing APIs (fallback to the new ones), fix VFT projects * Cache parse results after type check * Add impl files to file check results (#3659) * add LanguageServiceProfiling project to internals visible to list of FSharp.Compiler.Private project * add ImplementationFiles to FSharpCheckFileResults * make FSharpImplementationFileContents ctor internal * throw if ImplementationFiles is called having keepAssemblyContents flag set to false * add a test * spelling and cosmetics * This adds backup, restore, coloration and many more checks to the update-vsintegration.cmd (#3672) * This adds backup, restore, coloration and many more checks to the update-vsintegration.cmd * This adds backup, restore, coloration and many more checks to the update-vsintegration.cmd * Remove ambiguous an irrelevant instruction, improved help and instructions * Fix a scenario where the return code wasn't nonzero for error conditions, fixes not creating backup dir when not backing up * add LanguageServiceProfiling project to internals visible to list of FSharp.Compiler.Private project (#3657) * bump FCS version (#3676) * bump version * Update RELEASE_NOTES.md * updates to make tests pass * restore old behaviour of CheckFileInProjectAllowingStaleCachedResults (builder had been created by ParseFileInProject) * restore use of CheckFileInProjectAllowingStaleCachedResults * deprecate test relying on whacky behaviour of deprecated GetCheckResultsBeforeFileInProjectEvenIfStale * Use ParseFile and FSharpParsingOptions instead of ParseFileInProject * prepare FCS release with this feature
1 parent 88fc657 commit 4c244da

File tree

81 files changed

+835
-721
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+835
-721
lines changed

fcs/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ which does things like:
6060
Yu can push the packages if you have permissions, either automatically using ``build Release`` or manually
6161

6262
set APIKEY=...
63-
.nuget\nuget.exe push Release\FSharp.Compiler.Service.15.0.1.nupkg %APIKEY% -Source https://nuget.org
64-
.nuget\nuget.exe push Release\FSharp.Compiler.Service.MSBuild.v12.15.0.1.nupkg %APIKEY% -Source https://nuget.org
65-
.nuget\nuget.exe push Release\FSharp.Compiler.Service.ProjectCracker.15.0.1.nupkg %APIKEY% -Source https://nuget.org
63+
.nuget\nuget.exe push Release\FSharp.Compiler.Service.16.0.1.nupkg %APIKEY% -Source https://nuget.org
64+
.nuget\nuget.exe push Release\FSharp.Compiler.Service.MSBuild.v12.16.0.1.nupkg %APIKEY% -Source https://nuget.org
65+
.nuget\nuget.exe push Release\FSharp.Compiler.Service.ProjectCracker.16.0.1.nupkg %APIKEY% -Source https://nuget.org
6666

6767

6868
### Use of Paket and FAKE

fcs/RELEASE_NOTES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#### 16.0.1
2+
* FSharpChecker provides non-reactor ParseFile instead of ParseFileInProject
3+
* Add FSharpParsingOptions, GetParsingOptionsFromProjectOptions, GetParsingOptionsFromCommandLine
4+
15
#### 15.0.1
26
* Integrate latest changes from visualfsharp
37
* Add implementation file contents to CheckFileResults

fcs/docsrc/content/caches.fsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,14 @@ Each FSharpChecker object maintains a set of caches. These are
2121
2222
* ``braceMatchCache`` - an MRU cache of size ``braceMatchCacheSize`` (default = 5) keeping the results of calls to MatchBraces, keyed by filename, source and project options.
2323
24-
* ``parseFileInProjectCache`` - an MRU cache of size ``parseFileInProjectCacheSize`` (default = 2) keeping the results of ParseFileInProject,
24+
* ``parseFileCache`` - an MRU cache of size ``parseFileCacheSize`` (default = 2) keeping the results of ParseFile,
2525
keyed by filename, source and project options.
2626
27-
* ``parseAndCheckFileInProjectCache`` - an MRU cache of size ``incrementalTypeCheckCacheSize`` (default = 5) keeping the results of
27+
* ``checkFileInProjectCache`` - an MRU cache of size ``incrementalTypeCheckCacheSize`` (default = 5) keeping the results of
2828
ParseAndCheckFileInProject, CheckFileInProject and/or CheckFileInProjectIfReady. This is keyed by filename, file source
2929
and project options. The results held in this cache are only returned if they would reflect an accurate parse and check of the
3030
file.
3131
32-
* ``parseAndCheckFileInProjectCachePossiblyStale`` - a somewhat peculiar MRU cache of size ``incrementalTypeCheckCacheSize`` (default = 5)
33-
keeping the results of ParseAndCheckFileInProject, CheckFileInProject and CheckFileInProjectIfReady,
34-
keyed by filename and project options. This cache is accessed by TryGetRecentTypeCheckResultsForFile. Because the results
35-
are accessed regardless of the content of the file, the checking results returned may be "stale".
36-
3732
* ``getToolTipTextCache`` - an aged lookup cache of strong size ``getToolTipTextSize`` (default = 5) computing the results of GetToolTipText.
3833
3934
* ``ilModuleReaderCache`` - an aged lookup of weak references to "readers" for references .NET binaries. Because these

fcs/docsrc/content/editor.fsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,19 @@ let projOptions =
5656
checker.GetProjectOptionsFromScript(file, input)
5757
|> Async.RunSynchronously
5858

59+
let parsingOptions, _errors = checker.GetParsingOptionsFromProjectOptions(projOptions)
60+
5961
(**
6062
To perform type checking, we first need to parse the input using
61-
`ParseFileInProject`, which gives us access to the [untyped AST](untypedtree.html). However,
63+
`ParseFile`, which gives us access to the [untyped AST](untypedtree.html). However,
6264
then we need to call `CheckFileInProject` to perform the full type checking. This function
6365
also requires the result of `ParseFileInProject`, so the two functions are often called
6466
together.
6567
*)
6668
// Perform parsing
69+
6770
let parseFileResults =
68-
checker.ParseFileInProject(file, input, projOptions)
71+
checker.ParseFile(file, input, parsingOptions)
6972
|> Async.RunSynchronously
7073
(**
7174
Before we look at the interesting operations provided by `TypeCheckResults`, we

fcs/docsrc/content/ja/editor.fsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,22 @@ let file = "/home/user/Test.fsx"
5858

5959
let projOptions = checker.GetProjectOptionsFromScript(file, input) |> Async.RunSynchronously
6060

61+
let parsingOptions, _errors = checker.GetParsingOptionsFromProjectOptions(projOptions)
62+
6163
(**
6264
63-
型チェックを実行するには、まず `ParseFileInProject` を使って
65+
型チェックを実行するには、まず `ParseFile` を使って
6466
入力値をパースする必要があります。
6567
このメソッドを使うと [型無しAST](untypedtree.html) にアクセスできるようになります。
6668
しかし今回は完全な型チェックを実行するため、続けて `CheckFileInProject`
6769
を呼び出す必要があります。
68-
このメソッドは `ParseFileInProject` の結果も必要とするため、
70+
このメソッドは `ParseFile` の結果も必要とするため、
6971
たいていの場合にはこれら2つのメソッドをセットで呼び出すことになります。
7072
7173
*)
7274
// パースを実行
7375
let parseFileResults =
74-
checker.ParseFileInProject(file, input, projOptions)
76+
checker.ParseFile(file, input, parsingOptions)
7577
|> Async.RunSynchronously
7678
(**
7779
`TypeCheckResults` に備えられた興味深い機能の紹介に入る前に、

fcs/docsrc/content/ja/untypedtree.fsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ let getUntypedTree (file, input) =
7373
checker.GetProjectOptionsFromScript(file, input)
7474
|> Async.RunSynchronously
7575

76+
let parsingOptions, _errors = checker.GetParsingOptionsFromProjectOptions(projOptions)
77+
7678
// コンパイラの第1フェーズを実行する
7779
let untypedRes =
78-
checker.ParseFileInProject(file, input, projectOptions)
80+
checker.ParseFile(file, input, parsingOptions)
7981
|> Async.RunSynchronously
8082

8183
match untypedRes.ParseTree with

fcs/docsrc/content/untypedtree.fsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ To get the AST, we define a function that takes file name and the source code
4949
(the file is only used for location information and does not have to exist).
5050
We first need to get "interactive checker options" which represents the context.
5151
For simple tasks, you can use `GetProjectOptionsFromScriptRoot` which infers
52-
the context for a script file. Then we use the `ParseFileInProject` method and
52+
the context for a script file. Then we use the `ParseFile` method and
5353
return the `ParseTree` property:
5454
5555
*)
@@ -60,9 +60,11 @@ let getUntypedTree (file, input) =
6060
checker.GetProjectOptionsFromScript(file, input)
6161
|> Async.RunSynchronously
6262

63+
let parsingOptions, _errors = checker.GetParsingOptionsFromProjectOptions(projOptions)
64+
6365
// Run the first phase (untyped parsing) of the compiler
6466
let parseFileResults =
65-
checker.ParseFileInProject(file, input, projOptions)
67+
checker.ParseFile(file, input, parsingOptions)
6668
|> Async.RunSynchronously
6769

6870
match parseFileResults.ParseTree with

fcs/fcs.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
44
<PropertyGroup>
55

6-
<VersionPrefix>15.0.1</VersionPrefix>
6+
<VersionPrefix>16.0.1</VersionPrefix>
77
<!-- FSharp.Compiler.Tools is currently only used to get a working FSI.EXE to execute some scripts during the build -->
88
<!-- The LKG FSI.EXE requires MSBuild 15 to be installed, which is painful -->
99
<FsiToolPath>$(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.1.23\tools</FsiToolPath>

fcs/nuget/FSharp.Compiler.Service.MSBuild.v12.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</description>
99
<language>en-US</language>
1010
<requireLicenseAcceptance>false</requireLicenseAcceptance>
11-
<version>15.0.1</version>
11+
<version>16.0.1</version>
1212
<authors>Microsoft Corporation and F# community contributors</authors>
1313
<licenseUrl>https://github.com/fsharp/FSharp.Compiler.Service/blob/master/LICENSE</licenseUrl>
1414
<projectUrl>https://github.com/fsharp/FSharp.Compiler.Service</projectUrl>

fcs/nuget/FSharp.Compiler.Service.ProjectCracker.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</description>
1111
<language>en-US</language>
1212
<requireLicenseAcceptance>false</requireLicenseAcceptance>
13-
<version>15.0.1</version>
13+
<version>16.0.1</version>
1414
<authors>Microsoft Corporation and F# community contributors</authors>
1515
<licenseUrl>https://github.com/fsharp/FSharp.Compiler.Service/blob/master/LICENSE</licenseUrl>
1616
<projectUrl>https://github.com/fsharp/FSharp.Compiler.Service</projectUrl>

0 commit comments

Comments
 (0)