Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xtext custom cross-references

Tags:

xtext

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

like image 688
Exponent Avatar asked Apr 26 '11 10:04

Exponent


1 Answers

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.

like image 52
Sebastian Zarnekow Avatar answered Oct 02 '22 08:10

Sebastian Zarnekow