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

Completion display fix. #93

Merged
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private CompletionPreview(
devPilotInlay = DevPilotInlay.create(this);
}

public static DevPilotCompletion createInstance(
public static synchronized DevPilotCompletion createInstance(
Editor editor, List<DevPilotCompletion> completions, int offset) {
CompletionPreview preview = getInstance(editor);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.util.TextRange;
import com.intellij.util.ui.EdtInvocationManager;
import com.zhongan.devpilot.completions.prediction.DevPilotCompletion;
import com.zhongan.devpilot.util.CommentUtil;

Expand Down Expand Up @@ -174,13 +175,15 @@ private static void buildDelayTrigger(@NotNull Editor editor,
new TimerTask() {
@Override
public void run() {
singletonOfInlineCompletionHandler().retrieveAndShowCompletion(
editor,
offset,
lastShownSuggestion,
userInput,
completionAdjustment,
completionType);
EdtInvocationManager.invokeAndWaitIfNeeded(
() ->
singletonOfInlineCompletionHandler().retrieveAndShowCompletion(
editor,
offset,
lastShownSuggestion,
userInput,
completionAdjustment,
completionType));
}
}, getTriggerInterval());
lastTriggerInfo.setTimer(timer);
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/messages/devpilot_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,5 @@ devpilot.notification.upgrade.message=Go to upgrade devpilot

devpilot.settings.methodShortcutDisplayModeLabel=Method Shortcut Display Mode
devpilot.settings.methodShortcutHidden=Hidden
devpilot.settings.methodShortcutInlineDisplay=Inline Display
devpilot.settings.methodShortcutGroupDisplay=Group Display
devpilot.settings.methodShortcutInlineDisplay=Inline
devpilot.settings.methodShortcutGroupDisplay=Group
Loading