Skip to content

Conversation

@rosskuehl
Copy link
Contributor

Another piece of fsharp/issues/14459

Inline type hints are still being shown for optional parameters, even when an explicit annotation is provided by the user:
Screenshot 2022-12-29 at 10 34 39 AM

Fixed:
Screenshot 2022-12-29 at 12 56 37 PM

Root cause:
IsTypeAnnotationGivenAtPosition returns false when given the starting position of an optional parameter immediately following the ? symbol

Solution:
Account for ? and adjust column start by 1 for this check when detecting an optional parameter declaration

Comments:
This brings up another potential issue when manual annotations are subsequently removed; the parameter type is not resolved based on the usage below (see screenshot)

Screenshot 2022-12-29 at 12 57 25 PM

@rosskuehl rosskuehl requested a review from a team as a code owner December 29, 2022 18:24
@psfinaki
Copy link
Contributor

psfinaki commented Jan 5, 2023

@rosskuehl thanks a lot for your contributions to the hints and for refactoring the code on the way :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants