Java 类org.eclipse.xtext.LanguageInfo 实例源码

项目:xtext-core    文件:AbstractLanguageServerTest.java   
@Before
public void setup() {
  try {
    final Injector injector = Guice.createInjector(this.getServerModule());
    injector.injectMembers(this);
    final Object resourceServiceProvider = this.resourceServerProviderRegistry.getExtensionToFactoryMap().get(this.fileExtension);
    if ((resourceServiceProvider instanceof IResourceServiceProvider)) {
      this.languageInfo = ((IResourceServiceProvider)resourceServiceProvider).<LanguageInfo>get(LanguageInfo.class);
    }
    this.languageServer.connect(ServiceEndpoints.<LanguageClientExtensions>toServiceObject(this, LanguageClientExtensions.class));
    this.languageServer.supportedMethods();
    File _absoluteFile = new File("").getAbsoluteFile();
    File _file = new File(_absoluteFile, "/test-data/test-project");
    this.root = _file;
    boolean _mkdirs = this.root.mkdirs();
    boolean _not = (!_mkdirs);
    if (_not) {
      Files.cleanFolder(this.root, null, true, false);
    }
    this.root.deleteOnExit();
  } catch (Throwable _e) {
    throw Exceptions.sneakyThrow(_e);
  }
}
项目:xtext-extras    文件:TraceAsSmapInstaller.java   
protected String getStratumName(final SourceRelativeURI path) {
    IResourceServiceProvider provider = serviceProviderRegistry.getResourceServiceProvider(path.getURI());
    if (provider == null) {
        // it might happen that trace data is in the workspace but the corresponding language is not installed.
        // we use the file extension then.
        String result = path.getURI().fileExtension();
        if (result != null) {
            return result;
        }
        return "unknown";
    }
    final LanguageInfo languageInfo = provider.get(LanguageInfo.class);
    String name = languageInfo.getShortName();
    return name;
}
项目:xtext-core    文件:AbstractLocationInResource.java   
@Override
public LanguageInfo getLanguage() {
    LanguageInfo result = trace.findLanguage(getAbsoluteResourceURI());
    return result;
}
项目:xtext-core    文件:AbstractTrace.java   
@Override
public LanguageInfo getLocalLanguage() {
    return findLanguage(getLocalURI());
}
项目:xtext-core    文件:AbstractTrace.java   
protected LanguageInfo findLanguage(AbstractURIWrapper uri) {
    return getService(uri, LanguageInfo.class);
}
项目:bts    文件:LanguageAwareMarkerTypeProvider.java   
@Inject
public void initialize(LanguageInfo languageInfo, AbstractUIPlugin uiPlugin) {
    String bundleName = uiPlugin.getBundle().getSymbolicName();
    String languageName = languageInfo.getShortName().toLowerCase();
    setMarkerTypes(bundleName + "." + languageName);
}
项目:bts    文件:XtextEditorInfo.java   
@Inject
public XtextEditorInfo(LanguageInfo languageInfo) {
    this.languageInfo = languageInfo;
}
项目:bts    文件:XtextEditorInfo.java   
public LanguageInfo getLanguageInfo() {
    return languageInfo;
}
项目:xtext-core    文件:ILocationInResource.java   
/**
 * @return the language that this resource belongs to. May be <code>null</code>.
 */
LanguageInfo getLanguage();
项目:xtext-core    文件:ITrace.java   
/**
 * Returns the language that is associated with the local resource. May be <code>null</code>
 * if the artifact does not have an associated Xtext language, e.g. for html or java files.
 * 
 * @return the language that is associated with the local resource. May be <code>null</code>.
 */
LanguageInfo getLocalLanguage();