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

get editor context with read permission #680

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

yairco1990
Copy link
Contributor

No description provided.

@yairco1990 yairco1990 requested a review from a team as a code owner November 8, 2023 12:34
@@ -18,7 +18,7 @@ abstract class ChatMessageHandler<RequestPayload, ResponsePayload>(protected val
}

protected fun getEditorFromProject(project: Project): Editor? {
return AsyncAction(ActionPermissions.WRITE).execute {
return AsyncAction(ActionPermissions.READ).execute {
Copy link
Contributor

Choose a reason for hiding this comment

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

@yairco1990 why not reuse the getActiveEditor method that is used in the completions?

private static Editor getActiveEditor(@NotNull Document document) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the completions approach also uses EDT which can lead to the same problem

Copy link
Contributor

@dimacodota dimacodota left a comment

Choose a reason for hiding this comment

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

lgtm

@yairco1990 yairco1990 merged commit 8417604 into master Nov 9, 2023
7 of 9 checks passed
@yairco1990 yairco1990 deleted the yair/get_editor_context_with_read_permission branch November 9, 2023 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants