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

Fix parameter name hints crashing with multi-line arguments #15004

Merged
merged 1 commit into from
Mar 30, 2023

Conversation

0101
Copy link
Contributor

@0101 0101 commented Mar 30, 2023

Fixes #14885 which caused hints to stop working in certain files when parameter name hints were enabled.

The cause was that we're trying to look at arguments passed to a function and see if they're variables with the same name as the named parameter name. And we looked at a line substring between range.StartColumn and range.EndColumn. However the argument doesn't have to be a variable and can span multiple lines (like a lambda or a list) and then we're trying to get an impossible substring, e.g. of negative length.

@0101 0101 requested a review from a team as a code owner March 30, 2023 15:16
@vzarytovskii vzarytovskii merged commit 18c79cf into dotnet:main Mar 30, 2023
vzarytovskii pushed a commit that referenced this pull request Apr 1, 2023
* Fix parameter name hints crashing with multi-line arguments (#15004)

* Return type hints (#14998)

---------

Co-authored-by: Petr Pokorny <[email protected]>
Co-authored-by: Kevin Ransom (msft) <[email protected]>
kant2002 pushed a commit to kant2002/fsharp that referenced this pull request Apr 1, 2023
@psfinaki
Copy link
Member

psfinaki commented Apr 3, 2023

Thanks!

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.

Hints throw exception
4 participants