-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(eclipse): support partially accept inline completion. (#3269)
- Loading branch information
Showing
9 changed files
with
170 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...clipse/plugin/src/com/tabbyml/tabby4eclipse/commands/inlineCompletion/AcceptNextLine.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.tabbyml.tabby4eclipse.commands.inlineCompletion; | ||
|
||
import org.eclipse.core.commands.AbstractHandler; | ||
import org.eclipse.core.commands.ExecutionEvent; | ||
import org.eclipse.core.commands.ExecutionException; | ||
|
||
import com.tabbyml.tabby4eclipse.Logger; | ||
import com.tabbyml.tabby4eclipse.inlineCompletion.IInlineCompletionService.AcceptType; | ||
import com.tabbyml.tabby4eclipse.inlineCompletion.InlineCompletionService; | ||
|
||
public class AcceptNextLine extends AbstractHandler { | ||
private Logger logger = new Logger("Commands.InlineCompletion.AcceptNextLine"); | ||
|
||
@Override | ||
public Object execute(ExecutionEvent event) throws ExecutionException { | ||
logger.debug("Accept next line of the current inline completion."); | ||
InlineCompletionService.getInstance().accept(AcceptType.NEXT_LINE); | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean isEnabled() { | ||
return InlineCompletionService.getInstance().isCompletionItemVisible(); | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
...clipse/plugin/src/com/tabbyml/tabby4eclipse/commands/inlineCompletion/AcceptNextWord.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.tabbyml.tabby4eclipse.commands.inlineCompletion; | ||
|
||
import org.eclipse.core.commands.AbstractHandler; | ||
import org.eclipse.core.commands.ExecutionEvent; | ||
import org.eclipse.core.commands.ExecutionException; | ||
|
||
import com.tabbyml.tabby4eclipse.Logger; | ||
import com.tabbyml.tabby4eclipse.inlineCompletion.IInlineCompletionService.AcceptType; | ||
import com.tabbyml.tabby4eclipse.inlineCompletion.InlineCompletionService; | ||
|
||
public class AcceptNextWord extends AbstractHandler { | ||
private Logger logger = new Logger("Commands.InlineCompletion.AcceptNextLine"); | ||
|
||
@Override | ||
public Object execute(ExecutionEvent event) throws ExecutionException { | ||
logger.debug("Accept next word of the current inline completion."); | ||
InlineCompletionService.getInstance().accept(AcceptType.NEXT_WORD); | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean isEnabled() { | ||
return InlineCompletionService.getInstance().isCompletionItemVisible(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters