Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Commit

Permalink
Fix: Access is allowed from write thread only
Browse files Browse the repository at this point in the history
  • Loading branch information
meanmail committed Dec 25, 2022
1 parent 45ff16f commit 7181bcb
Show file tree
Hide file tree
Showing 16 changed files with 63 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
14 changes: 7 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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
#
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
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-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
12 changes: 7 additions & 5 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand Down
14 changes: 8 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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%

Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/ru/meanmail/psi/parser/RequirementsParser.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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,
Expand Down
6 changes: 6 additions & 0 deletions src/main/kotlin/ru/meanmail/quickfix/MergeExtrasQuickFix.kt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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,
Expand Down
6 changes: 6 additions & 0 deletions src/main/kotlin/ru/meanmail/quickfix/RemoveUnusedQuickFix.kt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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,
Expand Down

0 comments on commit 7181bcb

Please sign in to comment.