Skip to content

Commit 483f965

Browse files
committed
[code] final and volatile field modifiers are now united to the same alignment column because they are mutual exclusive
1 parent a415ec7 commit 483f965

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44

55
## [Unreleased]
66

7+
### Fixed
8+
9+
- `final` and `volatile` field modifiers are now united to the same alignment column because they are mutual exclusive.
10+
711
## [1.0.1]
8-
### Added
9-
- Initial implementation, feel free reporting any found bugs or wanted features/additional settings to the GitHub repo issues.
12+
13+
### Added
14+
15+
- Initial implementation, feel free reporting any found bugs or wanted features/additional settings to the GitHub repo
16+
issues.
1017

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
pluginGroup = com.github.bashspbu.intellijjavacodealigner
55
pluginName=Java Code Aligner
6-
pluginVersion=1.0.1
6+
pluginVersion=1.0.2
77

88
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
99
# for insight into build numbers and IntelliJ Platform versions.

src/main/kotlin/com/github/bashspbu/intellijjavacodealigner/JavaAligningInlaysCollector.kt

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ package com.github.bashspbu.intellijjavacodealigner
44

55
import com.github.bashspbu.intellijjavacodealigner.JavaAligningInlaysCollector.AlignCellType.*
66
import com.github.bashspbu.intellijjavacodealigner.util.*
7-
import com.github.bashspbu.intellijjavacodealigner.util.getElementStartOffsetSkippingAnnotationsOnSeparateLines
8-
import com.github.bashspbu.intellijjavacodealigner.util.getElementLineNumber
9-
import com.github.bashspbu.intellijjavacodealigner.util.getOffsetFromLineStartSkippingAnnotationsOnSeparateLines
107
import com.intellij.codeInsight.hints.InlayHintsCollector
118
import com.intellij.codeInsight.hints.InlayHintsSink
129
import com.intellij.openapi.editor.Document
@@ -340,9 +337,8 @@ class JavaAligningInlaysCollector(
340337
ABSTRACT,
341338
DEFAULT,
342339
STATIC,
343-
FINAL,
340+
MUTABILITY, // final or volatile
344341
TRANSIENT,
345-
VOLATILE,
346342
SYNCHRONIZED,
347343
NATIVE,
348344
STRICTFP,
@@ -362,9 +358,9 @@ class JavaAligningInlaysCollector(
362358
PsiModifier.ABSTRACT -> ABSTRACT
363359
PsiModifier.DEFAULT -> DEFAULT
364360
PsiModifier.STATIC -> STATIC
365-
PsiModifier.FINAL -> FINAL
361+
PsiModifier.FINAL -> MUTABILITY
362+
PsiModifier.VOLATILE -> MUTABILITY
366363
PsiModifier.TRANSIENT -> TRANSIENT
367-
PsiModifier.VOLATILE -> VOLATILE
368364
PsiModifier.SYNCHRONIZED -> SYNCHRONIZED
369365
PsiModifier.NATIVE -> NATIVE
370366
PsiModifier.STRICTFP -> STRICTFP
@@ -378,15 +374,15 @@ class JavaAligningInlaysCollector(
378374

379375
val paramTypes = listOf(
380376
VARIABLE_ANNOTATIONS,
381-
FINAL,
377+
MUTABILITY,
382378
TYPE_ANNOTATIONS,
383379
TYPE,
384380
VARIABLE_NAME
385381
)
386382

387383
val localVarTypes = listOf(
388384
VARIABLE_ANNOTATIONS,
389-
FINAL,
385+
MUTABILITY,
390386
TYPE_ANNOTATIONS,
391387
TYPE,
392388
VARIABLE_NAME,

src/main/kotlin/com/github/bashspbu/intellijjavacodealigner/util/ModifierUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ internal object ModifierComparator : Comparator<String> {
6363
PsiModifier.DEFAULT,
6464
PsiModifier.STATIC,
6565
PsiModifier.FINAL,
66-
PsiModifier.TRANSIENT,
6766
PsiModifier.VOLATILE,
67+
PsiModifier.TRANSIENT,
6868
PsiModifier.SYNCHRONIZED,
6969
PsiModifier.NATIVE,
7070
PsiModifier.STRICTFP,

0 commit comments

Comments
 (0)