DESCRIPTION

docker: Prepare docker editor on top of generic.

A side effect is adding hover data.

Change-Id: I0b746cc73e268e953d794d35f72e4609da95d3cc
Signed-off-by: Erick Ross xxx@xxx.xxx


COMMENTS

author: Brenden Conley
date: 2017-03-02 21:13:54.000000000

Patch Set 2:

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/11481/

-------------------------------------
author: Brenden Conley
date: 2017-03-02 21:35:21.000000000

Patch Set 2: Verified+1

Build Successful 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/11481/ : SUCCESS

-------------------------------------
author: Isis Velasquez
date: 2017-03-06 12:37:01.000000000

Patch Set 2:

I can reproduce the issue of comment lines not being styled. Investigating.

-------------------------------------
author: Isis Velasquez
date: 2017-03-06 14:05:59.000000000

Patch Set 2:

The reason is that the PresentationReconcilier heavily relies on the DockerDocument and the token content types to be set.
Several issues make the editor receive a plain Document instead of the DockerDocument (expected by the DockerDamager):
1. docker plugin doesn't define the document provider in plugin.xml
2. DocumentProviderRegistry.getDocumentProvider(editorInput) isn't able to deal with files without extensions to find the best document provider for a given URI.

Possible workaround
1. Find ways to make the PresentationReconcilier able to work at plain text level, without using the DockerDocument token content-types

Proper solution:
1. Make the DocumentProviderRegistry smarter to allow associating with files with no extensions (or even allow to rely on content-type directly), and declare the document provider for Dockerfile in plugin.xml. That would make the Generic Editor receive a DockerDocument that the PresentationReconcilier could use.

-------------------------------------
author: Isis Velasquez
date: 2017-03-06 14:08:44.000000000

Patch Set 2:

If Dockerfile were having a specific extension to recognize them, just declaring the document provider and associating it with those extensions in plugin.xml would have worked.

-------------------------------------
author: Erick Ross
date: 2017-03-06 14:14:52.000000000

Patch Set 2:

> If Dockerfile were having a specific extension to recognize them,
 > just declaring the document provider and associating it with those
 > extensions in plugin.xml would have worked.

The editor works with *.dockerfile too but the comment is not properly highlighted in this case too.

-------------------------------------
author: Isis Velasquez
date: 2017-03-06 14:23:03.000000000

Patch Set 2:

If you add

   <extension
         point="org.eclipse.ui.editors.documentProviders">
      <provider
            class="org.eclipse.linuxtools.internal.docker.editor.DockerDocumentProvider"
            extensions="dockerfile"
            id="org.eclipse.linuxtools.docker.editor.documentProvider">
      </provider>
   </extension>

to plugin.xml and open a `dummy.dockerfile`, comments get styled.

-------------------------------------
author: Gerrit Code Review
date: 2017-03-07 07:28:46.000000000

Change has been successfully cherry-picked as 4fe0876b9b73697c76c3551e819f7018900a7fa4 by Erick Ross

-------------------------------------
