Skip to content

Commit

Permalink
chore(eclipse): update DebouncedDocumentEventTrigger and use as default.
Browse files Browse the repository at this point in the history
  • Loading branch information
icycodes committed Nov 12, 2024
1 parent 86f9dc4 commit 0574b8d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions clients/eclipse/feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="com.tabbyml.features.tabby4eclipse"
label="Tabby"
version="0.0.2.27"
version="0.0.2.28"
provider-name="com.tabbyml">

<description url="http://www.example.com/description">
Expand All @@ -19,6 +19,6 @@

<plugin
id="com.tabbyml.tabby4eclipse"
version="0.0.2.27"/>
version="0.0.2.28"/>

</feature>
2 changes: 1 addition & 1 deletion clients/eclipse/plugin/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tabby Plugin for Eclipse
Bundle-SymbolicName: com.tabbyml.tabby4eclipse;singleton:=true
Bundle-Version: 0.0.2.27
Bundle-Version: 0.0.2.28
Bundle-Activator: com.tabbyml.tabby4eclipse.Activator
Bundle-Vendor: com.tabbyml
Require-Bundle: org.eclipse.ui,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
* valid.
*/
public class DebouncedDocumentEventTrigger implements IInlineCompletionTrigger {
private final static int DEBOUNCE_INTERVAL = 20; // ms
private final static int DOCUMENT_CHANGED_DEBOUNCE_INTERVAL = 3; // ms
private final static int CARET_MOVED_DEBOUNCE_INTERVAL = 16; // ms

private Logger logger = new Logger("InlineCompletionTrigger.DebouncedDocumentEventTrigger");

Expand Down Expand Up @@ -96,7 +97,7 @@ public void unregister(ITextEditor textEditor) {
} catch (Exception e) {
logger.error("Failed to handle documentChangedRunnable after debouncing.", e);
}
}, DEBOUNCE_INTERVAL);
}, DOCUMENT_CHANGED_DEBOUNCE_INTERVAL);

private DebouncedRunnable caretMovedRunnable = new DebouncedRunnable(() -> {
try {
Expand All @@ -111,7 +112,7 @@ public void unregister(ITextEditor textEditor) {
} catch (Exception e) {
logger.error("Failed to handle caretMovedRunnable after debouncing.", e);
}
}, DEBOUNCE_INTERVAL);
}, CARET_MOVED_DEBOUNCE_INTERVAL);

private void handleCaretMoved(ITextEditor textEditor, CaretEvent event) {
if (!EditorUtils.isActiveEditor(textEditor)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ public static IInlineCompletionTrigger createInstance() {
if (EXPERIMENTAL_TRIGGER_PAIREDDOCUMENT) {
return new PairedDocumentEventTrigger();
}
return new BasicInputEventTrigger();
return new DebouncedDocumentEventTrigger();
}
}

0 comments on commit 0574b8d

Please sign in to comment.