some more code cleanup

This commit is contained in:
FalsePattern 2023-07-29 12:29:19 +02:00
parent 623dc2aca7
commit 027356f627
Signed by: falsepattern
GPG key ID: FDF7126A9E124447
5 changed files with 12 additions and 13 deletions

View file

@ -37,15 +37,13 @@ public class HighlightingUtil {
app.runReadAction(() -> {
var highlightRanges = manager.semanticHighlighting();
var markup = editor.getMarkupModel();
SwingUtilities.invokeLater(() -> {
ApplicationManager.getApplication().runWriteAction(() -> {
SwingUtilities.invokeLater(() -> ApplicationManager.getApplication().runWriteAction(() -> {
markup.removeAllHighlighters();
for (var range : highlightRanges) {
markup.addRangeHighlighter(range.color(), range.start(), range.end(), HighlighterLayer.SYNTAX,
HighlighterTargetArea.EXACT_RANGE);
}
});
});
}));
});
}
}

View file

@ -16,7 +16,6 @@
package com.falsepattern.zigbrains.ide;
import com.intellij.openapi.editor.DefaultLanguageHighlighterColors;
import com.intellij.openapi.editor.colors.TextAttributesKey;
import org.jetbrains.annotations.Unmodifiable;

View file

@ -17,14 +17,13 @@
package com.falsepattern.zigbrains.ide;
import com.intellij.openapi.fileTypes.LanguageFileType;
import com.intellij.openapi.util.NlsContexts;
import com.intellij.openapi.util.NlsSafe;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import javax.swing.Icon;
public class ZigFileType extends LanguageFileType {
@SuppressWarnings("unused") // Used by plugin.xml
public static final ZigFileType INSTANCE = new ZigFileType();
private ZigFileType() {

View file

@ -32,6 +32,9 @@ import org.wso2.lsp4intellij.listeners.EditorMouseListenerImpl;
import org.wso2.lsp4intellij.listeners.EditorMouseMotionListenerImpl;
import org.wso2.lsp4intellij.listeners.LSPCaretListenerImpl;
// There's a couple unchecked casts here, because LSPExtensionManager has generics where it shouldn't,
// but we have to live with it for now, I guess...
@SuppressWarnings("unchecked")
public class ZLSExtensionManager implements LSPExtensionManager {
@Override
public <T extends DefaultRequestManager> T getExtendedRequestManagerFor(LanguageServerWrapper wrapper, LanguageServer server, LanguageClient client, ServerCapabilities serverCapabilities) {

View file

@ -36,7 +36,7 @@ public final class AppSettingsState implements PersistentStateComponent<AppSetti
}
@Override
public @Nullable AppSettingsState getState() {
public AppSettingsState getState() {
return this;
}