Get a List<String> in something.mydsl [message #691823] |
Sat, 02 July 2011 13:11 |
Caner Messages: 98 Registered: July 2011 |
Member |
|
|
Hi, Thank you so much for magnificently useful tool.
However, I had some problems;
For example, I have a List<String>writers , which contains 10000 writer's names, for instance one of them is "Stefan King" .
I dont want to define all of them by one by, because i have ten more existing lists like this. Is there any way to get a list into my grammar?
Because While I am coding with my dsl in my
" something.mydsl " file. I want that content assist completes "Stefan King" or comes up with some proposal names, which start with "Ste", , while I typed "Ste"
How can I solve this?
Or is there any other way than this, how can i monitor List elements in a content assist displayer ,
such as when I type "Ste" for "Stefan King" in "something.mydsl"
Thanks a lot
[Updated on: Sat, 02 July 2011 18:55] Report message to a moderator
|
|
|
Re: Get a List<String> in something.mydsl [message #692061 is a reply to message #691823] |
Sun, 03 July 2011 11:13 |
|
Hi,
since you did not post the grammar it's hard to understand what the problem really is. e.g. having a grammar
Model:
greetings+=Greeting*;
Greeting:
'Hello' name=Name '!';
Name hidden(): ID (WS ID)* ;
you can simply customize content assist
public class MyDslProposalProvider extends AbstractMyDslProposalProvider {
....
@Override
public void completeGreeting_Name(EObject model, Assignment assignment,
ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
for (String writer : writers) {
acceptor.accept(createCompletionProposal(writer, context));
}
}
}
the prefix matching works out of the box.
~Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
[Updated on: Sun, 03 July 2011 11:22] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03022 seconds