diff --git a/clients/eclipse/feature/feature.xml b/clients/eclipse/feature/feature.xml index cb0cd824006f..3a3b4dc29ad2 100644 --- a/clients/eclipse/feature/feature.xml +++ b/clients/eclipse/feature/feature.xml @@ -2,7 +2,7 @@ @@ -19,6 +19,6 @@ + version="0.0.2.27"/> diff --git a/clients/eclipse/plugin/META-INF/MANIFEST.MF b/clients/eclipse/plugin/META-INF/MANIFEST.MF index 7230fab47635..4bd0adabb224 100644 --- a/clients/eclipse/plugin/META-INF/MANIFEST.MF +++ b/clients/eclipse/plugin/META-INF/MANIFEST.MF @@ -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.26 +Bundle-Version: 0.0.2.27 Bundle-Activator: com.tabbyml.tabby4eclipse.Activator Bundle-Vendor: com.tabbyml Require-Bundle: org.eclipse.ui, diff --git a/clients/eclipse/plugin/chat-panel/index.html b/clients/eclipse/plugin/chat-panel/index.html index 101d71d66066..976acb59d0ad 100644 --- a/clients/eclipse/plugin/chat-panel/index.html +++ b/clients/eclipse/plugin/chat-panel/index.html @@ -125,13 +125,6 @@

Welcome to Tabby Chat

// server to client requests if (event.source === chat.contentWindow) { - // handle copy action - if (typeof event.data === "object" && "action" in event.data && event.data.action === "copy") { - if (navigator.clipboard?.writeText) { - navigator.clipboard.writeText(event.data.data); - } - } - // adapter for @quilted/threads requests if (Array.isArray(event.data) && event.data.length >= 2) { const [kind, data] = event.data; diff --git a/clients/eclipse/plugin/plugin.xml b/clients/eclipse/plugin/plugin.xml index 5cd00f7d994d..cd2673aa3cb1 100644 --- a/clients/eclipse/plugin/plugin.xml +++ b/clients/eclipse/plugin/plugin.xml @@ -103,7 +103,6 @@ painters = new HashMap<>(); - private ITextViewer currentTextViewer = null; - private InlineCompletionItem currentCompletionItem = null; - private String currentViewId = null; - private Long currentDisplayAt = null; - - public void show(ITextViewer viewer, InlineCompletionItem item) { - if (currentTextViewer != null) { - getPainter(currentTextViewer).update(null); - } - currentTextViewer = viewer; - currentCompletionItem = item; - getPainter(viewer).update(item); - - currentDisplayAt = System.currentTimeMillis(); - - String completionId = "no-cmpl-id"; - if (item.getEventId() != null && item.getEventId().getCompletionId()!= null) { - completionId = item.getEventId().getCompletionId().replace("cmpl-", ""); - } - currentViewId = String.format("view-%s-at-%d", completionId, currentDisplayAt); - } - - public void hide() { - if (currentTextViewer != null) { - getPainter(currentTextViewer).update(null); - currentTextViewer = null; - } - currentCompletionItem = null; - currentViewId = null; - currentDisplayAt = null; - } +public class InlineCompletionItemTextPainter implements IInlineCompletionItemRenderer { + private Logger logger = new Logger("InlineCompletionRenderer.InlineCompletionItemTextPainter"); + private Map painters = new HashMap<>(); - public ITextViewer getCurrentTextViewer() { - return currentTextViewer; - } - - public InlineCompletionItem getCurrentCompletionItem() { - return currentCompletionItem; - } - - public String getCurrentViewId() { - return currentViewId; - } - - public Long getCurrentDisplayedTime() { - if (currentDisplayAt != null) { - return System.currentTimeMillis() - currentDisplayAt; - } - return null; + @Override + public void updateInlineCompletionItem(ITextViewer textViewer, InlineCompletionItem item) { + getPainter(textViewer).update(item); } - private InlineCompletionItemPainter getPainter(ITextViewer viewer) { - InlineCompletionItemPainter painter = painters.get(viewer); + private GhostTextPainter getPainter(ITextViewer viewer) { + GhostTextPainter painter = painters.get(viewer); if (painter == null) { - painter = new InlineCompletionItemPainter(viewer); + painter = new GhostTextPainter(viewer); painters.put(viewer, painter); } return painter; } - private class InlineCompletionItemPainter implements IPainter, PaintListener { + private class GhostTextPainter implements IPainter, PaintListener { private ITextViewer viewer; private InlineCompletionItem item; @@ -103,7 +59,7 @@ private class InlineCompletionItemPainter implements IPainter, PaintListener { private List modifiedGlyphMetrics = new ArrayList<>(); private List> paintFunctions = new ArrayList<>(); - public InlineCompletionItemPainter(ITextViewer viewer) { + public GhostTextPainter(ITextViewer viewer) { this.viewer = viewer; getDisplay().syncExec(() -> { ((ITextViewerExtension2) this.viewer).addPainter(this); @@ -299,15 +255,15 @@ private void setupPainting() { private void drawOverwriteText(int offset, String text) { logger.debug("drawCurrentLineText:" + offset + ":" + text); StyledText widget = getWidget(); - TextWithTabs textWithTabs = splitLeadingTabs(text); + TextWithTabs textWithTabs = StringUtils.splitLeadingTabs(text); paintFunctions.add((gc) -> { // Draw ghost text setStyleToGhostText(gc); int spaceWidth = gc.textExtent(" ").x; - int tabWidth = textWithTabs.tabs * widget.getTabs() * spaceWidth; + int tabWidth = textWithTabs.getTabs() * widget.getTabs() * spaceWidth; Point location = widget.getLocationAtOffset(offset); - gc.drawString(textWithTabs.text, location.x + tabWidth, location.y); + gc.drawString(textWithTabs.getText(), location.x + tabWidth, location.y); }); } @@ -318,7 +274,7 @@ private void drawInsertPartText(int offset, String text) { private void drawReplacePartText(int offset, String text, String replacedText) { logger.debug("drawReplacePartText:" + offset + ":" + text + ":" + replacedText); StyledText widget = getWidget(); - TextWithTabs textWithTabs = splitLeadingTabs(text); + TextWithTabs textWithTabs = StringUtils.splitLeadingTabs(text); int targetOffset = offset + replacedText.length(); if (targetOffset >= widget.getCharCount()) { @@ -327,18 +283,19 @@ private void drawReplacePartText(int offset, String text, String replacedText) { // Draw ghost text setStyleToGhostText(gc); int spaceWidth = gc.textExtent(" ").x; - int tabWidth = textWithTabs.tabs * widget.getTabs() * spaceWidth; + int tabWidth = textWithTabs.getTabs() * widget.getTabs() * spaceWidth; Point location = widget.getLocationAtOffset(offset); - gc.drawString(textWithTabs.text, location.x + tabWidth, location.y); + gc.drawString(textWithTabs.getText(), location.x + tabWidth, location.y); }); - + } else { // otherwise, draw the ghost text, and move target char after the ghost text String targetChar = widget.getText(targetOffset, targetOffset); StyleRange originStyleRange; if (widget.getStyleRangeAtOffset(targetOffset) != null) { originStyleRange = widget.getStyleRangeAtOffset(targetOffset); - logger.debug("Find origin StyleRange:" + originStyleRange.start + " -> " + originStyleRange.metrics); + logger.debug( + "Find origin StyleRange:" + originStyleRange.start + " -> " + originStyleRange.metrics); } else { originStyleRange = new StyleRange(); originStyleRange.start = targetOffset; @@ -350,10 +307,10 @@ private void drawReplacePartText(int offset, String text, String replacedText) { // Draw ghost text setStyleToGhostText(gc); int spaceWidth = gc.textExtent(" ").x; - int tabWidth = textWithTabs.tabs * widget.getTabs() * spaceWidth; - int ghostTextWidth = tabWidth + gc.stringExtent(textWithTabs.text).x; + int tabWidth = textWithTabs.getTabs() * widget.getTabs() * spaceWidth; + int ghostTextWidth = tabWidth + gc.stringExtent(textWithTabs.getText()).x; Point location = widget.getLocationAtOffset(offset); - gc.drawString(textWithTabs.text, location.x + tabWidth, location.y); + gc.drawString(textWithTabs.getText(), location.x + tabWidth, location.y); // Leave the space for the ghost text setStyle(gc, originStyleRange); @@ -406,7 +363,7 @@ private void drawSuffixLines(int offset, String text) { List linesTextWithTab = new ArrayList<>(); for (String line : lines) { - linesTextWithTab.add(splitLeadingTabs(line)); + linesTextWithTab.add(StringUtils.splitLeadingTabs(line)); } paintFunctions.add((gc) -> { @@ -416,9 +373,9 @@ private void drawSuffixLines(int offset, String text) { Point location = widget.getLocationAtOffset(offset); int y = location.y; for (TextWithTabs textWithTabs : linesTextWithTab) { - int x = widget.getLeftMargin() + textWithTabs.tabs * widget.getTabs() * spaceWidth; + int x = widget.getLeftMargin() + textWithTabs.getTabs() * widget.getTabs() * spaceWidth; y += lineHeight; - gc.drawString(textWithTabs.text, x, y, true); + gc.drawString(textWithTabs.getText(), x, y, true); } }); } @@ -448,17 +405,6 @@ private void setStyleToGhostText(GC gc) { gc.setFont(font); } - static final Pattern PATTERN_LEADING_TABS = Pattern.compile("^(\\t*)(.*)$"); - - private static TextWithTabs splitLeadingTabs(String text) { - Matcher matcher = PATTERN_LEADING_TABS.matcher(text); - if (matcher.matches()) { - return new TextWithTabs(matcher.group(1).length(), matcher.group(2)); - } else { - return new TextWithTabs(0, text); - } - } - private static class ModifiedLineVerticalIndent { private Position position; private int indent; @@ -470,15 +416,5 @@ public ModifiedLineVerticalIndent(Position position, int indent, int modifiedInd this.modifiedIndent = modifiedIndent; } } - - private static class TextWithTabs { - private int tabs; - private String text; - - public TextWithTabs(int tabs, String text) { - this.tabs = tabs; - this.text = text; - } - } } } diff --git a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/renderer/InlineCompletionRendererSupport.java b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/renderer/InlineCompletionRendererSupport.java new file mode 100644 index 000000000000..95176d85bff7 --- /dev/null +++ b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/renderer/InlineCompletionRendererSupport.java @@ -0,0 +1,59 @@ +package com.tabbyml.tabby4eclipse.inlineCompletion.renderer; + +import org.eclipse.jface.text.ITextViewer; + +import com.tabbyml.tabby4eclipse.inlineCompletion.InlineCompletionItem; + +public class InlineCompletionRendererSupport { + private IInlineCompletionItemRenderer renderer = InlineCompletionItemRenderer.getInstance(); + private ITextViewer currentTextViewer = null; + private InlineCompletionItem currentCompletionItem = null; + private String currentViewId = null; + private Long currentDisplayAt = null; + + public void show(ITextViewer viewer, InlineCompletionItem item) { + if (currentTextViewer != null) { + renderer.updateInlineCompletionItem(currentTextViewer, null); + } + currentTextViewer = viewer; + currentCompletionItem = item; + renderer.updateInlineCompletionItem(viewer, item); + + currentDisplayAt = System.currentTimeMillis(); + + String completionId = "no-cmpl-id"; + if (item.getEventId() != null && item.getEventId().getCompletionId() != null) { + completionId = item.getEventId().getCompletionId().replace("cmpl-", ""); + } + currentViewId = String.format("view-%s-at-%d", completionId, currentDisplayAt); + } + + public void hide() { + if (currentTextViewer != null) { + renderer.updateInlineCompletionItem(currentTextViewer, null); + currentTextViewer = null; + } + currentCompletionItem = null; + currentViewId = null; + currentDisplayAt = null; + } + + public InlineCompletionItem getCurrentCompletionItem() { + return currentCompletionItem; + } + + public ITextViewer getCurrentTextViewer() { + return currentTextViewer; + } + + public String getCurrentViewId() { + return currentViewId; + } + + public Long getCurrentDisplayedTime() { + if (currentDisplayAt != null) { + return System.currentTimeMillis() - currentDisplayAt; + } + return null; + } +} diff --git a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/BasicInputEventTrigger.java b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/trigger/BasicInputEventTrigger.java similarity index 94% rename from clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/BasicInputEventTrigger.java rename to clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/trigger/BasicInputEventTrigger.java index 19e60497fc00..02f143aa64b2 100644 --- a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/BasicInputEventTrigger.java +++ b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/trigger/BasicInputEventTrigger.java @@ -1,4 +1,4 @@ -package com.tabbyml.tabby4eclipse.inlineCompletion; +package com.tabbyml.tabby4eclipse.inlineCompletion.trigger; import java.util.HashMap; import java.util.Map; @@ -12,6 +12,8 @@ import com.tabbyml.tabby4eclipse.Logger; import com.tabbyml.tabby4eclipse.editor.EditorUtils; +import com.tabbyml.tabby4eclipse.inlineCompletion.IInlineCompletionService; +import com.tabbyml.tabby4eclipse.inlineCompletion.InlineCompletionService; /** * This DocumentBasedTrigger listens to keyboard and mouse events to determine diff --git a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/DebouncedDocumentEventTrigger.java b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/trigger/DebouncedDocumentEventTrigger.java similarity index 95% rename from clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/DebouncedDocumentEventTrigger.java rename to clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/trigger/DebouncedDocumentEventTrigger.java index aaf520978699..4dd9fab0fd8e 100644 --- a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/DebouncedDocumentEventTrigger.java +++ b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/trigger/DebouncedDocumentEventTrigger.java @@ -1,11 +1,7 @@ -package com.tabbyml.tabby4eclipse.inlineCompletion; +package com.tabbyml.tabby4eclipse.inlineCompletion.trigger; import java.util.HashMap; import java.util.Map; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; import org.eclipse.jface.text.DocumentEvent; import org.eclipse.jface.text.IDocument; @@ -18,6 +14,8 @@ import com.tabbyml.tabby4eclipse.DebouncedRunnable; import com.tabbyml.tabby4eclipse.Logger; import com.tabbyml.tabby4eclipse.editor.EditorUtils; +import com.tabbyml.tabby4eclipse.inlineCompletion.IInlineCompletionService; +import com.tabbyml.tabby4eclipse.inlineCompletion.InlineCompletionService; /** * This DocumentBasedTrigger listens to document and caret events to determine diff --git a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/IInlineCompletionTrigger.java b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/trigger/IInlineCompletionTrigger.java similarity index 85% rename from clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/IInlineCompletionTrigger.java rename to clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/trigger/IInlineCompletionTrigger.java index 3960bfcffbfb..3953c4f4559b 100644 --- a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/IInlineCompletionTrigger.java +++ b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/trigger/IInlineCompletionTrigger.java @@ -1,4 +1,4 @@ -package com.tabbyml.tabby4eclipse.inlineCompletion; +package com.tabbyml.tabby4eclipse.inlineCompletion.trigger; import org.eclipse.ui.texteditor.ITextEditor; diff --git a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/InlineCompletionTrigger.java b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/trigger/InlineCompletionTrigger.java similarity index 96% rename from clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/InlineCompletionTrigger.java rename to clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/trigger/InlineCompletionTrigger.java index f1a9b5cc7b5e..0102f8a6b55c 100644 --- a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/InlineCompletionTrigger.java +++ b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/trigger/InlineCompletionTrigger.java @@ -1,4 +1,4 @@ -package com.tabbyml.tabby4eclipse.inlineCompletion; +package com.tabbyml.tabby4eclipse.inlineCompletion.trigger; public class InlineCompletionTrigger { public static IInlineCompletionTrigger getInstance() { diff --git a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/PairedDocumentEventTrigger.java b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/trigger/PairedDocumentEventTrigger.java similarity index 96% rename from clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/PairedDocumentEventTrigger.java rename to clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/trigger/PairedDocumentEventTrigger.java index b4cc196316a5..471b9238491a 100644 --- a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/PairedDocumentEventTrigger.java +++ b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/inlineCompletion/trigger/PairedDocumentEventTrigger.java @@ -1,4 +1,4 @@ -package com.tabbyml.tabby4eclipse.inlineCompletion; +package com.tabbyml.tabby4eclipse.inlineCompletion.trigger; import java.util.HashMap; import java.util.Map; @@ -13,6 +13,8 @@ import com.tabbyml.tabby4eclipse.Logger; import com.tabbyml.tabby4eclipse.editor.EditorUtils; +import com.tabbyml.tabby4eclipse.inlineCompletion.IInlineCompletionService; +import com.tabbyml.tabby4eclipse.inlineCompletion.InlineCompletionService; /** * This DocumentBasedTrigger listens to document and caret events to determine diff --git a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/LanguageClientImpl.java b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/LanguageClientImpl.java index 00afb3e2e05c..f3fef8bf3bc7 100644 --- a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/LanguageClientImpl.java +++ b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/LanguageClientImpl.java @@ -4,14 +4,13 @@ import java.util.List; import java.util.concurrent.CompletableFuture; -import org.eclipse.lsp4j.LocationLink; -import org.eclipse.lsp4j.Range; -import org.eclipse.lsp4j.SemanticTokensRangeParams; import org.eclipse.jface.text.IDocument; import org.eclipse.lsp4e.LSPEclipseUtils; -import org.eclipse.lsp4e.LanguageServers; import org.eclipse.lsp4j.DeclarationParams; import org.eclipse.lsp4j.Location; +import org.eclipse.lsp4j.LocationLink; +import org.eclipse.lsp4j.Range; +import org.eclipse.lsp4j.SemanticTokensRangeParams; import org.eclipse.lsp4j.jsonrpc.messages.Either; import org.eclipse.lsp4j.jsonrpc.services.JsonNotification; import org.eclipse.lsp4j.jsonrpc.services.JsonRequest; diff --git a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/LanguageSupportProvider.java b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/LanguageSupportProvider.java index 93237138155a..dd4436fe90a5 100644 --- a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/LanguageSupportProvider.java +++ b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/LanguageSupportProvider.java @@ -1,8 +1,8 @@ package com.tabbyml.tabby4eclipse.lsp; +import java.net.URI; import java.util.List; import java.util.concurrent.CompletableFuture; -import java.net.URI; import org.eclipse.jface.text.IDocument; import org.eclipse.lsp4e.LSPEclipseUtils; diff --git a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/ClientInfo.java b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/ClientInfo.java index e8652a37fcf4..4c257b9b90a5 100644 --- a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/ClientInfo.java +++ b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/ClientInfo.java @@ -7,7 +7,7 @@ public class ClientInfo { public ClientInfo() { } - + public String getName() { return name; } diff --git a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/ClientProvidedConfig.java b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/ClientProvidedConfig.java index 03e3e31409ea..df8cde1e6087 100644 --- a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/ClientProvidedConfig.java +++ b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/ClientProvidedConfig.java @@ -8,7 +8,7 @@ public class ClientProvidedConfig { public ClientProvidedConfig() { } - + public ServerConfig getServer() { return server; } diff --git a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/GitRepository.java b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/GitRepository.java index 849f53c2ff7f..2735e7fed513 100644 --- a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/GitRepository.java +++ b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/GitRepository.java @@ -3,22 +3,22 @@ public class GitRepository { private String root; private String remoteUrl; - + public GitRepository() { } - + public String getRoot() { return root; } - + public void setRoot(String root) { this.root = root; } - + public String getRemoteUrl() { return remoteUrl; } - + public void setRemoteUrl(String remoteUrl) { this.remoteUrl = remoteUrl; } diff --git a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/IConfigService.java b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/IConfigService.java index 45c7b7868aa0..b44182397f6f 100644 --- a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/IConfigService.java +++ b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/IConfigService.java @@ -1,6 +1,7 @@ package com.tabbyml.tabby4eclipse.lsp.protocol; import java.util.concurrent.CompletableFuture; + import org.eclipse.lsp4j.jsonrpc.services.JsonRequest; import org.eclipse.lsp4j.jsonrpc.services.JsonSegment; diff --git a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/ILanguageServer.java b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/ILanguageServer.java index f34236e14738..a97e758ccfc6 100644 --- a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/ILanguageServer.java +++ b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/ILanguageServer.java @@ -9,7 +9,7 @@ public interface ILanguageServer extends LanguageServer { @JsonDelegate IStatusService getStatusService(); - + @JsonDelegate ITelemetryService getTelemetryService(); } diff --git a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/IStatusService.java b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/IStatusService.java index 72343619cd62..6f4fdf9c986d 100644 --- a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/IStatusService.java +++ b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/IStatusService.java @@ -1,6 +1,7 @@ package com.tabbyml.tabby4eclipse.lsp.protocol; import java.util.concurrent.CompletableFuture; + import org.eclipse.lsp4j.jsonrpc.services.JsonRequest; import org.eclipse.lsp4j.jsonrpc.services.JsonSegment; diff --git a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/ITextDocumentServiceExt.java b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/ITextDocumentServiceExt.java index ecd67941fe92..ed564645a725 100644 --- a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/ITextDocumentServiceExt.java +++ b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/ITextDocumentServiceExt.java @@ -1,6 +1,7 @@ package com.tabbyml.tabby4eclipse.lsp.protocol; import java.util.concurrent.CompletableFuture; + import org.eclipse.lsp4j.jsonrpc.services.JsonRequest; import org.eclipse.lsp4j.jsonrpc.services.JsonSegment; diff --git a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/InlineCompletionParams.java b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/InlineCompletionParams.java index 28a3391a2690..a24775d011db 100644 --- a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/InlineCompletionParams.java +++ b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/lsp/protocol/InlineCompletionParams.java @@ -1,8 +1,8 @@ package com.tabbyml.tabby4eclipse.lsp.protocol; -import org.eclipse.lsp4j.TextDocumentIdentifier; import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.Range; +import org.eclipse.lsp4j.TextDocumentIdentifier; public class InlineCompletionParams { private InlineCompletionContext context; diff --git a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/preferences/MainPreferencesPage.java b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/preferences/MainPreferencesPage.java index dc38be424bfc..60bb065fbdc5 100644 --- a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/preferences/MainPreferencesPage.java +++ b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/preferences/MainPreferencesPage.java @@ -6,16 +6,12 @@ import org.eclipse.jface.preference.PreferenceDialog; import org.eclipse.jface.preference.StringFieldEditor; import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Color; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.dialogs.PreferencesUtil; diff --git a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/statusbar/StatusbarContribution.java b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/statusbar/StatusbarContribution.java index 8e557b67d5b7..046a28e92086 100644 --- a/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/statusbar/StatusbarContribution.java +++ b/clients/eclipse/plugin/src/com/tabbyml/tabby4eclipse/statusbar/StatusbarContribution.java @@ -148,7 +148,6 @@ public void widgetSelected(SelectionEvent e) { default: break; } - MenuItem openChatViewItem = new MenuItem(menu, SWT.NONE); openChatViewItem.setImage(Images.getIcon(Images.ICON_CHAT)); @@ -159,7 +158,7 @@ public void widgetSelected(SelectionEvent e) { ChatViewUtils.openChatView(); } }); - + MenuItem openPreferencesItem = new MenuItem(menu, SWT.NONE); openPreferencesItem.setImage(Images.getIcon(Images.ICON_SETTINGS)); openPreferencesItem.setText("Open Settings"); @@ -169,7 +168,7 @@ public void widgetSelected(SelectionEvent e) { MainPreferencesPage.openPreferences(); } }); - + return menu; } }