vscode-languageserver-types
Advanced tools
Comparing version 2.0.0-alpha.1 to 3.0.0-alpha.1
@@ -293,2 +293,32 @@ /** | ||
/** | ||
* A snippet string 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. Placeholders with equal identifiers are linked, | ||
* that is typing in one will update others too. | ||
*/ | ||
export interface SnippetString { | ||
/** | ||
* The snippet string. | ||
*/ | ||
value: string; | ||
} | ||
/** | ||
* The SnippetString namespace provides helper functions to work with | ||
* [SnippetString](#SnippetString) literals. | ||
*/ | ||
export declare namespace SnippetString { | ||
/** | ||
* Creates a new SnippetString literal. | ||
* @param uri The document's uri. | ||
*/ | ||
function create(value: string): SnippetString; | ||
/** | ||
* Checks whether the given literal conforms to the [SnippetString](#SnippetString) interface. | ||
*/ | ||
function is(value: any): value is SnippetString; | ||
} | ||
/** | ||
* A literal to identify a text document in the client. | ||
@@ -448,10 +478,34 @@ */ | ||
*/ | ||
insertText?: string; | ||
insertText?: string | SnippetString; | ||
/** | ||
* A range of text that should be replaced by this completion item. | ||
* | ||
* Defaults to a range from the start of the current word to the | ||
* current position. | ||
* | ||
* *Note:* The range must be a single line and it must | ||
* contain the position at which completion has been requested. | ||
*/ | ||
range?: Range; | ||
/** | ||
* * @deprecated **Deprecated** in favor of `CompletionItem.insertText` and `CompletionItem.range`. | ||
* | ||
* An [edit](#TextEdit) which is applied to a document when selecting | ||
* this completion. When an edit is provided the value of | ||
* [insertText](#CompletionItem.insertText) is ignored. | ||
* [insertText](#CompletionItem.insertText) and [range](#CompletionItem.range) is ignored. | ||
*/ | ||
textEdit?: TextEdit; | ||
/** | ||
* An optional array of additional [text edits](#TextEdit) that are applied when | ||
* selecting this completion. Edits must not overlap with the main [edit](#CompletionItem.textEdit) | ||
* nor with themselves. | ||
*/ | ||
additionalTextEdits?: TextEdit[]; | ||
/** | ||
* An optional [command](#Command) that is executed *after* inserting this completion. *Note* that | ||
* additional modifications to the current document should be described with the | ||
* [additionalTextEdits](#CompletionItem.additionalTextEdits)-property. | ||
*/ | ||
command?: Command; | ||
/** | ||
* An data entry field that is preserved on a completion item between | ||
@@ -939,2 +993,30 @@ * a [CompletionRequest](#CompletionRequest) and a [CompletionResolveRequest] | ||
/** | ||
* Represents reasons why a text document is saved. | ||
*/ | ||
export declare enum TextDocumentSaveReason { | ||
/** | ||
* Manually triggered, e.g. by the user pressing save, by starting debugging, | ||
* or by an API call. | ||
*/ | ||
Manual = 1, | ||
/** | ||
* Automatic after a delay. | ||
*/ | ||
AfterDelay = 2, | ||
/** | ||
* When the editor lost focus. | ||
*/ | ||
FocusOut = 3, | ||
} | ||
export interface TextDocumentWillSaveEvent { | ||
/** | ||
* The document that will be saved | ||
*/ | ||
document: TextDocument; | ||
/** | ||
* The reason why save was triggered. | ||
*/ | ||
reason: TextDocumentSaveReason; | ||
} | ||
/** | ||
* An event describing a change to a text document. If range and rangeLength are omitted | ||
@@ -941,0 +1023,0 @@ * the new text is considered to be the full content of the document. |
@@ -249,2 +249,25 @@ (function (factory) { | ||
/** | ||
* The SnippetString namespace provides helper functions to work with | ||
* [SnippetString](#SnippetString) literals. | ||
*/ | ||
var SnippetString; | ||
(function (SnippetString) { | ||
/** | ||
* Creates a new SnippetString literal. | ||
* @param uri The document's uri. | ||
*/ | ||
function create(value) { | ||
return { value: value }; | ||
} | ||
SnippetString.create = create; | ||
/** | ||
* Checks whether the given literal conforms to the [SnippetString](#SnippetString) interface. | ||
*/ | ||
function is(value) { | ||
var candidate = value; | ||
return Is.defined(candidate) && Is.string(candidate.value); | ||
} | ||
SnippetString.is = is; | ||
})(SnippetString = exports.SnippetString || (exports.SnippetString = {})); | ||
/** | ||
* The TextDocumentIdentifier namespace provides helper functions to work with | ||
@@ -575,2 +598,21 @@ * [TextDocumentIdentifier](#TextDocumentIdentifier) literals. | ||
})(TextDocument = exports.TextDocument || (exports.TextDocument = {})); | ||
/** | ||
* Represents reasons why a text document is saved. | ||
*/ | ||
(function (TextDocumentSaveReason) { | ||
/** | ||
* Manually triggered, e.g. by the user pressing save, by starting debugging, | ||
* or by an API call. | ||
*/ | ||
TextDocumentSaveReason[TextDocumentSaveReason["Manual"] = 1] = "Manual"; | ||
/** | ||
* Automatic after a delay. | ||
*/ | ||
TextDocumentSaveReason[TextDocumentSaveReason["AfterDelay"] = 2] = "AfterDelay"; | ||
/** | ||
* When the editor lost focus. | ||
*/ | ||
TextDocumentSaveReason[TextDocumentSaveReason["FocusOut"] = 3] = "FocusOut"; | ||
})(exports.TextDocumentSaveReason || (exports.TextDocumentSaveReason = {})); | ||
var TextDocumentSaveReason = exports.TextDocumentSaveReason; | ||
var FullTextDocument = (function () { | ||
@@ -577,0 +619,0 @@ function FullTextDocument(uri, languageId, version, content) { |
{ | ||
"name": "vscode-languageserver-types", | ||
"description": "Types used by the Language server for node", | ||
"version": "2.0.0-alpha.1", | ||
"version": "3.0.0-alpha.1", | ||
"author": "Microsoft Corporation", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -10,2 +10,9 @@ # VSCode Language Server | ||
Click [here](https://code.visualstudio.com/docs/extensions/example-language-server) for a detailed document on how | ||
to implement language servers for [VSCode](https://code.visualstudio.com/). | ||
to implement language servers for [VSCode](https://code.visualstudio.com/). | ||
## History | ||
For the history please see the [main repository](https://github.com/Microsoft/vscode-languageserver-node/blob/master/README.md) | ||
## License | ||
[MIT](https://github.com/Microsoft/vscode-languageserver-node/blob/master/License.txt) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61291
1785
17