| Summary: | Provide a language id constant | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Ed Willink <ed> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | NEW --- | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | knut.wannheden, sebastian.zarnekow |
| Version: | 2.0.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows Vista | ||
| Whiteboard: | |||
|
Description
Ed Willink
see org.eclipse.xtext.LanguageInfo.getLanguageName() and the generated activator in the UI plugin. Is that sufficient for your use case? I've also come across this need a few times. Neither LanguageInfo nor the generator UI activator is helpful when requiring this information in code of another plug-in. Further I think it would be great if we could use the language ID when accessing the IResourceServiceProvider.Registry. (In reply to comment #1) > see org.eclipse.xtext.LanguageInfo.getLanguageName() and the generated > activator in the UI plugin. Is that sufficient for your use case? Thanks, these are helpful but not as helpful as they could be: The long cryptic constant ORG_ECLIPSE_OCL_EXAMPLES_XTEXT_OCLSTDLIB_OCLSTDLIB ensures that spelling errors can be compile-time failures, but a normalised name such as LANGUAGE_ID would be easier to use. Also the name is in an internal plugin. My specific use case is for activation of an editor in an embedded context where I do Injector injector = XtextConsolePlugin.getInstance().getInjector(EssentialOCLPlugin.LANGUAGE_ID); Composite editorComposite = client; //new Composite(client, SWT.NULL); editor = new EmbeddedXtextEditor(editorComposite, injector, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL); to pass the correct injector to the embedded editor. I don't appear to require the name in the non-ui plugin, so I can put a static method in XtextConsolePlugin to exploit the new constant. I suspect that there may be multi-grammar parsing applications that may benefit from the name in the non-ui plugin so I think my original suggestion is still worth doing. |