Skip to content

Commit c215aee

Browse files
committed
Fix indentation rules
Signed-off-by: Fred Bricon <[email protected]>
1 parent afe9660 commit c215aee

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/extension.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -346,16 +346,15 @@ export function deactivate(): Thenable<void> {
346346
}
347347

348348
function enableJavadocSymbols() {
349-
// Let's enable Javadoc symbols autocompletion, shamelessly copied from MIT licensed code at
350-
// https://github.com/Microsoft/vscode/blob/9d611d4dfd5a4a101b5201b8c9e21af97f06e7a7/extensions/typescript/src/typescriptMain.ts#L186
351349
languages.setLanguageConfiguration('java', {
350+
//Indentation rules identical to js/ts. Copied from https://github.com/Microsoft/vscode/blob/41ddd41b71ea2bd5c6e49125beeb3e951f3d9c7c/extensions/typescript-language-features/src/features/languageConfiguration.ts#L17-L18
352351
indentationRules: {
353-
// ^(.*\*/)?\s*\}.*$
354-
decreaseIndentPattern: /^(.*\*\/)?\s*\}.*$/,
355-
// ^.*\{[^}"']*$
356-
increaseIndentPattern: /^.*\{[^}"']*$/
352+
decreaseIndentPattern: /^((?!.*?\/\*).*\*\/)?\s*[\}\]].*$/,
353+
increaseIndentPattern: /^((?!\/\/).)*(\{[^}"'`]*|\([^)"'`]*|\[[^\]"'`]*)$/
357354
},
358355
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
356+
// Let's enable Javadoc symbols autocompletion, shamelessly copied from MIT licensed code at
357+
// https://github.com/Microsoft/vscode/blob/9d611d4dfd5a4a101b5201b8c9e21af97f06e7a7/extensions/typescript/src/typescriptMain.ts#L186
359358
onEnterRules: [
360359
{
361360
// e.g. /** | */

0 commit comments

Comments
 (0)