Skip to content

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 enabled auto-merge March 30, 2023 20:15
@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]>
@psfinaki
Copy link
Contributor

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