some more code cleanup
This commit is contained in:
parent
623dc2aca7
commit
027356f627
5 changed files with 12 additions and 13 deletions
|
@ -37,15 +37,13 @@ public class HighlightingUtil {
|
|||
app.runReadAction(() -> {
|
||||
var highlightRanges = manager.semanticHighlighting();
|
||||
var markup = editor.getMarkupModel();
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
ApplicationManager.getApplication().runWriteAction(() -> {
|
||||
markup.removeAllHighlighters();
|
||||
for (var range : highlightRanges) {
|
||||
markup.addRangeHighlighter(range.color(), range.start(), range.end(), HighlighterLayer.SYNTAX,
|
||||
HighlighterTargetArea.EXACT_RANGE);
|
||||
}
|
||||
});
|
||||
});
|
||||
SwingUtilities.invokeLater(() -> ApplicationManager.getApplication().runWriteAction(() -> {
|
||||
markup.removeAllHighlighters();
|
||||
for (var range : highlightRanges) {
|
||||
markup.addRangeHighlighter(range.color(), range.start(), range.end(), HighlighterLayer.SYNTAX,
|
||||
HighlighterTargetArea.EXACT_RANGE);
|
||||
}
|
||||
}));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -36,7 +36,7 @@ public final class AppSettingsState implements PersistentStateComponent<AppSetti
|
|||
}
|
||||
|
||||
@Override
|
||||
public @Nullable AppSettingsState getState() {
|
||||
public AppSettingsState getState() {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue