ionide / FsAutoComplete

F# language server using Language Server Protocol
Other
391 stars 151 forks source link

Update value in signature file. #1161

Closed nojaf closed 5 months ago

nojaf commented 10 months ago

WHAT

🤖 Generated by Copilot at ffe2cca

This pull request adds a new code fix feature that updates the value declaration in a signature file to match the implementation file, and integrates it into the language server and the test suite. It also refactors and cleans up some existing test modules and utilities for code fixes, and adds a new module for a code fix that converts string concatenation to interpolated strings.

🤖 Generated by Copilot at ffe2cca

We're the crew of the FsAutoComplete ship We sail the seas of code with skill and wit We fix the strings and values as we go And test them all with testCaseAsync so

🧵🔄🧪

WHY

HOW

🤖 Generated by Copilot at ffe2cca

Dog feeding https://github.com/fsharp/FsAutoComplete/pull/1158 a bit. I think I'm doing something wrong on the Expecto side. dotnet run isn't exiting correctly.

The actual code fix needs to be expanded a bit more. I would, however, very much like to have this. I could use a first round of feedback if anybody is up for it.

nojaf commented 6 months ago

This can actually be solved quite easily if the newly added extended data is available.

image

@baronfel any ideas on how we want to expose this optional information in the Diagnostic type?

nojaf commented 6 months ago

@TheAngryByrd I'm able to get the extended data from the diagnostic in the check results. This is heaven-sent.

baronfel commented 6 months ago

This is great @nojaf - using extended data was what came to my mind immediately. Let me take a look at the way you're using it - we may want to think of some kind of protocol for single-fix vs whole-file fixes, for example.

TheAngryByrd commented 6 months ago

I know LSP kind of defines categories but they’re not explicit. Had to go looking thru the vscode code to see what was supported.

nojaf commented 6 months ago

Let me take a look at the way you're using it - we may want to think of some kind of protocol for single-fix vs whole-file fixes, for example.

Could that be part of a separate effort? I feel like this one is good to go, nothing to lose here.

And could someone re-run the failed builds? I don't think all of them are problematic. Thx!

TheAngryByrd commented 6 months ago

And could someone re-run the failed builds? I don't think all of them are problematic.

3 of them (mac/ubuntu) seem to be formatting failures.

src/FsAutoComplete.Core/Commands.fs needs formatting

Is this just newline/encoding nonsense?

nojaf commented 6 months ago

Serious doubt there. Did you re-run them?

nojaf commented 5 months ago

Could this one get merged please?

nojaf commented 5 months ago

Thanks Jimmy!