-
Notifications
You must be signed in to change notification settings - Fork 824
[WIP] Support --typecheck-only for fsi run (just typecheck, no execution) #18687
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
base: main
Are you sure you want to change the base?
Conversation
@copilot try again pls |
❗ Release notes requiredCaution No release notes found for the changed paths (see table below). Please make sure to add an entry with an informative description of the change as well as link to this pull request, issue and language suggestion if applicable. Release notes for this repository are based on Keep A Changelog format. The following format is recommended for this repository:
If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request. You can open this PR in browser to add release notes: open in github.dev
|
Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
I've implemented the --typecheck-only support for FSI as requested. The implementation includes:
The changes are minimal and surgical, following the existing patterns in the codebase. Commit a8db5c6 contains the complete implementation. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
@copilot : In the side effect test: rather than generating a file as the side effect which needs cleanup, just have the script print a string to the console. And use verifyOutput "MyCrazyString" You will need to add a not contains version though. |
…effects Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
Updated the tests to use console output with Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
/run ilverify |
🔧 CLI Command Report
❌ Command failed — no patch applied. |
@copilot : Add release notes to docs/release-notes/.FSharp.Compiler.Service/10.0.100.md please. |
Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
Added release notes for the --typecheck-only flag in docs/release-notes/.FSharp.Compiler.Service/10.0.100.md under the "Added" section. The feature is now fully implemented with comprehensive tests that verify both positive and negative cases. Commit 0140ab0 includes the release notes. |
/run ilverify |
🔧 CLI Command Report
❌ Command failed — no patch applied. |
@@ -1308,6 +1308,13 @@ let advancedFlagsFsi tcConfigB = | |||
None, | |||
Some(FSComp.SR.optsClearResultsCache ()) | |||
) | |||
CompilerOption( |
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.
This option is now available for help, hence the following 4 tests are failing:
CompilerOptions\fsi\help (-?-40) -- failed
CompilerOptions\fsi\help (--help-40) -- failed
CompilerOptions\fsi\help (/?-40) -- failed
CompilerOptions\fsi\help (-? --nologo-40) -- failed
They are part of the FsharpQa suite.
This can help you, the new lines are added between clearResultsCache and exec options:
--clearResultsCache Clear the package manager results
cache
--typecheck-only Perform type checking only, do not
execute code
--exec Exit fsi after loading the files or
running the .fsx script given on the
command line
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.
Updated help baselines to include the new --typecheck-only option. The baseline files help40.437.1033.bsl and help40-nologo.437.1033.bsl now correctly show the new option between clearResultsCache and exec options as expected. Commit f43c85a addresses this issue.
@@ -4763,6 +4768,7 @@ type FsiEvaluationSession | |||
let userRes = | |||
match res with | |||
| Choice1Of2 r -> Choice1Of2 r | |||
| Choice2Of2 None when errorInfos.Length = 0 && tcConfigB.typeCheckOnly -> Choice1Of2 None |
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.
Because of this change, line numbers after ilxgen for closures have shifted and therefore slightly changed ilverify baseline.
Read this repo docs for ilverify
(search for it) and follow the guide for updating the baseline. It will require setting an env var and then running a script.
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.
Updated ILVerify baselines to fix line number shifts caused by the code additions in fsi.fs. Updated line references from 3494→3495, 2225→2226, and 4446→4447 across all FSharp.Compiler.Service baseline files (Debug/Release, net9.0/netstandard2.0). Commit f43c85a addresses this issue.
- Update FSI help baselines to include new --typecheck-only option in help output - Update ILVerify baselines to fix line number shifts caused by code additions Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.
Original issue description:
Fixes #18686.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.