Closed nojaf closed 5 months ago
This can actually be solved quite easily if the newly added extended data is available.
@baronfel any ideas on how we want to expose this optional information in the Diagnostic
type?
@TheAngryByrd I'm able to get the extended data from the diagnostic in the check results. This is heaven-sent.
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.
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.
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!
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?
Serious doubt there. Did you re-run them?
Could this one get merged please?
Thanks Jimmy!
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
🧵🔄🧪
WHY
HOW
🤖 Generated by Copilot at ffe2cca
ToInterpolatedString.fix
function converts string concatenation expressions to interpolated strings using the$
syntax (link)UpdateValueInSignatureFile.fix
function updates the value declaration in a signature file to match the implementation file using theFSharpSymbolUse
information (link)ToInterpolatedString.fsi
andUpdateValueInSignatureFile.fsi
declare the public types and values of the new code fix modules (link, link)AdaptiveFSharpLspServer
andFSharpLspServer
types can handle the new code fixes by adding them to the list of code fix providers (link, link)UpdateValueInSignatureFileTests.fs
file contains the test cases for theUpdateValueInSignatureFile
code fix, using thecheckFixAt
function with different document identifiers (link)tests
function inTests.fs
runs the new code fix tests along with the existing ones (link)checkFixAt
function takes a new parametereditsFrom
that specifies the text document identifier from which the code fix edits should be extracted (link)checkFixAt
function applies the code fix edits to the document specified byeditsFrom
, which may not be the same as the document that triggered the code fix (link)checkFix
andcheckFixAll
functions pass the document identifier of the untitled or shared document to thecheckFixAt
function, which is the same as the document that triggered the code fix (link, link)RenameParamToMatchSignatureTests.fs
file adds new lines before eachtestCaseAsync
expression to improve the readability and consistency of the test code (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)RenameParamToMatchSignatureTests.fs
file removes an extra empty line at the end of the module (link)CursorbasedTests.fs
andCursorbasedTests.fsi
files remove some unused open statements from theUtils.CursorbasedTests
module (link, link, link, link)CursorbasedTests.fs
file removes some extra spaces and new lines from thediagnosticsIn
,checkFixAt
, andcheckFixAll
functions (link, link, link, link)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.