diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml
index 57ffca35..81cae9df 100644
--- a/.github/workflows/gradle.yml
+++ b/.github/workflows/gradle.yml
@@ -15,15 +15,11 @@ jobs:
env:
# see https://www.jetbrains.com/idea/download/previous.html
# and https://www.jetbrains.com/intellij-repository/snapshots/
- - IDEA_VERSION: IC-2018.3.6
- - IDEA_VERSION: IC-2019.1.4
- - IDEA_VERSION: IC-2019.2.4
- - IDEA_VERSION: IC-2019.3.3
- IDEA_VERSION: IC-2020.1
- IDEA_VERSION: IC-2020.2
- IDEA_VERSION: IC-2020.3
- IDEA_VERSION: IC-2021.2.4
- - IDEA_VERSION: IC-2021.3
+ - IDEA_VERSION: IC-2021.3.3
- IDEA_VERSION: IU-LATEST-EAP-SNAPSHOT
steps:
diff --git a/README.md b/README.md
index f77b3d47..01e2013b 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,10 @@
# IntelliJ Idea Plugin for ANTLR v4 ![Java CI](https://github.com/antlr/intellij-plugin-v4/workflows/Java%20CI/badge.svg?branch=master) [![Latest version](https://img.shields.io/jetbrains/plugin/v/7358.svg?label=latest%20version)](https://plugins.jetbrains.com/plugin/7358) ![Downloads](https://img.shields.io/jetbrains/plugin/d/7358.svg)
-An [IntelliJ](https://www.jetbrains.com/idea/) 2018.3 .. 2021.x plugin for ANTLR v4 ([plugin source at github](https://github.com/antlr/intellij-plugin-v4)).
+An [IntelliJ](https://www.jetbrains.com/idea/) 2020.3+ plugin for ANTLR v4 ([plugin source at github](https://github.com/antlr/intellij-plugin-v4)). (Technically, the plugin will load in 2019.2+ but you might not have much luck earlier than 2020.3)
[Plugin page at intellij](http://plugins.jetbrains.com/plugin/7358?pr=idea)
-This plugin is for ANTLR v4 grammars and includes ANTLR 4.9.1. Works with IntelliJ IDEA and other IntelliJ-based IDEs.
+This plugin is for ANTLR v4 grammars and includes ANTLR 4.10. Works with IntelliJ IDEA and other IntelliJ-based IDEs.
## Features:
@@ -131,7 +131,7 @@ If you see ambiguities highlighted, those you should definitely take a look
consistent with the speed of a generated and compiled parser but it does use
single-stage full LL parsing which can be slower. It needs to do that so
that it gets full and complete profiling information. For those in the know,
- it uses PredictionMode.LL_EXACT_AMBIG_DETECTION. For really big files and
+ it uses `PredictionMode.LL_EXACT_AMBIG_DETECTION`. For really big files and
slow grammars, there is an appreciable delay when displaying the parse tree or profiling information.
![parse-region.png](images/profiler.png)
@@ -173,7 +173,7 @@ Even when a grammar is getting a single interpretation of the input, we often wo
# Contributing
-We [moved to Gradle](https://github.com/antlr/intellij-plugin-v4/pull/295) for 1.9. To contribute to the project,
+We [use Gradle](https://github.com/antlr/intellij-plugin-v4/pull/295) to build. To contribute to the project,
you need a recent version of IntelliJ IDEA (either Community or Ultimate) with the `Gradle` and `Plugin DevKit`
plugins enabled.
@@ -189,6 +189,21 @@ To launch unit tests, run `./gradlew check`.
To build a zipped version of the plugin and its dependencies, run `./gradlew buildPlugin`.
-You can tweak the version of the IntelliJ platform used to build/test the plugin in `gradle.properties`. Versions prior to 2018.1.5 require a JDK 1.8, but later versions also support JDK 9+.
+You can tweak the version of the IntelliJ platform used to build/test the plugin in `gradle.properties`, such as:
+
+```
+ideaVersion=IC-2020.2.2
+```
+
+As of 1.18, java 11 is assumed but you might get away with earlier java.
A high level description of how the plugin works can be found in `ARCHITECTURE.md`.
+
+# Releasing
+
+* Search for 4.9, 4.10 etc... of ANTLR.
+* Update release notes in plugin.xml
+* Test with multiple IDE versions
+* Run unit tests
+* Upload to https://plugins.jetbrains.com/plugin/add#intellij
+* Write release note in github
diff --git a/build.gradle b/build.gradle
index ad5b2424..9e6b85a6 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,11 +5,11 @@ buildscript {
}
plugins {
- id "org.jetbrains.intellij" version "1.4.0"
+ id "org.jetbrains.intellij" version "1.5.2"
}
wrapper {
- gradleVersion = '6.8'
+ gradleVersion = '7.4.2'
}
group 'antlr'
@@ -34,6 +34,10 @@ intellij {
repositories {
mavenCentral()
+ mavenLocal()
+ maven { // Gets snapshots of antlr if needed
+ url "https://oss.sonatype.org/content/repositories/snapshots/"
+ }
}
dependencies {
@@ -42,7 +46,7 @@ dependencies {
}
implementation "org.antlr:antlr4-intellij-adaptor:0.1"
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
- testImplementation group: 'org.mockito', name: 'mockito-core', version: '4.3.1'
+ testImplementation group: 'org.mockito', name: 'mockito-core', version: '4.4.0'
}
generateGrammarSource {
diff --git a/gradle.properties b/gradle.properties
index 02019b9a..3ce9f154 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,4 +1,4 @@
-pluginVersion=1.17
+pluginVersion=1.18
# e.g. IC-2016.3.3, IU-2018.2.5 etc
# For a list of possible values, refer to the section 'com.jetbrains.intellij.idea' at
@@ -7,12 +7,16 @@ pluginVersion=1.17
# Old version we use to test code
#ideaVersion=IC-2019.1.3
+#ideaVersion=IC-2020.1 might work on non mac
+
# Fixes OS X Monterey error about missing a .dylib
#ideaVersion=IC-2020.2.1
#ideaVersion=IC-2020.2.2
-ideaVersion=IC-2021.2
+#ideaVersion=IC-2021.2
+
+ideaVersion=IC-2021.3.3
# The version of ANTLR v4 that will be used to generate the parser
-antlr4Version=4.9.3
+antlr4Version=4.10-SNAPSHOT
diff --git a/src/main/antlr/org/antlr/intellij/plugin/parser/ANTLRv4Parser.g4 b/src/main/antlr/org/antlr/intellij/plugin/parser/ANTLRv4Parser.g4
index 380fec03..4e2d3fc3 100644
--- a/src/main/antlr/org/antlr/intellij/plugin/parser/ANTLRv4Parser.g4
+++ b/src/main/antlr/org/antlr/intellij/plugin/parser/ANTLRv4Parser.g4
@@ -207,7 +207,7 @@ labeledAlt
lexerRule
: DOC_COMMENT* FRAGMENT?
- TOKEN_REF COLON lexerRuleBlock SEMI
+ TOKEN_REF optionsSpec? COLON lexerRuleBlock SEMI
;
lexerRuleBlock
diff --git a/src/main/java/org/antlr/intellij/plugin/ANTLRv4ExternalAnnotator.java b/src/main/java/org/antlr/intellij/plugin/ANTLRv4ExternalAnnotator.java
index 537f90d5..03e13704 100644
--- a/src/main/java/org/antlr/intellij/plugin/ANTLRv4ExternalAnnotator.java
+++ b/src/main/java/org/antlr/intellij/plugin/ANTLRv4ExternalAnnotator.java
@@ -122,6 +122,9 @@ private Optional