Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ActionUpdateThread exception #62

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@

## [Unreleased]

### Features

- Slint-LSP binary v1.8.0

### Fixed

- Fixed `ActionUpdateThread.OLD_EDT` error ([issue](https://github.com/kizeevov/slint-idea-plugin/issues/61))

## [1.2.0] - 2024-07-30

### Features
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ pluginRepositoryUrl = https://github.com/kizeevov/slint-idea-plugin

pluginGroup = dev.slint
pluginName = SlintPlugin
pluginVersion = 1.2.0
pluginVersion = 1.3.0
platformType = IU
platformVersion = 2024.1
platformVersion = 243-EAP-SNAPSHOT
pluginSinceBuild = 241
pluginUntilBuild =
platformPlugins =
jvmVersion = 17

slintLspVersion = 1.7.1
slintLspVersion = 1.8.0
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ annotations = "24.0.1"

# plugins
kotlin = "1.9.23"
changelog = "2.2.0"
changelog = "2.2.1"
intellij = "1.17.2"
grammarkit = "2022.3.2.2"
download = "5.6.0"
Expand Down
1 change: 0 additions & 1 deletion src/main/grammars/SlintLexer.flex
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import static dev.slint.ideaplugin.lang.psi.SlintElementTypes.*;
%type IElementType
%unicode

EOL=\R
WHITE_SPACE=\s+

STRING_LITERAL=('([^'\\]|\\.)*'|\"([^\"\\]|\\.)*\")
Expand Down
1 change: 0 additions & 1 deletion src/main/grammars/SlintParser.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ private TopLevelKeywords ::= EXPORT | IMPORT | STRUCT | COMPONENT | GLOBAL | ENU
///////////////////////////////////////////////////////////////////////////////////////////////////
private ExportDefinition ::= EXPORT (ComponentDefinition | EnumDefinition | StructDefinition | GlobalDefinition | ExportComponentDefinition) {
pin=2

}
private ExportComponentDefinition ::= '{' Expression (',' (Expression | &'}'))* '}' {
recoverWhile=Declaration_recover
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package dev.slint.ideaplugin.ide.actions

import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.CommonDataKeys
import com.intellij.openapi.actionSystem.*
import com.intellij.openapi.actionSystem.CommonDataKeys.VIRTUAL_FILE
import com.intellij.openapi.components.service
import dev.slint.ideaplugin.ide.services.SlintServerService
import dev.slint.ideaplugin.lang.SlintLanguage
import kotlin.io.path.Path



internal class PreviewAction : AnAction() {

override fun update(e: AnActionEvent) {
Expand All @@ -25,4 +25,8 @@ internal class PreviewAction : AnAction() {

slintServerService.previewComponent(uriFile.toString(), "")
}

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.BGT
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import com.intellij.openapi.util.TextRange
import com.intellij.psi.PsiComment
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiWhiteSpace
import com.intellij.refactoring.suggested.endOffset
import com.intellij.refactoring.suggested.startOffset
import com.jetbrains.rd.generator.nova.PredefinedType
import dev.slint.ideaplugin.lang.psi.SlintFile
import dev.slint.ideaplugin.lang.psi.SlintImportDefinition
import dev.slint.ideaplugin.util.parser.childrenOfType
Expand All @@ -33,11 +30,11 @@ class SlintImportFoldingBuilder : CustomFoldingBuilder(), DumbAware {

for (import in imports) {
if (import.isPrevImport().not()) {
startOffset = import.startOffset;
startOffset = import.textRange.startOffset;
startImport = import
}
if (import.isNextImport().not() && startImport != null) {
descriptors += FoldingDescriptor(startImport, TextRange(startOffset, import.endOffset))
descriptors += FoldingDescriptor(startImport, TextRange(startOffset, import.textRange.endOffset))
}
}
}
Expand Down
Loading