Skip to content

Commit 58c677b

Browse files
committed
Released
1 parent 149db97 commit 58c677b

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
# plugin-template
1+
# Clojure plugin for DevKt
22

3-
This is the template of the plugin project.
3+
This is yet another clojure plugin for [DevKt](https://github.com/ice1000/dev-kt),
4+
based on [la-clojure](https://github.com/JetBrains/la-clojure).
45

5-
Things to change before coding:
6+
It works better than [this plugin](https://github.com/devkt-plugins/clojure-devkt).
67

7-
+ `your-language-devkt` in [settings.gradle.kts](settings.gradle.kts)
8-
+ `your.package.name` in [build.gradle.kts](build.gradle.kts)
8+
Everything related to DevKt are in [this Java file](src/org/jetbrains/plugin/devkt/clojure/Clojure.java).
9+
You may use it as a reference of DevKt plugin development, if you don't know Kotlin.
10+
11+
# Build
12+
13+
```
14+
$ gradlew jar
15+
```
916

src/org/jetbrains/plugin/devkt/clojure/Clojure.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,18 @@ private void symbol(ClSymbol symbol, AnnotationHolder<? super TextAttributes> an
6161
if (null == parent) return;
6262
ClSymbol functionName = parent.getFirstSymbol();
6363
if (null == functionName) return;
64-
PsiElement nextVisibleLeaf = PsiTreeUtil.nextVisibleLeaf(functionName);
64+
PsiElement nextVisibleLeaf = PsiTreeUtil.getNextSiblingOfType(functionName, ClVector.class);
6565
if (null == nextVisibleLeaf) return;
66-
if ("let".equals(functionName.getText()) && nextVisibleLeaf instanceof ClVector && PsiTreeUtil.isAncestor(
67-
nextVisibleLeaf,
68-
symbol,
69-
true)) annotationHolder.highlight(symbol, colorScheme.getVariable());
66+
if ("let".equals(functionName.getText()) && PsiTreeUtil.isAncestor(nextVisibleLeaf, symbol, true))
67+
annotationHolder.highlight(symbol, colorScheme.getVariable());
7068
}
7169
}
7270

7371
@Override
7472
public @Nullable
7573
TextAttributes attributesOf(IElementType iElementType, ColorScheme<? extends TextAttributes> colorScheme) {
7674
if (iElementType == ClojureTokenTypes.COMMA) return colorScheme.getComma();
75+
else if (iElementType == ClojureTokenTypes.CHAR_LITERAL) return colorScheme.getCharLiteral();
7776
else if (iElementType == ClojureTokenTypes.BAD_CHARACTER) return colorScheme.getUnknown();
7877
else if (NUMBERS.contains(iElementType)) return colorScheme.getNumbers();
7978
else if (ClojureTokenTypes.STRINGS.contains(iElementType)) return colorScheme.getString();

0 commit comments

Comments
 (0)