Skip to content

Commit

Permalink
Version compatibility fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pbroadbery committed Apr 6, 2021
1 parent b25a36d commit c8ddef1
Show file tree
Hide file tree
Showing 11 changed files with 3,243 additions and 39 deletions.
5 changes: 5 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3,194 changes: 3,194 additions & 0 deletions aldor-idea.iml

Large diffs are not rendered by default.

24 changes: 8 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ plugins {
id "org.jetbrains.intellij" version "0.6.3"
id "de.undercouch.download" version "3.2.0"
id "org.jetbrains.grammarkit" version "2020.3.1"
id 'net.ltgt.errorprone' version '2.0.1' apply false
}

wrapper {
Expand Down Expand Up @@ -56,9 +57,6 @@ java {
}

intellij {
//version "IC-202.8194.7" //version '2020.2.4'
//version "IC-201.7223.91" //version '2019.2'
//version "202.8194.7" // 2020.3
plugins = ['java']
downloadSources = true
type = 'IC'
Expand All @@ -67,8 +65,11 @@ intellij {
updateSinceUntilBuild = true
}

runPluginVerifier {
ideVersions pluginVerifierIdeVersions
}

buildSearchableOptions {
enabled = false
}

allprojects {
Expand Down Expand Up @@ -107,6 +108,7 @@ grammarKit {
}

dependencies {
//errorprone 'com.google.errorprone:error_prone_core:2.6.0'
compile project('jps-plugin')
testCompile group: 'junit', name: 'junit', version: '4.13.2'
compile files(libFiles.collect({"lib/${it}.jar"}))
Expand All @@ -118,9 +120,7 @@ patchPluginXml {
sinceBuild("${pluginSinceBuild}")
untilBuild("${pluginUntilBuild}")

changeNotes """
Add change notes here.<br>
<em>most HTML tags may be used</em>"""
// changeNotes "Notes"
version
}

Expand Down Expand Up @@ -225,17 +225,9 @@ task listCompileOnly(dependsOn: configurations.compile) {
tasks.prepareSandbox.dependsOn project('aldorunit').tasks.jar
tasks.prepareTestingSandbox.dependsOn project('aldorunit').tasks.jar
prepareTestingSandbox {
doFirst {
//${project('aldorunit').libsDir}.collect {println "Found file ${it}"}
println "outputs ${project('aldorunit').tasks.jar.archiveFile.asFile}"
println "copy files ${project('aldorunit').libsDir} ${destinationDir}/${intellij.pluginName}/aldorunit"
}
from(project('aldorunit').tasks.jar) {
into "${intellij.pluginName}/aldorunit"
}
eachFile {
println "File: ${it}"
}
}

prepareSandbox {
Expand Down Expand Up @@ -284,7 +276,7 @@ def parserTask(project, parserName, pkg) {
test {
testLogging {
events "failed"
exceptionFormat "short"
exceptionFormat "full"
}
maxHeapSize = "6g"
}
Expand Down
13 changes: 9 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
baseVersion=1.3
baseVersion=1.3.1

pluginSinceBuild = 202
pluginUntilBuild = 203.*
pluginSinceBuild = 201
pluginUntilBuild = 215.*
platformVersion = 2020.2.4

# 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
pluginVerifierIdeVersions = 2020.2.4, 2020.3.2, 2021.1
# 2019.3.5 193.7288.26 - JdkCombo box is broken
# 2020.1.4 201.8743.12
# 2020.2.4 202.8194.7
# 2020.3.2 203.7148.57
# 2020.3.3 203.7717.56
pluginVerifierIdeVersions = IC-2020.3.3, IC-2020.2.4, IC-2020.1.4
4 changes: 4 additions & 0 deletions jps-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ intellij {
plugins = ['java'] // Probably shouldn't be needed, but is
configureDefaultDependencies = false
}
runPluginVerifier {
}

dependencies {
compile group: 'org.jetbrains', name: 'annotations', version: '19.0.0'
Expand All @@ -28,6 +30,8 @@ afterEvaluate {
}

project.tasks.runIde.setEnabled(false)
project.tasks.verifyPlugin.setEnabled(false)
project.tasks.runPluginVerifier.setEnabled(false)
}

task list(dependsOn: configurations.compile) {
Expand Down
26 changes: 18 additions & 8 deletions src/main/grammar/Aldor.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,18 @@
implements("UnaryWithExpr") = 'aldor.psi.AldorWith'
implements("BinaryWithExpr") = 'aldor.psi.AldorWith'

stubClass("UnaryWith")='com.intellij.psi.stubs.EmptyStub<aldor.psi.AldorWith>'
stubClass("WithPart")='com.intellij.psi.stubs.EmptyStub<aldor.psi.AldorWith>'
stubClass("UnaryWithExpr")='com.intellij.psi.stubs.EmptyStub<aldor.psi.AldorWith>'
stubClass("BinaryWithExpr")='com.intellij.psi.stubs.EmptyStub<aldor.psi.AldorWith>'
stubClass("UnaryWith")='com.intellij.psi.stubs.EmptyStub<aldor.psi.AldorWith>'
stubClass("WithPart")='com.intellij.psi.stubs.EmptyStub<aldor.psi.AldorWith>'

mixin("UnaryWithExpr") ="com.intellij.extapi.psi.StubBasedPsiElementBase<com.intellij.psi.stubs.EmptyStub<aldor.psi.AldorWith>>"
mixin("BinaryWithExpr") ="com.intellij.extapi.psi.StubBasedPsiElementBase<com.intellij.psi.stubs.EmptyStub<aldor.psi.AldorWith>>"
mixin("UnaryWith")="aldor.psi.impl.AldorWithMixin"
mixin("WithPart")="aldor.psi.impl.AldorWithMixin"
mixin("UnaryWithExpr")="aldor.psi.impl.AldorWithMixin"
mixin("BinaryWithExpr")="aldor.psi.impl.AldorWithMixin"

//mixin("UnaryWithExpr")="aldor.psi.impl.AldorWithExprMixin"
//mixin("BinaryWithExprStubbed")="aldor.psi.impl.AldorWithExprMixin"

// add
//stubClass("UnaryAdd")='com.intellij.psi.stubs.EmptyStub<com.intellij.psi.PsiElement>'
Expand Down Expand Up @@ -274,9 +277,9 @@ private BindingL_Infixed_Collection ::=
| BindingL_Infixed_Collection_Define
| BindingL_Infixed_Collection_Macro
| BindingL_Infixed_Collection_Lambda
// | (Iterator+ <<noRepeatHere>>)
| KW_MapsToStar BindingL_Infixed_Collection)
| Collection

| Collection
left BindingL_Infixed_Collection_Assign ::= KW_Assign BindingL_Infixed_Collection
left BindingL_Infixed_Collection_Macro ::= KW_MArrow BindingL_Infixed_Collection
left BindingL_Infixed_Collection_Define ::= KW_2EQ BindingL_Infixed_Collection
Expand Down Expand Up @@ -735,12 +738,12 @@ PreDocument ::= TK_PreDoc*

SpadTopLevel ::= <<parseTopLevel "SpadTopLevel">>
// NB: All spad comments are '++'. Guess that top level is pre - anything else is post.
SpadTopLevelExpression ::= SpadAbbrevCmd* PreDocument Expression //{pin=PreDocument} {recoverWhile="TopLevel_Recover"}
SpadTopLevelExpression ::= SpadAbbrevCmd* PreDocument Expression // {pin=PreDocument} {recoverWhile="TopLevel_Recover"}
SpadDocument ::= TK_PostDoc*
SpadAbbrevCmd ::= TK_SysCmdAbbrev


//private TopLevel_Recover ::= !(TK_PreDoc)
//private TopLevel_Recover ::= !(TK_PreDoc | SpadAbbrevCmd)

SpadInfixed ::= Block | Expr

Expand Down Expand Up @@ -784,8 +787,15 @@ Colon_194_Expr ::= KW_Colon Expr
//private PrimaryGroup ::= PrimaryExpr
PrimaryExpr ::= Application

//UnaryWithExpr ::= UnaryWithExprStubbed
//BinaryWithExpr ::= BinaryWithExprStubbed
UnaryWithExpr ::= KW_With DeclMolecule
BinaryWithExpr ::= Expr KW_With DeclMolecule

//UnaryWithExprStubbed ::= KW_With DeclMolecule
//BinaryWithExprStubbed ::= Expr KW_With DeclMolecule


UnaryAddExpr ::= KW_Add DeclMolecule
BinaryAddExpr ::= Expr KW_Add DeclMolecule

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

public class AldorLanguageCodeStyleSettingsProvider extends LanguageCodeStyleSettingsProvider {

// TODO: Disable tab size editor - see
// GroovyLanguageCodeStyleSettingsProvider for how to select from list of common options

@NotNull
@Override
public Language getLanguage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public class NoTabWidthIndentOptionsEditor extends IndentOptionsEditor {
@Override
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
myTabSizeField.setEnabled(false);
}

}
7 changes: 2 additions & 5 deletions src/main/java/aldor/psi/elements/AldorElementTypeFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

import aldor.language.AldorLanguage;
import aldor.language.SpadLanguage;
import aldor.psi.AldorUnaryAdd;
import aldor.psi.AldorWhereBlock;
import aldor.psi.AldorWith;
import aldor.psi.impl.AldorBinaryWithExprImpl;
import aldor.psi.impl.AldorColonExprFixedImpl;
import aldor.psi.impl.AldorDeclPartImpl;
import aldor.psi.impl.AldorDefineMixin;
import aldor.psi.impl.AldorMacroMixin;
import aldor.psi.impl.AldorUnaryAddImpl;
import aldor.psi.impl.AldorUnaryWithExprImpl;
import aldor.psi.impl.AldorUnaryWithImpl;
import aldor.psi.impl.AldorWhereBlockImpl;
Expand All @@ -20,7 +18,6 @@
import com.intellij.lang.Language;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.stubs.EmptyStub;
import com.intellij.psi.stubs.PsiFileStub;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.tree.IStubFileElementType;
Expand Down Expand Up @@ -74,8 +71,8 @@ public PsiElement createElement(ASTNode node) {

factoryForName.put("UNARY_WITH", new EmptyStubElementType<AldorWith>("WithPart", AldorLanguage.INSTANCE, AldorUnaryWithImpl::new));
factoryForName.put("WITH_PART", new EmptyStubElementType<AldorWith>("BinaryWith", AldorLanguage.INSTANCE, AldorWithPartImpl::new));
//factoryForName.put("UNARY_WITH_EXPR", new EmptyStubElementType<AldorWith>("UnaryWithExpr", AldorLanguage.INSTANCE, AldorUnaryWithExprImpl::new));
//factoryForName.put("BINARY_WITH_EXPR", new EmptyStubElementType<AldorWith>("BinaryWithExpr", AldorLanguage.INSTANCE, AldorBinaryWithExprImpl::new));
factoryForName.put("UNARY_WITH_EXPR", new EmptyStubElementType<AldorWith>("UnaryWithExpr", AldorLanguage.INSTANCE, AldorUnaryWithExprImpl::new));
factoryForName.put("BINARY_WITH_EXPR", new EmptyStubElementType<AldorWith>("BinaryWithExpr", AldorLanguage.INSTANCE, AldorBinaryWithExprImpl::new));
}

public static IElementType createElement(String name) {
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/aldor/psi/impl/AldorWithMixin.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package aldor.psi.impl;

import aldor.psi.AldorWith;
import aldor.psi.stub.SpadAbbrevStub;
import aldor.psi.stub.WithStub;
import com.intellij.extapi.psi.ASTWrapperPsiElement;
import com.intellij.extapi.psi.StubBasedPsiElementBase;
import com.intellij.lang.ASTNode;
import com.intellij.psi.stubs.EmptyStub;
Expand Down
2 changes: 0 additions & 2 deletions src/test/java/aldor/parser/TopLevelParseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,4 @@ private PsiElement parseText(CharSequence text) {
private PsiElement parseText(CharSequence text, IElementType elementType) {
return ParserFunctions.parseAldorText(getProject(), text, elementType);
}


}

0 comments on commit c8ddef1

Please sign in to comment.