Adds cursor information to the return value of reshape_info
The upcoming release of LSP will support SnippetEdits as returned WorkspaceEdits in a code action, which allows for setting the cursor position after reshaping so that it stays on the same syntax element after applying the reshape.
To allow this, I updated reshape_info so that it returns the character index where the cursor should be in the replacement text. This is determined by finding the same non-whitespace character index in the new text.
reshape_info
:facepalm:reshape_info
The upcoming release of LSP will support SnippetEdits as returned WorkspaceEdits in a code action, which allows for setting the cursor position after reshaping so that it stays on the same syntax element after applying the reshape.
To allow this, I updated
reshape_info
so that it returns the character index where the cursor should be in the replacement text. This is determined by finding the same non-whitespace character index in the new text.