-
-
Notifications
You must be signed in to change notification settings - Fork 78
/
completion_item.go
76 lines (67 loc) · 1.84 KB
/
completion_item.go
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
package analyzer
// This file contains monaco-editor symbols bindings with the same symbol names.
// See: https://microsoft.github.io/monaco-editor/api/enums/monaco.languages.completionitemkind.html
// CompletionItemKind is monaco-editor binding
type CompletionItemKind int
const (
Method CompletionItemKind = iota
Function
Constructor
Field
Variable
Class
Struct
Interface
Module
Property
Event
Operator
Unit
Value
Constant
Enum
EnumMember
Keyword
Text
Color
File
Reference
Customcolor
Folder
TypeParameter
Snippet
)
// CompletionItemInsertTextRule is insert text insert rule.
type CompletionItemInsertTextRule int
const (
// KeepWhitespace is adjust whitespace/indentation of
// multiline insert texts to match the current line indentation.
KeepWhitespace CompletionItemInsertTextRule = 1
// InsertAsSnippet means that `insertText` is a snippet.
InsertAsSnippet CompletionItemInsertTextRule = 4
)
// CompletionItem is monaco-editor binding
type CompletionItem struct {
// Label is item label
Label string `json:"label"`
// Kind is item kind
Kind CompletionItemKind `json:"kind"`
// Detail is item description
Detail string `json:"detail"`
// Documentation is string or MarkdownString doc string
Documentation interface{} `json:"documentation"`
// InsertText is text to be inserted
InsertText string `json:"insertText"`
// InsertTextRules is a string or snippet that should be inserted in a document
// when selecting this completion. When `falsy` the label in used.
InsertTextRules CompletionItemInsertTextRule `json:"insertTextRules,omitempty"`
}
// MarkdownString is monaco-editor string with markdown
type MarkdownString struct {
// Value is string contents
Value string `json:"value"`
}
// NewMarkdownString returns markdown string
func NewMarkdownString(val string) MarkdownString {
return MarkdownString{Value: val}
}