diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index fb7f4a8..b589d56 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml
index 106c782..b083d8b 100644
--- a/.idea/kotlinc.xml
+++ b/.idea/kotlinc.xml
@@ -5,6 +5,6 @@
-
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 6d5ded3..e3f4387 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -7,7 +7,7 @@
-
+
\ No newline at end of file
diff --git a/CHANGES.md b/CHANGES.md
index 261a4e7..222c688 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,3 +1,7 @@
+## 2022.4.1 (December, 25, 2022)
+
+* Fix: Access is allowed from write thread only
+
## 2022.4 (October, 30, 2022)
* Fix: Must not start write action from within read action in the other thread - deadlock is coming
diff --git a/build.gradle.kts b/build.gradle.kts
index 9feacaa..2deefbc 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -9,22 +9,22 @@ repositories {
plugins {
java
// https://plugins.jetbrains.com/docs/intellij/using-kotlin.html#kotlin-standard-library
- kotlin("jvm") version "1.5.10"
- kotlin("plugin.serialization") version "1.5.10"
- id("org.jetbrains.intellij") version "1.9.0"
+ kotlin("jvm") version "1.6.20"
+ kotlin("plugin.serialization") version "1.6.20"
+ id("org.jetbrains.intellij") version "1.11.0"
}
group = config("group")
version = config("version")
dependencies {
- compileOnly("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.10")
- val serializationVersion = "1.4.0"
+ compileOnly("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20")
+ val serializationVersion = "1.4.1"
compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:$serializationVersion")
compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-json:$serializationVersion")
- implementation("io.sentry:sentry:6.5.0")
+ implementation("io.sentry:sentry:6.10.0")
testImplementation(kotlin("test"))
- testImplementation("org.junit.jupiter:junit-jupiter-params:5.9.0")
+ testImplementation("org.junit.jupiter:junit-jupiter-params:5.9.1")
}
intellij {
diff --git a/gradle.properties b/gradle.properties
index 2f9f846..e370a10 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,21 +1,21 @@
# Gradle
-gradleVersion=7.5.1
+gradleVersion=7.6
org.gradle.parallel=true
# https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html#intellij-platform-based-products-of-recent-ide-versions
-jvmVersion=11
+jvmVersion=17
#
# Plugin
group=dev.meanmail
repository=https://github.com/meanmail-dev/requirements
pluginName=requirements
-version=2022.4
+version=2022.4.1
# https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library
kotlin.stdlib.default.dependency=false
#
# Platform
-platformSinceBuild=212
+platformSinceBuild=222
# Develop platform
-platformVersion=2022.2.3
+platformVersion=2022.3
platformType=PC
usePlugins=python:222.4167.37
#
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 41d9927..249e583 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 8fad3f5..f42e62f 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
index 1b6c787..1af455a 100755
--- a/gradlew
+++ b/gradlew
@@ -199,11 +199,13 @@ fi
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
-set -- \
- "-Dorg.gradle.appname=$APP_BASE_NAME" \
- -classpath "$CLASSPATH" \
- org.gradle.wrapper.GradleWrapperMain \
- "$@"
+set --"-Dorg.gradle.appname=$APP_BASE_NAME"-classpath "$CLASSPATH"org.gradle.wrapper.GradleWrapperMain"$@"
+
+# Stop when "xargs" is not available.
+if ! command -v xargs >/dev/null 2>&1
+then
+ die "xargs is not available"
+fi
# Use "xargs" to parse quoted args.
#
diff --git a/gradlew.bat b/gradlew.bat
index 107acd3..f127cfd 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -14,7 +14,7 @@
@rem limitations under the License.
@rem
-@if "%DEBUG%" == "" @echo off
+@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@@ -25,7 +25,7 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
+if "%DIRNAME%"=="" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto execute
+if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
:end
@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
+if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
diff --git a/src/main/java/ru/meanmail/psi/parser/RequirementsParser.java b/src/main/java/ru/meanmail/psi/parser/RequirementsParser.java
index 159231b..635de8f 100644
--- a/src/main/java/ru/meanmail/psi/parser/RequirementsParser.java
+++ b/src/main/java/ru/meanmail/psi/parser/RequirementsParser.java
@@ -7,14 +7,15 @@
import com.intellij.lang.PsiBuilder.Marker;
import com.intellij.lang.PsiParser;
import com.intellij.psi.tree.IElementType;
+import org.jetbrains.annotations.NotNull;
import static com.intellij.lang.parser.GeneratedParserUtilBase.*;
import static ru.meanmail.psi.Types.*;
-@SuppressWarnings({"SimplifiableIfStatement", "UnusedAssignment"})
+@SuppressWarnings({"SimplifiableIfStatement"})
public class RequirementsParser implements PsiParser, LightPsiParser {
-
- public ASTNode parse(IElementType t, PsiBuilder b) {
+ @NotNull
+ public ASTNode parse(@NotNull IElementType t, @NotNull PsiBuilder b) {
parseLight(t, b);
return b.getTreeBuilt();
}
diff --git a/src/main/kotlin/ru/meanmail/codeInspection/UnusedInspection.kt b/src/main/kotlin/ru/meanmail/codeInspection/UnusedInspection.kt
index 62ab38d..519760a 100644
--- a/src/main/kotlin/ru/meanmail/codeInspection/UnusedInspection.kt
+++ b/src/main/kotlin/ru/meanmail/codeInspection/UnusedInspection.kt
@@ -1,6 +1,5 @@
package ru.meanmail.codeInspection
-import com.intellij.codeInspection.LocalInspectionTool
import com.intellij.codeInspection.LocalInspectionToolSession
import com.intellij.codeInspection.ProblemHighlightType
import com.intellij.codeInspection.ProblemsHolder
diff --git a/src/main/kotlin/ru/meanmail/quickfix/InstallPackageQuickFix.kt b/src/main/kotlin/ru/meanmail/quickfix/InstallPackageQuickFix.kt
index ed2ebb9..6daa780 100644
--- a/src/main/kotlin/ru/meanmail/quickfix/InstallPackageQuickFix.kt
+++ b/src/main/kotlin/ru/meanmail/quickfix/InstallPackageQuickFix.kt
@@ -1,6 +1,8 @@
package ru.meanmail.quickfix
+import com.intellij.codeInsight.intention.preview.IntentionPreviewInfo
import com.intellij.codeInspection.LocalQuickFixOnPsiElement
+import com.intellij.codeInspection.ProblemDescriptor
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiElement
@@ -20,6 +22,10 @@ class InstallPackageQuickFix(
return description
}
+ override fun generatePreview(project: Project, previewDescriptor: ProblemDescriptor): IntentionPreviewInfo {
+ return IntentionPreviewInfo.EMPTY
+ }
+
override fun invoke(
project: Project,
file: PsiFile,
diff --git a/src/main/kotlin/ru/meanmail/quickfix/MergeExtrasQuickFix.kt b/src/main/kotlin/ru/meanmail/quickfix/MergeExtrasQuickFix.kt
index 7e16d8a..4086721 100644
--- a/src/main/kotlin/ru/meanmail/quickfix/MergeExtrasQuickFix.kt
+++ b/src/main/kotlin/ru/meanmail/quickfix/MergeExtrasQuickFix.kt
@@ -1,6 +1,8 @@
package ru.meanmail.quickfix
+import com.intellij.codeInsight.intention.preview.IntentionPreviewInfo
import com.intellij.codeInspection.LocalQuickFixOnPsiElement
+import com.intellij.codeInspection.ProblemDescriptor
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.WriteAction
import com.intellij.openapi.command.WriteCommandAction
@@ -22,6 +24,10 @@ class MergeExtrasQuickFix(
return description
}
+ override fun generatePreview(project: Project, previewDescriptor: ProblemDescriptor): IntentionPreviewInfo {
+ return IntentionPreviewInfo.EMPTY
+ }
+
override fun invoke(
project: Project,
file: PsiFile,
diff --git a/src/main/kotlin/ru/meanmail/quickfix/RemoveUnusedQuickFix.kt b/src/main/kotlin/ru/meanmail/quickfix/RemoveUnusedQuickFix.kt
index d51d60e..69e1b00 100644
--- a/src/main/kotlin/ru/meanmail/quickfix/RemoveUnusedQuickFix.kt
+++ b/src/main/kotlin/ru/meanmail/quickfix/RemoveUnusedQuickFix.kt
@@ -1,6 +1,8 @@
package ru.meanmail.quickfix
+import com.intellij.codeInsight.intention.preview.IntentionPreviewInfo
import com.intellij.codeInspection.LocalQuickFixOnPsiElement
+import com.intellij.codeInspection.ProblemDescriptor
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.WriteAction
import com.intellij.openapi.command.WriteCommandAction
@@ -18,6 +20,10 @@ class RemoveUnusedQuickFix(
return description
}
+ override fun generatePreview(project: Project, previewDescriptor: ProblemDescriptor): IntentionPreviewInfo {
+ return IntentionPreviewInfo.EMPTY
+ }
+
override fun invoke(
project: Project, file: PsiFile,
startElement: PsiElement,
diff --git a/src/main/kotlin/ru/meanmail/quickfix/UninstallPackageQuickFix.kt b/src/main/kotlin/ru/meanmail/quickfix/UninstallPackageQuickFix.kt
index e26983a..0c7aa18 100644
--- a/src/main/kotlin/ru/meanmail/quickfix/UninstallPackageQuickFix.kt
+++ b/src/main/kotlin/ru/meanmail/quickfix/UninstallPackageQuickFix.kt
@@ -1,6 +1,8 @@
package ru.meanmail.quickfix
+import com.intellij.codeInsight.intention.preview.IntentionPreviewInfo
import com.intellij.codeInspection.LocalQuickFixOnPsiElement
+import com.intellij.codeInspection.ProblemDescriptor
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiFile
@@ -16,6 +18,10 @@ class UninstallPackageQuickFix(
return description
}
+ override fun generatePreview(project: Project, previewDescriptor: ProblemDescriptor): IntentionPreviewInfo {
+ return IntentionPreviewInfo.EMPTY
+ }
+
override fun invoke(
project: Project,
file: PsiFile,