-
-
Couldn't load subscription status.
- Fork 293
Extract shared line lens and pipeline hint code #1895
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
Conversation
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.
Thanks! Looks good.
We have some CI issues we need to get dealt with before we merge.
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.
I can't get this to build locally
.\src\Components\LineLens\LineLens.fs(145,9): (145,56) error FSHARP: Type mismatch. Expecting a
'Fable.Import.VSCode.Vscode.TextDocument -> Ionide.VSCode.FSharp.DTO.Result<Ionide.VSCode.FSharp.DTO.Symbols Microsoft.FSharp.Core.array> -> Fable.Import.VSCode.Vscode.Uri -> Fable.Core.JS.Promise<(Fable.Import.VSCode.Vscode.Range * Microsoft.FSharp.Core.string) Microsoft.FSharp.Core.array>'
but given a
'Fable.Import.VSCode.Vscode.TextDocument -> Ionide.VSCode.FSharp.DTO.Result<Ionide.VSCode.FSharp.DTO.Symbols Microsoft.FSharp.Core.array> -> Fable.Import.VSCode.Vscode.Uri -> Fable.Core.JS.Promise<(Ionide.VSCode.FSharp.DTO.Range * Microsoft.FSharp.Core.string) Microsoft.FSharp.Core.array>'
The type 'Fable.Import.VSCode.Vscode.Range' does not match the type 'Ionide.VSCode.FSharp.DTO.Range' (code 1)
Compilation failed
|
@TheAngryByrd This should be fixed now, not sure what happened there, I must have not pushed something 🤦♂️ |
|
👋 I'm pretty busy until next week, I'll do another pass then. |
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 - this really illustrates the shared workflow between the features. It'll also make it easier to add new kinds of lenses!
|
Thank you for this! |
WHAT
🤖 Generated by Copilot at eed7bb7
This pull request refactors the code for the LineLens and PipelineHints features, which show the signatures and types of F# expressions at the end of the lines. The code is moved from a single file
Components/LineLens.fsto three separate filesComponents/LineLens/LineLensShared.fs,Components/LineLens/LineLens.fs, andComponents/LineLens/PipelineHints.fs, to improve the organization and readability of the code. The code also uses a newLineLenstype andInstancevalues to expose the features as singletons, and updates the references to the features in other modules and the project file.🤖 Generated by Copilot at eed7bb7
📁🔧🚀
WHY
The line lens and Pipeline hint code has significant duplication. I have attempted to share as much code as possible. This was initially motivated by investigating how difficult it would be to port this feature to the ocaml vscode extension
HOW
🤖 Generated by Copilot at eed7bb7
LineLensShared.fsthat contains common types and functions for managing the decorations that show the signatures and types at the end of the lines (link)LineLens.fsthat contains the code for the LineLens feature, which shows the signature of functions and values at the end of the line, and uses theLineLensShared.fsmodule (link)PipelineHints.fsthat contains the code for the PipelineHints feature, which shows the type of expressions in pipelines at the end of the line, and uses theLineLensShared.fsmodule (link)Components/LineLens.fsthat contained the code for both features (link)Instancevalues that expose theLineLenstype as a singleton for each feature, and use them to access the features from other modules (link, link)Components/LineLens/LineLensShared.fs,Components/LineLens/LineLens.fs, andComponents/LineLens/PipelineHints.fsto the list of compiled files (link)Components/LineLens.fsfrom the list of compiled files (link)activateinsrc/fsharp.fsto use theInstancevalues ofLineLensandPipelineHintsinstead of the old module names (link, link)LineLens.activateandLineLens.deactivatewithLineLens.Instance.activateandLineLens.Instance.deactivate(link)PipelineHints.activateandPipelineHints.deactivatewithPipelineHints.Instance.activateandPipelineHints.Instance.deactivate(link)privateinsrc/Components/SolutionExplorer.fsto use theInstancevalues ofLineLensandPipelineHintsinstead of the old module names (link)LineLens.removeDecorationsandPipelineHints.removeDecorationswithLineLens.Instance.removeDecorationsandPipelineHints.Instance.removeDecorations(link)