|
|
Re: ContentAssist - CodeCompletion with Templates for Function-Parameters [message #642680 is a reply to message #642500] |
Thu, 02 December 2010 10:09 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Julian,
Xtext supports somewhat limited placeholders in content proposals out of
the box. Please have a look at
TerminalsProposalProvider#createStringProposal and digg into
ConfigurableCompletionProposal#setSimpleLinkedMode. However, multiple
linked fields in your proposal are not supported out of the box and
you'll have to implement that on your own.
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 01.12.10 16:41, schrieb Julian:
> Hello,
>
> I include a model of different functions to my DSL with the import-URI
> mechanism.
>
> The CodeCompletion works so far. I get a Proposal list with all modelled
> functions + parameters and additional Information.
> I did this in the {DSL}ProposalProvider as mentioned in the
> xText-Documentation.
>
> If I choose one Proposal from the list, the proposal will be inserted.
> Like:
> .. Testfunction (int para1, int para2) ...
>
> What I want to achieve now is, that there are placeholders for the
> parameters, so that I can enter one an switch to the other one with a
> tab. As is known from the JavaIDE when I insert a function.
>
> At which point I have to start??
>
> The get the information for the proposal from a List with all functions.
> The functions createProposal and createAdditionalInformation just build
> a String from the information.
>
> part of my ProposalProvider
>
>
> for (int j=0; j < functions.size(); j++) {
>
> String proposal = pu.createProposal(functions.get(j));
> String additionalInformation =
> pu.createAdditionalInformation(functions.get(j));
> ICompletionProposal prop = createCompletionProposal(proposal, context);
> ConfigurableCompletionProposal confp = (ConfigurableCompletionProposal)
> prop;
> confp.setAdditionalProposalInfo(additionalInformation);
> acceptor.accept(prop);
>
> }
>
>
>
> Julian
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04902 seconds