1

I created editor with Xtext 2.9.1 and now I want to make it independent of JDT. I followed this guide https://eclipse.org/Xtext/documentation/307_special_languages.html

but it does not seem to work. This is my ErrmsgUiModule.xtend

@FinalFieldsConstructor
class ErrmsgUiModule extends AbstractErrmsgUiModule {

    override configure(Binder binder) {
        super.configure(binder);
        binder.bind(DefaultHighlightingConfiguration).to(ErrMsgHighlightingConfiguration);
        binder.bind(DefaultSemanticHighlightingCalculator).to(ErrorSemanticHighlightingCalculator);
    }

    override bindIResourceForEditorInputFactory() {
        return ResourceForIEditorInputFactory
    }

    override bindIResourceSetProvider() {
        return SimpleResourceSetProvider
    }

    override provideIAllContainersState() {
        return Access.getWorkspaceProjectsState()
    }
}

I checked every overwritten method with debugger and all 3 methods are called. I did not created my own project wizard so this should be enough. But still after plugin installating the Java project wizard becomes available...

/Edit: To provide more information, this is project's mwe2 file

module com.xxx.lang.errmsg.GenerateErrmsg

import org.eclipse.xtext.xtext.generator.*
import org.eclipse.xtext.xtext.generator.model.project.*
import org.eclipse.xtext.ui.generator.*


var rootPath = ".."

Workflow {

    component = XtextGenerator {
        configuration = {
            project = StandardProjectConfig {
                baseName = "com.xxx.lang.errmsg"
                rootPath = rootPath
                runtimeTest = {
                    enabled = true
                }
                eclipsePlugin = {
                    enabled = true
                }
                eclipsePluginTest = {
                    enabled = true
                }
                createEclipseMetaData = true
            }
            code = {
                encoding = "windows-1250"
                fileHeader = "/*\n * generated by Xtext \${version}\n */"
            }
        }
        language = StandardLanguage {
            name = "com.xxx.lang.errmsg.Errmsg"
            fileExtensions = "msg"
            fragment = formatting.Formatter2Fragment2 auto-inject {}
            serializer = {
                generateStub = false
            }
            validator = {
            // composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
            }
        }

    }
}

and this is list of Dependencies from plugin.xml for various projects:

project com.xxx.lang.errmsg

org.eclipse.xtext,
org.eclipse.xtext.xbase,
org.eclipse.equinox.common;bundle-version="3.5.0",
org.eclipse.emf.ecore,
org.eclipse.xtext.xbase.lib,
org.antlr.runtime,
org.eclipse.xtext.util,
org.eclipse.xtend.lib,
org.eclipse.emf.common,
org.objectweb.asm;bundle-version="[5.0.1,6.0.0)";resolution:=optional,
org.eclipse.xtext.ui

project com.xxx.lang.errmsg.ui

com.xxx.lang.errmsg,
com.xxx.lang.errmsg.ide,
org.eclipse.xtext.ui,
org.eclipse.xtext.ui.shared,
org.eclipse.xtext.ui.codetemplates.ui,
org.eclipse.ui.editors;bundle-version="3.5.0",
org.eclipse.ui.ide;bundle-version="3.5.0",
org.eclipse.ui,
org.eclipse.compare,
org.eclipse.xtext.builder,
org.eclipse.xtend.lib;resolution:=optional,
org.eclipse.xtext.xbase.lib,
org.eclipse.xtext.xbase.ui

/Edit2: According to this topic https://bugs.eclipse.org/bugs/show_bug.cgi?id=336217, I also tried to disable all org.eclipse.jdt* plugins in run configuration. This is what i get http://pastebin.com/Wi0gzceM

Smarty77
  • 1,208
  • 3
  • 15
  • 30
  • You need to make sure that you don't have JDT installed in Eclipse, in the first place. Is it an RCP app you are building or simply a plugin? – Sven Efftinge Jun 27 '16 at 15:43
  • I downloaded clean Eclipse Neon for C/C++. I tried it first without my plugin (no Java Project Wizard available in new project), then I installed the plugin and Java Project Wizard appeared. It is an editor based on Xtext. (syntax highlighting, some validations, quick fixes, formatting). – Smarty77 Jun 27 '16 at 15:50
  • Question have been edited. I have tried to provide more information to resolve this issue. – Smarty77 Jun 28 '16 at 08:24

1 Answers1

0

You have to remove the dependencies on org.eclipse.xtext.xbase and org.eclipse.xtext.xbase.ui from your runtime and UI project.

Make sure if you open the Plug-in Dependencies in the Package Explorer that you do not see org.eclipse.jdt.core in the list. If so, there is another plug-in having a (transitive) dependency. Find out which and remove.

kthoms
  • 39
  • 6