Skip to content

Commit

Permalink
update to new version
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Vanusanik committed Jul 30, 2023
1 parent d5b03eb commit 02e75b4
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 36 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.5.3 230730

### Fixes
- updated and tested new version for later IDE

## 0.5.2 230629

### Added
Expand Down
14 changes: 7 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
plugins {
id("java")
id("org.jetbrains.intellij") version "1.13.3"
id("org.jetbrains.intellij") version "1.15.0"
id("idea")
}

group = "com.en_circle.slt"
version = "0.5.2"
version = "0.5.3"

idea {
module {
Expand All @@ -24,8 +24,8 @@ dependencies {
implementation("org.rauschig:jarchivelib:1.2.0")
implementation("org.jsoup:jsoup:1.16.1")

testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.3")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.0")
}

sourceSets {
Expand All @@ -39,7 +39,7 @@ sourceSets {
// Configure Gradle IntelliJ Plugin
// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
intellij {
version.set("2022.2")
version.set("2023.2")
pluginName.set("slt")
var ide = System.getenv("TARGET_IDE")
if (ide == null || "" == ide)
Expand Down Expand Up @@ -89,8 +89,8 @@ tasks {
}

patchPluginXml {
sinceBuild.set("222")
untilBuild.set("231.*")
sinceBuild.set("232")
untilBuild.set("242.*")
}

signPlugin {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
19 changes: 19 additions & 0 deletions src/main/java/com/en_circle/slt/plugin/SltProjectActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.en_circle.slt.plugin;

import com.en_circle.slt.plugin.services.SltProjectService;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.startup.ProjectActivity;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class SltProjectActivity implements ProjectActivity {

@Nullable
@Override
public Object execute(@NotNull Project project, @NotNull Continuation<? super Unit> continuation) {
SltProjectService.getInstance(project);
return null;
}
}
15 changes: 0 additions & 15 deletions src/main/java/com/en_circle/slt/plugin/SltProjectListener.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.fileTypes.FileTypes;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.startup.StartupActivity;
import com.intellij.openapi.startup.ProjectActivity;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.PsiBinaryFile;
Expand All @@ -44,6 +44,8 @@
import com.intellij.util.Alarm;
import com.intellij.util.containers.Stack;
import com.intellij.util.text.CharArrayUtil;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand All @@ -53,21 +55,23 @@

// Copied from IJ source to implement highlight WITHOUT smart insertion!

public class SltBraceHighlighter implements StartupActivity.DumbAware {
public class SltBraceHighlighter implements ProjectActivity {
private static final Key<List<RangeHighlighter>> BRACE_HIGHLIGHTERS_IN_EDITOR_VIEW_KEY = Key.create("BraceHighlighter.BRACE_HIGHLIGHTERS_IN_EDITOR_VIEW_KEY");
private static final Key<RangeHighlighter> LINE_MARKER_IN_EDITOR_KEY = Key.create("BraceHighlighter.LINE_MARKER_IN_EDITOR_KEY");

private final Alarm alarm = new Alarm();

@Nullable
@Override
public void runActivity(@NotNull Project project) {
public Object execute(@NotNull Project project, @NotNull Continuation<? super Unit> continuation) {
if (ApplicationManager.getApplication().isHeadlessEnvironment() && !ApplicationManager.getApplication().isUnitTestMode() ||
!IdentifierHighlighterPassFactory.isEnabled()) {
return;
return null;
}

Disposable activityDisposable = SltProjectService.getInstance(project);
registerListeners(project, activityDisposable);
return null;
}

private void registerListeners(@NotNull Project project, @NotNull Disposable parentDisposable) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
import com.intellij.openapi.editor.actionSystem.EditorActionManager;
import com.intellij.openapi.editor.ex.util.EditorUIUtil;
import com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.InvalidStateException;
import com.intellij.openapi.editor.textarea.TextComponentEditor;
import com.intellij.openapi.util.Ref;
import com.intellij.psi.PsiDocumentManager;
Expand Down Expand Up @@ -99,7 +100,11 @@ public void run() {
EditorModificationUtil.deleteSelectedText(editor);
int caretOffset = editor.getCaretModel().getOffset();
String s = "\n" + StringUtils.repeat(' ', additionalOffset);
document.insertString(caretOffset, s);
try {
document.insertString(caretOffset, s);
} catch (InvalidStateException ignored) {
// lexer error is ignored
}
editor.getCaretModel().moveToOffset(caretOffset + s.length());
EditorModificationUtil.scrollToCaret(editor);
editor.getSelectionModel().removeSelection();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.intellij.openapi.editor.EditorFactory;
import com.intellij.openapi.editor.event.*;
import com.intellij.openapi.editor.ex.EditorEx;
import com.intellij.openapi.fileEditor.FileEditorManagerEvent;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.NlsContexts.Label;
Expand Down Expand Up @@ -127,11 +126,6 @@ public void caretRemoved(@NotNull CaretEvent e) {
updatePosition(e.getEditor());
}

@Override
public void selectionChanged(@NotNull FileEditorManagerEvent event) {
updatePosition(getEditor());
}

@Override
public void afterDocumentChange(@NotNull Document document) {
EditorFactory.getInstance().editors(document)
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@

<additionalTextAttributes scheme="Default" file="colorSchemes/SLT.xml"/>
<additionalTextAttributes scheme="Darcula" file="colorSchemes/SLTDarcula.xml"/>

<postStartupActivity implementation="com.en_circle.slt.plugin.SltProjectActivity"/>
</extensions>

<actions resource-bundle="messages.SltBundle">
Expand Down Expand Up @@ -274,8 +276,6 @@
<projectListeners>
<listener class="com.en_circle.slt.plugin.ui.debug.SltBreakpointListener"
topic="com.intellij.xdebugger.breakpoints.XBreakpointListener" />
<listener class="com.en_circle.slt.plugin.SltProjectListener"
topic="com.intellij.openapi.project.ProjectManagerListener" />
</projectListeners>

<change-notes><![CDATA[
Expand Down

0 comments on commit 02e75b4

Please sign in to comment.