1
0
Fork 0

Add InsertTextFormat

pull/266/head
Felix Becker 2017-02-02 01:51:55 +01:00
parent 0e29092597
commit 893ce411d2
2 changed files with 36 additions and 0 deletions

View File

@ -63,6 +63,14 @@ class CompletionItem
*/
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.
*

View File

@ -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;
}