Skip to content

Commit 829e8c6

Browse files
testforstephenrgrunber
authored andcommitted
Revert "Smart semicolon autocorrect (#3159)"
This reverts commit 3ad9b16.
1 parent f6aa821 commit 829e8c6

File tree

10 files changed

+4
-142
lines changed

10 files changed

+4
-142
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
## 1.21.0 (July 27th, 2023)
44
* performance - Check completion proposal is compatible or not. See [JLS#2733](https://github.com/eclipse/eclipse.jdt.ls/pull/2733).
5-
* enhancement - Add support for smart semicolon insertion. See [#703](https://github.com/redhat-developer/vscode-java/issues/703).
65
* enhancement - Add code actions for Join/Split variable. See [JLS#2732](https://github.com/eclipse/eclipse.jdt.ls/pull/2732).
76
* enhancement - Support outline view for decompiled source. See [JLS#2742](https://github.com/eclipse/eclipse.jdt.ls/pull/2742).
87
* enhancement - Reload the cached classfile sources when their source attachment is updated. See [#3207](https://github.com/redhat-developer/vscode-java/pull/3207).

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ New in 1.21.0
240240
- `ask`: Ask to reload the sources of the open class files
241241
- `auto`: Automatically reload the sources of the open class files
242242
- `manual`: Manually reload the sources of the open class files
243-
* `java.edit.smartSemicolonDetection.enabled`: Defines the `smart semicolon` detection. Defaults to `false`.
244243

245244
Semantic Highlighting
246245
===============

package.json

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,12 +1140,6 @@
11401140
"markdownDescription": "Specifies whether to recheck all open Java files for diagnostics when editing a Java file.",
11411141
"scope": "window"
11421142
},
1143-
"java.edit.smartSemicolonDetection.enabled": {
1144-
"type": "boolean",
1145-
"default": false,
1146-
"markdownDescription": "Defines the `smart semicolon` detection. Defaults to `false`.",
1147-
"scope": "window"
1148-
},
11491143
"java.editor.reloadChangedSources": {
11501144
"type": "string",
11511145
"enum": [
@@ -1308,16 +1302,6 @@
13081302
"command": "java.server.restart",
13091303
"title": "%java.server.restart%",
13101304
"category": "Java"
1311-
},
1312-
{
1313-
"command": "java.edit.smartSemicolonDetection.command",
1314-
"title": "%java.edit.smartSemicolonDetection%",
1315-
"category": "Java"
1316-
},
1317-
{
1318-
"command": "java.edit.smartSemicolonDetectionUndo",
1319-
"title": "%java.edit.smartSemicolonDetectionUndo%",
1320-
"category": "Java"
13211305
}
13221306
],
13231307
"keybindings": [
@@ -1335,16 +1319,6 @@
13351319
"key": "ctrl+shift+v",
13361320
"mac": "cmd+shift+v",
13371321
"when": "javaLSReady && editorLangId == java"
1338-
},
1339-
{
1340-
"command": "java.edit.smartSemicolonDetection.command",
1341-
"key": ";",
1342-
"when": "editorFocus && javaLSReady && editorLangId == java"
1343-
},
1344-
{
1345-
"command": "java.edit.smartSemicolonDetectionUndo",
1346-
"key": "backspace",
1347-
"when": "editorFocus && javaLSReady && editorLangId == java"
13481322
}
13491323
],
13501324
"menus": {

package.nls.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,5 @@
2424
"java.action.changeBaseType": "Base on this Type",
2525
"java.project.createModuleInfo.command": "Create module-info.java",
2626
"java.clean.sharedIndexes": "Clean Shared Indexes",
27-
"java.server.restart": "Restart Java Language Server",
28-
"java.edit.smartSemicolonDetection": "Java Smart Semicolon Detection",
29-
"java.edit.smartSemicolonDetectionUndo": "Java Smart Semicolon Detection Undo"
27+
"java.server.restart": "Restart Java Language Server"
3028
}

src/commands.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -335,15 +335,4 @@ export namespace Commands {
335335
*/
336336
export const GET_DECOMPILED_SOURCE = "java.decompile";
337337

338-
/**
339-
* Smart semicolon detection.
340-
*/
341-
export const SMARTSEMICOLON_DETECTION = "java.edit.smartSemicolonDetection";
342-
export const SMARTSEMICOLON_DETECTION_CMD = "java.edit.smartSemicolonDetection.command";
343-
344-
/**
345-
* Smart semicolon detection backspace.
346-
*/
347-
export const SMARTSEMICOLON_DETECTION_UNDO = "java.edit.smartSemicolonDetectionUndo";
348-
349338
}

src/extension.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as fs from 'fs';
55
import * as fse from 'fs-extra';
66
import * as os from 'os';
77
import * as path from 'path';
8-
import { CodeActionContext, commands, ConfigurationTarget, Diagnostic, env, EventEmitter, ExtensionContext, extensions, IndentAction, InputBoxOptions, languages, RelativePattern, TextDocument, UIKind, Uri, ViewColumn, window, workspace, WorkspaceConfiguration, ProgressLocation, Position, Selection, Range } from 'vscode';
8+
import { CodeActionContext, commands, ConfigurationTarget, Diagnostic, env, EventEmitter, ExtensionContext, extensions, IndentAction, InputBoxOptions, languages, RelativePattern, TextDocument, UIKind, Uri, ViewColumn, window, workspace, WorkspaceConfiguration, ProgressLocation } from 'vscode';
99
import { CancellationToken, CodeActionParams, CodeActionRequest, Command, DidChangeConfigurationNotification, ExecuteCommandParams, ExecuteCommandRequest, LanguageClientOptions, RevealOutputChannelOn } from 'vscode-languageclient';
1010
import { LanguageClient } from 'vscode-languageclient/node';
1111
import { apiManager } from './apiManager';
@@ -268,6 +268,7 @@ export function activate(context: ExtensionContext): Promise<ExtensionAPI> {
268268
// the promise is resolved
269269
// no need to pass `resolve` into any code past this point,
270270
// since `resolve` is a no-op from now on
271+
271272
const serverOptions = prepareExecutable(requirements, syntaxServerWorkspacePath, getJavaConfig(requirements.java_home), context, true);
272273
if (requireSyntaxServer) {
273274
if (process.env['SYNTAXLS_CLIENT_PORT']) {

src/settings.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
import * as fs from 'fs';
44
import * as path from 'path';
5-
import { commands, ConfigurationTarget, env, ExtensionContext, Position, Range, Selection, SnippetString, TextDocument, Uri, window, workspace, WorkspaceConfiguration, WorkspaceFolder } from 'vscode';
5+
import { commands, ConfigurationTarget, env, ExtensionContext, Position, Range, SnippetString, TextDocument, Uri, window, workspace, WorkspaceConfiguration, WorkspaceFolder } from 'vscode';
66
import { Commands } from './commands';
77
import { cleanupLombokCache } from './lombokSupport';
88
import { ensureExists, getJavaConfiguration } from './utils';
9-
import { apiManager } from './apiManager';
10-
import { setSmartSemiColonDetectionState } from './smartSemicolonDetection';
119

1210
const DEFAULT_HIDDEN_FILES: string[] = ['**/.classpath', '**/.project', '**/.settings', '**/.factorypath'];
1311
const IS_WORKSPACE_JDK_ALLOWED = "java.ls.isJdkAllowed";
@@ -331,9 +329,6 @@ export function handleTextBlockClosing(document: TextDocument, changes: readonly
331329
return;
332330
}
333331
if (lastChange.text !== '"""";') {
334-
if (lastChange.text !== ';') {
335-
setSmartSemiColonDetectionState(null, null);
336-
}
337332
return;
338333
}
339334
const selection = activeTextEditor.selection.active;
@@ -354,5 +349,3 @@ export function handleTextBlockClosing(document: TextDocument, changes: readonly
354349
}
355350
}
356351
}
357-
358-

src/smartSemicolonDetection.ts

Lines changed: 0 additions & 76 deletions
This file was deleted.

src/standardLanguageClient.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import { getAllJavaProjects, getJavaConfig, getJavaConfiguration } from "./utils
4040
import { Telemetry } from "./telemetry";
4141
import { TelemetryEvent } from "@redhat-developer/vscode-redhat-telemetry/lib";
4242
import { registerDocumentValidationListener } from './diagnostic';
43-
import { registerSmartSemicolonDetection } from './smartSemicolonDetection';
4443

4544
const extensionName = 'Language Support for Java';
4645
const GRADLE_CHECKSUM = "gradle/checksum/prompt";
@@ -138,11 +137,6 @@ export class StandardLanguageClient {
138137
// clients may not have properly configured documentPaste
139138
logger.error(error);
140139
}
141-
try {
142-
registerSmartSemicolonDetection(context);
143-
} catch (error) {
144-
logger.error(error);
145-
}
146140
activationProgressNotification.hide();
147141
if (!hasImported) {
148142
showImportFinishNotification(context);

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ suite('Java Language Extension - Standard', () => {
4242
return vscode.commands.getCommands(true).then((commands) =>
4343
{
4444
const JAVA_COMMANDS = [
45-
Commands.ADD_TO_SOURCEPATH,
4645
Commands.ADD_TO_SOURCEPATH_CMD,
4746
Commands.APPLY_REFACTORING_COMMAND,
4847
Commands.APPLY_WORKSPACE_EDIT,
@@ -54,7 +53,6 @@ suite('Java Language Extension - Standard', () => {
5453
Commands.CLIPBOARD_ONPASTE,
5554
Commands.COMPILE_WORKSPACE,
5655
Commands.CONFIGURATION_UPDATE,
57-
Commands.CREATE_MODULE_INFO,
5856
Commands.CREATE_MODULE_INFO_COMMAND,
5957
Commands.EXECUTE_WORKSPACE_COMMAND,
6058
Commands.GENERATE_ACCESSORS_PROMPT,
@@ -104,20 +102,13 @@ suite('Java Language Extension - Standard', () => {
104102
Commands.SHOW_SERVER_TASK_STATUS,
105103
Commands.SWITCH_SERVER_MODE,
106104
"java.edit.stringFormatting",
107-
"java.completion.onDidSelect",
108-
"java.decompile",
109-
"java.protobuf.generateSources",
110105
Commands.SHOW_TYPE_HIERARCHY,
111106
Commands.SHOW_SUBTYPE_HIERARCHY,
112107
Commands.SHOW_SUPERTYPE_HIERARCHY,
113108
Commands.SHOW_CLASS_HIERARCHY,
114109
Commands.UPGRADE_GRADLE_WRAPPER,
115-
Commands.UPGRADE_GRADLE_WRAPPER_CMD,
116110
Commands.UPDATE_SOURCE_ATTACHMENT,
117111
Commands.UPDATE_SOURCE_ATTACHMENT_CMD,
118-
Commands.SMARTSEMICOLON_DETECTION_CMD,
119-
Commands.SMARTSEMICOLON_DETECTION_UNDO,
120-
Commands.RESOLVE_SOURCE_ATTACHMENT,
121112
].sort();
122113
const foundJavaCommands = commands.filter((value) => {
123114
return JAVA_COMMANDS.indexOf(value)>=0 || value.startsWith('java.');

0 commit comments

Comments
 (0)