首次打开MyDsl xtext编辑器时Guice提供错误

时间:2019-02-22 09:03:20

标签: eclipse-plugin xtext xtext-gradle-plugin

我正在开发xtext域模型,首先一切都很好。但是由于有几天,当我第一次使用eclipse中的生成的编辑器打开dsl文件时,总是会遇到以下错误:

Guice provision errors:

1) Error injecting method, java.lang.NullPointerException
  at org.eclipse.xtext.ui.editor.formatting.PreferenceStoreIndentationInformation.setPreferenceStoreAccess(Unknown Source)
  at org.eclipse.xtext.ui.editor.formatting.PreferenceStoreIndentationInformation.class(Unknown Source)
  while locating org.eclipse.xtext.ui.editor.formatting.PreferenceStoreIndentationInformation
  while locating org.eclipse.xtext.formatting.IIndentationInformation
    for field at org.eclipse.xtext.ui.editor.autoedit.MultiLineTerminalsEditStrategy$Factory.indentationInformation(Unknown Source)
  while locating org.eclipse.xtext.ui.editor.autoedit.MultiLineTerminalsEditStrategy$Factory
    for field at org.eclipse.xtext.ui.editor.autoedit.DefaultAutoEditStrategyProvider.multiLineTerminals(Unknown Source)
  while locating org.eclipse.xtext.ui.editor.autoedit.DefaultAutoEditStrategyProvider
  while locating org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategyProvider
    for field at org.eclipse.xtext.ui.editor.XtextSourceViewerConfiguration.editStrategyProvider(Unknown Source)
  while locating org.eclipse.xtext.ui.editor.XtextSourceViewerConfiguration
    for field at org.eclipse.xtext.ui.editor.XtextEditor.sourceViewerConfiguration(Unknown Source)
  while locating org.eclipse.xtext.ui.editor.XtextEditor

1 error (occurred in org.xtext.example.mydsl.ui.MyDslExecutableExtensionFactory)

我首先注意到,在将片段LabelProviderFragment2OutlineTreeProviderFragment2添加到mwe2文件之后。

重新打开编辑器即可,然后可以编辑文件。唯一不起作用的是我要添加的轮廓中的自定义图标。

1 个答案:

答案 0 :(得分:0)

我自己找到了答案。问题与添加的片段无关,但与我也添加的输出配置无关。

在输出配置中,我没有为输出指定描述。设置好说明并重新安装插件后,错误消失了。访问插件的首选项页面时,我也遇到了错误,因为在那里使用了说明。