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

Light up method tupled parameters #1140

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

baronfel
Copy link
Contributor

@baronfel baronfel commented Jul 11, 2023

WHAT

🤖 Generated by Copilot at 4024f9c

Enhance inlay hints for F# code by adding support for methods and named arguments, and simplify hint creation code in InlayHints.fs.

🤖 Generated by Copilot at 4024f9c

The F# coder loves inlay hints
They help to avoid syntax stints
But methods and args
Were missing some sparks
This pull request adds them in sprints

🚀🔧🧹

WHY

Now that we're on a version of FCS that supports the ArgumentLocations member for supporting parameter hints in methods, we should light this up. This currently fails because the new parameter hint reports at the incorrect position, so I need to figure that part out.

HOW

🤖 Generated by Copilot at 4024f9c

  • Extend condition for showing parameter hints to methods as well as constructors (link). This is part of the inlay hints feature for F# code in src/FsAutoComplete.Core/InlayHints.fs.

@baronfel baronfel force-pushed the reenable-commented-out-constructor-parameter-hints branch from 4024f9c to 15c69e1 Compare July 11, 2023 13:22
@baronfel
Copy link
Contributor Author

Example of failing test:

Number of actual hints and expected hints don't match. Expected list to have length 1, but length was 2. Seq:
[|{ Position = { Line = 1
                 Character = 61 }
    Label = String "jsonText ="
    Kind = Some Parameter
    TextEdits = None
    Tooltip = None
    PaddingLeft = None
    PaddingRight = Some true
    Data = None }; { Position = { Line = 1
                                  Character = 61 }
                     Label = String "decoder ="
                     Kind = Some Parameter
                     TextEdits = None
                     Tooltip = None
                     PaddingLeft = None
                     PaddingRight = Some true
                     Data = None }|]

There are two things that need to change here:

  • the test needs to update to expect 2 hints
  • the second hint has an incorrect position/range. I think the VS F# code may have some pointers here, but I think this just needs a bit of debugging.

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.

1 participant