Add InsertTextFormat
parent
0e29092597
commit
893ce411d2
|
@ -63,6 +63,14 @@ class CompletionItem
|
||||||
*/
|
*/
|
||||||
public $insertText;
|
public $insertText;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The format of the insert text. The format applies to both the `insertText` property
|
||||||
|
* and the `newText` property of a provided `textEdit`.
|
||||||
|
*
|
||||||
|
* @var InsertTextFormat|null
|
||||||
|
*/
|
||||||
|
public $insertTextFormat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A range of text that should be replaced by this completion item.
|
* A range of text that should be replaced by this completion item.
|
||||||
*
|
*
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
<?php
|
||||||
|
declare(strict_types = 1);
|
||||||
|
|
||||||
|
namespace LanguageServer\Protocol;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines whether the insert text in a completion item should be interpreted as
|
||||||
|
* plain text or a snippet.
|
||||||
|
*/
|
||||||
|
abstract class InsertTextFormat
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The primary text to be inserted is treated as a plain string.
|
||||||
|
*/
|
||||||
|
const PLAIN_TEXT = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The primary text to be inserted is treated as a snippet.
|
||||||
|
*
|
||||||
|
* A snippet can define tab stops and placeholders with `$1`, `$2`
|
||||||
|
* and `${3:foo}`. `$0` defines the final tab stop, it defaults to
|
||||||
|
* the end of the snippet. Placeholders with equal identifiers are linked,
|
||||||
|
* that is typing in one will update others too.
|
||||||
|
*
|
||||||
|
* See also: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/common/snippet.md
|
||||||
|
*/
|
||||||
|
const SNIPPET = 2;
|
||||||
|
}
|
Loading…
Reference in New Issue