Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ pluginVersion = 0.1.1

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 223
pluginUntilBuild = 251.*
pluginUntilBuild = 253.*

# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
platformType = IC
platformVersion = 2024.3.3
platformVersion = 2024.1

# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
platformPlugins = com.intellij.java, PsiViewer:243.7768
platformPlugins = com.intellij.java
#platformPlugins = com.intellij.java, PsiViewer:243.7768

# Gradle Releases -> https://github.com/gradle/gradle/releases
gradleVersion = 8.5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import org.antlr.intellij.adaptor.lexer.TokenIElementType;
import org.antlr.intellij.adaptor.parser.ANTLRParserAdaptor;
import org.antlr.intellij.adaptor.psi.ANTLRPsiNode;
import org.antlr.v4.runtime.Parser;

Check warning on line 26 in src/main/java/com/github/kechinvv/libslpluginij/language/LibSLParserDefinition.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused import

Unused import `import org.antlr.v4.runtime.Parser;`
import org.antlr.v4.runtime.tree.ParseTree;

Check warning on line 27 in src/main/java/com/github/kechinvv/libslpluginij/language/LibSLParserDefinition.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused import

Unused import `import org.antlr.v4.runtime.tree.ParseTree;`
import org.jetbrains.annotations.NotNull;

import java.util.List;
Expand Down Expand Up @@ -74,14 +74,7 @@
@NotNull
public PsiParser createParser(final Project project) {
final LibSLParser parser = new LibSLParser(null);
return new ANTLRParserAdaptor(LibSL.INSTANCE, parser) {
@Override
protected ParseTree parse(Parser parser, IElementType root) {
if (root instanceof IFileElementType) {
return ((LibSLParser) parser).file();
} else throw new UnsupportedOperationException("Wrong Lsl file structure");
}
};
return new LslParserAdaptor(LibSL.INSTANCE, parser);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.github.kechinvv.libslpluginij.language;

import com.github.kechinvv.libslpluginij.antlr.LibSLParser;
import com.intellij.lang.Language;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.tree.IFileElementType;
import org.antlr.intellij.adaptor.parser.ANTLRParserAdaptor;
import org.antlr.v4.runtime.Parser;
import org.antlr.v4.runtime.tree.ParseTree;

public class LslParserAdaptor extends ANTLRParserAdaptor {
public LslParserAdaptor(Language language, Parser parser) {
super(language, parser);
}

@Override
protected ParseTree parse(Parser parser, IElementType root) {
if (root instanceof IFileElementType) {
return ((LibSLParser) parser).file();
} else throw new UnsupportedOperationException("Wrong Lsl file structure");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import com.intellij.ide.util.projectWizard.WizardContext
import com.intellij.ide.wizard.withVisualPadding
import com.intellij.openapi.Disposable
import com.intellij.openapi.fileChooser.FileChooserDescriptor

Check warning on line 14 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused import directive

Unused import directive
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory
import com.intellij.openapi.observable.properties.GraphProperty
import com.intellij.openapi.observable.properties.PropertyGraph
Expand All @@ -33,8 +33,8 @@
import javax.swing.JComponent
import javax.swing.JTextField

class LslPanel(val context: LslContext) : ModuleWizardStep() {

Check notice on line 36 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Class member can have 'private' visibility

Property 'context' could be private
protected val validatedTextComponents: MutableList<JTextField> = mutableListOf()

Check notice on line 37 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

'protected' visibility is effectively 'private' in a final class

'protected' visibility is effectively 'private' in a final class
private val propertyGraph: PropertyGraph = PropertyGraph()
private val entityNameProperty: GraphProperty<String> = propertyGraph.lazyProperty(::suggestName)
private val locationProperty: GraphProperty<String> = propertyGraph.lazyProperty(::suggestLocationByName)
Expand All @@ -45,15 +45,15 @@

private var entityName: String by entityNameProperty.trim()
private var location: String by locationProperty
protected var groupId: String by groupIdProperty.trim()

Check notice on line 48 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

'protected' visibility is effectively 'private' in a final class

'protected' visibility is effectively 'private' in a final class

protected lateinit var groupRow: Row

Check notice on line 50 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

'protected' visibility is effectively 'private' in a final class

'protected' visibility is effectively 'private' in a final class


private val parentDisposable: Disposable = context.parentDisposable;

Check warning on line 53 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Redundant semicolon

Redundant semicolon
private val moduleBuilder: ModuleBuilder = context.moduleBuilder;

Check warning on line 54 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Redundant semicolon

Redundant semicolon
private val wizardContext: WizardContext = context.wizardContext;

Check warning on line 55 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Redundant semicolon

Redundant semicolon
private val generatorContext: LslGeneratorContext = context.generatorContext;

Check warning on line 56 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Redundant semicolon

Redundant semicolon


private val contentPanel: DialogPanel by lazy { createComponent() }
Expand Down Expand Up @@ -84,8 +84,8 @@
textField()
.bindText(entityNameProperty)
.withSpecialValidation(
listOf(ValidationFunctions.CHECK_NOT_EMPTY, ValidationFunctions.CHECK_SIMPLE_NAME_FORMAT),

Check warning on line 87 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'CHECK_NOT_EMPTY' is declared in unstable package 'com.intellij.ide.starters.shared' marked with @ApiStatus.Experimental

Check warning on line 87 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'CHECK_SIMPLE_NAME_FORMAT' is declared in unstable package 'com.intellij.ide.starters.shared' marked with @ApiStatus.Experimental

Check warning on line 87 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.ide.starters.shared.ValidationFunctions' is declared in unstable package 'com.intellij.ide.starters.shared' marked with @ApiStatus.Experimental

Check warning on line 87 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.ide.starters.shared.ValidationFunctions' is declared in unstable package 'com.intellij.ide.starters.shared' marked with @ApiStatus.Experimental
ValidationFunctions.createLocationWarningValidator(locationProperty)

Check warning on line 88 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.ide.starters.shared.ValidationFunctions' is declared in unstable package 'com.intellij.ide.starters.shared' marked with @ApiStatus.Experimental

Check warning on line 88 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'createLocationWarningValidator(com.intellij.openapi.observable.properties.GraphProperty)' is declared in unstable package 'com.intellij.ide.starters.shared' marked with @ApiStatus.Experimental
)
.columns(COLUMNS_MEDIUM)
.gap(RightGap.SMALL)
Expand All @@ -98,8 +98,8 @@
val commentLabel = projectLocationField(locationProperty, wizardContext)
.align(AlignX.FILL)
.withSpecialValidation(
ValidationFunctions.CHECK_NOT_EMPTY,

Check warning on line 101 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.ide.starters.shared.ValidationFunctions' is declared in unstable package 'com.intellij.ide.starters.shared' marked with @ApiStatus.Experimental

Check warning on line 101 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'CHECK_NOT_EMPTY' is declared in unstable package 'com.intellij.ide.starters.shared' marked with @ApiStatus.Experimental
ValidationFunctions.CHECK_LOCATION_FOR_ERROR

Check warning on line 102 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'CHECK_LOCATION_FOR_ERROR' is declared in unstable package 'com.intellij.ide.starters.shared' marked with @ApiStatus.Experimental

Check warning on line 102 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.ide.starters.shared.ValidationFunctions' is declared in unstable package 'com.intellij.ide.starters.shared' marked with @ApiStatus.Experimental
)
.comment(getLocationComment(), 100)
.comment!!
Expand All @@ -125,9 +125,9 @@
.bindText(groupIdProperty)
.columns(COLUMNS_MEDIUM)
.withSpecialValidation(
ValidationFunctions.CHECK_NO_WHITESPACES,

Check warning on line 128 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'CHECK_NO_WHITESPACES' is declared in unstable package 'com.intellij.ide.starters.shared' marked with @ApiStatus.Experimental

Check warning on line 128 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.ide.starters.shared.ValidationFunctions' is declared in unstable package 'com.intellij.ide.starters.shared' marked with @ApiStatus.Experimental
ValidationFunctions.CHECK_GROUP_FORMAT,

Check warning on line 129 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.ide.starters.shared.ValidationFunctions' is declared in unstable package 'com.intellij.ide.starters.shared' marked with @ApiStatus.Experimental

Check warning on line 129 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'CHECK_GROUP_FORMAT' is declared in unstable package 'com.intellij.ide.starters.shared' marked with @ApiStatus.Experimental
ValidationFunctions.CHECK_NO_RESERVED_WORDS)

Check warning on line 130 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.ide.starters.shared.ValidationFunctions' is declared in unstable package 'com.intellij.ide.starters.shared' marked with @ApiStatus.Experimental

Check warning on line 130 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'CHECK_NO_RESERVED_WORDS' is declared in unstable package 'com.intellij.ide.starters.shared' marked with @ApiStatus.Experimental
}.bottomGap(BottomGap.SMALL)
}

Expand All @@ -145,14 +145,14 @@
}

@Suppress("SameParameterValue")
private fun <T : JComponent> Cell<T>.withSpecialValidation(vararg errorValidationUnits: TextValidationFunction): Cell<T> =

Check warning on line 148 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.ide.starters.shared.TextValidationFunction' is declared in unstable package 'com.intellij.ide.starters.shared' marked with @ApiStatus.Experimental
withValidation(this, errorValidationUnits.asList(), null, validatedTextComponents, parentDisposable)

Check warning on line 149 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'withValidation(com.intellij.ui.dsl.builder.Cell, java.util.List, com.intellij.ide.starters.shared.TextValidationFunction, java.util.List, com.intellij.openapi.Disposable)' is declared in unstable package 'com.intellij.ide.starters.shared' marked with @ApiStatus.Experimental

private fun <T : JComponent> Cell<T>.withSpecialValidation(
errorValidationUnits: List<TextValidationFunction>,

Check warning on line 152 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.ide.starters.shared.TextValidationFunction' is declared in unstable package 'com.intellij.ide.starters.shared' marked with @ApiStatus.Experimental
warningValidationUnit: TextValidationFunction?

Check warning on line 153 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.ide.starters.shared.TextValidationFunction' is declared in unstable package 'com.intellij.ide.starters.shared' marked with @ApiStatus.Experimental
): Cell<T> {
return withValidation(

Check warning on line 155 in src/main/kotlin/com/github/kechinvv/libslpluginij/project/LslPanel.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'withValidation(com.intellij.ui.dsl.builder.Cell, java.util.List, com.intellij.ide.starters.shared.TextValidationFunction, java.util.List, com.intellij.openapi.Disposable)' is declared in unstable package 'com.intellij.ide.starters.shared' marked with @ApiStatus.Experimental
this,
errorValidationUnits,
warningValidationUnit,
Expand All @@ -166,14 +166,13 @@
wizardContext: WizardContext
): Cell<TextFieldWithBrowseButton> {
//TODO: what happened with file choose descriptor?
// val fileChooserDescriptor =
// FileChooserDescriptorFactory.createSingleLocalFileDescriptor().withFileFilter { it.isDirectory }
val fileChosen = { file: VirtualFile -> getPresentablePath(file.path) }
val title = IdeBundle.message("title.select.project.file.directory", wizardContext.presentationName)
val fileChooserDescriptor =
FileChooserDescriptorFactory.createSingleLocalFileDescriptor().withFileFilter { it.isDirectory }
val fileChosen = { file: VirtualFile -> getPresentablePath(file.path) }
val property = locationProperty.transform(::getPresentablePath, ::getCanonicalPath)
return this.textFieldWithBrowseButton(title, wizardContext.project, fileChosen)
return textFieldWithBrowseButton(title, wizardContext.project, fileChooserDescriptor, fileChosen)
.bindText(property)

}

private fun getLocationComment(): @Nls String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json

class ActionHolderConverter : Converter<Map<String, ActionData>>() {
override fun toString(actions: Map<String, ActionData>): String {
return Json.encodeToString(actions)
override fun toString(value: Map<String, ActionData>): String {
return Json.encodeToString(value)
}

override fun fromString(actions: String): Map<String, ActionData> {
return Json.decodeFromString(actions) ?: emptyMap()
override fun fromString(value: String): Map<String, ActionData> {
return Json.decodeFromString(value) ?: emptyMap()
}
}
Loading