GitPopcorn / tabnine-eclipse

A Eclipse content assistant plug-in with TabNine
MIT License
14 stars 7 forks source link

TabNine-Eclipse

TabNine-Eclipse is a plug-in working in Eclipse Platform with the core executable file from TabNine by zxqfl.

This repository is the source code of TabNine-Eclipse, but with no core file which provided from TabNine.

This plug-in is developed and tested in JDK 1.8 and Eclipse platform 2019-09 Release.

This plug-in support follows editor now:

Screenshot

Image-01

Image-02

Changelogs

1.0.0-TEST (January 13, 2019)

Installation

1. Clone repository/Download source code

You can clone this repo by command line or just download ZIP pack, in short you should put the source code in your Eclipse workspace firstly.

2. Import the plug-in project into workspace of Eclipse

Start Eclipse and open workspace, import the plug-in project as "Projects from Folder or Archive"(File Menu -> Import -> General -> Projects from Folder or Archive -> Select directory and impoort this plug-in project).

3. Download the TabNine core file manully

If you will use this plug-in in a online enviroment, this step can be just skipped.

If you will use this plug-in in a offline enviroment, open the com.tabnine.eclipse.module.impl.TabNineCoreRunnerBasicImpl.java, then run it as a Java Application using Eclipse(You can also run it by the command line tools of Java like javac/java).

When this application successfully ended, a TabNine Core file with latest version saving in the /target/tabnine-core/${TABNINE_VERSION}/${OS_PLATFORM}/ position, copy that tabnine-core folder to /src/main/resources/tabnine-core position. so it will be export to the plug-in package when we compile.

4. Export and pack the plug-in

Note: This step must be processed with Eclipse or other OSGi platform util, cause we need to pack this plug-in with the rule provided by Eclipse

5. Move the package to the .plug-in folder of Eclipse

If you choose Eclipse root folder as the exporting destination, you can just skip this type.

Put the JAR file we got from exportation to the /plugin folder under Eclipse root folder(e.g. C:\Program Files\eclipse\jee-2019-09R\eclipse\plugins).

you can also unpack the JAR file and put unpacking result to this folder, it still works(But don't put the JAR file and unpacking document together).

6. Start or restart targeted Eclipse Instance

Start or restart the Eclipse where you put plug-in in, and the use it.

Knowing Issues

Configurations

1. Close the downloading function

When this plug-in is used in a offline enviroment, we can turn off the downloader by set constant com.tabnine.eclipse.constant.TabNineConstants#IS_TABNINE_CORE_DOWNLOADER_AVAILABLE to false.

2. Change the context extraction range

When we send completion request to TabNine core program, we can take the context text from current line or the whole document. That would affect the accuracy and cost of TabNine core program.

We can change this setting by editing follow constant: