Skip to content
Merged
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
18 changes: 9 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:

# Store already-built plugin as an artifact for downloading
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact.outputs.filename }}
path: ./build/distributions/content/*/*
Expand All @@ -107,7 +107,7 @@ jobs:

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
Expand All @@ -125,14 +125,14 @@ jobs:
# Collect Tests Result of failed tests
- name: Collect Tests Result
if: ${{ failure() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: tests-result
path: ${{ github.workspace }}/build/reports/tests

# Upload the Kover report to CodeCov
- name: Upload Code Coverage Report
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
with:
files: ${{ github.workspace }}/build/reports/kover/report.xml

Expand Down Expand Up @@ -160,7 +160,7 @@ jobs:

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
Expand Down Expand Up @@ -191,7 +191,7 @@ jobs:

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
Expand All @@ -216,7 +216,7 @@ jobs:
# Collect Plugin Verifier Result
- name: Collect Plugin Verifier Result
if: ${{ always() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: pluginVerifier-result
path: ${{ github.workspace }}/build/reports/pluginVerifier
Expand All @@ -238,7 +238,7 @@ jobs:

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
Expand Down
8 changes: 2 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@

### Added

- LibSL project generation and detection
- LibSL Tools dynamic actions
- File templates
- Folding
- LibSL grammar upd
- support new versions of IJ

### Changed

### Fixed

- Intents for params

[Unreleased]: https://github.com/kechinvv/LibSLPluginIJ/commits
43 changes: 36 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.date
import org.jetbrains.changelog.markdownToHTML
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

fun properties(key: String) = providers.gradleProperty(key)
fun environment(key: String) = providers.environmentVariable(key)
Expand Down Expand Up @@ -30,8 +31,8 @@ dependencies {
antlr("org.antlr:antlr4:4.13.1")
implementation("org.antlr:antlr4-intellij-adaptor:0.1")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.11.4")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.11.4")
}


Expand Down Expand Up @@ -95,12 +96,39 @@ val printVersionName: Task = tasks.create("printVersionName") {
}

tasks {

generateGrammarSource {
val packageName = "${project.group}.antlr"
println(packageName)
outputDirectory = File(outputDirectory, packageName.replace('.', '/'))
println(outputDirectory)
arguments = arguments + listOf("-package", packageName)
}

test {
useJUnitPlatform()
}

runIde {
dependsOn(withType<AntlrTask>())
}

buildPlugin {
dependsOn(withType<AntlrTask>())
}

withType<Jar>().configureEach {
dependsOn(withType<AntlrTask>())
}

withType<KotlinCompile>().configureEach {
dependsOn(withType<AntlrTask>())
}


withType<JavaCompile> {
options.compilerArgs.add("--enable-preview")
dependsOn(withType<AntlrTask>())
}

withType<JavaExec> {
Expand Down Expand Up @@ -134,10 +162,10 @@ tasks {
changeNotes = properties("pluginVersion").map { pluginVersion ->
with(changelog) {
renderItem(
(getOrNull(pluginVersion) ?: getUnreleased())
.withHeader(false)
.withEmptySections(false),
Changelog.OutputType.HTML,
(getOrNull(pluginVersion) ?: getUnreleased())
.withHeader(false)
.withEmptySections(false),
Changelog.OutputType.HTML,
)
}
}
Expand All @@ -164,6 +192,7 @@ tasks {
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
channels = properties("pluginVersion").map { listOf(it.split('-').getOrElse(1) { "default" }.split('.').first()) }
channels =
properties("pluginVersion").map { listOf(it.split('-').getOrElse(1) { "default" }.split('.').first()) }
}
}
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ pluginGroup = com.github.kechinvv.libslpluginij
pluginName = LibSL Support
pluginRepositoryUrl = https://github.com/kechinvv/LibSLPluginIJ
# SemVer format -> https://semver.org
pluginVersion = 0.1.0
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 = 241.*
pluginUntilBuild = 251.*

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

# 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
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
@@ -1,7 +1,5 @@
lexer grammar LibSLLexer;

@header {package org.jetbrains.research.libsl;}

SEMICOLON : ';' ;

ASSIGN_OP : '=' ;
Expand Down Expand Up @@ -254,6 +252,55 @@ NULL
: 'null'
;

IN
: 'in'
;

OUT
: 'out'
;

WHERE
: 'where'
;

IntegerLiteral:
DecimalIntegerLiteral
| HexIntegerLiteral
| OctalIntegerLiteral
| BinaryIntegerLiteral
;

fragment DecimalIntegerLiteral: DecimalNumeral IntegerTypeSuffix?;

fragment HexIntegerLiteral: HexNumeral IntegerTypeSuffix?;

fragment OctalIntegerLiteral: OctalNumeral IntegerTypeSuffix?;

fragment BinaryIntegerLiteral: BinaryNumeral IntegerTypeSuffix?;

fragment DecimalNumeral: '0' | NonZeroDigit (Digits?);

fragment IntegerTypeSuffix: [lLxsu] | 'ux' | 'us' | 'uL';

FloatingPointLiteral: DecimalFloatingPointLiteral;

fragment DecimalFloatingPointLiteral:
Digits '.' Digits? ExponentPart? FloatTypeSuffix?
| Digits ExponentPart FloatTypeSuffix?
| Digits FloatTypeSuffix
;

fragment ExponentPart: ExponentIndicator SignedInteger;

fragment ExponentIndicator: [eE];

fragment SignedInteger: Sign? Digits;

fragment Sign: [+-];

fragment FloatTypeSuffix: [fFdD];

Identifier
: [a-zA-Z_$][a-zA-Z0-9_$]*
| '`' .*? '`'
Expand All @@ -272,19 +319,43 @@ CHARACTER
| '\'' EscapeSequence '\''
;

fragment
SingleCharacter
fragment SingleCharacter
: ~['\\\r\n]
;

fragment
EscapeSequence
: '\\u' Hex Hex Hex Hex Hex Hex Hex Hex
fragment EscapeSequence
: '\\' [btnfr"'\\]
| UnicodeEscape
| OctalEscape
;

fragment UnicodeEscape: '\\' 'u'+ Hex Hex Hex Hex;

fragment OctalEscape:
'\\' OctalDigit
| '\\' OctalDigit OctalDigit
| '\\' ZeroToThree OctalDigit OctalDigit
;

fragment ZeroToThree: [0-3];

fragment Digits: Digit+;

Digit: ('0'..'9');

Hex: Digit | ('A'..'F');
fragment NonZeroDigit: [1-9];

fragment Hex: Digit | [a-fA-F];

fragment HexNumeral: '0' [xX] Hex+;

fragment OctalNumeral: '0' OctalDigit+;

fragment OctalDigit: [0-7];

fragment BinaryNumeral: '0' [bB] BinaryDigit+;

fragment BinaryDigit: [01];

fragment
NEWLINE
Expand All @@ -310,6 +381,10 @@ LINE_COMMENT
: ('//' ~[\r\n]*) -> channel(HIDDEN)
;

UNBOUNDED
: '?'
;

BAD_CHARACTER
: .
;
: .
;
Loading
Loading