File tree 2 files changed +38
-1
lines changed
2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,15 @@ class CompletionItem
96
96
*/
97
97
public $ data ;
98
98
99
+ /**
100
+ * The format of the insert text. The format applies to both the `insertText` property
101
+ * and the `newText` property of a provided `textEdit`.
102
+ *
103
+ * @var int|null
104
+ * @see InsertTextFormat
105
+ */
106
+ public $ insertTextFormat ;
107
+
99
108
/**
100
109
* @param string $label
101
110
* @param int|null $kind
@@ -108,6 +117,7 @@ class CompletionItem
108
117
* @param TextEdit[]|null $additionalTextEdits
109
118
* @param Command|null $command
110
119
* @param mixed|null $data
120
+ * @param int|null $insertTextFormat
111
121
*/
112
122
public function __construct (
113
123
string $ label = null ,
@@ -120,7 +130,8 @@ public function __construct(
120
130
TextEdit $ textEdit = null ,
121
131
array $ additionalTextEdits = null ,
122
132
Command $ command = null ,
123
- $ data = null
133
+ $ data = null ,
134
+ int $ insertTextFormat = null
124
135
) {
125
136
$ this ->label = $ label ;
126
137
$ this ->kind = $ kind ;
@@ -133,5 +144,6 @@ public function __construct(
133
144
$ this ->additionalTextEdits = $ additionalTextEdits ;
134
145
$ this ->command = $ command ;
135
146
$ this ->data = $ data ;
147
+ $ this ->insertTextFormat = $ insertTextFormat ;
136
148
}
137
149
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace LanguageServerProtocol ;
4
+
5
+ /**
6
+ * Defines whether the insert text in a completion item should be interpreted as
7
+ * plain text or a snippet.
8
+ */
9
+ class InsertTextFormat
10
+ {
11
+ /**
12
+ * The primary text to be inserted is treated as a plain string.
13
+ */
14
+ const PLAIN_TEXT = 1 ;
15
+
16
+ /**
17
+ * The primary text to be inserted is treated as a snippet.
18
+ *
19
+ * A snippet can define tab stops and placeholders with `$1`, `$2`
20
+ * and `${3:foo}`. `$0` defines the final tab stop, it defaults to
21
+ * the end of the snippet. Placeholders with equal identifiers are linked,
22
+ * that is typing in one will update others too.
23
+ */
24
+ const SNIPPET = 2 ;
25
+ }
You can’t perform that action at this time.
0 commit comments