Skip to content

Commit aee592a

Browse files
snjezargrunber
authored andcommitted
Remove command 'java.edit.smartSemicolonDetectionUndo'
Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
1 parent 4352492 commit aee592a

File tree

5 files changed

+2
-36
lines changed

5 files changed

+2
-36
lines changed

package.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,11 +1301,6 @@
13011301
"command": "java.edit.smartSemicolonDetection.command",
13021302
"title": "%java.edit.smartSemicolonDetection%",
13031303
"category": "Java"
1304-
},
1305-
{
1306-
"command": "java.edit.smartSemicolonDetectionUndo",
1307-
"title": "%java.edit.smartSemicolonDetectionUndo%",
1308-
"category": "Java"
13091304
}
13101305
],
13111306
"keybindings": [
@@ -1328,11 +1323,6 @@
13281323
"command": "java.edit.smartSemicolonDetection.command",
13291324
"key": ";",
13301325
"when": "editorTextFocus && !editorReadonly && javaLSReady && editorLangId == java"
1331-
},
1332-
{
1333-
"command": "java.edit.smartSemicolonDetectionUndo",
1334-
"key": "backspace",
1335-
"when": "editorTextFocus && !editorReadonly && javaLSReady && editorLangId == java"
13361326
}
13371327
],
13381328
"menus": {

package.nls.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,5 @@
2525
"java.project.createModuleInfo.command": "Create module-info.java",
2626
"java.clean.sharedIndexes": "Clean Shared Indexes",
2727
"java.server.restart": "Restart Java Language Server",
28-
"java.edit.smartSemicolonDetection": "Java Smart Semicolon Detection",
29-
"java.edit.smartSemicolonDetectionUndo": "Java Smart Semicolon Detection Undo"
28+
"java.edit.smartSemicolonDetection": "Java Smart Semicolon Detection"
3029
}

src/commands.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,4 @@ export namespace Commands {
341341
export const SMARTSEMICOLON_DETECTION = "java.edit.smartSemicolonDetection";
342342
export const SMARTSEMICOLON_DETECTION_CMD = "java.edit.smartSemicolonDetection.command";
343343

344-
/**
345-
* Smart semicolon detection backspace.
346-
*/
347-
export const SMARTSEMICOLON_DETECTION_UNDO = "java.edit.smartSemicolonDetectionUndo";
348-
349344
}

src/smartSemicolonDetection.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,6 @@ export function registerSmartSemicolonDetection(context: ExtensionContext) {
3131
newPosition = null;
3232
oldPosition = null;
3333
}));
34-
context.subscriptions.push(commands.registerCommand(Commands.SMARTSEMICOLON_DETECTION_UNDO, async () => {
35-
if (didSmartSemicolonInsertion() && enabled()) {
36-
window.activeTextEditor!.edit(editBuilder => {
37-
editBuilder.insert(oldPosition, ";");
38-
const delRange = new Range(newPosition, new Position(newPosition.line, newPosition.character + 1));
39-
editBuilder.delete(delRange);
40-
window.activeTextEditor.selections = [new Selection(oldPosition, oldPosition)];
41-
oldPosition = null;
42-
newPosition = null;
43-
});
44-
return;
45-
}
46-
window.activeTextEditor!.edit(() => {
47-
commands.executeCommand("deleteLeft");
48-
});
49-
oldPosition = null;
50-
newPosition = null;
51-
}));
5234
}
5335

5436
interface SmartDetectionParams {

test/standard-mode-suite/extension.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ suite('Java Language Extension - Standard', () => {
115115
Commands.UPGRADE_GRADLE_WRAPPER_CMD,
116116
Commands.UPDATE_SOURCE_ATTACHMENT,
117117
Commands.UPDATE_SOURCE_ATTACHMENT_CMD,
118+
Commands.SMARTSEMICOLON_DETECTION,
118119
Commands.SMARTSEMICOLON_DETECTION_CMD,
119-
Commands.SMARTSEMICOLON_DETECTION_UNDO,
120120
Commands.RESOLVE_SOURCE_ATTACHMENT,
121121
].sort();
122122
const foundJavaCommands = commands.filter((value) => {

0 commit comments

Comments
 (0)