]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/completions/Completion.java
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / completions / Completion.java
1 package org.simantics.scl.compiler.completions;
2
3 public class Completion {
4     public final int startOfReplacedText;
5     public final int lengthOfReplacedText;
6     public final String replacement;
7     public final int cursorPositionAfterReplacement;
8     
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
14     
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;
24         this.name = name;
25         this.type = type;
26         this.documentation = "".equals(documentation) ? null : documentation;
27     }
28     
29     public String getLabel() {
30         return name + (type != null ? " :: " + type : "") + (module != null ? " (" + module + ")" : "") ;
31     }
32 }