-
Notifications
You must be signed in to change notification settings - Fork 807
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
Support CallerArgumentExpression
(without #line
)
#17519
base: main
Are you sure you want to change the base?
Changes from all commits
9d3917a
b698a3b
dec3d3e
e5d7763
5119bb6
c914672
5fe3495
536cf34
b270e16
3fc4642
550daa4
5cecb20
1b6cd56
08d958b
68f2f61
ec3b97f
7e93270
5790db9
46c4d46
8d792fa
65a4acc
1bdae47
9e46116
f379b7f
843c71a
6d1a30d
5f499a5
470b993
477ed6e
6fb6548
c8ca45b
b5f22fb
271985b
31e7bb2
d47ee7e
424b83c
77697cd
1e43eff
2d38b2a
52a0fc0
24a9494
935af15
31125f5
49c46b1
983f180
cf2085b
52a4d53
6e6dd39
9c5d917
795c64a
98d8708
d68a6f7
9ac37e6
2cfba8d
262ed24
9c24123
081a36b
1999506
2e7121d
fb8a3d0
70f5630
1cc4395
3c1deb4
a5a4b8b
5cba8ca
0b02f01
1258816
95a4930
c3baed5
5e1e27c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1539,3 +1539,14 @@ type TcConfigProvider = | |
TcConfigProvider(fun _ctok -> TcConfig.Create(tcConfigB, validate = false)) | ||
|
||
let GetFSharpCoreLibraryName () = getFSharpCoreLibraryName | ||
|
||
/// Read and store the source file content for the `CallerArgumentExpression` feature | ||
let readAndStoreFileContents (tcConfig: TcConfig) (sourceFiles: #seq<string>) = | ||
for fileName in sourceFiles do | ||
if FSharpImplFileSuffixes |> List.exists (FileSystemUtils.checkSuffix fileName) then | ||
try | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I still wonder there is any way we could pass in an existing |
||
use fileStream = FileSystem.OpenFileForReadShim fileName | ||
use reader = fileStream.GetReader(tcConfig.inputCodePage) | ||
FileContent.update fileName (reader.ReadToEnd()) | ||
with _ -> | ||
() |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -671,6 +671,9 @@ let main1 | |
// Build the initial type checking environment | ||
ReportTime tcConfig "Typecheck" | ||
|
||
// Read the source file content for the `CallerArgumentExpression` feature | ||
readAndStoreFileContents tcConfig sourceFiles | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you also add a "ReportTime" section here so that we can see impact on timing in selected compilations? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Especially something bigger, like when the compiler compiles itself (this will need the |
||
|
||
use unwindParsePhase = UseBuildPhase BuildPhase.TypeCheck | ||
|
||
let tcEnv0, openDecls0 = | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls add a remark about this only being for CLI standalone compilation + fsi
(so that future contributors do not attempt to hook this into design-time scenarios, especially because of allocations and file-reads this would have massive consequences for typing)