1 package org.simantics.scl.ui.assist;
3 import org.eclipse.jface.fieldassist.IContentProposal;
4 import org.simantics.scl.compiler.common.names.Name;
5 import org.simantics.scl.compiler.elaboration.modules.SCLValue;
6 import org.simantics.scl.compiler.types.Type;
8 public class SCLContentProposal implements IContentProposal {
10 private final String content;
11 private final String name;
12 private final String module;
13 private final Type type;
14 private final String documentation;
16 public SCLContentProposal(SCLValue value) {
17 Name n = value.getName();
19 this.module = n.module;
20 // this.content = name.substring(prefixLength-namespaceLength);
22 this.type = value.getType();
23 this.documentation = value.getDocumentation();
26 public SCLContentProposal(String name, String module, Type type) {
29 // this.content = name.substring(prefixLength-namespaceLength);
32 this.documentation = null;
36 public String getContent() {
41 public int getCursorPosition() {
42 return content.length();
46 public String getLabel() {
47 return name + " :: " + type + " (" + module + ")";
51 public String getDescription() {