Skip to content

Commit 30174f5

Browse files
authored
Merge pull request #35 from elm-tooling/warning-fixes
Fixes for the warnings
2 parents 8050c9b + 0db257a commit 30174f5

File tree

59 files changed

+114
-331
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+114
-331
lines changed

src/main/kotlin/org/elm/ide/actions/ElmExternalReviewAction.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,17 @@ import com.intellij.openapi.actionSystem.AnAction
66
import com.intellij.openapi.actionSystem.AnActionEvent
77
import com.intellij.openapi.actionSystem.CommonDataKeys
88
import com.intellij.openapi.actionSystem.PlatformDataKeys
9-
import com.intellij.openapi.diagnostic.logger
109
import com.intellij.openapi.fileEditor.FileEditorManager
1110
import com.intellij.openapi.project.Project
1211
import com.intellij.openapi.vfs.VfsUtil
1312
import com.intellij.openapi.vfs.VirtualFile
1413
import org.elm.ide.notifications.showBalloon
1514
import org.elm.lang.core.ElmFileType
1615
import org.elm.openapiext.saveAllDocuments
17-
import org.elm.workspace.*
1816
import org.elm.workspace.commandLineTools.makeProject
1917
import org.elm.workspace.compiler.findEntrypoints
20-
21-
private val log = logger<ElmExternalReviewAction>()
18+
import org.elm.workspace.elmToolchain
19+
import org.elm.workspace.elmWorkspace
2220

2321
class ElmExternalReviewAction : AnAction() {
2422

src/main/kotlin/org/elm/ide/actions/ElmExternalReviewWatchmodeAction.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import com.intellij.openapi.actionSystem.AnAction
66
import com.intellij.openapi.actionSystem.AnActionEvent
77
import com.intellij.openapi.actionSystem.CommonDataKeys
88
import com.intellij.openapi.actionSystem.PlatformDataKeys
9-
import com.intellij.openapi.diagnostic.logger
109
import com.intellij.openapi.fileEditor.FileEditorManager
1110
import com.intellij.openapi.project.Project
1211
import com.intellij.openapi.vfs.VfsUtil
@@ -19,8 +18,6 @@ import org.elm.workspace.compiler.findEntrypoints
1918
import org.elm.workspace.elmToolchain
2019
import org.elm.workspace.elmWorkspace
2120

22-
private val log = logger<ElmExternalReviewAction>()
23-
2421
class ElmExternalReviewWatchmodeAction : AnAction() {
2522

2623
override fun update(e: AnActionEvent) {

src/main/kotlin/org/elm/ide/color/ElmColorProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class ElmColorProvider : ElementColorProvider {
9898
element.project,
9999
command,
100100
// This is the message that the JavaColorProvider uses, value copied from JavaBundle.properties
101-
"Change color",
101+
"Change Color",
102102
null, // groupId
103103
document
104104
)

src/main/kotlin/org/elm/ide/color/ElmColorSettingsPage.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import org.elm.ide.icons.ElmIcons
77

88
class ElmColorSettingsPage : ColorSettingsPage {
99

10-
private val ATTRS = ElmColor.values().map { it.attributesDescriptor }.toTypedArray()
10+
private val ATTRS = ElmColor.entries.map { it.attributesDescriptor }.toTypedArray()
1111

1212
override fun getDisplayName() =
1313
"Elm"

src/main/kotlin/org/elm/ide/folding/ElmFoldingBuilder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import org.elm.lang.core.psi.elements.*
1919

2020
class ElmFoldingBuilder : FoldingBuilderEx(), DumbAware {
2121

22-
override fun getPlaceholderText(node: ASTNode): String? {
22+
override fun getPlaceholderText(node: ASTNode): String {
2323
return when (node.elementType) {
2424
BLOCK_COMMENT, DOC_COMMENT -> {
2525
val nl = node.text.indexOf('\n')

src/main/kotlin/org/elm/ide/formatter/settings/ElmCodeStyleSettingsProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class ElmLanguageCodeStyleSettingsProvider : LanguageCodeStyleSettingsProvider()
3939

4040
// If we ever add formatting support, we'll probably want to return a plain
4141
// `SmartIndentOptionsEditor()` rather than this custom one.
42-
override fun getIndentOptionsEditor(): IndentOptionsEditor? = ElmOptionsEditor()
42+
override fun getIndentOptionsEditor(): IndentOptionsEditor = ElmOptionsEditor()
4343
}
4444

4545

src/main/kotlin/org/elm/ide/highlight/ElmSyntaxHighlightAnnotator.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class ElmSyntaxHighlightAnnotator : Annotator {
131131
}
132132

133133
val qid = element.valueQID
134-
if (qid != null && qid.isQualified == true) {
134+
if (qid != null && qid.isQualified) {
135135
qid.qualifiers.forEach {
136136
applyColor(it, ElmColor.EXTERNAL_MODULE)
137137
}
@@ -146,7 +146,7 @@ class ElmSyntaxHighlightAnnotator : Annotator {
146146
val parentFunction = PsiTreeUtil.getParentOfType(
147147
element,
148148
ElmFunctionDeclarationLeft::class.java
149-
);
149+
)
150150
if (parentFunction != null) {
151151
if (parentFunction.isTopLevel) {
152152
applyColor(element, ElmColor.FUNCTION_ARGUMENT)
@@ -159,7 +159,7 @@ class ElmSyntaxHighlightAnnotator : Annotator {
159159
val anonymousFunction = PsiTreeUtil.getParentOfType(
160160
element,
161161
ElmAnonymousFunctionExpr::class.java
162-
);
162+
)
163163
if (anonymousFunction != null) {
164164
applyColor(element, ElmColor.INLINE_FUNCTION_ARGUMENT)
165165
return
@@ -168,7 +168,7 @@ class ElmSyntaxHighlightAnnotator : Annotator {
168168
val unionPattern = PsiTreeUtil.getParentOfType(
169169
element,
170170
ElmUnionPattern::class.java
171-
);
171+
)
172172
if (unionPattern != null) {
173173
applyColor(element, ElmColor.PATTERN_ARGUMENT)
174174
return

src/main/kotlin/org/elm/ide/icons/ElmIcons.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ object ElmIcons {
99
/** Basic file icon, matching the rest of IntelliJ's file icons */
1010
val FILE = getIcon("elm-file.png")
1111

12-
/** Monochromatic Elm icon suitable for toolwindow (it's also smaller than the normal icons */
13-
val TOOL_WINDOW = getIcon("elm-toolwindow.png")
14-
1512
/** Colorful Elm icon */
1613
val COLORFUL = getIcon("elm-colorful.png")
1714

@@ -23,7 +20,6 @@ object ElmIcons {
2320
// STRUCTURE VIEW ICONS
2421

2522
val FUNCTION = getIcon("function.png")
26-
val VALUE = getIcon("value.png")
2723
val UNION_TYPE = getIcon("type.png")
2824
val TYPE_ALIAS = getIcon("type.png")
2925

src/main/kotlin/org/elm/ide/inspections/ElmInspectionSuppressor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ElmInspectionSuppressor : InspectionSuppressor {
4444

4545
private class SuppressInspectionFix(
4646
id: String
47-
) : AbstractBatchSuppressByNoInspectionCommentFix(id, /* replaceOthers = */ id == SuppressionUtil.ALL) {
47+
) : AbstractBatchSuppressByNoInspectionCommentFix(id, /* replaceOtherSuppressionIds = */ id == SuppressionUtil.ALL) {
4848

4949
init {
5050
text = when (id) {

src/main/kotlin/org/elm/ide/inspections/QuickFixInvocationTracker.kt

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

0 commit comments

Comments
 (0)