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

Context Actions: support named patterns annotation #783

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

DedSec256
Copy link
Collaborator

No description provided.

@DedSec256 DedSec256 changed the title Context Actions: support named pattern annotations Context Actions: support named patterns annotation Dec 17, 2024
@DedSec256 DedSec256 marked this pull request as ready for review February 12, 2025 21:09
@DedSec256 DedSec256 requested a review from auduchinok February 13, 2025 12:33
@@ -19,3 +21,8 @@ let getFunctionTypeArgs includeReturnType fcsType =
acc

loop fcsType [] |> List.rev

let fixIfOptionalParameter (pattern: IReferencePat) fcsType =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does fix mean here?

What does it return? And what happens if the parameter is not optional?



[<ContextAction(Name = "AnnotatePattern", GroupType = typeof<FSharpContextActions>,
Description = "Annotate named pattern")>]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we only want to work it for named patterns?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this PR, I would focus on named patterns (for example, we now show inlay hints mainly for named patterns)

@@ -50,7 +50,12 @@ module SpecifyTypes =
parenPat.SetPattern(pattern) |> ignore
parenPat :> IFSharpPattern

let specifyParameterType displayContext (fcsType: FSharpType) (pattern: IFSharpPattern) =
let specifyPattern displayContext (fcsType: FSharpType) (pattern: IFSharpPattern) =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does 'specify pattern' mean?

@DedSec256 DedSec256 marked this pull request as draft February 19, 2025 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants