Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions lib/adapters/code-action-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,20 @@ export default class CodeActionAdapter {
connection: LanguageClientConnection,
): Promise<void> {
if (Command.is(command)) {
await connection.executeCommand({
command: command.command,
arguments: command.arguments,
});
// eclipse.jdt.ls breaks with the spec and expects the client to handle the command
// https://github.com/eclipse/eclipse.jdt.ls/issues/376
if (command.command === 'java.apply.workspaceEdit') {
if (command.arguments) {
// Guaranteed only ever one element in the arguments array
const edit: WorkspaceEdit = command.arguments[0];
CodeActionAdapter.applyWorkspaceEdit(edit);
}
} else {
await connection.executeCommand({
command: command.command,
arguments: command.arguments,
});
}
}
}

Expand Down