Skip to content
This repository was archived by the owner on Mar 5, 2026. It is now read-only.

Do not run EDT code in CodyFixHighlightPass:doCollectInformation#2289

Merged
pkukielka merged 2 commits intomainfrom
pkukielka/fix-CodyFixHighlightPass
Sep 13, 2024
Merged

Do not run EDT code in CodyFixHighlightPass:doCollectInformation#2289
pkukielka merged 2 commits intomainfrom
pkukielka/fix-CodyFixHighlightPass

Conversation

@pkukielka
Copy link
Copy Markdown
Contributor

@pkukielka pkukielka commented Sep 13, 2024

Fixes #2287

Changes

Looks like we cannot do EDT actions in the CodyFixHighlightPass:doCollectInformation or we are risking a deadlock.

Test plan

It's a bit hard to test deterministically but for me adding and removing few special characters on an empty file was triggering IDE crash pretty quickly (10-20 sec).
I used combination of:

Option + \ («)
Option + P (Ļ)
Backspace

In a random order.
Timing matters, keep changing the tempo of the keystrokes.

// >= HighlightSeverity.INFO
myHighlights.mapNotNull {
try {
val range = document.codyRange(it.startOffset, it.endOffset)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codyRange already contains the same check.

break
}

val range =
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to recompute the same thing again

Copy link
Copy Markdown
Contributor

@mkondratek mkondratek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tried it a few times.
before this change I was able to reproduce it
after this change I am not able to repro it

lgtm

@pkukielka pkukielka merged commit 03e9897 into main Sep 13, 2024
@pkukielka pkukielka deleted the pkukielka/fix-CodyFixHighlightPass branch September 13, 2024 11:53
pkukielka added a commit that referenced this pull request Sep 19, 2024
Fixes #2287

## Changes 

Looks like we cannot do EDT actions in the
`CodyFixHighlightPass:doCollectInformation` or we are risking a
deadlock.

## Test plan

It's a bit hard to test deterministically but for me adding and removing
few special characters on an empty file was triggering IDE crash pretty
quickly (10-20 sec).
I used combination of:

`Option + \` (`«`)
`Option + P` (`Ļ`)
`Backspace`

In a random order.
Timing matters, keep changing the tempo of the keystrokes.
pkukielka added a commit that referenced this pull request Sep 19, 2024
Fixes #2287

## Changes 

Looks like we cannot do EDT actions in the
`CodyFixHighlightPass:doCollectInformation` or we are risking a
deadlock.

## Test plan

It's a bit hard to test deterministically but for me adding and removing
few special characters on an empty file was triggering IDE crash pretty
quickly (10-20 sec).
I used combination of:

`Option + \` (`«`)
`Option + P` (`Ļ`)
`Backspace`

In a random order.
Timing matters, keep changing the tempo of the keystrokes.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JetBrains: IDE got stuck and user has to force quit it with different actions - Autocomplete & Generate Unit Tests

2 participants