Customize the inserted value from auto-complete from the proposed [message #1801514] |
Mon, 21 January 2019 08:28  |
Eclipse User |
|
|
|
In my language, I have a sort of a package and it contains several primary rules in it. Primary rules contain some variables that can be used directly by their name or using fully qualified name.
Example:
PACKAGE pack:
GENERAL gen:
VARIABLE foo : string ;
VARIABLE foo2 : boolean ;
END GENERAL;
END PACKAGE;
In the scope, I managed to create a scope for the rule GENERAL where all the items in it are available only in it. The scope is created by fully qualified names as pack.gen.foo, pack.gen.foo2 and then I created an ImportNormalizer with pack.gen and an ImportScope in order to be able to use foo alone and pack.gen.foo
My problem now is that when I auto-complete, I need when I write pack. to have the gen ONLY as a suggestion and not keywords, pack.gen.foo and pack.gen.foo2
Another problem, when I choose from the auto-complete list the pack.gen.foo option, I need the entered text to be just foo and not the fully qualified name.
Can you help me with these problems?
|
|
|
|
Re: Customize the inserted value from auto-complete from the proposed [message #1801599 is a reply to message #1801525] |
Wed, 23 January 2019 05:28   |
Eclipse User |
|
|
|
In my language, I have packages where I can import them to be used by other rules. i.e.
PACKAGE pack:
GENERAL gen:
VARIABLE foo : string ;
VARIABLE foo2 : boolean ;
END GENERAL;
END PACKAGE;
// In the same file I can add something like this to use the above declared variables
USE pack.gen.*
FUNCTION func:
foo = "Assignment";
pack.gen.foo = "Still valid sytnax";
END FUNCTION;
In the previous function, I need to import all the variables in gen and to be able to write them as foo and by their fully qualified name pack.gen.foo . So, in order to make this, I created an importscope with all the variables and added a normalizer pack.gen to allow me to write them as foo. My problem is that in auto-complete, when I write pack.gen. and then make auto-complete, I still get another variables from another generals that I didnot import. Also, I need when I have the suggestion in the auto-complete pack.gen.foo, when I choose it, the inserted text to be just foo and not its fully qualified name (pack.gen.foo)
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.53557 seconds