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

An exception in the ChangePrefixNegationToInfixSubstraction code fix #16356

Closed
Tracked by #15408
psfinaki opened this issue Nov 29, 2023 · 4 comments
Closed
Tracked by #15408

An exception in the ChangePrefixNegationToInfixSubstraction code fix #16356

psfinaki opened this issue Nov 29, 2023 · 4 comments
Labels
Area-LangService-CodeFixes Code fixes associated with diagnostics Bug good first issue Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Milestone

Comments

@psfinaki
Copy link
Member

This code throws:

type MyType = { Value: int }

let test = { Value = 42 }x

The stack trace:

System.ArgumentOutOfRangeException : Specified argument was out of the range of valid values.
Parameter name: index
   at Microsoft.VisualStudio.Text.Implementation.StringRebuilderForString.get_Item(Int32 index)
   at async StartupCode$FSharp-Editor(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.VisualStudio.FSharp.Editor.CodeFixExtensions.CodeFixContext-RegisterFsharpFix@93(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.CodeFixes.CodeFixService.GetCodeFixesAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformFunctionAsync[T](<Unknown Parameters>)

This happens because the code above happens to produce FS0003 (This value is not a function) whereas the code fix searches for the - sign in the code and fails to find one here.

@psfinaki psfinaki added the Area-LangService-CodeFixes Code fixes associated with diagnostics label Nov 29, 2023
@github-actions github-actions bot added this to the Backlog milestone Nov 29, 2023
@psfinaki psfinaki mentioned this issue Nov 29, 2023
85 tasks
@0101 0101 added Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code. and removed Needs-Triage labels Dec 4, 2023
@brianrourkeboll
Copy link
Contributor

Was this fixed by #17448?

@psfinaki
Copy link
Member Author

I don't think so, repros in main 🤔

@brianrourkeboll
Copy link
Contributor

I don't think so, repros in main 🤔

Hmm, it doesn't seem to repro for me.

@psfinaki
Copy link
Member Author

psfinaki commented Sep 2, 2024

Right, actually you're correct, I had old old main in my branch 🤦
This seems to be fixed then, thanks for pointing out, closing the ticket!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-LangService-CodeFixes Code fixes associated with diagnostics Bug good first issue Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Projects
Archived in project
Development

No branches or pull requests

3 participants