-
Notifications
You must be signed in to change notification settings - Fork 946
client->server request: Join Lines #992
Copy link
Copy link
Open
Labels
feature-requestRequest for new features or functionalityRequest for new features or functionalitynew request
Milestone
Description
Meta: I am in the process of formalizing protocol extensions, used by rust-analyzer. I will be filing issues for generally useful extensions. Here's the doc where we will document our extensions.
joinLines
Server Capability: { "joinLines": boolean }
This request is send from client to server to handle "Join Lines" editor action.
Method: experimental/JoinLines
Request:
interface JoinLinesParams {
textDocument: TextDocumentIdentifier,
/// Currently active selections/cursor offsets.
/// This is an array to support multiple cursors.
ranges: Range[],
}Response:
TextEdit[]Example
fn main() {
/*cursor here*/let x = {
92
};
}experimental/joinLines yields (curly braces are automagiacally removed)
fn main() {
let x = 92;
}Unresolved Question
- What is the position of the cursor after
joinLines?
Currently this is left to editor's discretion, but it might be useful to specify on the server via snippets.
However, it then becomes unclear how it works with multi cursor.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature-requestRequest for new features or functionalityRequest for new features or functionalitynew request