-
Notifications
You must be signed in to change notification settings - Fork 805
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
port fsih to fsi as a hash directive #17140
Conversation
❗ Release notes required
|
Nice, I'm fine with having it shipped by default, it will need tests though (simple baseline which verifies couple of outputs). And an approval from @KevinRansom |
From a usability perspective, is there any auto complete support for hash directive contents? If so, users could dot-into the expression they want docs for. |
Hey Dawe, I think this would be a great addition to FSI, worth spreading a word about it once it's in. A note on errh clean code, would you want to move the new module to a separate file or something like this? |
Considerations:
Disregarding this, it already sound like nice feature that will speak to users of python REPL and other similar environments 🙂. |
It's not a dependency manager related functionality, so probably not(?). There's no such thing as "FSI extension",
In this case, we will need additional testing for it for different
Also would require much more testing with both non-terminal environments as well as all popular emulators and shells. |
There is autocomplete in VS for filepaths inside the But I think I'm a bit thrown off by the What is the primary motivation for using a hash directive?
(1) doesn't feel super-compelling to me, since all the other FSI directives, including If (2), then I think we could just add the help for If (3), then what about just adding an fsi.h List.map;; |
Thanks :) |
My motivation was an uniform distribution among all three points. You're making a strong argument for a new |
I concede it might sound unatural, but #r stands for "reference" (looking for "reference documentation"), and #r extensions can/do print to the output. It would need 0 parser changes. @brianrourkeboll suggestion of I also prefer it to hash directive and quoting the expression. Are there special events that FSI session will trigger? Can such events be done from a type extension over This could help extending IDEs in terms of how the output is parsed / displayed (with the idea of markdown or pretty printing strategies that could be implemented on top, rather than raw parsing of stdout). |
Unfortunately, we lose access to the shimed filesystem by being in the FSharp.Compiler.Interactive.Settings project.
Co-authored-by: Brian Rourke Boll <brianrourkeboll@users.noreply.github.com>
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
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.
Nice, I think this will be useful. I have one issue about the help text, it's not really an expression, it is probably better described as an identifier.
tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs
Outdated
Show resolved
Hide resolved
Head branch was pushed to by a user without write access
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
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.
Nice work.
Thanks
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
13b3c0d
to
2e399bf
Compare
2e399bf
to
01fbdf2
Compare
Thanks for this. |
Description
This is a port of fsih to fsi itself as a hash directive.
I think using a hash directive for this makes the most sense but as we use the normal parser for them it also means we have to wrap the expression in parentheses. I hope that's an acceptable tradeoff.
If you want to give this a try, you have to copy the
FSharp.Core.xml
manually to the fsi artifacts folder. The build process doesn't do it. Later, in the SDK distribution, the xml file will be there as far as I can see.I want to mention that this PR was made possible by the supporters of the Amplifying FSharp Open Collective.
Checklist
Test cases added
Performance benchmarks added in case of performance changes
Release notes entry updated: