1 package org.simantics.scl.compiler.completions;
3 public class Completion {
4 public final int startOfReplacedText;
5 public final int lengthOfReplacedText;
6 public final String replacement;
7 public final int cursorPositionAfterReplacement;
9 public final CompletionType completionType;
10 public final String module;
11 public final String name;
12 public final String type; // may be null
13 public final String documentation; // may be null
15 public Completion(int startOfReplacedText, int lengthOfReplacedText, String replacement,
16 int cursorPositionAfterReplacement, CompletionType completionType, String definingModule, String name,
17 String type, String documentation) {
18 this.startOfReplacedText = startOfReplacedText;
19 this.lengthOfReplacedText = lengthOfReplacedText;
20 this.replacement = replacement;
21 this.cursorPositionAfterReplacement = cursorPositionAfterReplacement;
22 this.completionType = completionType;
23 this.module = definingModule;
26 this.documentation = "".equals(documentation) ? null : documentation;
29 public String getLabel() {
30 return name + (type != null ? " :: " + type : "") + (module != null ? " (" + module + ")" : "") ;