Skip to content

Commit

Permalink
Add string value definition (#1893)
Browse files Browse the repository at this point in the history
  • Loading branch information
MariaSolOs committed Feb 2, 2024
1 parent b9c4429 commit 0a0ccb4
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -2,3 +2,4 @@ npm-debug.log
_site/
.bundle/
vendor/
.jekyll-metadata
4 changes: 3 additions & 1 deletion _data/linkableTypes.yml
Expand Up @@ -897,4 +897,6 @@
- type: 'InlineCompletionList'
link: '#inlineCompletionList'
- type: 'InlineCompletionItem'
link: '#inlineCompletionItem'
link: '#inlineCompletionItem'
- type: 'StringValue'
link: '#stringValue'
2 changes: 2 additions & 0 deletions _data/specification-3-18-toc.yml
Expand Up @@ -56,6 +56,8 @@
anchor: textDocumentPositionParams
- title: Document Filter
anchor: documentFilter
- title: String Value
anchor: stringValue
- title: Text Edit
anchor: textEdit
- title: Text Edit Array
Expand Down
2 changes: 1 addition & 1 deletion _specifications/lsp/3.18/language/inlineCompletion.md
Expand Up @@ -203,7 +203,7 @@ export interface InlineCompletionItem {
* The text to replace the range with. Must be set.
* Is used both for the preview and the accept operation.
*/
insertText: string;
insertText: string | StringValue;

/**
* A text that is used to decide if this inline completion should be
Expand Down
1 change: 1 addition & 0 deletions _specifications/lsp/3.18/specification.md
Expand Up @@ -451,6 +451,7 @@ There are quite some JSON structures that are shared between different requests
{% include_relative types/textDocumentPositionParams.md %}
{% include_relative types/documentFilter.md %}

{% include_relative types/stringValue.md %}
{% include_relative types/textEdit.md %}
{% include_relative types/textEditArray.md %}
{% include_relative types/textDocumentEdit.md %}
Expand Down
28 changes: 28 additions & 0 deletions _specifications/lsp/3.18/types/stringValue.md
@@ -0,0 +1,28 @@
#### <a href="#stringValue" name="stringValue" class="anchor"> String Value </a>

Template strings for inserting text and controlling the editor cursor upon insertion.

```typescript
/**
* A string value used as a snippet is a template which allows to insert text
* and to control the editor cursor when insertion happens.
*
* 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. Variables are defined with `$name` and
* `${name:default value}`.
*
* @since 3.18.0
*/
export interface StringValue {
/**
* The kind of string value.
*/
kind: 'snippet';

/**
* The snippet string.
*/
value: string;
}
```

0 comments on commit 0a0ccb4

Please sign in to comment.