Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update service_slim_fcsw to latest #5

Closed
wants to merge 43 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
2f7ac1a
Allowing IncrementalBuilder cache to be used on any thread
TIHan Oct 20, 2020
7084021
Put if statements back in the reactor queue
TIHan Oct 21, 2020
8669a13
Queueing ClearCache
TIHan Oct 21, 2020
014798d
Making several uses of Dictionary types be ConcurrentDictionary
TIHan Oct 21, 2020
5eb8092
Remove space
TIHan Oct 21, 2020
2008c0d
Forcing type provider calls on the reactor thread
TIHan Oct 21, 2020
cc40667
Fixing build and preventing deadlock in IncrementalBuild's compilatio…
TIHan Oct 21, 2020
f085e71
Fixing more deadlocks
TIHan Oct 21, 2020
1c22bfd
start of ctok work
Oct 22, 2020
67d47c1
fix calls
Oct 22, 2020
ffcbdea
Removed ICompilationThread and added TypeProviderLock singleton
TIHan Oct 22, 2020
3b294c4
remove text snapshot objects, is-text-changed callbacks and async beh…
Oct 22, 2020
91af6e8
Removing reactor changes
TIHan Oct 22, 2020
e802f43
fix tests
Oct 22, 2020
7024592
update FCS docs
Oct 22, 2020
32d884f
delete old code
Oct 22, 2020
9b9506c
fix baselines
Oct 22, 2020
afbe8e0
Update CompilerImports.fs
TIHan Oct 22, 2020
d4693c1
test no longer applicable
Oct 22, 2020
4f608a4
Merge branch 'main' of https://github.com/dotnet/fsharp into ib-cache…
Oct 22, 2020
bbd79e7
remove dead union case
Oct 22, 2020
d750363
Merge branch 'main' of https://github.com/dotnet/fsharp into ib-cache…
Oct 22, 2020
785f4b4
Fixing tests
TIHan Oct 22, 2020
1333c0a
Merge branch 'main' of https://github.com/dotnet/fsharp into ib-cache…
Oct 22, 2020
a4d78a1
Merge remote-tracking branch 'upstream/main' into concurrent-structures
TIHan Oct 22, 2020
93c05ea
Fixing tests
TIHan Oct 23, 2020
08c32bc
Lock per TP instance
TIHan Oct 23, 2020
e8607a4
Merged
TIHan Oct 23, 2020
5334b99
Fixing tests
TIHan Oct 23, 2020
18079e1
Update compiler-guide.md (#10341)
dsyme Oct 27, 2020
c08f160
Create fsharp-core-notes.md (#10340)
dsyme Oct 27, 2020
c8cc6f2
Merge pull request #10310 from TIHan/type-provider-forced-compilation…
dsyme Oct 27, 2020
a2180e8
Merge branch 'main' into ib-cache-any-thread
dsyme Oct 27, 2020
0d2a2b2
fix build
Oct 27, 2020
381b22a
Merge pull request #10308 from TIHan/concurrent-structures
dsyme Oct 27, 2020
2bbe70d
Merge branch 'main' of https://github.com/dotnet/fsharp into ib-cache…
Oct 27, 2020
07e12af
Merge pull request #10292 from TIHan/ib-cache-any-thread
dsyme Oct 28, 2020
886205d
Merge branch 'main' of https://github.com/dotnet/fsharp into feature/…
Oct 28, 2020
c4b28a1
Fix Regression with quotations of List.sum on non-primitive type
Oct 30, 2020
c8d5dfd
further testing for FCS on List.sum on non-primitive type
Oct 30, 2020
812e67e
run Expr tests in independent checkers to get consistent names
Oct 30, 2020
4a2a189
Added service_slim
ncave Oct 27, 2020
8981cbb
Fix build
alfonsogarciacaro Oct 30, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/artifacts/bin/fcs-test/Debug/netcoreapp3.1/fcs-test.dll",
"args": [],
"cwd": "${workspaceFolder}/fcs/fcs-test",
"console": "internalConsole",
"stopAtEntry": false
}
]
}
9 changes: 7 additions & 2 deletions docs/compiler-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ There are several artifacts involved in the development of F#:

The `FSharp.Compiler.Private` is by far the largest of these components and contains nearly all logic that `fsc` and `fsi` use. It is the primary subject of this guide.

The F# compiler repositories are used to produce a range of different artifacts. For the purposes of this
guide, the important ones are:
## Resources for learning

* Video: [Learn me some F# Compiler, an online chat with Vlad and Don](https://www.youtube.com/watch?v=-dKf15xSWPY)

* Video: [Understanding the F# Optimizer, and online chat with Vlad and Don](https://www.youtube.com/watch?v=sfAe5lDue7k)

## Key data formats and representations

Expand Down Expand Up @@ -110,8 +113,10 @@ These and transformations used to build the following:
## Tools to help work with the compiler

* [sharplab.io](https://sharplab.io/) can be used to decompile code.

* [fantomas-tools](https://fsprojects.github.io/fantomas-tools/#/ast) can be used to view the Untyped & Typed Abstract Syntax Tree.


## Coding standards and idioms

The compiler codebase uses various abbreviations. Here are some of the most common ones.
Expand Down
2 changes: 1 addition & 1 deletion docs/fcs/caches.fsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(*** hide ***)
#I "../../../artifacts/bin/fcs/net461"
#I "../../artifacts/bin/FSharp.Compiler.Service/Debug/netstandard2.0"
(**
Compiler Services: Notes on the FSharpChecker caches
=================================================
Expand Down
2 changes: 1 addition & 1 deletion docs/fcs/compiler.fsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(*** hide ***)
#I "../../../artifacts/bin/fcs/net461"
#I "../../artifacts/bin/FSharp.Compiler.Service/Debug/netstandard2.0"
(**
Hosted Compiler
===============
Expand Down
2 changes: 1 addition & 1 deletion docs/fcs/corelib.fsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(*** hide ***)
#I "../../../artifacts/bin/fcs/net461"
#I "../../artifacts/bin/FSharp.Compiler.Service/Debug/netstandard2.0"
(**
Compiler Services: Notes on FSharp.Core.dll
=================================================
Expand Down
6 changes: 2 additions & 4 deletions docs/fcs/editor.fsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(*** hide ***)
#I "../../../artifacts/bin/fcs/net461"
#I "../../artifacts/bin/FSharp.Compiler.Service/Debug/netstandard2.0"
(**
Compiler Services: Editor services
==================================
Expand Down Expand Up @@ -166,8 +166,7 @@ where we need to perform the completion.
// Get declarations (autocomplete) for a location
let decls =
checkFileResults.GetDeclarationListInfo
(Some parseFileResults, 7, inputLines.[6], PartialLongName.Empty 23, (fun () -> []), fun _ -> false)
|> Async.RunSynchronously
(Some parseFileResults, 7, inputLines.[6], PartialLongName.Empty 23, (fun () -> []))

// Print the names of available items
for item in decls.Items do
Expand Down Expand Up @@ -199,7 +198,6 @@ changes):
// Get overloads of the String.Concat method
let methods =
checkFileResults.GetMethods(5, 27, inputLines.[4], Some ["String"; "Concat"])
|> Async.RunSynchronously

// Print concatenated parameter lists
for mi in methods.Methods do
Expand Down
2 changes: 1 addition & 1 deletion docs/fcs/filesystem.fsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(*** hide ***)
#I "../../../artifacts/bin/fcs/net461"
#I "../../artifacts/bin/FSharp.Compiler.Service/Debug/netstandard2.0"
(**
Compiler Services: Virtualized File System
==========================================
Expand Down
2 changes: 1 addition & 1 deletion docs/fcs/interactive.fsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(*** hide ***)
#I "../../../artifacts/bin/fcs/net461"
#I "../../artifacts/bin/FSharp.Compiler.Service/Debug/netstandard2.0"
(**
Interactive Service: Embedding F# Interactive
=============================================
Expand Down
2 changes: 1 addition & 1 deletion docs/fcs/ja/compiler.fsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(*** hide ***)
#I "../../../../artifacts/bin/fcs/net461"
#I "../../../artifacts/bin/FSharp.Compiler.Service/Debug/netstandard2.0"
(**
コンパイラの組み込み
====================
Expand Down
2 changes: 1 addition & 1 deletion docs/fcs/ja/corelib.fsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(*** hide ***)
#I "../../../../artifacts/bin/fcs/net461"
#I "../../../artifacts/bin/FSharp.Compiler.Service/Debug/netstandard2.0"
(**
コンパイラサービス: FSharp.Core.dll についてのメモ
==================================================
Expand Down
16 changes: 8 additions & 8 deletions docs/fcs/ja/editor.fsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(*** hide ***)
#I "../../../../artifacts/bin/fcs/net461"
#I "../../../artifacts/bin/FSharp.Compiler.Service/Debug/netstandard2.0"
(**
コンパイラサービス: エディタサービス
====================================
Expand Down Expand Up @@ -29,6 +29,7 @@

open System
open FSharp.Compiler.SourceCodeServices
open FSharp.Compiler.Text

// インタラクティブチェッカーのインスタンスを作成
let checker = FSharpChecker.Create()
Expand Down Expand Up @@ -56,7 +57,7 @@ printfn "%s" msg.
let inputLines = input.Split('\n')
let file = "/home/user/Test.fsx"

let projOptions, _errors1 = checker.GetProjectOptionsFromScript(file, input) |> Async.RunSynchronously
let projOptions, _errors1 = checker.GetProjectOptionsFromScript(file, SourceText.ofString input) |> Async.RunSynchronously

let parsingOptions, _errors2 = checker.GetParsingOptionsFromProjectOptions(projOptions)

Expand All @@ -73,7 +74,7 @@ let parsingOptions, _errors2 = checker.GetParsingOptionsFromProjectOptions(projO
*)
// パースを実行
let parseFileResults =
checker.ParseFile(file, input, parsingOptions)
checker.ParseFile(file, SourceText.ofString input, parsingOptions)
|> Async.RunSynchronously
(**
`TypeCheckResults` に備えられた興味深い機能の紹介に入る前に、
Expand All @@ -84,15 +85,15 @@ F#コードにエラーがあった場合も何らかの型チェックの結果

// 型チェックを実行
let checkFileAnswer =
checker.CheckFileInProject(parseFileResults, file, 0, input, projOptions)
checker.CheckFileInProject(parseFileResults, file, 0, SourceText.ofString input, projOptions)
|> Async.RunSynchronously

(**
あるいは `ParseAndCheckFileInProject` を使用すれば1つの操作で両方のチェックを行うことができます:
*)

let parseResults2, checkFileAnswer2 =
checker.ParseAndCheckFileInProject(file, 0, input, projOptions)
checker.ParseAndCheckFileInProject(file, 0, SourceText.ofString input, projOptions)
|> Async.RunSynchronously

(**
Expand Down Expand Up @@ -178,8 +179,7 @@ printfn "%A" tip
// 特定の位置における宣言(自動補完)を取得する
let decls =
checkFileResults.GetDeclarationListInfo
(Some parseFileResults, 7, inputLines.[6], PartialLongName.Empty 23, (fun _ -> []), fun _ -> false)
|> Async.RunSynchronously
(Some parseFileResults, 7, inputLines.[6], PartialLongName.Empty 23, (fun _ -> []))

// 利用可能な項目を表示
for item in decls.Items do
Expand Down Expand Up @@ -213,7 +213,7 @@ for item in decls.Items do
*)
//String.Concatメソッドのオーバーロードを取得する
let methods =
checkFileResults.GetMethods(5, 27, inputLines.[4], Some ["String"; "Concat"]) |> Async.RunSynchronously
checkFileResults.GetMethods(5, 27, inputLines.[4], Some ["String"; "Concat"])

// 連結された引数リストを表示
for mi in methods.Methods do
Expand Down
2 changes: 1 addition & 1 deletion docs/fcs/ja/filesystem.fsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(*** hide ***)
#I "../../../../artifacts/bin/fcs/net461"
#I "../../../artifacts/bin/FSharp.Compiler.Service/Debug/netstandard2.0"
(**
コンパイラサービス: ファイルシステム仮想化
==========================================
Expand Down
6 changes: 3 additions & 3 deletions docs/fcs/ja/interactive.fsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(*** hide ***)
#I "../../../../artifacts/bin/fcs/net461"
#I "../../../artifacts/bin/FSharp.Compiler.Service/Debug/netstandard2.0"
(**
インタラクティブサービス: F# Interactiveの組み込み
==================================================
Expand Down Expand Up @@ -55,8 +55,8 @@ open System.IO
open System.Text

// 入出力のストリームを初期化
let sbOut = new StringBuilder()
let sbErr = new StringBuilder()
let sbOut = StringBuilder()
let sbErr = StringBuilder()
let inStream = new StringReader("")
let outStream = new StringWriter(sbOut)
let errStream = new StringWriter(sbErr)
Expand Down
9 changes: 4 additions & 5 deletions docs/fcs/ja/project.fsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(*** hide ***)
#I "../../../../artifacts/bin/fcs/net461"
#I "../../../artifacts/bin/FSharp.Compiler.Service/Debug/netstandard2.0"
(**
コンパイラサービス: プロジェクトの分析
======================================
Expand All @@ -25,6 +25,7 @@
open System
open System.Collections.Generic
open FSharp.Compiler.SourceCodeServices
open FSharp.Compiler.Text

// インタラクティブチェッカーのインスタンスを作成
let checker = FSharpChecker.Create()
Expand Down Expand Up @@ -157,7 +158,6 @@ let backgroundParseResults1, backgroundTypedParse1 =

let xSymbol =
backgroundTypedParse1.GetSymbolUseAtLocation(9,9,"",["xxx"])
|> Async.RunSynchronously

(**
それぞれのシンボルに対して、シンボルへの参照を検索することもできます:
Expand Down Expand Up @@ -187,7 +187,7 @@ let allUsesOfAllSymbols = wholeProjectResults.GetAllUsesOfAllSymbols()

*)
let parseResults1, checkAnswer1 =
checker.ParseAndCheckFileInProject(Inputs.fileName1, 0, Inputs.fileSource1, projectOptions)
checker.ParseAndCheckFileInProject(Inputs.fileName1, 0, SourceText.ofString Inputs.fileSource1, projectOptions)
|> Async.RunSynchronously

let checkResults1 =
Expand All @@ -196,7 +196,7 @@ let checkResults1 =
| _ -> failwith "想定外の終了状態です"

let parseResults2, checkAnswer2 =
checker.ParseAndCheckFileInProject(Inputs.fileName2, 0, Inputs.fileSource2, projectOptions)
checker.ParseAndCheckFileInProject(Inputs.fileName2, 0, SourceText.ofString Inputs.fileSource2, projectOptions)
|> Async.RunSynchronously

let checkResults2 =
Expand All @@ -210,7 +210,6 @@ let checkResults2 =

let xSymbol2 =
checkResults1.GetSymbolUseAtLocation(9,9,"",["xxx"])
|> Async.RunSynchronously

let usesOfXSymbol2 = wholeProjectResults.GetUsesOfSymbol(xSymbol2.Value.Symbol)

Expand Down
7 changes: 4 additions & 3 deletions docs/fcs/ja/symbols.fsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(*** hide ***)
#I "../../../../artifacts/bin/fcs/net461"
#I "../../../artifacts/bin/FSharp.Compiler.Service/Debug/netstandard2.0"
(**
コンパイラサービス: シンボルの処理
==================================
Expand All @@ -22,6 +22,7 @@
open System
open System.IO
open FSharp.Compiler.SourceCodeServices
open FSharp.Compiler.Text

// インタラクティブチェッカーのインスタンスを作成
let checker = FSharpChecker.Create()
Expand Down Expand Up @@ -77,7 +78,7 @@ type C() =
member x.P = 1
"""
let parseFileResults, checkFileResults =
parseAndTypeCheckSingleFile(file, input2)
parseAndTypeCheckSingleFile(file, SourceText.ofString input2)

(**
これでコードに対する部分的なアセンブリのシグネチャが取得できるようになります:
Expand Down Expand Up @@ -204,7 +205,7 @@ for assembly in projectContext.GetReferencedAssemblies() do
*)
let parseAndCheckScript (file, input) =
let projOptions, errors =
checker.GetProjectOptionsFromScript(file, input)
checker.GetProjectOptionsFromScript(file, SourceText.ofString input)
|> Async.RunSynchronously

let projResults =
Expand Down
2 changes: 1 addition & 1 deletion docs/fcs/ja/tokenizer.fsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(*** hide ***)
#I "../../../../artifacts/bin/fcs/net461"
#I "../../../artifacts/bin/FSharp.Compiler.Service/Debug/netstandard2.0"
(**
コンパイラサービス:F#トークナイザを使用する
============================================
Expand Down
9 changes: 5 additions & 4 deletions docs/fcs/ja/untypedtree.fsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(*** hide ***)
#I "../../../../artifacts/bin/fcs/net461"
#I "../../../artifacts/bin/FSharp.Compiler.Service/Debug/netstandard2.0"
(**
コンパイラサービス:型無し構文木の処理
======================================
Expand Down Expand Up @@ -42,6 +42,7 @@
#r "FSharp.Compiler.Service.dll"
open System
open FSharp.Compiler.SourceCodeServices
open FSharp.Compiler.Text
(**

### 型無しパースの実行
Expand Down Expand Up @@ -70,14 +71,14 @@ let getUntypedTree (file, input) =
// 1つのスクリプトファイルから推測される「プロジェクト」用の
// コンパイラオプションを取得する
let projOptions, errors =
checker.GetProjectOptionsFromScript(file, input)
checker.GetProjectOptionsFromScript(file, SourceText.ofString input)
|> Async.RunSynchronously

let parsingOptions, _errors = checker.GetParsingOptionsFromProjectOptions(projOptions)

// コンパイラの第1フェーズを実行する
let untypedRes =
checker.ParseFile(file, input, parsingOptions)
checker.ParseFile(file, SourceText.ofString input, parsingOptions)
|> Async.RunSynchronously

match untypedRes.ParseTree with
Expand All @@ -101,7 +102,7 @@ ASTを理解するには

ASTに関連する要素は以下の名前空間に含まれています:
*)
open FSharp.Compiler.Ast
open FSharp.Compiler.SyntaxTree
(**

ASTを処理する場合、異なる文法的要素に対するパターンマッチを行うような
Expand Down
Loading