7

I've been working on an Xtext-based Eclipse plugin for a language we use in-house. This language might have a statement of the form:

run : /some/file/path/foo.txt

... and ultimately I want to provide a custom Location provider so that pressing F3 on the filepath will open up the file in a new editor in Eclipse. I haven't had a chance yet to try this out, but does anyone see anything wrong with the following approach?

  1. Override IHyperlinkHelper to make my filepath rule cross-referencable
  2. Override ILocationInFileProvider to make the filepath rule do the Eclipse magic to open the file in a new editor

Any advice is appreciated, thanks

Exponent
  • 492
  • 1
  • 11
  • 18
  • 1
    For anyone who's interested in doing this, be aware that you need to override the LanguageSpecificURIEditorOpener#open() method. – Exponent May 02 '11 at 09:02

1 Answers1

4

The approach sounds good to me. You could provide content assist for paths as well by customizing the proposal provider. A validation rule for the file reference may be helpful, too.

Sebastian Zarnekow
  • 6,609
  • 20
  • 23