Skip to content

Commit

Permalink
Bumping Gradle, RSTA, and all other dependencies to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbylight committed Jan 14, 2023
1 parent 98aa773 commit 4b55626
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 93 deletions.
2 changes: 1 addition & 1 deletion AutoComplete/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ assert current().isJava8Compatible()
archivesBaseName = 'autocomplete'

dependencies {
api 'com.fifesoft:rsyntaxtextarea:3.3.1'
api 'com.fifesoft:rsyntaxtextarea:3.3.2'
}

ext.isReleaseVersion = !project.version.endsWith('SNAPSHOT')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,53 @@ public CompletionCellRenderer(DefaultListCellRenderer delegate) {
}


/**
* Utility function to append a short description to a string buffer.
* Useful to ensure consistency when rendering completions that display
* a trailing description of the completion.
*
* @param sb The string buffer to append to.
* @param definition The text to append.
* @see #prepareForOtherCompletion(JList, Completion, int, boolean, boolean)
* @see #prepareForTemplateCompletion(JList, TemplateCompletion, int, boolean, boolean)
*/
protected void appendShortDescription(StringBuilder sb, String definition) {
sb.append(" - ");
if (!selected) {
sb.append("<font color='").append(typeColor).append("'>");
}
sb.append(definition);
if (!selected) {
sb.append("</font>");
}
}


/**
* Utility function that appends a variable or function completion's type to a
* string buffer if {@link #getShowTypes()} is {@code true}.
*
* @param sb The string buffer to possibly append to.
* @param varOrFunctionCompletion The completion to examine.
* @see #prepareForFunctionCompletion(JList, FunctionCompletion, int, boolean, boolean)
* @see #prepareForVariableCompletion(JList, VariableCompletion, int, boolean, boolean)
*/
protected void appendTypeIfNecessary(StringBuilder sb, VariableCompletion varOrFunctionCompletion) {

if (getShowTypes() && varOrFunctionCompletion.getType()!=null) {

sb.append(" : ");
if (!selected) {
sb.append("<font color='").append(typeColor).append("'>");
}
sb.append(varOrFunctionCompletion.getType());
if (!selected) {
sb.append("</font>");
}
}
}


/**
* Creates the icon to use if no icon is found for a specific completion.
* The default implementation returns a 16x16 empty icon.
Expand Down Expand Up @@ -439,17 +486,7 @@ protected void prepareForFunctionCompletion(JList<?> list,
sb.append(paramListEnd);
}

if (getShowTypes() && fc.getType()!=null) {
sb.append(" : ");
if (!selected) {
sb.append("<font color='").append(typeColor).append("'>");
}
sb.append(fc.getType());
if (!selected) {
sb.append("</font>");
}
}

appendTypeIfNecessary(sb, fc);
setText(sb.toString());

}
Expand Down Expand Up @@ -489,14 +526,7 @@ protected void prepareForOtherCompletion(JList<?> list,
if (c instanceof BasicCompletion) {
String definition = ((BasicCompletion)c).getShortDescription();
if (definition!=null) {
sb.append(" - ");
if (!selected) {
sb.append("<font color='").append(typeColor).append("'>");
}
sb.append(definition);
if (!selected) {
sb.append("</font>");
}
appendShortDescription(sb, definition);
}
}

Expand All @@ -522,14 +552,7 @@ protected void prepareForTemplateCompletion(JList<?> list,

String definition = tc.getShortDescription();
if (definition!=null) {
sb.append(" - ");
if (!selected) {
sb.append("<font color='").append(typeColor).append("'>");
}
sb.append(definition);
if (!selected) {
sb.append("</font>");
}
appendShortDescription(sb, definition);
}

setText(sb.toString());
Expand All @@ -551,17 +574,7 @@ protected void prepareForVariableCompletion(JList<?> list,

StringBuilder sb = new StringBuilder(PREFIX);
sb.append(vc.getName());

if (getShowTypes() && vc.getType()!=null) {
sb.append(" : ");
if (!selected) {
sb.append("<font color='").append(typeColor).append("'>");
}
sb.append(vc.getType());
if (!selected) {
sb.append("</font>");
}
}
appendTypeIfNecessary(sb, vc);

setText(sb.toString());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ private static int getFirstHighlight(List<Highlight> highlights) {
* Returns the highlight from a list that comes "last" in that list. Even
* though most parameter highlights are ordered, sometimes they aren't
* (e.g. the "cursor" parameter in a template completion is always last,
* even though it can be anywhere in the template.
* even though it can be anywhere in the template).
*
* @param highlights The list of highlights. Assumed to be non-empty.
* @return The highlight that comes last in the document.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ public String getDefinitionString() {
return definitionString;
}


public String getShortDescription() {
return shortDescription;
}
Expand Down
107 changes: 54 additions & 53 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"https://www.puppycrawl.com/dtds/configuration_1_3.dtd">
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">

<!--
Expand All @@ -20,11 +20,12 @@
- some best practices
Checkstyle is very configurable. Be sure to read the documentation at
https://checkstyle.sourceforge.io/ (or in your downloaded distribution).
https://checkstyle.org (or in your downloaded distribution).
Most Checks are configurable, be sure to consult the documentation.
To completely disable a check, just comment it out or delete it from the file.
To suppress certain violations please review suppression filters.
Finally, it is worth reading the documentation.
Expand All @@ -39,18 +40,18 @@
<property name="basedir" value="${basedir}"/>
-->

<property name="fileExtensions" value="java"/>
<property name="fileExtensions" value="java"/>
<property name="tabWidth" value="4"/>

<!-- Part of turning off individual checks: -->
<!-- https://stackoverflow.com/questions/4023185/disable-a-particular-checkstyle-rule-for-a-particular-line-of-code -->
<module name="SuppressWarningsFilter" />
<!-- Part of turning off individual checks: -->
<!-- https://stackoverflow.com/questions/4023185/disable-a-particular-checkstyle-rule-for-a-particular-line-of-code -->
<module name="SuppressWarningsFilter" />

<!-- Checks that a package-info.java file exists for each package. -->
<!-- See https://checkstyle.sourceforge.io/config_javadoc.html#JavadocPackage -->
<module name="JavadocPackage">
<property name="allowLegacy" value="true"/> <!-- Allow package.html in addition to package-info.java -->
</module>
<property name="allowLegacy" value="true"/> <!-- Allow package.html in addition to package-info.java -->
</module>

<!-- Checks whether files end with a new line. -->
<!-- See https://checkstyle.sourceforge.io/config_misc.html#NewlineAtEndOfFile -->
Expand All @@ -59,12 +60,12 @@
<!-- Checks that property files contain the same keys. -->
<!-- See https://checkstyle.sourceforge.io/config_misc.html#Translation -->
<module name="Translation"/>

<!-- Checks for Size Violations. -->
<!-- See https://checkstyle.sourceforge.io/config_sizes.html -->
<module name="FileLength">
<property name="max" value="1615"/>
</module>
<property name="max" value="1615"/>
</module>

<module name="LineLength">
<property name="max" value="120"/>
Expand All @@ -77,10 +78,10 @@
<!-- Miscellaneous other checks. -->
<!-- See https://checkstyle.sourceforge.io/config_misc.html -->
<module name="RegexpSingleline">
<property name="format" value="\s+$"/>
<property name="minimum" value="0"/>
<property name="maximum" value="0"/>
<property name="message" value="Line has trailing spaces."/>
<property name="format" value="\s+$"/>
<property name="minimum" value="0"/>
<property name="maximum" value="0"/>
<property name="message" value="Line has trailing spaces."/>
</module>

<!-- Checks for Headers -->
Expand All @@ -92,19 +93,19 @@

<module name="TreeWalker">

<!-- Part of turning off individual checks: -->
<!-- https://stackoverflow.com/questions/5761188/checkstyle-suppressioncommentfilter-not-ignoring-specified-rule/5764666#5764666 -->
<module name="SuppressWarningsHolder" />
<!-- Part of turning off individual checks: -->
<!-- https://stackoverflow.com/questions/5761188/checkstyle-suppressioncommentfilter-not-ignoring-specified-rule/5764666#5764666 -->
<module name="SuppressWarningsHolder" />

<!-- Checks for Javadoc comments. -->
<!-- See https://checkstyle.sourceforge.io/config_javadoc.html -->
<!--<module name="JavadocMethod"/> This is just too whiny for now. -->
<module name="JavadocType"/>
<!--
<!--
<module name="JavadocVariable">
<property name="scope" value="package"/>
</module>
-->
<property name="scope" value="package"/>
</module>
-->
<module name="JavadocStyle"/>
<module name="AtclauseOrder"/>
<module name="InvalidJavadocPosition"/>
Expand Down Expand Up @@ -145,7 +146,7 @@
<module name="MissingDeprecated"/>
<module name="MissingOverride"/>

<!-- Checks for imports -->
<!-- Checks for imports -->
<!-- See https://checkstyle.sourceforge.io/config_imports.html -->
<!--<module name="AvoidStarImport"/>-->
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
Expand All @@ -154,14 +155,14 @@


<!-- Checks for Size Violations. -->
<!-- See https://checkstyle.sourceforge.io/config_imports.html -->
<!-- See https://checkstyle.sourceforge.io/config_sizes.html -->
<module name="MethodLength">
<property name="max" value="300"/>
</module>
<property name="max" value="300"/>
</module>
<module name="ParameterNumber">
<property name="max" value="9"/>
<!--<property name="ignoreOverriddenMethods" value="true"/>-->
</module>
<property name="max" value="9"/>
<!--<property name="ignoreOverriddenMethods" value="true"/>-->
</module>


<!-- Checks for whitespace -->
Expand All @@ -172,8 +173,8 @@
<!--<module name="NoWhitespaceAfter"/>-->
<!--<module name="NoWhitespaceBefore"/>-->
<module name="OperatorWrap">
<property name="option" value="eol"/>
</module>
<property name="option" value="eol"/>
</module>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<!--<module name="WhitespaceAround"/>-->
Expand All @@ -191,12 +192,12 @@
<module name="EmptyBlock"/>
<module name="LeftCurly"/>
<module name="NeedBraces"> <!-- Allow stuff like "while (doSomething(minus-minus-count));" -->
<property name="allowEmptyLoopBody" value="true"/>
</module>
<module name="RightCurly"> <!-- Right curlies should be alone in if/else -->
<property name="option" value="alone"/>
<property name="tokens" value="LITERAL_ELSE, METHOD_DEF"/>
</module>
<property name="allowEmptyLoopBody" value="true"/>
</module>
<module name="RightCurly"> <!-- Right curlies should be alone in if/else -->
<property name="option" value="alone"/>
<property name="tokens" value="LITERAL_ELSE, METHOD_DEF"/>
</module>

<!-- Checks for common coding problems -->
<!-- See https://checkstyle.sourceforge.io/config_coding.html -->
Expand All @@ -205,13 +206,13 @@
<module name="EqualsAvoidNull"/>
<module name="EqualsHashCode"/>
<module name="ExplicitInitialization"/>
<!-- Completely overridden since it's common in Java to do e.g. this.foo = foo;
<!-- Completely overridden since it's common in Java to do e.g. this.foo = foo;
<module name="HiddenField">
<property name="ignoreSetter" value="true" />
<property name="ignoreConstructorParameter" value="true" />
</module>
-->
<!-- <module name="IllegalCatch"/>-->
<property name="ignoreSetter" value="true" />
<property name="ignoreConstructorParameter" value="true" />
</module>
-->
<!-- <module name="IllegalCatch"/>-->
<module name="IllegalInstantiation"/>
<module name="IllegalThrows"/>
<module name="IllegalType"/>
Expand All @@ -221,9 +222,9 @@
<module name="MultipleVariableDeclarations"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<!-- <module name="UnnecessaryParentheses"/>-->
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration"/>
<!-- <module name="UnnecessaryParentheses"/>-->
<module name="UnnecessarySemicolonAfterOuterTypeDeclaration"/>
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration"/>
<module name="UnnecessarySemicolonInEnumeration"/>
<module name="UnnecessarySemicolonInTryWithResources"/>
<module name="UnusedLocalVariable"/>
Expand All @@ -235,9 +236,9 @@
<module name="HideUtilityClassConstructor"/>
<!--<module name="InterfaceIsType"/> Allow constant interfaces -->
<module name="VisibilityModifier">
<property name="protectedAllowed" value="true"/>
<property name="packageAllowed" value="true"/>
</module>
<property name="protectedAllowed" value="true"/>
<property name="packageAllowed" value="true"/>
</module>


<!-- Miscellaneous other checks. -->
Expand All @@ -251,7 +252,7 @@

<!-- Checks for metrics. -->
<!-- See https://checkstyle.sourceforge.io/config_metrics.html -->
<!-- <module name="CyclomaticComplexity"/>-->
<!-- <module name="CyclomaticComplexity"/>-->

</module>

Expand All @@ -260,8 +261,8 @@
</module>
<module name="UniqueProperties"/>

<module name="SuppressionFilter">
<module name="SuppressionFilter">
<property name="file" value="${config_loc}/acSuppressions.xml"/>
</module>
</module>

</module>

0 comments on commit 4b55626

Please sign in to comment.