Skip to main content
summaryrefslogtreecommitdiffstats
blob: c802850e81ba2cf7800d574c67a10c7a17a4fad2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*******************************************************************************
 * Copyright (c) 2005, 2007 committers of openArchitectureWare and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     committers of openArchitectureWare - initial API and implementation
 *******************************************************************************/

package org.eclipse.internal.xtend.expression.codeassist;

import java.util.Set;

import org.eclipse.internal.xtend.xtend.ast.Extension;
import org.eclipse.xtend.typesystem.Operation;
import org.eclipse.xtend.typesystem.Property;
import org.eclipse.xtend.typesystem.StaticProperty;
import org.eclipse.xtend.typesystem.Type;

public interface ProposalFactory {
	public Object createPropertyProposal(Property p, String prefix, boolean onCollection);

	/**
	 * Creates an proposal for a static property
	 * @param p The property for which a proposal should be created
	 * @param prefix Current evaluation text prefix
	 * @param onCollection <code>true</code>: Proposal is computed on a collection
	 * @return A proposal for the content assist
	 */
	public Object createStaticPropertyProposal(StaticProperty p, String prefix, boolean onCollection);

	public Object createOperationProposal(Operation p, String prefix, boolean onCollection);

	public Object createCollectionSpecificOperationProposal(String insertString, String displayString, String prefix,
			int cursor, int marked);

	public Object createDefinitionProposal(final String insertStr, final String displayStr, final String prefix);

	public Object createExtensionProposal(Extension p, String prefix);

	public Object createExtensionOnMemberPositionProposal(Extension p, String prefix, boolean onCollection);

	public Object createVariableProposal(String name, Type t, String prefix);

	public Object createTypeProposal(String insertString, Type type, String prefix);

	public Object createNamespaceProposal(final String insertStr, final String displayStr, final String prefix);

	public Object createStatementProposal(String insertString, String displayString, String prefix, int cursor,
			int marked);

	public Object createStatementProposal(String insertString, String displayString, String prefix);

	public Object createKeywordProposal(String insertString, String displayString, String prefix);

	public Object createExtensionImportProposal(final String insertStr, final String displayStr, final String prefix,
			final int cursor, final int marked);

	public boolean isDuplicate(Set<String> nameCache, Object proposal);

	public void addToCache(Set<String> nameCache, Object proposal);

}

Back to the top