Description for the Content Assist of File Cross-References [message #1860111] |
Tue, 18 July 2023 12:20  |
Eclipse User |
|
|
|
Hello,
I was wanting to know whether it is possible to have a description for the content assist of references. For example in the simple grammar below:
Model:
greetings+=Greeting*;
Greeting:
'Hello' name=ID '!';
References:
'ref' greeting=[Greeting];
And I have a file A:
Hello World1 !
And in file B:
Hello World2 !
Is it possible to have the content assist display a description like World1 :File A and World2 :File B for Reference?
Thank you,
Atul
|
|
|
Re: Description for the Content Assist of File Cross-References [message #1860114 is a reply to message #1860111] |
Tue, 18 July 2023 13:35   |
Eclipse User |
|
|
|
starting point
public class MyDslProposalProvider extends AbstractMyDslProposalProvider {
protected StyledString getStyledDisplayString(IEObjectDescription description) {
StyledString styledDisplayString = getStyledDisplayString(description.getEObjectOrProxy(),
getQualifiedNameConverter().toString(description.getQualifiedName()),
getQualifiedNameConverter().toString(description.getName()));
StyledString append = styledDisplayString.append(" - " + description.getEObjectURI().trimFragment());
return append;
}
}
|
|
|
|
|
|
Re: Description for the Content Assist of File Cross-References [message #1860312 is a reply to message #1860302] |
Fri, 28 July 2023 03:20   |
Eclipse User |
|
|
|
Hello,
If there are two references with the same name in different files, the default scope takes only the first reference. Is there a way to provide a qualified name to the other reference similar to <filename>.<reference>?
If File A contains:
Hello World1 !
And File B also contains:
Hello World1 !
So if i do ref, I should get World1 and FileB.World1 as the possible references instead of just World1.
Thank you,
Atul
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02844 seconds