Skip to content
Snippets Groups Projects
Commit ab0d846d authored by Johannes Mey's avatar Johannes Mey
Browse files

Merge branch 'chore/support-for-intellij-2023.1' into 'develop'

Chore/support for intellij 2023.1

See merge request !18
parents dbdac0e5 531e29a5
Branches
Tags v0.3.1
1 merge request!18Chore/support for intellij 2023.1
Pipeline #17796 passed
...@@ -5,16 +5,16 @@ stages: ...@@ -5,16 +5,16 @@ stages:
- deploy - deploy
test: test:
image: openjdk:11 image: openjdk:17
stage: test stage: test
script: script:
- ./gradlew --continue --console=plain --info runPluginVerifier - ./gradlew --continue --console=plain --info runPluginVerifier
jar: jar:
image: openjdk:11 image: openjdk:17
stage: jar stage: jar
script: script:
- ./gradlew --continue --console=plain --info buildPlugin - ./gradlew --continue --console=plain --info buildPlugin
artifacts: artifacts:
paths: paths:
- "/builds/jastadd/*/build/libs/JastAddIntelliJPlugin-*.jar" - "build/libs/JastAddIntelliJPlugin-*.jar"
# Changelog # Changelog
## [Unreleased]
### Added
### Changed
### Deprecated
### Removed
### Fixed
## [0.3.1] ## [0.3.1]
### Added ### Added
- Reference support for type names within aspect files.
- Usages are now highlighted. - Usages are now highlighted.
- Refactoring of type names now also works in aspects.
- Note that although it works in the Java embeddings within aspects, it does *not* work in "real" Java classes. - Note that although it works in the Java embeddings within aspects, it does *not* work in "real" Java classes.
- Please use this feature with caution. As with most refactoring tools, it is quite fragile and won't give correct Please use this feature with caution. As with most refactoring tools, it is quite fragile and won't give correct
results in all cases. results in all cases.
- Folding support for aspect files.
- Aspects and most blocks now can be folded. - Aspects and most blocks now can be folded.
- Structure view for aspect files.
- Attributes and inter-type declarations are shown sorted by aspect. - Attributes and inter-type declarations are shown sorted by aspect.
- There are toggle buttons to show or hide attributes, inter-type declarations and rewrites. - There are toggle buttons to show or hide attributes, inter-type declarations and rewrites.
- Note that things outside aspects, equations and some other elements are not yet included. - Note that things outside aspects, equations and some other elements are not yet included.
- Support for IntelliJ IDEA 2022.3. - Support for IntelliJ IDEA 2022.3 and 2023.1.
### Changed
### Deprecated
### Removed
### Fixed ### Fixed
- A bug for type name refactoring in grammar files which prevented the actual definition from being renamed. - A bug for type name refactoring in grammar files which prevented the actual definition from being renamed.
- Wrong inspection messages related to names in wrappers of injected java code ("x", "m", "X"). - Wrong inspection messages related to names in wrappers of injected java code ("x", "m", "X").
- A bug that required a visibility modifier in refined constructors.
### Removed
- Support for all IntelliJ IDEA version prior to 2022.3.
## [0.2.0] ## [0.2.0]
### Added ### Added
- Support for IntelliJ IDEA 2021.2.3. - Support for IntelliJ IDEA 2021.2.3.
- Initial support for JastAdd aspect files.
- syntax highlighter and color settings - syntax highlighter and color settings
- two file types for jrag and jadd two file types for jrag and jadd
- embedded java for attribute equation blocks embedded java for attribute equation blocks
- Annotations for JastAdd usages in Java.
- configurable highlighters for attribute and api usages - configurable highlighters for attribute and api usages
- Dark mode icon which is a bit less colourful. - Dark mode icon which is a bit less colourful.
### Removed ### Removed
- Support for IntelliJ IDEA 2020.2.4. Minimal version now is 2021.1.1. - Support for IntelliJ IDEA 2020.2.4. Minimal version now is 2021.1.1.
[Unreleased]: https://git-st.inf.tu-dresden.de/jastadd/jetbrains-plugin//compare/v0.3.1...HEAD
[0.3.1]: https://git-st.inf.tu-dresden.de/jastadd/jetbrains-plugin//compare/v0.2.0...v0.3.1
[0.2.0]: https://git-st.inf.tu-dresden.de/jastadd/jetbrains-plugin//commits/v0.2.0
# JastAdd Language Support # JastAdd Language Support
<!-- Plugin description --> <!-- Plugin description -->
This plugin provides support for [JastAdd](https://jastadd.cs.lth.se/) and [Relational RAGs](http://relational-rags.eu) This plugin provides support for [JastAdd](https://jastadd.cs.lth.se/) and [Relational RAGs](https://jastadd.pages.st.inf.tu-dresden.de/relational-rags/)
<!-- Plugin description end --> <!-- Plugin description end -->
import io.gitlab.arturbosch.detekt.Detekt import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.markdownToHTML import org.jetbrains.changelog.markdownToHTML
import org.jetbrains.grammarkit.tasks.GenerateLexer import org.jetbrains.grammarkit.tasks.GenerateLexerTask
import org.jetbrains.grammarkit.tasks.GenerateParser import org.jetbrains.grammarkit.tasks.GenerateParserTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
fun properties(key: String) = project.findProperty(key).toString() fun properties(key: String) = project.findProperty(key).toString()
...@@ -12,17 +13,17 @@ plugins { ...@@ -12,17 +13,17 @@ plugins {
// Java support // Java support
id("java") id("java")
// Kotlin support // Kotlin support
id("org.jetbrains.kotlin.jvm") version "1.5.10" id("org.jetbrains.kotlin.jvm") version "1.8.20"
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin // gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
id("org.jetbrains.intellij") version "1.0" id("org.jetbrains.intellij") version "1.13.3"
// gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin // gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
id("org.jetbrains.changelog") version "1.1.2" id("org.jetbrains.changelog") version "2.0.0"
// detekt linter - read more: https://detekt.github.io/detekt/gradle.html // detekt linter - read more: https://detekt.github.io/detekt/gradle.html
id("io.gitlab.arturbosch.detekt") version "1.18.1" id("io.gitlab.arturbosch.detekt") version "1.23.0"
// ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle // ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle
id("org.jlleitschuh.gradle.ktlint") version "10.2.0" id("org.jlleitschuh.gradle.ktlint") version "11.3.2"
// grammrkit - read more: https://plugins.gradle.org/plugin/org.jetbrains.grammarkit
id("org.jetbrains.grammarkit") version "2021.1.3" id("org.jetbrains.grammarkit") version "2022.3.1"
} }
group = properties("pluginGroup") group = properties("pluginGroup")
...@@ -32,9 +33,7 @@ version = properties("pluginVersion") ...@@ -32,9 +33,7 @@ version = properties("pluginVersion")
repositories { repositories {
mavenCentral() mavenCentral()
} }
dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.18.1")
}
java { java {
sourceCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8
...@@ -68,55 +67,49 @@ sourceSets { ...@@ -68,55 +67,49 @@ sourceSets {
// Configure gradle-changelog-plugin plugin. // Configure gradle-changelog-plugin plugin.
// Read more: https://github.com/JetBrains/gradle-changelog-plugin // Read more: https://github.com/JetBrains/gradle-changelog-plugin
changelog { changelog {
version = properties("pluginVersion") version.set(properties("pluginVersion"))
groups = listOf("Added", "Changed", "Deprecated", "Removed", "Fixed") groups.set(listOf("Added", "Changed", "Deprecated", "Removed", "Fixed"))
repositoryUrl.set(properties("pluginRepositoryUrl"))
} }
// Configure detekt plugin. // Configure detekt plugin.
// Read more: https://detekt.github.io/detekt/kotlindsl.html // Read more: https://detekt.github.io/detekt/kotlindsl.html
detekt { detekt {
config = files("./detekt-config.yml") source.from(files("build.gradle.kts"))
buildUponDefaultConfig = true
reports {
html.enabled = true
xml.enabled = false
txt.enabled = false
}
} }
tasks { tasks {
val generateGrammarLexer = task<GenerateLexer>("generateGrammarLexer") { val generateGrammarLexer = task<GenerateLexerTask>("generateGrammarLexer") {
source = "src/main/grammar/Grammar.flex" sourceFile.set(file("src/main/grammar/Grammar.flex"))
targetDir = "src/gen/java/org/jastadd/tooling/grammar/lexer/" targetDir.set("src/gen/java/org/jastadd/tooling/grammar/lexer/")
targetClass = "GrammarLexer" targetClass.set("GrammarLexer")
purgeOldFiles = true purgeOldFiles.set(true)
} }
// not fully working because of https://github.com/JetBrains/gradle-grammar-kit-plugin/issues/3 // not fully working because of https://github.com/JetBrains/gradle-grammar-kit-plugin/issues/3
val generateGrammarParser = task<GenerateParser>("generateGrammarParser") { val generateGrammarParser = task<GenerateParserTask>("generateGrammarParser") {
source = "src/main/grammar/Grammar.bnf" sourceFile.set(file("src/main/grammar/Grammar.bnf"))
targetRoot = "src/gen/java" targetRoot.set("src/gen/java")
pathToParser = "/org/jastadd/tooling/grammar/GrammarParser.java" pathToParser.set("/org/jastadd/tooling/grammar/GrammarParser.java")
pathToPsiRoot = "/org/jastadd/tooling/grammar/psi" pathToPsiRoot.set("/org/jastadd/tooling/grammar/psi")
purgeOldFiles = true purgeOldFiles.set(true)
} }
val generateAspectLexer = task<GenerateLexer>("generateAspectLexer") { val generateAspectLexer = task<GenerateLexerTask>("generateAspectLexer") {
source = "src/main/grammar/Aspect.flex" sourceFile.set(file("src/main/grammar/Aspect.flex"))
targetDir = "src/gen/java/org/jastadd/tooling/aspect/lexer/" targetDir.set("src/gen/java/org/jastadd/tooling/aspect/lexer/")
targetClass = "AspectLexer" targetClass.set("AspectLexer")
purgeOldFiles = true purgeOldFiles.set(true)
} }
// not fully working because of https://github.com/JetBrains/gradle-grammar-kit-plugin/issues/3 // not fully working because of https://github.com/JetBrains/gradle-grammar-kit-plugin/issues/3
val generateAspectParser = task<GenerateParser>("generateAspectParser") { val generateAspectParser = task<GenerateParserTask>("generateAspectParser") {
source = "src/main/grammar/Aspect.bnf" sourceFile.set(file("src/main/grammar/Aspect.bnf"))
targetRoot = "src/gen/java" targetRoot.set("src/gen/java")
pathToParser = "/org/jastadd/tooling/aspect/AspectParser.java" pathToParser.set("/org/jastadd/tooling/aspect/AspectParser.java")
pathToPsiRoot = "/org/jastadd/tooling/aspect/psi" pathToPsiRoot.set("/org/jastadd/tooling/aspect/psi")
purgeOldFiles = true purgeOldFiles.set(true)
} }
compileJava { compileJava {
...@@ -128,15 +121,15 @@ tasks { ...@@ -128,15 +121,15 @@ tasks {
// Set the compatibility versions to 1.8 // Set the compatibility versions to 1.8
withType<JavaCompile> { withType<JavaCompile> {
sourceCompatibility = "1.8" sourceCompatibility = "17"
targetCompatibility = "1.8" targetCompatibility = "17"
} }
withType<KotlinCompile> { withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8" kotlinOptions.jvmTarget = "17"
} }
withType<Detekt> { withType<Detekt> {
jvmTarget = "1.8" jvmTarget = "17"
} }
patchPluginXml { patchPluginXml {
...@@ -158,11 +151,11 @@ tasks { ...@@ -158,11 +151,11 @@ tasks {
) )
// Get the latest available change notes from the changelog file // Get the latest available change notes from the changelog file
changeNotes.set(provider { changelog.getLatest().toHTML() }) changeNotes.set(provider { changelog.renderItem(changelog.get(properties("pluginVersion")), Changelog.OutputType.HTML) })
} }
runPluginVerifier { jar {
ideVersions.set(properties("pluginVerifierIdeVersions").split(',').map(String::trim).filter(String::isNotEmpty)) dependsOn("patchChangelog")
} }
publishPlugin { publishPlugin {
......
# Default detekt configuration:
# https://github.com/detekt/detekt/blob/master/detekt-core/src/main/resources/default-detekt-config.yml
formatting:
Indentation:
continuationIndentSize: 8
ParameterListWrapping:
indentSize: 8
...@@ -4,18 +4,19 @@ ...@@ -4,18 +4,19 @@
pluginGroup = org.jastadd pluginGroup = org.jastadd
pluginName = JastAdd pluginName = JastAdd
pluginVersion = 0.3.1 pluginVersion = 0.3.1
pluginRepositoryUrl = https://git-st.inf.tu-dresden.de/jastadd/jetbrains-plugin/
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html # See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions. # for insight into build numbers and IntelliJ Platform versions.
pluginSinceBuild = 211 pluginSinceBuild = 223
pluginUntilBuild = 223.* pluginUntilBuild = 231.*
# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl ## Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
# See https://jb.gg/intellij-platform-builds-list for available build versions. ## See https://jb.gg/intellij-platform-builds-list for available build versions.
pluginVerifierIdeVersions = 2021.1.3, 2021.2.4, 2021.3.3, 2022.1.4, 2022.2.4, 2022.3.1 #pluginVerifierIdeVersions = 2022.2.4, 2022.3.1, 2023.1.2
platformType = IC platformType = IC
platformVersion = 2021.3.1 platformVersion = 2022.3.1
platformDownloadSources = true platformDownloadSources = true
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html # Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
......
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
...@@ -111,7 +111,7 @@ aspect_refine_method_declaration ::= REFINE [aspect_name] modifiers type_paramet ...@@ -111,7 +111,7 @@ aspect_refine_method_declaration ::= REFINE [aspect_name] modifiers type_paramet
aspect_constructor_declaration ::= modifiers ast_type_name DOT ast_type_name formal_parameters (THROWS name_list)? LBRACE explicit_constructor_invocation? block_statement* RBRACE aspect_constructor_declaration ::= modifiers ast_type_name DOT ast_type_name formal_parameters (THROWS name_list)? LBRACE explicit_constructor_invocation? block_statement* RBRACE
aspect_refine_constructor_declaration ::= REFINE aspect_name (PUBLIC | PROTECTED | PRIVATE) ast_type_name DOT method_name formal_parameters (THROWS name_list)? LBRACE block_statement* RBRACE aspect_refine_constructor_declaration ::= REFINE aspect_name (PUBLIC | PROTECTED | PRIVATE)? ast_type_name DOT method_name formal_parameters (THROWS name_list)? LBRACE block_statement* RBRACE
aspect_field_declaration ::= modifiers aspect_type ast_type_name DOT variable_declarator (COMMA variable_declarator)* SEMICOLON aspect_field_declaration ::= modifiers aspect_type ast_type_name DOT variable_declarator (COMMA variable_declarator)* SEMICOLON
......
<idea-plugin> <idea-plugin>
<id>org.jastadd.JastAddGrammar</id> <id>org.jastadd.JastAddGrammar</id>
<name>JastAdd Grammar Language</name> <name>JastAdd Grammar Language</name>
<vendor email="johannes.mey@tu-dresden.de" url="jastadd.org">The JastAdd Team</vendor> <vendor email="johannes.mey@tu-dresden.de" url="jastadd.org">Johannes Mey</vendor>
<!-- please see https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html <!-- please see https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html
on how to target different products --> on how to target different products -->
...@@ -32,7 +31,7 @@ ...@@ -32,7 +31,7 @@
<completion.contributor language="JastAddGrammar" <completion.contributor language="JastAddGrammar"
implementationClass="org.jastadd.tooling.grammar.GrammarCompletionContributor"/> implementationClass="org.jastadd.tooling.grammar.GrammarCompletionContributor"/>
<psi.referenceContributor implementation="org.jastadd.tooling.grammar.GrammarReferenceContributor"/> <psi.referenceContributor language="JastAddGrammar" implementation="org.jastadd.tooling.grammar.GrammarReferenceContributor"/>
<lang.refactoringSupport language="JastAddGrammar" <lang.refactoringSupport language="JastAddGrammar"
...@@ -80,7 +79,7 @@ ...@@ -80,7 +79,7 @@
<colorSettingsPage implementation="org.jastadd.tooling.java.JavaColorSettingsPage"/> <colorSettingsPage implementation="org.jastadd.tooling.java.JavaColorSettingsPage"/>
<psi.referenceContributor implementation="org.jastadd.tooling.aspect.AspectReferenceContributor"/> <psi.referenceContributor language="JastAddAspect" implementation="org.jastadd.tooling.aspect.AspectReferenceContributor"/>
<lang.elementManipulator forClass="org.jastadd.tooling.aspect.psi.JastAddAspectAstTypeName" <lang.elementManipulator forClass="org.jastadd.tooling.aspect.psi.JastAddAspectAstTypeName"
implementationClass="org.jastadd.tooling.aspect.psi.JastAddAspectAstTypeNameManipulator"/> implementationClass="org.jastadd.tooling.aspect.psi.JastAddAspectAstTypeNameManipulator"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment