/
PresentationCompilerConfig.java
91 lines (74 loc) 路 2.5 KB
/
PresentationCompilerConfig.java
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package scala.meta.pc;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
/**
* Configuration options used by the Metals presentation compiler.
*/
public interface PresentationCompilerConfig {
/**
* Command ID to trigger parameter hints (textDocument/signatureHelp) in the editor.
*
* See https://scalameta.org/metals/docs/editors/new-editor.html#dmetalssignature-helpcommand
* for details.
*/
Optional<String> parameterHintsCommand();
/**
* Command ID to trigger completions (textDocument/completion) in the editor.
*/
Optional<String> completionCommand();
Map<String, String> symbolPrefixes();
static Map<String, String> defaultSymbolPrefixes() {
HashMap<String, String> map = new HashMap<>();
map.put("scala/collection/mutable/", "mutable.");
map.put("java/util/", "ju.");
return map;
}
/**
* What text format to use for rendering `override def` labels for completion items.
*/
OverrideDefFormat overrideDefFormat();
enum OverrideDefFormat {
/** Render as "override def". */
Ascii,
/** Render as "馃敿". */
Unicode
}
/**
* Returns true if the <code>CompletionItem.detail</code> field should be populated.
*/
boolean isCompletionItemDetailEnabled();
/**
* Returns true if the <code>CompletionItem.documentation</code> field should be populated.
*/
boolean isCompletionItemDocumentationEnabled();
/**
* Returns true if the result from <code>textDocument/hover</code> should include docstrings.
*/
boolean isHoverDocumentationEnabled();
/**
* True if the client defaults to adding the identation of the reference
* line that the operation started on (relevant for multiline textEdits)
*/
boolean snippetAutoIndent();
/**
* Returns true if the <code>SignatureHelp.documentation</code> field should be populated.
*/
boolean isSignatureHelpDocumentationEnabled();
/**
* Returns true if completions can contain snippets.
*/
boolean isCompletionSnippetsEnabled();
/**
* The maximum delay for requests to respond.
*
* After the given delay, every request to completions/hover/signatureHelp
* is automatically cancelled and the presentation compiler is restarted.
*/
long timeoutDelay();
/**
* The unit to use for <code>timeoutDelay</code>.
*/
TimeUnit timeoutUnit();
}