mybatis / mybatipse

Eclipse plugin adding support for MyBatis SQL Mapper Framework.
Eclipse Public License 1.0
332 stars 91 forks source link

Can't get any assist in mapping file in Oxygen.2 #79

Closed kuchaguangjie closed 6 years ago

kuchaguangjie commented 6 years ago

I am using Eclipse Oxygen.2 Release (4.7.2), Build id: 20171218-0600. On linux mint mate 18.

After install mybatipse plugin, and restart eclipse, I still don't get any content assist when editing a mybatis mapping file.

Here is the doctype of my config file:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

Any idea?

harawata commented 6 years ago

Hi @kuchaguangjie ,

I just tested and it worked with the same version of Eclipse (Eclipse IDE for Java EE Developers) on Mint 18.2 MATE (Java version 1.8.0_161). By default, MyBatis proposals are displayed at the bottom of the proposal list (see tips for more info).

A few things you can try...

Also, see if there is any output with net.harawata in the log file ($WORKSPACE/.metadata/.log) when you perform content-assist.

kuchaguangjie commented 6 years ago

@hazendaz Thanks, I don't see relevant error in $WORKSPACE/.metadata/.log, tried in new workspace, but still don't work, not sure why, any how, thanks for the help.

harawata commented 6 years ago

Could you test it with a simple project if you haven't? I used this small maven project: https://github.com/harawata/mybatis-issues/tree/master/gh-724 I would like to know if it's project specific or not.

kuchaguangjie commented 6 years ago

@harawata

I download the project mentioned above, and import gh-724 into eclipse workspace, then open the Mapper.xml file with XML editor.

Then presss ctrl + q to get the content assist, since that's my customized shortcut for that.

And the result is the same, as following screenshot taken from my mobile:

issue

harawata commented 6 years ago

Thanks for the screenshot, @kuchaguangjie !

At that cursor position, MyBatipse does not suggest anything, actually (I'll explain later). To test MyBatipse, please try something like this:

image

It is Eclipse's XML plugin that proposes tags, attributes, etc. using the online DTD file. As there is a warning icon on line 19, there seems to be some network issue and Eclipse cannot load the DTD file. If it's difficult to access http://mybatis.org from your computer, you can resolve it by registering XML Catalog manually.

  1. You need to download the DTD file on another computer that has unrestricted internet access and copy it to your computer.
  2. In Eclipse, open Preferences and go to XML -> XML Catalog.
  3. Press 'Add...' button and enter the following.
    • Location : press 'Workspace...' or 'File System...' button and select the DTD file.
    • Key type : Public
    • Key : -//mybatis.org//DTD Mapper 3.0//EN
  4. Close and reopen XML mapper files.
hazendaz commented 6 years ago

@harawata Not sure if you have that info here in a readme/wiki but that looks like incredibly great informaton (pictures and all) 👍

harawata commented 6 years ago

Thanks @hazendaz ! I kind of assumed that most developers have unrestricted internet access :D Maybe I should consider reverting #13 for those who do not.

Anyway, I'll create F.A.Q. wiki page if I could find the time.

kuchaguangjie commented 6 years ago

@harawata

This is really useful, I didn't notice that before, afte install the dtd file by hand, could get content assist according to dtd file.

Though still can't see the assist from mybatipse, as following: b

But I saw some harawata relevant output int .log file, as following: a

Not sure is that relevant.

harawata commented 6 years ago

@kuchaguangjie ,

Now it looks similar to #8 . 😑 The log message seems irrelevant.

Have you tested it with a new installation of Eclipse? It seems unlikely, but another plugin might prevent MyBatipse from working properly. If it still does not work, I'm out of ideas...

kuchaguangjie commented 6 years ago

@harawata I just installed a new Eclipse 4.7.2, then create a new workspace, and install the plugin, restart eclipse, import the git project mentioned above, but still don't get content assist.

Maybe would have a try later on some other os.

Anyhow, thanks for the help.

kuchaguangjie commented 6 years ago

@harawata I just installed a new Eclipse 4.7.2, then create a new workspace, and install the plugin, restart eclipse, import the git project mentioned above, but still don't get content assist.

Maybe would have a try later on some other os.

Anyhow, thanks for the help.

harawata commented 6 years ago

@kuchaguangjie , Thank you very much for taking the time to provide various information. And I'm sorry for the inconvenience.