Open Mandarancio opened 2 months ago
I have implemented this some time ago with support for previewing and approving the changes graphically https://github.com/pragtical/lsp/pull/3
@jgmdev nice, there are any plans to merge it into lite-xl-lsp?
Can be picked by any one for merging.
I just realized that different LSP have different responses, for example clangd
will reply with something like this
{
"results": {
"changes": {
"$FILE_URI_0": [ ... ],
"$FILE_URI_1": [ ... ]
}
}
}
While pyright
will answer like:
{
"results": {
"documentChanges": [
{
"textDocument": { "uri": "$FILE_URI_0" },
"edits": [ ... ]
}, {
"textDocument": { "uri": "$FILE_URI_1" },
"edits": [ ... ]
}
]
}
}
There is a way to uniform the responses?
I just realized that different LSP have different responses, for example
clangd
will reply with something like this{ "results": { "changes": { "$FILE_URI_0": [ ... ], "$FILE_URI_1": [ ... ] } } }
While
pyright
will answer like:{ "results": { "documentChanges": [ { "textDocument": { "uri": "$FILE_URI_0" }, "edits": [ ... ] }, { "textDocument": { "uri": "$FILE_URI_1" }, "edits": [ ... ] } ] } }
There is a way to uniform the responses?
Implemented workaround that convert the two types of answer to a same structure
Implementation of symbol renaming using the results from the lsp server:
get_token_range
when no selection is active to get the symbol under the cursorI did not implement an automatic file save of the changes as it force the developer to open, (review), and save the changes manually (it could be a configuration).
There is still work to do as the LSP after the refactoring seems to be out of sync with the updated files, help with testing and debugging is needed