diff --git a/README.md b/README.md index dcf4d26..a67481a 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,35 @@ # SQF Language This extension integrates the SQF Language into Visual Studio Code. -The SQF Syntax was created by [Bohemia Interactive](https://www.bistudio.com/) for its games & simulators. -It's simple and easy to learn even without any knowledge in scripting or programming, for more information visit the [wiki](https://community.bistudio.com/wiki/Scripting_Commands_by_Functionality). - +For more information please visit the [wiki](https://community.bistudio.com/wiki/). + + +## Supported Products +* Operation Flashpoint [OFP & OFP Resistance] + * Enable/Disable commands from OFP via "sqf.enableOFP". Default: enabled (needed for all futher ArmA versions) + * [Wiki: OFP Commands](https://community.bistudio.com/wiki/Category:Introduced_with_Operation_Flashpoint) + * [Wiki: OFP: Resistance Commands](https://community.bistudio.com/wiki/Category:Introduced_with_Operation_Flashpoint:_Resistance) +* Take On Helicopters [ToH] + * Enable/Disable commands from ToH via "sqf.enableTOH". Default: disabled + * [Wiki: OFP Commands](https://community.bistudio.com/wiki/Category:Introduced_with_Operation_Flashpoint) +* Armed Assault [ArmA] + * Enable/Disable commands from ArmA via "sqf.enableARMA". Default: enabled (needed for all futher ArmA versions) + * [Wiki: ArmA Commands](https://community.bistudio.com/wiki/Category:Introduced_with_Armed_Assault) +* Armed Assault 2 & Operation Arrowhead [ArmA 2 & ArmA 2: OA] + * Enable/Disable commands from ArmA 2 via "sqf.enableARMA2". Default: enabled (needed for all futher ArmA versions) + * [Wiki: ArmA 2 Commands](https://community.bistudio.com/wiki/Category:Introduced_with_Arma_2) + * [Wiki: ArmA 2: OA Commands](https://community.bistudio.com/wiki/Category:Introduced_with_Arma_2:_Operation_Arrowhead) +* Armed Assault 3 [ArmA 3] + * Enable/Disable commands from ArmA 3 via "sqf.enableARMA3". Default: enabled (needed for all futher ArmA versions) + * [Wiki: ArmA 3 Commands](https://community.bistudio.com/wiki/Category:Introduced_with_Arma_3) +* Community Based Addons [CBA] + * Enable/Disable commands from CBA via "sqf.enableCBA". Default: disabled + * [Wiki: CBA GitHub](https://github.com/CBATeam/CBA_A3/wiki) + * Contributors: [bux](https://github.com/bux) +* ACE 3 [CBA] + * Enable/Disable commands from ACE3 via "sqf.enableACE3". Default: disabled + * [Wiki: ACE3](https://ace3mod.com/wiki/) + * Contributors: [bux](https://github.com/bux) ## Manual Installation @@ -25,7 +51,8 @@ Use this guide if the installation over the marketplace isn't possible. ## Links & Downloads * [Visual Studio Code](https://code.visualstudio.com/) +* [Project Website](https://armitxes.net/Projects/VSCodeSQF/) * [GitHub Project](https://github.com/Armitxes/VSCode_SQF) * [GitHub Project Files (master.zip)](https://github.com/Armitxes/VSCode_SQF/archive/master.zip) [(or older releases)](https://github.com/Armitxes/VSCode_SQF/releases) -* [Discussion](https://forums.bistudio.com/topic/182917-vs-code-sqf-visual-studio-code-sqf-language-release-arma-3-arma-2/) +* [BI Forums](https://forums.bistudio.com/topic/182917-vs-code-sqf-visual-studio-code-sqf-language-release-arma-3-arma-2/) * [Questions, Bugs & Suggestions](https://github.com/Armitxes/VSCode_SQF/issues) \ No newline at end of file diff --git a/node_modules/vscode-jsonrpc/.npmignore b/node_modules/vscode-jsonrpc/.npmignore new file mode 100644 index 0000000..2b1e5b1 --- /dev/null +++ b/node_modules/vscode-jsonrpc/.npmignore @@ -0,0 +1,9 @@ +.vscode/ +lib/test/ +lib/*.map +src/ +test/ +.eslintrc +.gitignore +gulpfile.js +tsd.json \ No newline at end of file diff --git a/node_modules/vscode-jsonrpc/License.txt b/node_modules/vscode-jsonrpc/License.txt new file mode 100644 index 0000000..a07e3ae --- /dev/null +++ b/node_modules/vscode-jsonrpc/License.txt @@ -0,0 +1,11 @@ +Copyright (c) Microsoft Corporation + +All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/vscode-jsonrpc/README.md b/node_modules/vscode-jsonrpc/README.md new file mode 100644 index 0000000..6c4f3a4 --- /dev/null +++ b/node_modules/vscode-jsonrpc/README.md @@ -0,0 +1,60 @@ +# VSCode JSON RPC + +[![NPM Version](https://img.shields.io/npm/v/vscode-jsonrpc.svg)](https://npmjs.org/package/vscode-jsonrpc) +[![NPM Downloads](https://img.shields.io/npm/dm/vscode-jsonrpc.svg)](https://npmjs.org/package/vscode-jsonrpc) +[![Build Status](https://travis-ci.org/Microsoft/vscode-languageserver-node.svg?branch=master)](https://travis-ci.org/Microsoft/vscode-languageserver-node) + +This npm module implements the base messaging protocol spoken between a VSCode language server and a VSCode language client. + +The npm module can also be used standalone to establish a [JSON-RPC](http://www.jsonrpc.org/) channel between +a client and a server. Below an example how to setup a JSON-RPC connection. First the client side. + +```ts +import * as cp from 'child_process'; +import * as rpc from 'vscode-jsonrpc'; + +let childProcess = cp.spawn(...); + +// Use stdin and stdout for communication: +let connection = rpc.createMessageConnection( + new rpc.StreamMessageReader(childProcess.stdout), + new rpc.StreamMessageWriter(childProcess.stdin)); + +let notification = new NotificationType('testNotification'); + +connection.listen(); + +connection.sendNotification(notification, 'Hello World'); +``` + +The server side looks very symmetrical: + +```ts +import * as rpc from 'vscode-jsonrpc'; + + +let connection = rpc.createMessageConnection( + new rpc.StreamMessageReader(process.stdin), + new rpc.StreamMessageWriter(process.stdout)); + +let notification = new NotificationType('testNotification'); +connection.onNotification(notification, (param: string) => { + console.log(param); // This prints Hello World +}); + +connection.listen(); +``` + +# History + +### 3.0.0: + +- converted the NPM module to use TypeScript 2.0.3. +- added strict null support. +- support for passing more than one parameter to a request or notification. +- Breaking changes: + - due to the use of TypeScript 2.0.3 and differences in d.ts generation users of the new version need to move to + TypeScript 2.0.3 as well. + +## License +[MIT](https://github.com/Microsoft/vscode-languageserver-node/blob/master/License.txt) \ No newline at end of file diff --git a/node_modules/vscode-jsonrpc/lib/cancellation.d.ts b/node_modules/vscode-jsonrpc/lib/cancellation.d.ts new file mode 100644 index 0000000..6f37801 --- /dev/null +++ b/node_modules/vscode-jsonrpc/lib/cancellation.d.ts @@ -0,0 +1,27 @@ +import { Event } from './events'; +/** + * Defines a CancellationToken. This interface is not + * intended to be implemented. A CancellationToken must + * be created via a CancellationTokenSource. + */ +export interface CancellationToken { + /** + * Is `true` when the token has been cancelled, `false` otherwise. + */ + readonly isCancellationRequested: boolean; + /** + * An [event](#Event) which fires upon cancellation. + */ + readonly onCancellationRequested: Event; +} +export declare namespace CancellationToken { + const None: CancellationToken; + const Cancelled: CancellationToken; + function is(value: any): value is CancellationToken; +} +export declare class CancellationTokenSource { + private _token; + readonly token: CancellationToken; + cancel(): void; + dispose(): void; +} diff --git a/node_modules/vscode-jsonrpc/lib/cancellation.js b/node_modules/vscode-jsonrpc/lib/cancellation.js new file mode 100644 index 0000000..87b274e --- /dev/null +++ b/node_modules/vscode-jsonrpc/lib/cancellation.js @@ -0,0 +1,96 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; +var events_1 = require("./events"); +var Is = require("./is"); +var CancellationToken; +(function (CancellationToken) { + CancellationToken.None = Object.freeze({ + isCancellationRequested: false, + onCancellationRequested: events_1.Event.None + }); + CancellationToken.Cancelled = Object.freeze({ + isCancellationRequested: true, + onCancellationRequested: events_1.Event.None + }); + function is(value) { + var candidate = value; + return candidate && (candidate === CancellationToken.None + || candidate === CancellationToken.Cancelled + || (Is.boolean(candidate.isCancellationRequested) && !!candidate.onCancellationRequested)); + } + CancellationToken.is = is; +})(CancellationToken = exports.CancellationToken || (exports.CancellationToken = {})); +var shortcutEvent = Object.freeze(function (callback, context) { + var handle = setTimeout(callback.bind(context), 0); + return { dispose: function () { clearTimeout(handle); } }; +}); +var MutableToken = (function () { + function MutableToken() { + this._isCancelled = false; + } + MutableToken.prototype.cancel = function () { + if (!this._isCancelled) { + this._isCancelled = true; + if (this._emitter) { + this._emitter.fire(undefined); + this._emitter = undefined; + } + } + }; + Object.defineProperty(MutableToken.prototype, "isCancellationRequested", { + get: function () { + return this._isCancelled; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MutableToken.prototype, "onCancellationRequested", { + get: function () { + if (this._isCancelled) { + return shortcutEvent; + } + if (!this._emitter) { + this._emitter = new events_1.Emitter(); + } + return this._emitter.event; + }, + enumerable: true, + configurable: true + }); + return MutableToken; +}()); +var CancellationTokenSource = (function () { + function CancellationTokenSource() { + } + Object.defineProperty(CancellationTokenSource.prototype, "token", { + get: function () { + if (!this._token) { + // be lazy and create the token only when + // actually needed + this._token = new MutableToken(); + } + return this._token; + }, + enumerable: true, + configurable: true + }); + CancellationTokenSource.prototype.cancel = function () { + if (!this._token) { + // save an object by returning the default + // cancelled token when cancellation happens + // before someone asks for the token + this._token = CancellationToken.Cancelled; + } + else { + this._token.cancel(); + } + }; + CancellationTokenSource.prototype.dispose = function () { + this.cancel(); + }; + return CancellationTokenSource; +}()); +exports.CancellationTokenSource = CancellationTokenSource; diff --git a/node_modules/vscode-jsonrpc/lib/events.d.ts b/node_modules/vscode-jsonrpc/lib/events.d.ts new file mode 100644 index 0000000..d912830 --- /dev/null +++ b/node_modules/vscode-jsonrpc/lib/events.d.ts @@ -0,0 +1,47 @@ +export interface Disposable { + /** + * Dispose this object. + */ + dispose(): void; +} +export declare namespace Disposable { + function create(func: () => void): Disposable; +} +/** + * Represents a typed event. + */ +export interface Event { + /** + * + * @param listener The listener function will be call when the event happens. + * @param thisArgs The 'this' which will be used when calling the event listener. + * @param disposables An array to which a {{IDisposable}} will be added. The + * @return + */ + (listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]): Disposable; +} +export declare namespace Event { + const None: Event; +} +export interface EmitterOptions { + onFirstListenerAdd?: Function; + onLastListenerRemove?: Function; +} +export declare class Emitter { + private _options; + private static _noop; + private _event; + private _callbacks; + constructor(_options?: EmitterOptions); + /** + * For the public to allow to subscribe + * to events from this Emitter + */ + readonly event: Event; + /** + * To be kept private to fire an event to + * subscribers + */ + fire(event: T): any; + dispose(): void; +} diff --git a/node_modules/vscode-jsonrpc/lib/events.js b/node_modules/vscode-jsonrpc/lib/events.js new file mode 100644 index 0000000..124ef29 --- /dev/null +++ b/node_modules/vscode-jsonrpc/lib/events.js @@ -0,0 +1,189 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +'use strict'; +var Disposable; +(function (Disposable) { + function create(func) { + return { + dispose: func + }; + } + Disposable.create = create; +})(Disposable = exports.Disposable || (exports.Disposable = {})); +var Event; +(function (Event) { + var _disposable = { dispose: function () { } }; + Event.None = function () { return _disposable; }; +})(Event = exports.Event || (exports.Event = {})); +/** + * Represents a type which can release resources, such + * as event listening or a timer. + */ +var DisposableImpl = (function () { + function DisposableImpl(callOnDispose) { + this._callOnDispose = callOnDispose; + } + /** + * Combine many disposable-likes into one. Use this method + * when having objects with a dispose function which are not + * instances of Disposable. + * + * @return Returns a new disposable which, upon dispose, will + * dispose all provides disposable-likes. + */ + DisposableImpl.from = function () { + var _disposables = []; + for (var _i = 0; _i < arguments.length; _i++) { + _disposables[_i] = arguments[_i]; + } + return new DisposableImpl(function () { + var disposables = _disposables; + if (disposables) { + for (var _i = 0, disposables_1 = disposables; _i < disposables_1.length; _i++) { + var disposable = disposables_1[_i]; + disposable.dispose(); + } + disposables = undefined; + } + }); + }; + /** + * Dispose this object. + */ + DisposableImpl.prototype.dispose = function () { + if (typeof this._callOnDispose === 'function') { + this._callOnDispose(); + this._callOnDispose = undefined; + } + }; + return DisposableImpl; +}()); +var CallbackList = (function () { + function CallbackList() { + } + CallbackList.prototype.add = function (callback, context, bucket) { + var _this = this; + if (context === void 0) { context = null; } + if (!this._callbacks) { + this._callbacks = []; + this._contexts = []; + } + this._callbacks.push(callback); + this._contexts.push(context); + if (Array.isArray(bucket)) { + bucket.push({ dispose: function () { return _this.remove(callback, context); } }); + } + }; + CallbackList.prototype.remove = function (callback, context) { + if (context === void 0) { context = null; } + if (!this._callbacks) { + return; + } + var foundCallbackWithDifferentContext = false; + for (var i = 0, len = this._callbacks.length; i < len; i++) { + if (this._callbacks[i] === callback) { + if (this._contexts[i] === context) { + // callback & context match => remove it + this._callbacks.splice(i, 1); + this._contexts.splice(i, 1); + return; + } + else { + foundCallbackWithDifferentContext = true; + } + } + } + if (foundCallbackWithDifferentContext) { + throw new Error('When adding a listener with a context, you should remove it with the same context'); + } + }; + CallbackList.prototype.invoke = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!this._callbacks) { + return []; + } + var ret = [], callbacks = this._callbacks.slice(0), contexts = this._contexts.slice(0); + for (var i = 0, len = callbacks.length; i < len; i++) { + try { + ret.push(callbacks[i].apply(contexts[i], args)); + } + catch (e) { + console.error(e); + } + } + return ret; + }; + CallbackList.prototype.isEmpty = function () { + return !this._callbacks || this._callbacks.length === 0; + }; + CallbackList.prototype.dispose = function () { + this._callbacks = undefined; + this._contexts = undefined; + }; + return CallbackList; +}()); +var Emitter = (function () { + function Emitter(_options) { + this._options = _options; + } + Object.defineProperty(Emitter.prototype, "event", { + /** + * For the public to allow to subscribe + * to events from this Emitter + */ + get: function () { + var _this = this; + if (!this._event) { + this._event = function (listener, thisArgs, disposables) { + if (!_this._callbacks) { + _this._callbacks = new CallbackList(); + } + if (_this._options && _this._options.onFirstListenerAdd && _this._callbacks.isEmpty()) { + _this._options.onFirstListenerAdd(_this); + } + _this._callbacks.add(listener, thisArgs); + var result; + result = { + dispose: function () { + _this._callbacks.remove(listener, thisArgs); + result.dispose = Emitter._noop; + if (_this._options && _this._options.onLastListenerRemove && _this._callbacks.isEmpty()) { + _this._options.onLastListenerRemove(_this); + } + } + }; + if (Array.isArray(disposables)) { + disposables.push(result); + } + return result; + }; + } + return this._event; + }, + enumerable: true, + configurable: true + }); + /** + * To be kept private to fire an event to + * subscribers + */ + Emitter.prototype.fire = function (event) { + if (this._callbacks) { + this._callbacks.invoke.call(this._callbacks, event); + } + }; + Emitter.prototype.dispose = function () { + if (this._callbacks) { + this._callbacks.dispose(); + this._callbacks = undefined; + } + }; + return Emitter; +}()); +Emitter._noop = function () { }; +exports.Emitter = Emitter; diff --git a/node_modules/vscode-jsonrpc/lib/is.d.ts b/node_modules/vscode-jsonrpc/lib/is.d.ts new file mode 100644 index 0000000..9261a26 --- /dev/null +++ b/node_modules/vscode-jsonrpc/lib/is.d.ts @@ -0,0 +1,7 @@ +export declare function boolean(value: any): value is boolean; +export declare function string(value: any): value is string; +export declare function number(value: any): value is number; +export declare function error(value: any): value is Error; +export declare function func(value: any): value is Function; +export declare function array(value: any): value is T[]; +export declare function stringArray(value: any): value is string[]; diff --git a/node_modules/vscode-jsonrpc/lib/is.js b/node_modules/vscode-jsonrpc/lib/is.js new file mode 100644 index 0000000..76a7dbb --- /dev/null +++ b/node_modules/vscode-jsonrpc/lib/is.js @@ -0,0 +1,34 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +'use strict'; +var toString = Object.prototype.toString; +function boolean(value) { + return value === true || value === false; +} +exports.boolean = boolean; +function string(value) { + return toString.call(value) === '[object String]'; +} +exports.string = string; +function number(value) { + return toString.call(value) === '[object Number]'; +} +exports.number = number; +function error(value) { + return toString.call(value) === '[object Error]'; +} +exports.error = error; +function func(value) { + return toString.call(value) === '[object Function]'; +} +exports.func = func; +function array(value) { + return Array.isArray(value); +} +exports.array = array; +function stringArray(value) { + return array(value) && value.every(function (elem) { return string(elem); }); +} +exports.stringArray = stringArray; diff --git a/node_modules/vscode-jsonrpc/lib/main.d.ts b/node_modules/vscode-jsonrpc/lib/main.d.ts new file mode 100644 index 0000000..94e99a9 --- /dev/null +++ b/node_modules/vscode-jsonrpc/lib/main.d.ts @@ -0,0 +1,190 @@ +/// +/// +import { Message, MessageType, RequestMessage, RequestType, RequestType0, RequestType1, RequestType2, RequestType3, RequestType4, RequestType5, RequestType6, RequestType7, RequestType8, RequestType9, ResponseError, ErrorCodes, NotificationMessage, NotificationType, NotificationType0, NotificationType1, NotificationType2, NotificationType3, NotificationType4, NotificationType5, NotificationType6, NotificationType7, NotificationType8, NotificationType9 } from './messages'; +import { MessageReader, DataCallback, StreamMessageReader, IPCMessageReader } from './messageReader'; +import { MessageWriter, StreamMessageWriter, IPCMessageWriter } from './messageWriter'; +import { Disposable, Event, Emitter } from './events'; +import { CancellationTokenSource, CancellationToken } from './cancellation'; +export { Message, MessageType, ErrorCodes, ResponseError, RequestMessage, RequestType, RequestType0, RequestType1, RequestType2, RequestType3, RequestType4, RequestType5, RequestType6, RequestType7, RequestType8, RequestType9, NotificationMessage, NotificationType, NotificationType0, NotificationType1, NotificationType2, NotificationType3, NotificationType4, NotificationType5, NotificationType6, NotificationType7, NotificationType8, NotificationType9, MessageReader, DataCallback, StreamMessageReader, IPCMessageReader, MessageWriter, StreamMessageWriter, IPCMessageWriter, CancellationTokenSource, CancellationToken, Disposable, Event, Emitter }; +export * from './pipeSupport'; +export interface GenericRequestHandler { + (...params: any[]): R | ResponseError | Thenable | Thenable>; +} +export interface RequestHandler0 { + (token: CancellationToken): R | ResponseError | Thenable | Thenable>; +} +export interface RequestHandler { + (params: P, token: CancellationToken): R | ResponseError | Thenable | Thenable>; +} +export interface RequestHandler1 { + (p1: P1, token: CancellationToken): R | ResponseError | Thenable | Thenable>; +} +export interface RequestHandler2 { + (p1: P1, p2: P2, token: CancellationToken): R | ResponseError | Thenable | Thenable>; +} +export interface RequestHandler3 { + (p1: P1, p2: P2, p3: P3, token: CancellationToken): R | ResponseError | Thenable | Thenable>; +} +export interface RequestHandler4 { + (p1: P1, p2: P2, p3: P3, p4: P4, token: CancellationToken): R | ResponseError | Thenable | Thenable>; +} +export interface RequestHandler5 { + (p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, token: CancellationToken): R | ResponseError | Thenable | Thenable>; +} +export interface RequestHandler6 { + (p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, token: CancellationToken): R | ResponseError | Thenable | Thenable>; +} +export interface RequestHandler7 { + (p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, token: CancellationToken): R | ResponseError | Thenable | Thenable>; +} +export interface RequestHandler8 { + (p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, token: CancellationToken): R | ResponseError | Thenable | Thenable>; +} +export interface RequestHandler9 { + (p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, token: CancellationToken): R | ResponseError | Thenable | Thenable>; +} +export interface GenericNotificationHandler { + (...params: any[]): void; +} +export interface NotificationHandler0 { + (): void; +} +export interface NotificationHandler

{ + (params: P): void; +} +export interface NotificationHandler1 { + (p1: P1): void; +} +export interface NotificationHandler2 { + (p1: P1, p2: P2): void; +} +export interface NotificationHandler3 { + (p1: P1, p2: P2, p3: P3): void; +} +export interface NotificationHandler4 { + (p1: P1, p2: P2, p3: P3, p4: P4): void; +} +export interface NotificationHandler5 { + (p1: P1, p2: P2, p3: P3, p4: P4, p5: P5): void; +} +export interface NotificationHandler6 { + (p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6): void; +} +export interface NotificationHandler7 { + (p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7): void; +} +export interface NotificationHandler8 { + (p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8): void; +} +export interface NotificationHandler9 { + (p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9): void; +} +export interface Logger { + error(message: string): void; + warn(message: string): void; + info(message: string): void; + log(message: string): void; +} +export declare enum Trace { + Off = 0, + Messages = 1, + Verbose = 2, +} +export declare type TraceValues = 'off' | 'messages' | 'verbose'; +export declare namespace Trace { + function fromString(value: string): Trace; + function toString(value: Trace): TraceValues; +} +export interface SetTraceParams { + value: TraceValues; +} +export declare namespace SetTraceNotification { + const type: NotificationType; +} +export interface LogTraceParams { + message: string; + verbose?: string; +} +export declare namespace LogTraceNotification { + const type: NotificationType; +} +export interface Tracer { + log(message: string, data?: string): void; +} +export declare enum ConnectionErrors { + /** + * The connection is closed. + */ + Closed = 1, + /** + * The connection got disposed. + */ + Disposed = 2, + /** + * The connection is already in listening mode. + */ + AlreadyListening = 3, +} +export declare class ConnectionError extends Error { + readonly code: ConnectionErrors; + constructor(code: ConnectionErrors, message: string); +} +export interface MessageConnection { + sendRequest(type: RequestType0, token?: CancellationToken): Thenable; + sendRequest(type: RequestType, params: P, token?: CancellationToken): Thenable; + sendRequest(type: RequestType1, p1: P1, token?: CancellationToken): Thenable; + sendRequest(type: RequestType2, p1: P1, p2: P2, token?: CancellationToken): Thenable; + sendRequest(type: RequestType3, p1: P1, p2: P2, p3: P3, token?: CancellationToken): Thenable; + sendRequest(type: RequestType4, p1: P1, p2: P2, p3: P3, p4: P4, token?: CancellationToken): Thenable; + sendRequest(type: RequestType5, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, token?: CancellationToken): Thenable; + sendRequest(type: RequestType6, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, token?: CancellationToken): Thenable; + sendRequest(type: RequestType7, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, token?: CancellationToken): Thenable; + sendRequest(type: RequestType8, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, token?: CancellationToken): Thenable; + sendRequest(type: RequestType9, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, token?: CancellationToken): Thenable; + sendRequest(method: string, ...params: any[]): Thenable; + onRequest(type: RequestType0, handler: RequestHandler0): void; + onRequest(type: RequestType, handler: RequestHandler): void; + onRequest(type: RequestType1, handler: RequestHandler1): void; + onRequest(type: RequestType2, handler: RequestHandler2): void; + onRequest(type: RequestType3, handler: RequestHandler3): void; + onRequest(type: RequestType4, handler: RequestHandler4): void; + onRequest(type: RequestType5, handler: RequestHandler5): void; + onRequest(type: RequestType6, handler: RequestHandler6): void; + onRequest(type: RequestType7, handler: RequestHandler7): void; + onRequest(type: RequestType8, handler: RequestHandler8): void; + onRequest(type: RequestType9, handler: RequestHandler9): void; + onRequest(method: string, handler: GenericRequestHandler): void; + sendNotification(type: NotificationType0): void; + sendNotification(type: NotificationType, params?: P): void; + sendNotification(type: NotificationType1, p1: P1): void; + sendNotification(type: NotificationType2, p1: P1, p2: P2): void; + sendNotification(type: NotificationType3, p1: P1, p2: P2, p3: P3): void; + sendNotification(type: NotificationType4, p1: P1, p2: P2, p3: P3, p4: P4): void; + sendNotification(type: NotificationType5, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5): void; + sendNotification(type: NotificationType6, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6): void; + sendNotification(type: NotificationType7, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7): void; + sendNotification(type: NotificationType8, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8): void; + sendNotification(type: NotificationType9, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9): void; + sendNotification(method: string, ...params: any[]): void; + onNotification(type: NotificationType0, handler: NotificationHandler0): void; + onNotification(type: NotificationType, handler: NotificationHandler

): void; + onNotification(type: NotificationType1, handler: NotificationHandler1): void; + onNotification(type: NotificationType2, handler: NotificationHandler2): void; + onNotification(type: NotificationType3, handler: NotificationHandler3): void; + onNotification(type: NotificationType4, handler: NotificationHandler4): void; + onNotification(type: NotificationType5, handler: NotificationHandler5): void; + onNotification(type: NotificationType6, handler: NotificationHandler6): void; + onNotification(type: NotificationType7, handler: NotificationHandler7): void; + onNotification(type: NotificationType8, handler: NotificationHandler8): void; + onNotification(type: NotificationType9, handler: NotificationHandler9): void; + onNotification(method: string, handler: GenericNotificationHandler): void; + trace(value: Trace, tracer: Tracer, sendNotification?: boolean): void; + onError: Event<[Error, Message, number]>; + onClose: Event; + onUnhandledNotification: Event; + listen(): void; + onDispose: Event; + dispose(): void; +} +export declare function createMessageConnection(reader: MessageReader, writer: MessageWriter, logger: Logger): MessageConnection; +export declare function createMessageConnection(inputStream: NodeJS.ReadableStream, outputStream: NodeJS.WritableStream, logger: Logger): MessageConnection; diff --git a/node_modules/vscode-jsonrpc/lib/main.js b/node_modules/vscode-jsonrpc/lib/main.js new file mode 100644 index 0000000..78a8be1 --- /dev/null +++ b/node_modules/vscode-jsonrpc/lib/main.js @@ -0,0 +1,696 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +/// +'use strict'; +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +var is = require("./is"); +var messages_1 = require("./messages"); +exports.RequestType = messages_1.RequestType; +exports.RequestType0 = messages_1.RequestType0; +exports.RequestType1 = messages_1.RequestType1; +exports.RequestType2 = messages_1.RequestType2; +exports.RequestType3 = messages_1.RequestType3; +exports.RequestType4 = messages_1.RequestType4; +exports.RequestType5 = messages_1.RequestType5; +exports.RequestType6 = messages_1.RequestType6; +exports.RequestType7 = messages_1.RequestType7; +exports.RequestType8 = messages_1.RequestType8; +exports.RequestType9 = messages_1.RequestType9; +exports.ResponseError = messages_1.ResponseError; +exports.ErrorCodes = messages_1.ErrorCodes; +exports.NotificationType = messages_1.NotificationType; +exports.NotificationType0 = messages_1.NotificationType0; +exports.NotificationType1 = messages_1.NotificationType1; +exports.NotificationType2 = messages_1.NotificationType2; +exports.NotificationType3 = messages_1.NotificationType3; +exports.NotificationType4 = messages_1.NotificationType4; +exports.NotificationType5 = messages_1.NotificationType5; +exports.NotificationType6 = messages_1.NotificationType6; +exports.NotificationType7 = messages_1.NotificationType7; +exports.NotificationType8 = messages_1.NotificationType8; +exports.NotificationType9 = messages_1.NotificationType9; +var messageReader_1 = require("./messageReader"); +exports.StreamMessageReader = messageReader_1.StreamMessageReader; +exports.IPCMessageReader = messageReader_1.IPCMessageReader; +var messageWriter_1 = require("./messageWriter"); +exports.StreamMessageWriter = messageWriter_1.StreamMessageWriter; +exports.IPCMessageWriter = messageWriter_1.IPCMessageWriter; +var events_1 = require("./events"); +exports.Disposable = events_1.Disposable; +exports.Event = events_1.Event; +exports.Emitter = events_1.Emitter; +var cancellation_1 = require("./cancellation"); +exports.CancellationTokenSource = cancellation_1.CancellationTokenSource; +exports.CancellationToken = cancellation_1.CancellationToken; +__export(require("./pipeSupport")); +var CancelNotification; +(function (CancelNotification) { + CancelNotification.type = new messages_1.NotificationType('$/cancelRequest'); +})(CancelNotification || (CancelNotification = {})); +var Trace; +(function (Trace) { + Trace[Trace["Off"] = 0] = "Off"; + Trace[Trace["Messages"] = 1] = "Messages"; + Trace[Trace["Verbose"] = 2] = "Verbose"; +})(Trace = exports.Trace || (exports.Trace = {})); +(function (Trace) { + function fromString(value) { + value = value.toLowerCase(); + switch (value) { + case 'off': + return Trace.Off; + case 'messages': + return Trace.Messages; + case 'verbose': + return Trace.Verbose; + default: + return Trace.Off; + } + } + Trace.fromString = fromString; + function toString(value) { + switch (value) { + case Trace.Off: + return 'off'; + case Trace.Messages: + return 'messages'; + case Trace.Verbose: + return 'verbose'; + default: + return 'off'; + } + } + Trace.toString = toString; +})(Trace = exports.Trace || (exports.Trace = {})); +var SetTraceNotification; +(function (SetTraceNotification) { + SetTraceNotification.type = new messages_1.NotificationType('$/setTraceNotification'); +})(SetTraceNotification = exports.SetTraceNotification || (exports.SetTraceNotification = {})); +var LogTraceNotification; +(function (LogTraceNotification) { + LogTraceNotification.type = new messages_1.NotificationType('$/logTraceNotification'); +})(LogTraceNotification = exports.LogTraceNotification || (exports.LogTraceNotification = {})); +var ConnectionErrors; +(function (ConnectionErrors) { + /** + * The connection is closed. + */ + ConnectionErrors[ConnectionErrors["Closed"] = 1] = "Closed"; + /** + * The connection got disposed. + */ + ConnectionErrors[ConnectionErrors["Disposed"] = 2] = "Disposed"; + /** + * The connection is already in listening mode. + */ + ConnectionErrors[ConnectionErrors["AlreadyListening"] = 3] = "AlreadyListening"; +})(ConnectionErrors = exports.ConnectionErrors || (exports.ConnectionErrors = {})); +var ConnectionError = (function (_super) { + __extends(ConnectionError, _super); + function ConnectionError(code, message) { + var _this = _super.call(this, message) || this; + _this.code = code; + Object.setPrototypeOf(_this, ConnectionError.prototype); + return _this; + } + return ConnectionError; +}(Error)); +exports.ConnectionError = ConnectionError; +var ConnectionState; +(function (ConnectionState) { + ConnectionState[ConnectionState["New"] = 1] = "New"; + ConnectionState[ConnectionState["Listening"] = 2] = "Listening"; + ConnectionState[ConnectionState["Closed"] = 3] = "Closed"; + ConnectionState[ConnectionState["Disposed"] = 4] = "Disposed"; +})(ConnectionState || (ConnectionState = {})); +function _createMessageConnection(messageReader, messageWriter, logger) { + var sequenceNumber = 0; + var version = '2.0'; + var requestHandlers = Object.create(null); + var notificationHandlers = Object.create(null); + var responsePromises = Object.create(null); + var requestTokens = Object.create(null); + var trace = Trace.Off; + var tracer; + var state = ConnectionState.New; + var errorEmitter = new events_1.Emitter(); + var closeEmitter = new events_1.Emitter(); + var unhandledNotificationEmitter = new events_1.Emitter(); + var disposeEmitter = new events_1.Emitter(); + function isListening() { + return state === ConnectionState.Listening; + } + function isClosed() { + return state === ConnectionState.Closed; + } + function isDisposed() { + return state === ConnectionState.Disposed; + } + function closeHandler() { + if (state === ConnectionState.New || state === ConnectionState.Listening) { + state = ConnectionState.Closed; + closeEmitter.fire(undefined); + } + // If the connection is disposed don't sent close events. + } + ; + function readErrorHandler(error) { + errorEmitter.fire([error, undefined, undefined]); + } + function writeErrorHandler(data) { + errorEmitter.fire(data); + } + messageReader.onClose(closeHandler); + messageReader.onError(readErrorHandler); + messageWriter.onClose(closeHandler); + messageWriter.onError(writeErrorHandler); + function handleRequest(requestMessage) { + if (isDisposed()) { + // we return here silently since we fired an event when the + // connection got disposed. + return; + } + function reply(resultOrError, method, startTime) { + var message = { + jsonrpc: version, + id: requestMessage.id + }; + if (resultOrError instanceof messages_1.ResponseError) { + message.error = resultOrError.toJson(); + } + else { + message.result = resultOrError === void 0 ? null : resultOrError; + } + traceSendingResponse(message, method, startTime); + messageWriter.write(message); + } + function replyError(error, method, startTime) { + var message = { + jsonrpc: version, + id: requestMessage.id, + error: error.toJson() + }; + traceSendingResponse(message, method, startTime); + messageWriter.write(message); + } + function replySuccess(result, method, startTime) { + // The JSON RPC defines that a response must either have a result or an error + // So we can't treat undefined as a valid response result. + if (result === void 0) { + result = null; + } + var message = { + jsonrpc: version, + id: requestMessage.id, + result: result + }; + traceSendingResponse(message, method, startTime); + messageWriter.write(message); + } + traceReceviedRequest(requestMessage); + var requestHandler = requestHandlers[requestMessage.method]; + var startTime = Date.now(); + if (requestHandler) { + var cancellationSource = new cancellation_1.CancellationTokenSource(); + var tokenKey_1 = String(requestMessage.id); + requestTokens[tokenKey_1] = cancellationSource; + try { + var handlerResult = void 0; + if (!requestMessage.params) { + handlerResult = requestHandler(cancellationSource.token); + } + else if (is.array(requestMessage.params)) { + handlerResult = requestHandler.apply(void 0, requestMessage.params.concat([cancellationSource.token])); + } + else { + handlerResult = requestHandler(requestMessage.params, cancellationSource.token); + } + var promise = handlerResult; + if (!handlerResult) { + delete requestTokens[tokenKey_1]; + replySuccess(handlerResult, requestMessage.method, startTime); + } + else if (promise.then) { + promise.then(function (resultOrError) { + delete requestTokens[tokenKey_1]; + reply(resultOrError, requestMessage.method, startTime); + }, function (error) { + delete requestTokens[tokenKey_1]; + if (error instanceof messages_1.ResponseError) { + replyError(error, requestMessage.method, startTime); + } + else if (error && is.string(error.message)) { + replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, "Request " + requestMessage.method + " failed with message: " + error.message), requestMessage.method, startTime); + } + else { + replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, "Request " + requestMessage.method + " failed unexpectedly without providing any details."), requestMessage.method, startTime); + } + }); + } + else { + delete requestTokens[tokenKey_1]; + reply(handlerResult, requestMessage.method, startTime); + } + } + catch (error) { + delete requestTokens[tokenKey_1]; + if (error instanceof messages_1.ResponseError) { + reply(error, requestMessage.method, startTime); + } + else if (error && is.string(error.message)) { + replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, "Request " + requestMessage.method + " failed with message: " + error.message), requestMessage.method, startTime); + } + else { + replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, "Request " + requestMessage.method + " failed unexpectedly without providing any details."), requestMessage.method, startTime); + } + } + } + else { + replyError(new messages_1.ResponseError(messages_1.ErrorCodes.MethodNotFound, "Unhandled method " + requestMessage.method), requestMessage.method, startTime); + } + } + function handleResponse(responseMessage) { + if (isDisposed()) { + // See handle request. + return; + } + var key = String(responseMessage.id); + var responsePromise = responsePromises[key]; + traceReceviedResponse(responseMessage, responsePromise); + if (responsePromise) { + delete responsePromises[key]; + try { + if (responseMessage.error) { + var error = responseMessage.error; + responsePromise.reject(new messages_1.ResponseError(error.code, error.message, error.data)); + } + else if (responseMessage.result !== void 0) { + responsePromise.resolve(responseMessage.result); + } + else { + throw new Error('Should never happen.'); + } + } + catch (error) { + if (error.message) { + logger.error("Response handler '" + responsePromise.method + "' failed with message: " + error.message); + } + else { + logger.error("Response handler '" + responsePromise.method + "' failed unexpectedly."); + } + } + } + } + function handleNotification(message) { + if (isDisposed()) { + // See handle request. + return; + } + var notificationHandler; + if (message.method === CancelNotification.type.method) { + notificationHandler = function (params) { + var id = params.id; + var source = requestTokens[String(id)]; + if (source) { + source.cancel(); + } + }; + } + else { + notificationHandler = notificationHandlers[message.method]; + } + if (notificationHandler) { + try { + traceReceivedNotification(message); + if (!message.params) { + notificationHandler(); + } + else if (is.array(message.params)) { + notificationHandler.apply(void 0, message.params); + } + else { + notificationHandler(message.params); + } + } + catch (error) { + if (error.message) { + logger.error("Notification handler '" + message.method + "' failed with message: " + error.message); + } + else { + logger.error("Notification handler '" + message.method + "' failed unexpectedly."); + } + } + } + else { + unhandledNotificationEmitter.fire(message); + } + } + function handleInvalidMessage(message) { + if (!message) { + logger.error('Received empty message.'); + return; + } + logger.error("Received message which is neither a response nor a notification message:\n" + JSON.stringify(message, null, 4)); + // Test whether we find an id to reject the promise + var responseMessage = message; + if (is.string(responseMessage.id) || is.number(responseMessage.id)) { + var key = String(responseMessage.id); + var responseHandler = responsePromises[key]; + if (responseHandler) { + responseHandler.reject(new Error('The received response has neither a result nor an error property.')); + } + } + } + function traceSendingRequest(message) { + if (trace === Trace.Off || !tracer) { + return; + } + var data = undefined; + if (trace === Trace.Verbose && message.params) { + data = "Params: " + JSON.stringify(message.params, null, 4) + "\n\n"; + } + tracer.log("Sending request '" + message.method + " - (" + message.id + ")'.", data); + } + function traceSendNotification(message) { + if (trace === Trace.Off || !tracer) { + return; + } + var data = undefined; + if (trace === Trace.Verbose) { + if (message.params) { + data = "Params: " + JSON.stringify(message.params, null, 4) + "\n\n"; + } + else { + data = 'No parameters provided.\n\n'; + } + } + tracer.log("Sending notification '" + message.method + "'.", data); + } + function traceSendingResponse(message, method, startTime) { + if (trace === Trace.Off || !tracer) { + return; + } + var data = undefined; + if (trace === Trace.Verbose) { + if (message.error && message.error.data) { + data = "Error data: " + JSON.stringify(message.error.data, null, 4) + "\n\n"; + } + else { + if (message.result) { + data = "Result: " + JSON.stringify(message.result, null, 4) + "\n\n"; + } + else if (message.error === void 0) { + data = 'No result returned.\n\n'; + } + } + } + tracer.log("Sending response '" + method + " - (" + message.id + ")'. Processing request took " + (Date.now() - startTime) + "ms"); + } + function traceReceviedRequest(message) { + if (trace === Trace.Off || !tracer) { + return; + } + var data = undefined; + if (trace === Trace.Verbose && message.params) { + data = "Params: " + JSON.stringify(message.params, null, 4) + "\n\n"; + } + tracer.log("Received request '" + message.method + " - (" + message.id + ")'.", data); + } + function traceReceivedNotification(message) { + if (trace === Trace.Off || !tracer || message.method === LogTraceNotification.type.method) { + return; + } + var data = undefined; + if (trace === Trace.Verbose) { + if (message.params) { + data = "Params: " + JSON.stringify(message.params, null, 4) + "\n\n"; + } + else { + data = 'No parameters provided.\n\n'; + } + } + tracer.log("Received notification '" + message.method + "'.", data); + } + function traceReceviedResponse(message, responsePromise) { + if (trace === Trace.Off || !tracer) { + return; + } + var data = undefined; + if (trace === Trace.Verbose) { + if (message.error && message.error.data) { + data = "Error data: " + JSON.stringify(message.error.data, null, 4) + "\n\n"; + } + else { + if (message.result) { + data = "Result: " + JSON.stringify(message.result, null, 4) + "\n\n"; + } + else if (message.error === void 0) { + data = 'No result returned.\n\n'; + } + } + } + if (responsePromise) { + var error = message.error ? " Request failed: " + message.error.message + " (" + message.error.code + ")." : ''; + tracer.log("Received response '" + responsePromise.method + " - (" + message.id + ")' in " + (Date.now() - responsePromise.timerStart) + "ms." + error, data); + } + else { + tracer.log("Received response " + message.id + " without active response promise.", data); + } + } + var callback = function (message) { + if (messages_1.isRequestMessage(message)) { + handleRequest(message); + } + else if (messages_1.isReponseMessage(message)) { + handleResponse(message); + } + else if (messages_1.isNotificationMessage(message)) { + handleNotification(message); + } + else { + handleInvalidMessage(message); + } + }; + function throwIfClosedOrDisposed() { + if (isClosed()) { + throw new ConnectionError(ConnectionErrors.Closed, 'Connection is closed.'); + } + if (isDisposed()) { + throw new ConnectionError(ConnectionErrors.Disposed, 'Connection is disposed.'); + } + } + function throwIfListening() { + if (isListening()) { + throw new ConnectionError(ConnectionErrors.AlreadyListening, 'Connection is already listening'); + } + } + function computeMessageParams(type, params) { + var result; + var numberOfParams = type.numberOfParams; + switch (numberOfParams) { + case 0: + result = null; + break; + case 1: + result = params[0] || null; + break; + default: + result = []; + for (var i = 0; i < params.length && i < numberOfParams; i++) { + result.push(params[i] || null); + } + if (params.length < numberOfParams) { + for (var i = params.length; i < numberOfParams; i++) { + result.push(null); + } + } + break; + } + return result; + } + var connection = { + sendNotification: function (type) { + var params = []; + for (var _i = 1; _i < arguments.length; _i++) { + params[_i - 1] = arguments[_i]; + } + throwIfClosedOrDisposed(); + var method; + var messageParams; + if (is.string(type)) { + method = type; + switch (params.length) { + case 0: + messageParams = null; + break; + case 1: + messageParams = params[0]; + break; + default: + messageParams = params; + break; + } + } + else { + method = type.method; + messageParams = computeMessageParams(type, params); + } + var notificatioMessage = { + jsonrpc: version, + method: is.string(type) ? type : type.method, + params: messageParams + }; + traceSendNotification(notificatioMessage); + messageWriter.write(notificatioMessage); + }, + onNotification: function (type, handler) { + throwIfClosedOrDisposed(); + notificationHandlers[is.string(type) ? type : type.method] = handler; + }, + sendRequest: function (type) { + var params = []; + for (var _i = 1; _i < arguments.length; _i++) { + params[_i - 1] = arguments[_i]; + } + throwIfClosedOrDisposed(); + var method; + var messageParams; + var token = undefined; + if (is.string(type)) { + method = type; + switch (params.length) { + case 0: + messageParams = null; + break; + case 1: + // The cancellation token is optional so it can also be undefined. + if (cancellation_1.CancellationToken.is(params[0])) { + messageParams = null; + token = params[0]; + } + else { + messageParams = params[0] || null; + } + break; + default: + var last = params.length - 1; + if (cancellation_1.CancellationToken.is(params[last])) { + token = params[last]; + if (params.length === 2) { + messageParams = params[0] || null; + } + else { + messageParams = params.slice(0, last).map(function (value) { return value || null; }); + } + } + else { + messageParams = params.map(function (value) { return value || null; }); + } + break; + } + } + else { + method = type.method; + messageParams = computeMessageParams(type, params); + var numberOfParams = type.numberOfParams; + token = cancellation_1.CancellationToken.is(params[numberOfParams]) ? params[numberOfParams] : undefined; + } + var id = sequenceNumber++; + var result = new Promise(function (resolve, reject) { + var requestMessage = { + jsonrpc: version, + id: id, + method: method, + params: messageParams + }; + var responsePromise = { method: method, timerStart: Date.now(), resolve: resolve, reject: reject }; + traceSendingRequest(requestMessage); + try { + messageWriter.write(requestMessage); + } + catch (e) { + // Writing the message failed. So we need to reject the promise. + responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, e.message ? e.message : 'Unknown reason')); + responsePromise = null; + } + if (responsePromise) { + responsePromises[String(id)] = responsePromise; + } + }); + if (token) { + token.onCancellationRequested(function () { + connection.sendNotification(CancelNotification.type, { id: id }); + }); + } + return result; + }, + onRequest: function (type, handler) { + throwIfClosedOrDisposed(); + requestHandlers[is.string(type) ? type : type.method] = handler; + }, + trace: function (_value, _tracer, sendNotification) { + if (sendNotification === void 0) { sendNotification = false; } + trace = _value; + if (trace === Trace.Off) { + tracer = undefined; + } + else { + tracer = _tracer; + } + if (sendNotification && !isClosed() && !isDisposed()) { + connection.sendNotification(SetTraceNotification.type, { value: Trace.toString(_value) }); + } + }, + onError: errorEmitter.event, + onClose: closeEmitter.event, + onUnhandledNotification: unhandledNotificationEmitter.event, + onDispose: disposeEmitter.event, + dispose: function () { + if (isDisposed()) { + return; + } + state = ConnectionState.Disposed; + disposeEmitter.fire(undefined); + var error = new Error('Connection got disposed.'); + Object.keys(responsePromises).forEach(function (key) { + responsePromises[key].reject(error); + }); + responsePromises = Object.create(null); + requestTokens = Object.create(null); + }, + listen: function () { + throwIfClosedOrDisposed(); + throwIfListening(); + state = ConnectionState.Listening; + messageReader.listen(callback); + } + }; + connection.onNotification(LogTraceNotification.type, function (params) { + if (trace === Trace.Off || !tracer) { + return; + } + tracer.log(params.message, trace === Trace.Verbose ? params.verbose : undefined); + }); + return connection; +} +function isMessageReader(value) { + return value.listen !== void 0 && value.read === void 0; +} +function isMessageWriter(value) { + return value.write !== void 0 && value.end === void 0; +} +function createMessageConnection(input, output, logger) { + var reader = isMessageReader(input) ? input : new messageReader_1.StreamMessageReader(input); + var writer = isMessageWriter(output) ? output : new messageWriter_1.StreamMessageWriter(output); + return _createMessageConnection(reader, writer, logger); +} +exports.createMessageConnection = createMessageConnection; diff --git a/node_modules/vscode-jsonrpc/lib/messageReader.d.ts b/node_modules/vscode-jsonrpc/lib/messageReader.d.ts new file mode 100644 index 0000000..e66a547 --- /dev/null +++ b/node_modules/vscode-jsonrpc/lib/messageReader.d.ts @@ -0,0 +1,54 @@ +/// +import { Socket } from 'net'; +import { ChildProcess } from 'child_process'; +import { Message } from './messages'; +import { Event } from './events'; +export interface DataCallback { + (data: Message): void; +} +export interface PartialMessageInfo { + readonly messageToken: number; + readonly waitingTime: number; +} +export interface MessageReader { + readonly onError: Event; + readonly onClose: Event; + readonly onPartialMessage: Event; + listen(callback: DataCallback): void; +} +export declare abstract class AbstractMessageReader { + private errorEmitter; + private closeEmitter; + private partialMessageEmitter; + constructor(); + readonly onError: Event; + protected fireError(error: any): void; + readonly onClose: Event; + protected fireClose(): void; + readonly onPartialMessage: Event; + protected firePartialMessage(info: PartialMessageInfo): void; + private asError(error); +} +export declare class StreamMessageReader extends AbstractMessageReader implements MessageReader { + private readable; + private callback; + private buffer; + private nextMessageLength; + private messageToken; + private partialMessageTimer; + private _partialMessageTimeout; + constructor(readable: NodeJS.ReadableStream, encoding?: string); + partialMessageTimeout: number; + listen(callback: DataCallback): void; + private onData(data); + private clearPartialMessageTimer(); + private setPartialMessageTimer(); +} +export declare class IPCMessageReader extends AbstractMessageReader implements MessageReader { + private process; + constructor(process: NodeJS.Process | ChildProcess); + listen(callback: DataCallback): void; +} +export declare class SocketMessageReader extends StreamMessageReader { + constructor(socket: Socket, encoding?: string); +} diff --git a/node_modules/vscode-jsonrpc/lib/messageReader.js b/node_modules/vscode-jsonrpc/lib/messageReader.js new file mode 100644 index 0000000..3bd9d09 --- /dev/null +++ b/node_modules/vscode-jsonrpc/lib/messageReader.js @@ -0,0 +1,249 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +'use strict'; +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var events_1 = require("./events"); +var is = require("./is"); +var DefaultSize = 8192; +var CR = new Buffer('\r', 'ascii')[0]; +var LF = new Buffer('\n', 'ascii')[0]; +var CRLF = '\r\n'; +var MessageBuffer = (function () { + function MessageBuffer(encoding) { + if (encoding === void 0) { encoding = 'utf-8'; } + this.encoding = encoding; + this.index = 0; + this.buffer = new Buffer(DefaultSize); + } + MessageBuffer.prototype.append = function (chunk) { + var toAppend = chunk; + if (typeof (chunk) == 'string') { + var str = chunk; + var bufferLen = Buffer.byteLength(str, this.encoding); + toAppend = new Buffer(bufferLen); + toAppend.write(str, 0, bufferLen, this.encoding); + } + if (this.buffer.length - this.index >= toAppend.length) { + toAppend.copy(this.buffer, this.index, 0, toAppend.length); + } + else { + var newSize = (Math.ceil((this.index + toAppend.length) / DefaultSize) + 1) * DefaultSize; + if (this.index === 0) { + this.buffer = new Buffer(newSize); + toAppend.copy(this.buffer, 0, 0, toAppend.length); + } + else { + this.buffer = Buffer.concat([this.buffer.slice(0, this.index), toAppend], newSize); + } + } + this.index += toAppend.length; + }; + MessageBuffer.prototype.tryReadHeaders = function () { + var result = undefined; + var current = 0; + while (current + 3 < this.index && (this.buffer[current] !== CR || this.buffer[current + 1] !== LF || this.buffer[current + 2] !== CR || this.buffer[current + 3] !== LF)) { + current++; + } + // No header / body separator found (e.g CRLFCRLF) + if (current + 3 >= this.index) { + return result; + } + result = Object.create(null); + var headers = this.buffer.toString('ascii', 0, current).split(CRLF); + headers.forEach(function (header) { + var index = header.indexOf(':'); + if (index === -1) { + throw new Error('Message header must separate key and value using :'); + } + var key = header.substr(0, index); + var value = header.substr(index + 1).trim(); + result[key] = value; + }); + var nextStart = current + 4; + this.buffer = this.buffer.slice(nextStart); + this.index = this.index - nextStart; + return result; + }; + MessageBuffer.prototype.tryReadContent = function (length) { + if (this.index < length) { + return null; + } + var result = this.buffer.toString(this.encoding, 0, length); + var nextStart = length; + this.buffer.copy(this.buffer, 0, nextStart); + this.index = this.index - nextStart; + return result; + }; + Object.defineProperty(MessageBuffer.prototype, "numberOfBytes", { + get: function () { + return this.index; + }, + enumerable: true, + configurable: true + }); + return MessageBuffer; +}()); +var AbstractMessageReader = (function () { + function AbstractMessageReader() { + this.errorEmitter = new events_1.Emitter(); + this.closeEmitter = new events_1.Emitter(); + this.partialMessageEmitter = new events_1.Emitter(); + } + Object.defineProperty(AbstractMessageReader.prototype, "onError", { + get: function () { + return this.errorEmitter.event; + }, + enumerable: true, + configurable: true + }); + AbstractMessageReader.prototype.fireError = function (error) { + this.errorEmitter.fire(this.asError(error)); + }; + Object.defineProperty(AbstractMessageReader.prototype, "onClose", { + get: function () { + return this.closeEmitter.event; + }, + enumerable: true, + configurable: true + }); + AbstractMessageReader.prototype.fireClose = function () { + this.closeEmitter.fire(undefined); + }; + Object.defineProperty(AbstractMessageReader.prototype, "onPartialMessage", { + get: function () { + return this.partialMessageEmitter.event; + }, + enumerable: true, + configurable: true + }); + AbstractMessageReader.prototype.firePartialMessage = function (info) { + this.partialMessageEmitter.fire(info); + }; + AbstractMessageReader.prototype.asError = function (error) { + if (error instanceof Error) { + return error; + } + else { + return new Error("Reader recevied error. Reason: " + (is.string(error.message) ? error.message : 'unknown')); + } + }; + return AbstractMessageReader; +}()); +exports.AbstractMessageReader = AbstractMessageReader; +var StreamMessageReader = (function (_super) { + __extends(StreamMessageReader, _super); + function StreamMessageReader(readable, encoding) { + if (encoding === void 0) { encoding = 'utf-8'; } + var _this = _super.call(this) || this; + _this.readable = readable; + _this.buffer = new MessageBuffer(encoding); + _this._partialMessageTimeout = 10000; + return _this; + } + Object.defineProperty(StreamMessageReader.prototype, "partialMessageTimeout", { + get: function () { + return this._partialMessageTimeout; + }, + set: function (timeout) { + this._partialMessageTimeout = timeout; + }, + enumerable: true, + configurable: true + }); + StreamMessageReader.prototype.listen = function (callback) { + var _this = this; + this.nextMessageLength = -1; + this.messageToken = 0; + this.partialMessageTimer = undefined; + this.callback = callback; + this.readable.on('data', function (data) { + _this.onData(data); + }); + this.readable.on('error', function (error) { return _this.fireError(error); }); + this.readable.on('close', function () { return _this.fireClose(); }); + }; + StreamMessageReader.prototype.onData = function (data) { + this.buffer.append(data); + while (true) { + if (this.nextMessageLength === -1) { + var headers = this.buffer.tryReadHeaders(); + if (!headers) { + return; + } + var contentLength = headers['Content-Length']; + if (!contentLength) { + throw new Error('Header must provide a Content-Length property.'); + } + var length = parseInt(contentLength); + if (isNaN(length)) { + throw new Error('Content-Length value must be a number.'); + } + this.nextMessageLength = length; + } + var msg = this.buffer.tryReadContent(this.nextMessageLength); + if (msg === null) { + /** We haven't recevied the full message yet. */ + this.setPartialMessageTimer(); + return; + } + this.clearPartialMessageTimer(); + this.nextMessageLength = -1; + this.messageToken++; + var json = JSON.parse(msg); + this.callback(json); + } + }; + StreamMessageReader.prototype.clearPartialMessageTimer = function () { + if (this.partialMessageTimer) { + clearTimeout(this.partialMessageTimer); + this.partialMessageTimer = undefined; + } + }; + StreamMessageReader.prototype.setPartialMessageTimer = function () { + var _this = this; + this.clearPartialMessageTimer(); + if (this._partialMessageTimeout <= 0) { + return; + } + this.partialMessageTimer = setTimeout(function (token, timeout) { + _this.partialMessageTimer = undefined; + if (token === _this.messageToken) { + _this.firePartialMessage({ messageToken: token, waitingTime: timeout }); + _this.setPartialMessageTimer(); + } + }, this._partialMessageTimeout, this.messageToken, this._partialMessageTimeout); + }; + return StreamMessageReader; +}(AbstractMessageReader)); +exports.StreamMessageReader = StreamMessageReader; +var IPCMessageReader = (function (_super) { + __extends(IPCMessageReader, _super); + function IPCMessageReader(process) { + var _this = _super.call(this) || this; + _this.process = process; + var eventEmitter = _this.process; + eventEmitter.on('error', function (error) { return _this.fireError(error); }); + eventEmitter.on('close', function () { return _this.fireClose(); }); + return _this; + } + IPCMessageReader.prototype.listen = function (callback) { + this.process.on('message', callback); + }; + return IPCMessageReader; +}(AbstractMessageReader)); +exports.IPCMessageReader = IPCMessageReader; +var SocketMessageReader = (function (_super) { + __extends(SocketMessageReader, _super); + function SocketMessageReader(socket, encoding) { + if (encoding === void 0) { encoding = 'utf-8'; } + return _super.call(this, socket, encoding) || this; + } + return SocketMessageReader; +}(StreamMessageReader)); +exports.SocketMessageReader = SocketMessageReader; diff --git a/node_modules/vscode-jsonrpc/lib/messageWriter.d.ts b/node_modules/vscode-jsonrpc/lib/messageWriter.d.ts new file mode 100644 index 0000000..204e030 --- /dev/null +++ b/node_modules/vscode-jsonrpc/lib/messageWriter.d.ts @@ -0,0 +1,47 @@ +/// +import { ChildProcess } from 'child_process'; +import { Socket } from 'net'; +import { Message } from './messages'; +import { Event } from './events'; +export interface MessageWriter { + readonly onError: Event<[Error, Message | undefined, number | undefined]>; + readonly onClose: Event; + write(msg: Message): void; +} +export declare abstract class AbstractMessageWriter { + private errorEmitter; + private closeEmitter; + constructor(); + readonly onError: Event<[Error, Message, number]>; + protected fireError(error: any, message?: Message, count?: number): void; + readonly onClose: Event; + protected fireClose(): void; + private asError(error); +} +export declare class StreamMessageWriter extends AbstractMessageWriter implements MessageWriter { + private writable; + private encoding; + private errorCount; + constructor(writable: NodeJS.WritableStream, encoding?: string); + write(msg: Message): void; +} +export declare class IPCMessageWriter extends AbstractMessageWriter implements MessageWriter { + private process; + private queue; + private sending; + private errorCount; + constructor(process: NodeJS.Process | ChildProcess); + write(msg: Message): void; + doWriteMessage(msg: Message): void; +} +export declare class SocketMessageWriter extends AbstractMessageWriter implements MessageWriter { + private socket; + private queue; + private sending; + private encoding; + private errorCount; + constructor(socket: Socket, encoding?: string); + write(msg: Message): void; + doWriteMessage(msg: Message): void; + private handleError(error, msg); +} diff --git a/node_modules/vscode-jsonrpc/lib/messageWriter.js b/node_modules/vscode-jsonrpc/lib/messageWriter.js new file mode 100644 index 0000000..8dc7185 --- /dev/null +++ b/node_modules/vscode-jsonrpc/lib/messageWriter.js @@ -0,0 +1,203 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +'use strict'; +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var events_1 = require("./events"); +var is = require("./is"); +var ContentLength = 'Content-Length: '; +var CRLF = '\r\n'; +var AbstractMessageWriter = (function () { + function AbstractMessageWriter() { + this.errorEmitter = new events_1.Emitter(); + this.closeEmitter = new events_1.Emitter(); + } + Object.defineProperty(AbstractMessageWriter.prototype, "onError", { + get: function () { + return this.errorEmitter.event; + }, + enumerable: true, + configurable: true + }); + AbstractMessageWriter.prototype.fireError = function (error, message, count) { + this.errorEmitter.fire([this.asError(error), message, count]); + }; + Object.defineProperty(AbstractMessageWriter.prototype, "onClose", { + get: function () { + return this.closeEmitter.event; + }, + enumerable: true, + configurable: true + }); + AbstractMessageWriter.prototype.fireClose = function () { + this.closeEmitter.fire(undefined); + }; + AbstractMessageWriter.prototype.asError = function (error) { + if (error instanceof Error) { + return error; + } + else { + return new Error("Writer recevied error. Reason: " + (is.string(error.message) ? error.message : 'unknown')); + } + }; + return AbstractMessageWriter; +}()); +exports.AbstractMessageWriter = AbstractMessageWriter; +var StreamMessageWriter = (function (_super) { + __extends(StreamMessageWriter, _super); + function StreamMessageWriter(writable, encoding) { + if (encoding === void 0) { encoding = 'utf8'; } + var _this = _super.call(this) || this; + _this.writable = writable; + _this.encoding = encoding; + _this.errorCount = 0; + _this.writable.on('error', function (error) { return _this.fireError(error); }); + _this.writable.on('close', function () { return _this.fireClose(); }); + return _this; + } + StreamMessageWriter.prototype.write = function (msg) { + var json = JSON.stringify(msg); + var contentLength = Buffer.byteLength(json, this.encoding); + var headers = [ + ContentLength, contentLength.toString(), CRLF, + CRLF + ]; + try { + // Header must be written in ASCII encoding + this.writable.write(headers.join(''), 'ascii'); + // Now write the content. This can be written in any encoding + this.writable.write(json, this.encoding); + this.errorCount = 0; + } + catch (error) { + this.errorCount++; + this.fireError(error, msg, this.errorCount); + } + }; + return StreamMessageWriter; +}(AbstractMessageWriter)); +exports.StreamMessageWriter = StreamMessageWriter; +var IPCMessageWriter = (function (_super) { + __extends(IPCMessageWriter, _super); + function IPCMessageWriter(process) { + var _this = _super.call(this) || this; + _this.process = process; + _this.errorCount = 0; + _this.queue = []; + _this.sending = false; + var eventEmitter = _this.process; + eventEmitter.on('error', function (error) { return _this.fireError(error); }); + eventEmitter.on('close', function () { return _this.fireClose; }); + return _this; + } + IPCMessageWriter.prototype.write = function (msg) { + if (!this.sending && this.queue.length === 0) { + // See https://github.com/nodejs/node/issues/7657 + this.doWriteMessage(msg); + } + else { + this.queue.push(msg); + } + }; + IPCMessageWriter.prototype.doWriteMessage = function (msg) { + var _this = this; + try { + if (this.process.send) { + this.sending = true; + this.process.send(msg, undefined, undefined, function (error) { + _this.sending = false; + if (error) { + _this.errorCount++; + _this.fireError(error, msg, _this.errorCount); + } + else { + _this.errorCount = 0; + } + if (_this.queue.length > 0) { + _this.doWriteMessage(_this.queue.shift()); + } + }); + } + } + catch (error) { + this.errorCount++; + this.fireError(error, msg, this.errorCount); + } + }; + return IPCMessageWriter; +}(AbstractMessageWriter)); +exports.IPCMessageWriter = IPCMessageWriter; +var SocketMessageWriter = (function (_super) { + __extends(SocketMessageWriter, _super); + function SocketMessageWriter(socket, encoding) { + if (encoding === void 0) { encoding = 'utf8'; } + var _this = _super.call(this) || this; + _this.socket = socket; + _this.queue = []; + _this.sending = false; + _this.encoding = encoding; + _this.errorCount = 0; + _this.socket.on('error', function (error) { return _this.fireError(error); }); + _this.socket.on('close', function () { return _this.fireClose(); }); + return _this; + } + SocketMessageWriter.prototype.write = function (msg) { + if (!this.sending && this.queue.length === 0) { + // See https://github.com/nodejs/node/issues/7657 + this.doWriteMessage(msg); + } + else { + this.queue.push(msg); + } + }; + SocketMessageWriter.prototype.doWriteMessage = function (msg) { + var _this = this; + var json = JSON.stringify(msg); + var contentLength = Buffer.byteLength(json, this.encoding); + var headers = [ + ContentLength, contentLength.toString(), CRLF, + CRLF + ]; + try { + // Header must be written in ASCII encoding + this.sending = true; + this.socket.write(headers.join(''), 'ascii', function (error) { + if (error) { + _this.handleError(error, msg); + } + try { + // Now write the content. This can be written in any encoding + _this.socket.write(json, _this.encoding, function (error) { + _this.sending = false; + if (error) { + _this.handleError(error, msg); + } + else { + _this.errorCount = 0; + } + if (_this.queue.length > 0) { + _this.doWriteMessage(_this.queue.shift()); + } + }); + } + catch (error) { + _this.handleError(error, msg); + } + }); + } + catch (error) { + this.handleError(error, msg); + } + }; + SocketMessageWriter.prototype.handleError = function (error, msg) { + this.errorCount++; + this.fireError(error, msg, this.errorCount); + }; + return SocketMessageWriter; +}(AbstractMessageWriter)); +exports.SocketMessageWriter = SocketMessageWriter; diff --git a/node_modules/vscode-jsonrpc/lib/messages.d.ts b/node_modules/vscode-jsonrpc/lib/messages.d.ts new file mode 100644 index 0000000..11e3e46 --- /dev/null +++ b/node_modules/vscode-jsonrpc/lib/messages.d.ts @@ -0,0 +1,221 @@ +/** + * A language server message + */ +export interface Message { + jsonrpc: string; +} +/** + * Request message + */ +export interface RequestMessage extends Message { + /** + * The request id. + */ + id: number | string; + /** + * The method to be invoked. + */ + method: string; + /** + * The method's params. + */ + params?: any; +} +/** + * Predefined error codes. + */ +export declare namespace ErrorCodes { + const ParseError: number; + const InvalidRequest: number; + const MethodNotFound: number; + const InvalidParams: number; + const InternalError: number; + const serverErrorStart: number; + const serverErrorEnd: number; + const ServerNotInitialized: number; + const UnknownErrorCode: number; + const MessageWriteError: number; + const MessageReadError: number; +} +export interface ResponseErrorLiteral { + /** + * A number indicating the error type that occured. + */ + code: number; + /** + * A string providing a short decription of the error. + */ + message: string; + /** + * A Primitive or Structured value that contains additional + * information about the error. Can be omitted. + */ + data?: D; +} +/** + * A error object return in a response in case a request + * has failed. + */ +export declare class ResponseError extends Error { + readonly code: number; + readonly data: D; + constructor(code: number, message: string, data?: D); + toJson(): ResponseErrorLiteral; +} +/** + * A response message. + */ +export interface ResponseMessage extends Message { + /** + * The request id. + */ + id: number | string; + /** + * The result of a request. This can be omitted in + * the case of an error. + */ + result?: any; + /** + * The error object in case a request fails. + */ + error?: ResponseErrorLiteral; +} +/** + * An interface to type messages. + */ +export interface MessageType { + readonly method: string; + readonly numberOfParams: number; +} +/** + * An abstract implementation of a MessageType. + */ +export declare abstract class AbstractMessageType implements MessageType { + private _method; + private _numberOfParams; + constructor(_method: string, _numberOfParams: number); + readonly method: string; + readonly numberOfParams: number; +} +/** + * End marker interface for request and notification types. + */ +export interface _EM { + _$endMarker$_: number; +} +/** + * Classes to type request response pairs + */ +export declare class RequestType0 extends AbstractMessageType { + private _?; + constructor(method: string); +} +export declare class RequestType extends AbstractMessageType { + private _?; + constructor(method: string); +} +export declare class RequestType1 extends AbstractMessageType { + private _?; + constructor(method: string); +} +export declare class RequestType2 extends AbstractMessageType { + private _?; + constructor(method: string); +} +export declare class RequestType3 extends AbstractMessageType { + private _?; + constructor(method: string); +} +export declare class RequestType4 extends AbstractMessageType { + private _?; + constructor(method: string); +} +export declare class RequestType5 extends AbstractMessageType { + private _?; + constructor(method: string); +} +export declare class RequestType6 extends AbstractMessageType { + private _?; + constructor(method: string); +} +export declare class RequestType7 extends AbstractMessageType { + private _?; + constructor(method: string); +} +export declare class RequestType8 extends AbstractMessageType { + private _?; + constructor(method: string); +} +export declare class RequestType9 extends AbstractMessageType { + private _?; + constructor(method: string); +} +/** + * Notification Message + */ +export interface NotificationMessage extends Message { + /** + * The method to be invoked. + */ + method: string; + /** + * The notification's params. + */ + params?: any; +} +export declare class NotificationType extends AbstractMessageType { + private _?; + constructor(method: string); +} +export declare class NotificationType0 extends AbstractMessageType { + private _?; + constructor(method: string); +} +export declare class NotificationType1 extends AbstractMessageType { + private _?; + constructor(method: string); +} +export declare class NotificationType2 extends AbstractMessageType { + private _?; + constructor(method: string); +} +export declare class NotificationType3 extends AbstractMessageType { + private _?; + constructor(method: string); +} +export declare class NotificationType4 extends AbstractMessageType { + private _?; + constructor(method: string); +} +export declare class NotificationType5 extends AbstractMessageType { + private _?; + constructor(method: string); +} +export declare class NotificationType6 extends AbstractMessageType { + private _?; + constructor(method: string); +} +export declare class NotificationType7 extends AbstractMessageType { + private _?; + constructor(method: string); +} +export declare class NotificationType8 extends AbstractMessageType { + private _?; + constructor(method: string); +} +export declare class NotificationType9 extends AbstractMessageType { + private _?; + constructor(method: string); +} +/** + * Tests if the given message is a request message + */ +export declare function isRequestMessage(message: Message): message is RequestMessage; +/** + * Tests if the given message is a notification message + */ +export declare function isNotificationMessage(message: Message): message is NotificationMessage; +/** + * Tests if the given message is a response message + */ +export declare function isReponseMessage(message: Message): message is ResponseMessage; diff --git a/node_modules/vscode-jsonrpc/lib/messages.js b/node_modules/vscode-jsonrpc/lib/messages.js new file mode 100644 index 0000000..b24f051 --- /dev/null +++ b/node_modules/vscode-jsonrpc/lib/messages.js @@ -0,0 +1,331 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +'use strict'; +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var is = require("./is"); +/** + * Predefined error codes. + */ +var ErrorCodes; +(function (ErrorCodes) { + // Defined by JSON RPC + ErrorCodes.ParseError = -32700; + ErrorCodes.InvalidRequest = -32600; + ErrorCodes.MethodNotFound = -32601; + ErrorCodes.InvalidParams = -32602; + ErrorCodes.InternalError = -32603; + ErrorCodes.serverErrorStart = -32099; + ErrorCodes.serverErrorEnd = -32000; + ErrorCodes.ServerNotInitialized = -32002; + ErrorCodes.UnknownErrorCode = -32001; + // Defined by VSCode. + ErrorCodes.MessageWriteError = 1; + ErrorCodes.MessageReadError = 2; +})(ErrorCodes = exports.ErrorCodes || (exports.ErrorCodes = {})); +/** + * A error object return in a response in case a request + * has failed. + */ +var ResponseError = (function (_super) { + __extends(ResponseError, _super); + function ResponseError(code, message, data) { + var _this = _super.call(this, message) || this; + _this.code = is.number(code) ? code : ErrorCodes.UnknownErrorCode; + if (data !== void 0) { + _this.data = data; + } + Object.setPrototypeOf(_this, ResponseError.prototype); + return _this; + } + ResponseError.prototype.toJson = function () { + var result = { + code: this.code, + message: this.message + }; + if (this.data !== void 0) { + result.data = this.data; + } + ; + return result; + }; + return ResponseError; +}(Error)); +exports.ResponseError = ResponseError; +/** + * An abstract implementation of a MessageType. + */ +var AbstractMessageType = (function () { + function AbstractMessageType(_method, _numberOfParams) { + this._method = _method; + this._numberOfParams = _numberOfParams; + } + Object.defineProperty(AbstractMessageType.prototype, "method", { + get: function () { + return this._method; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMessageType.prototype, "numberOfParams", { + get: function () { + return this._numberOfParams; + }, + enumerable: true, + configurable: true + }); + return AbstractMessageType; +}()); +exports.AbstractMessageType = AbstractMessageType; +/** + * Classes to type request response pairs + */ +var RequestType0 = (function (_super) { + __extends(RequestType0, _super); + function RequestType0(method) { + var _this = _super.call(this, method, 0) || this; + _this._ = undefined; + return _this; + } + return RequestType0; +}(AbstractMessageType)); +exports.RequestType0 = RequestType0; +var RequestType = (function (_super) { + __extends(RequestType, _super); + function RequestType(method) { + var _this = _super.call(this, method, 1) || this; + _this._ = undefined; + return _this; + } + return RequestType; +}(AbstractMessageType)); +exports.RequestType = RequestType; +var RequestType1 = (function (_super) { + __extends(RequestType1, _super); + function RequestType1(method) { + var _this = _super.call(this, method, 1) || this; + _this._ = undefined; + return _this; + } + return RequestType1; +}(AbstractMessageType)); +exports.RequestType1 = RequestType1; +var RequestType2 = (function (_super) { + __extends(RequestType2, _super); + function RequestType2(method) { + var _this = _super.call(this, method, 2) || this; + _this._ = undefined; + return _this; + } + return RequestType2; +}(AbstractMessageType)); +exports.RequestType2 = RequestType2; +var RequestType3 = (function (_super) { + __extends(RequestType3, _super); + function RequestType3(method) { + var _this = _super.call(this, method, 3) || this; + _this._ = undefined; + return _this; + } + return RequestType3; +}(AbstractMessageType)); +exports.RequestType3 = RequestType3; +var RequestType4 = (function (_super) { + __extends(RequestType4, _super); + function RequestType4(method) { + var _this = _super.call(this, method, 4) || this; + _this._ = undefined; + return _this; + } + return RequestType4; +}(AbstractMessageType)); +exports.RequestType4 = RequestType4; +var RequestType5 = (function (_super) { + __extends(RequestType5, _super); + function RequestType5(method) { + var _this = _super.call(this, method, 5) || this; + _this._ = undefined; + return _this; + } + return RequestType5; +}(AbstractMessageType)); +exports.RequestType5 = RequestType5; +var RequestType6 = (function (_super) { + __extends(RequestType6, _super); + function RequestType6(method) { + var _this = _super.call(this, method, 6) || this; + _this._ = undefined; + return _this; + } + return RequestType6; +}(AbstractMessageType)); +exports.RequestType6 = RequestType6; +var RequestType7 = (function (_super) { + __extends(RequestType7, _super); + function RequestType7(method) { + var _this = _super.call(this, method, 7) || this; + _this._ = undefined; + return _this; + } + return RequestType7; +}(AbstractMessageType)); +exports.RequestType7 = RequestType7; +var RequestType8 = (function (_super) { + __extends(RequestType8, _super); + function RequestType8(method) { + var _this = _super.call(this, method, 8) || this; + _this._ = undefined; + return _this; + } + return RequestType8; +}(AbstractMessageType)); +exports.RequestType8 = RequestType8; +var RequestType9 = (function (_super) { + __extends(RequestType9, _super); + function RequestType9(method) { + var _this = _super.call(this, method, 9) || this; + _this._ = undefined; + return _this; + } + return RequestType9; +}(AbstractMessageType)); +exports.RequestType9 = RequestType9; +var NotificationType = (function (_super) { + __extends(NotificationType, _super); + function NotificationType(method) { + var _this = _super.call(this, method, 1) || this; + _this._ = undefined; + return _this; + } + return NotificationType; +}(AbstractMessageType)); +exports.NotificationType = NotificationType; +var NotificationType0 = (function (_super) { + __extends(NotificationType0, _super); + function NotificationType0(method) { + var _this = _super.call(this, method, 0) || this; + _this._ = undefined; + return _this; + } + return NotificationType0; +}(AbstractMessageType)); +exports.NotificationType0 = NotificationType0; +var NotificationType1 = (function (_super) { + __extends(NotificationType1, _super); + function NotificationType1(method) { + var _this = _super.call(this, method, 1) || this; + _this._ = undefined; + return _this; + } + return NotificationType1; +}(AbstractMessageType)); +exports.NotificationType1 = NotificationType1; +var NotificationType2 = (function (_super) { + __extends(NotificationType2, _super); + function NotificationType2(method) { + var _this = _super.call(this, method, 2) || this; + _this._ = undefined; + return _this; + } + return NotificationType2; +}(AbstractMessageType)); +exports.NotificationType2 = NotificationType2; +var NotificationType3 = (function (_super) { + __extends(NotificationType3, _super); + function NotificationType3(method) { + var _this = _super.call(this, method, 3) || this; + _this._ = undefined; + return _this; + } + return NotificationType3; +}(AbstractMessageType)); +exports.NotificationType3 = NotificationType3; +var NotificationType4 = (function (_super) { + __extends(NotificationType4, _super); + function NotificationType4(method) { + var _this = _super.call(this, method, 4) || this; + _this._ = undefined; + return _this; + } + return NotificationType4; +}(AbstractMessageType)); +exports.NotificationType4 = NotificationType4; +var NotificationType5 = (function (_super) { + __extends(NotificationType5, _super); + function NotificationType5(method) { + var _this = _super.call(this, method, 5) || this; + _this._ = undefined; + return _this; + } + return NotificationType5; +}(AbstractMessageType)); +exports.NotificationType5 = NotificationType5; +var NotificationType6 = (function (_super) { + __extends(NotificationType6, _super); + function NotificationType6(method) { + var _this = _super.call(this, method, 6) || this; + _this._ = undefined; + return _this; + } + return NotificationType6; +}(AbstractMessageType)); +exports.NotificationType6 = NotificationType6; +var NotificationType7 = (function (_super) { + __extends(NotificationType7, _super); + function NotificationType7(method) { + var _this = _super.call(this, method, 7) || this; + _this._ = undefined; + return _this; + } + return NotificationType7; +}(AbstractMessageType)); +exports.NotificationType7 = NotificationType7; +var NotificationType8 = (function (_super) { + __extends(NotificationType8, _super); + function NotificationType8(method) { + var _this = _super.call(this, method, 8) || this; + _this._ = undefined; + return _this; + } + return NotificationType8; +}(AbstractMessageType)); +exports.NotificationType8 = NotificationType8; +var NotificationType9 = (function (_super) { + __extends(NotificationType9, _super); + function NotificationType9(method) { + var _this = _super.call(this, method, 9) || this; + _this._ = undefined; + return _this; + } + return NotificationType9; +}(AbstractMessageType)); +exports.NotificationType9 = NotificationType9; +/** + * Tests if the given message is a request message + */ +function isRequestMessage(message) { + var candidate = message; + return candidate && is.string(candidate.method) && (is.string(candidate.id) || is.number(candidate.id)); +} +exports.isRequestMessage = isRequestMessage; +/** + * Tests if the given message is a notification message + */ +function isNotificationMessage(message) { + var candidate = message; + return candidate && is.string(candidate.method) && message.id === void 0; +} +exports.isNotificationMessage = isNotificationMessage; +/** + * Tests if the given message is a response message + */ +function isReponseMessage(message) { + var candidate = message; + return candidate && (candidate.result !== void 0 || !!candidate.error) && (is.string(candidate.id) || is.number(candidate.id)); +} +exports.isReponseMessage = isReponseMessage; diff --git a/node_modules/vscode-jsonrpc/lib/pipeSupport.d.ts b/node_modules/vscode-jsonrpc/lib/pipeSupport.d.ts new file mode 100644 index 0000000..190d5a8 --- /dev/null +++ b/node_modules/vscode-jsonrpc/lib/pipeSupport.d.ts @@ -0,0 +1,8 @@ +import { MessageReader } from './messageReader'; +import { MessageWriter } from './messageWriter'; +export declare function generateRandomPipeName(): string; +export interface PipeTransport { + onConnected(): Thenable<[MessageReader, MessageWriter]>; +} +export declare function createClientPipeTransport(pipeName: string, encoding?: string): Thenable; +export declare function createServerPipeTransport(pipeName: string, encoding?: string): [MessageReader, MessageWriter]; diff --git a/node_modules/vscode-jsonrpc/lib/pipeSupport.js b/node_modules/vscode-jsonrpc/lib/pipeSupport.js new file mode 100644 index 0000000..10092ad --- /dev/null +++ b/node_modules/vscode-jsonrpc/lib/pipeSupport.js @@ -0,0 +1,55 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +'use strict'; +var path_1 = require("path"); +var os_1 = require("os"); +var crypto_1 = require("crypto"); +var net_1 = require("net"); +var messageReader_1 = require("./messageReader"); +var messageWriter_1 = require("./messageWriter"); +function generateRandomPipeName() { + var randomSuffix = crypto_1.randomBytes(21).toString('hex'); + if (process.platform === 'win32') { + return "\\\\.\\pipe\\vscode-" + randomSuffix + "-sock"; + } + else { + // Mac/Unix: use socket file + return path_1.join(os_1.tmpdir(), "vscode-" + randomSuffix + ".sock"); + } +} +exports.generateRandomPipeName = generateRandomPipeName; +function createClientPipeTransport(pipeName, encoding) { + if (encoding === void 0) { encoding = 'utf-8'; } + var connectResolve; + var connected = new Promise(function (resolve, _reject) { + connectResolve = resolve; + }); + return new Promise(function (resolve, reject) { + var server = net_1.createServer(function (socket) { + server.close(); + connectResolve([ + new messageReader_1.SocketMessageReader(socket, encoding), + new messageWriter_1.SocketMessageWriter(socket, encoding) + ]); + }); + server.on('error', reject); + server.listen(pipeName, function () { + server.removeListener('error', reject); + resolve({ + onConnected: function () { return connected; } + }); + }); + }); +} +exports.createClientPipeTransport = createClientPipeTransport; +function createServerPipeTransport(pipeName, encoding) { + if (encoding === void 0) { encoding = 'utf-8'; } + var socket = net_1.createConnection(pipeName); + return [ + new messageReader_1.SocketMessageReader(socket, encoding), + new messageWriter_1.SocketMessageWriter(socket, encoding) + ]; +} +exports.createServerPipeTransport = createServerPipeTransport; diff --git a/node_modules/vscode-jsonrpc/lib/thenable.d.ts b/node_modules/vscode-jsonrpc/lib/thenable.d.ts new file mode 100644 index 0000000..a6d43eb --- /dev/null +++ b/node_modules/vscode-jsonrpc/lib/thenable.d.ts @@ -0,0 +1,2 @@ +interface Thenable extends PromiseLike { +} diff --git a/node_modules/vscode-jsonrpc/lib/thenable.js b/node_modules/vscode-jsonrpc/lib/thenable.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/vscode-jsonrpc/package.json b/node_modules/vscode-jsonrpc/package.json new file mode 100644 index 0000000..d8cab19 --- /dev/null +++ b/node_modules/vscode-jsonrpc/package.json @@ -0,0 +1,127 @@ +{ + "_args": [ + [ + { + "raw": "vscode-jsonrpc@^3.1.0", + "scope": null, + "escapedName": "vscode-jsonrpc", + "name": "vscode-jsonrpc", + "rawSpec": "^3.1.0", + "spec": ">=3.1.0 <4.0.0", + "type": "range" + }, + "C:\\Users\\Jan Brodersen\\.vscode\\extensions\\Examples\\vscode-languageserver-node-example\\client\\node_modules\\vscode-languageclient" + ] + ], + "_from": "vscode-jsonrpc@>=3.1.0 <4.0.0", + "_id": "vscode-jsonrpc@3.1.0", + "_inCache": true, + "_installable": true, + "_location": "/vscode-jsonrpc", + "_nodeVersion": "6.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/vscode-jsonrpc-3.1.0.tgz_1488368125378_0.17436180403456092" + }, + "_npmUser": { + "name": "dbaeumer", + "email": "dirk.baeumer@gmail.com" + }, + "_npmVersion": "3.10.8", + "_phantomChildren": {}, + "_requested": { + "raw": "vscode-jsonrpc@^3.1.0", + "scope": null, + "escapedName": "vscode-jsonrpc", + "name": "vscode-jsonrpc", + "rawSpec": "^3.1.0", + "spec": ">=3.1.0 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/vscode-languageclient" + ], + "_resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-3.1.0.tgz", + "_shasum": "d18d44bcf265025d291211b8a489f6f38212d6ec", + "_shrinkwrap": null, + "_spec": "vscode-jsonrpc@^3.1.0", + "_where": "C:\\Users\\Jan Brodersen\\.vscode\\extensions\\Examples\\vscode-languageserver-node-example\\client\\node_modules\\vscode-languageclient", + "author": { + "name": "Microsoft Corporation" + }, + "bugs": { + "url": "https://github.com/Microsoft/vscode-languageserver-node/issues" + }, + "dependencies": {}, + "description": "A json rpc implementation over streams", + "devDependencies": { + "@types/mocha": "^2.2.32", + "@types/node": "^6.0.42", + "mocha": "^3.1.0", + "typescript": "^2.1.5" + }, + "directories": {}, + "dist": { + "shasum": "d18d44bcf265025d291211b8a489f6f38212d6ec", + "tarball": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-3.1.0.tgz" + }, + "engines": { + "node": ">=4.0.0 || >=6.0.0" + }, + "homepage": "https://github.com/Microsoft/vscode-languageserver-node#readme", + "license": "MIT", + "main": "./lib/main.js", + "maintainers": [ + { + "name": "aeschli", + "email": "martinae@microsoft.com" + }, + { + "name": "alexandrudima", + "email": "alexdima@microsoft.com" + }, + { + "name": "bpasero", + "email": "benjpas@microsoft.com" + }, + { + "name": "chrisdias", + "email": "cdias@microsoft.com" + }, + { + "name": "dbaeumer", + "email": "dirk.baeumer@gmail.com" + }, + { + "name": "egamma", + "email": "egamma@microsoft.com" + }, + { + "name": "isidor", + "email": "inikolic@microsoft.com" + }, + { + "name": "joaomoreno.ms", + "email": "joao.moreno@microsoft.com" + }, + { + "name": "jrieken", + "email": "jrieken@microsoft.com" + } + ], + "name": "vscode-jsonrpc", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/Microsoft/vscode-languageserver-node.git" + }, + "scripts": { + "compile": "tsc -p ./src", + "prepublish": "tsc -p ./src", + "test": "mocha", + "watch": "tsc -w -p ./src" + }, + "typings": "./lib/main.d.ts", + "version": "3.1.0" +} diff --git a/node_modules/vscode-jsonrpc/thirdpartynotices.txt b/node_modules/vscode-jsonrpc/thirdpartynotices.txt new file mode 100644 index 0000000..4a6720c --- /dev/null +++ b/node_modules/vscode-jsonrpc/thirdpartynotices.txt @@ -0,0 +1,31 @@ +THIRD-PARTY SOFTWARE NOTICES AND INFORMATION +For Microsoft vscode-jsonrpc + +This project incorporates material from the project(s) listed below (collectively, “Third Party Code”). +Microsoft is not the original author of the Third Party Code. The original copyright notice and license +under which Microsoft received such Third Party Code are set out below. This Third Party Code is licensed +to you under their original license terms set forth below. Microsoft reserves all other rights not expressly +granted, whether by implication, estoppel or otherwise. + +1. DefinitelyTyped version 0.0.1 (https://github.com/borisyankov/DefinitelyTyped) + +This project is licensed under the MIT license. +Copyrights are respective of each contributor listed at the beginning of each definition file. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/vscode-languageclient/.npmignore b/node_modules/vscode-languageclient/.npmignore new file mode 100644 index 0000000..2b1e5b1 --- /dev/null +++ b/node_modules/vscode-languageclient/.npmignore @@ -0,0 +1,9 @@ +.vscode/ +lib/test/ +lib/*.map +src/ +test/ +.eslintrc +.gitignore +gulpfile.js +tsd.json \ No newline at end of file diff --git a/node_modules/vscode-languageclient/License.txt b/node_modules/vscode-languageclient/License.txt new file mode 100644 index 0000000..a07e3ae --- /dev/null +++ b/node_modules/vscode-languageclient/License.txt @@ -0,0 +1,11 @@ +Copyright (c) Microsoft Corporation + +All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/vscode-languageclient/README.md b/node_modules/vscode-languageclient/README.md new file mode 100644 index 0000000..8575831 --- /dev/null +++ b/node_modules/vscode-languageclient/README.md @@ -0,0 +1,17 @@ +# VSCode Language Server - Client Module + +[![NPM Version](https://img.shields.io/npm/v/vscode-languageclient.svg)](https://npmjs.org/package/vscode-languageclient) +[![NPM Downloads](https://img.shields.io/npm/dm/vscode-languageclient.svg)](https://npmjs.org/package/vscode-languageclient) +[![Build Status](https://travis-ci.org/Microsoft/vscode-languageserver-node.svg?branch=master)](https://travis-ci.org/Microsoft/vscode-languageserver-node) + +This npm module allows VSCode extensions to easily integrate language servers adhering to the [language server protocol](https://github.com/Microsoft/vscode-languageserver-protocol) + +See [here](https://code.visualstudio.com/docs/extensions/example-language-server) for a detailed documentation on how 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) diff --git a/node_modules/vscode-languageclient/lib/codeConverter.d.ts b/node_modules/vscode-languageclient/lib/codeConverter.d.ts new file mode 100644 index 0000000..626933a --- /dev/null +++ b/node_modules/vscode-languageclient/lib/codeConverter.d.ts @@ -0,0 +1,43 @@ +import * as code from 'vscode'; +import * as types from 'vscode-languageserver-types'; +import * as proto from './protocol'; +export interface Converter { + asUri(uri: code.Uri): string; + asTextDocumentIdentifier(textDocument: code.TextDocument): types.TextDocumentIdentifier; + asOpenTextDocumentParams(textDocument: code.TextDocument): proto.DidOpenTextDocumentParams; + asChangeTextDocumentParams(textDocument: code.TextDocument): proto.DidChangeTextDocumentParams; + asChangeTextDocumentParams(event: code.TextDocumentChangeEvent): proto.DidChangeTextDocumentParams; + asCloseTextDocumentParams(textDocument: code.TextDocument): proto.DidCloseTextDocumentParams; + asSaveTextDocumentParams(textDocument: code.TextDocument, includeContent?: boolean): proto.DidSaveTextDocumentParams; + asWillSaveTextDocumentParams(event: code.TextDocumentWillSaveEvent): proto.WillSaveTextDocumentParams; + asTextDocumentPositionParams(textDocument: code.TextDocument, position: code.Position): proto.TextDocumentPositionParams; + asWorkerPosition(position: code.Position): types.Position; + asPosition(value: code.Position): types.Position; + asPosition(value: undefined): undefined; + asPosition(value: null): null; + asPosition(value: code.Position | undefined | null): types.Position | undefined | null; + asRange(value: code.Range): types.Range; + asRange(value: undefined): undefined; + asRange(value: null): null; + asRange(value: code.Range | undefined | null): types.Range | undefined | null; + asDiagnosticSeverity(value: code.DiagnosticSeverity): number; + asDiagnostic(item: code.Diagnostic): types.Diagnostic; + asDiagnostics(items: code.Diagnostic[]): types.Diagnostic[]; + asCompletionItem(item: code.CompletionItem): types.CompletionItem; + asTextEdit(edit: code.TextEdit): types.TextEdit; + asReferenceParams(textDocument: code.TextDocument, position: code.Position, options: { + includeDeclaration: boolean; + }): proto.ReferenceParams; + asCodeActionContext(context: code.CodeActionContext): types.CodeActionContext; + asCommand(item: code.Command): types.Command; + asCodeLens(item: code.CodeLens): types.CodeLens; + asFormattingOptions(item: code.FormattingOptions): types.FormattingOptions; + asDocumentSymbolParams(textDocument: code.TextDocument): types.DocumentSymbolParams; + asCodeLensParams(textDocument: code.TextDocument): proto.CodeLensParams; + asDocumentLink(item: code.DocumentLink): types.DocumentLink; + asDocumentLinkParams(textDocument: code.TextDocument): proto.DocumentLinkParams; +} +export interface URIConverter { + (value: code.Uri): string; +} +export declare function createConverter(uriConverter?: URIConverter): Converter; diff --git a/node_modules/vscode-languageclient/lib/codeConverter.js b/node_modules/vscode-languageclient/lib/codeConverter.js new file mode 100644 index 0000000..91fe1ed --- /dev/null +++ b/node_modules/vscode-languageclient/lib/codeConverter.js @@ -0,0 +1,324 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +'use strict'; +const code = require("vscode"); +const types = require("vscode-languageserver-types"); +const is = require("./utils/is"); +const protocolCompletionItem_1 = require("./protocolCompletionItem"); +const protocolCodeLens_1 = require("./protocolCodeLens"); +function createConverter(uriConverter) { + const nullConverter = (value) => value.toString(); + const _uriConverter = uriConverter || nullConverter; + function asUri(value) { + return _uriConverter(value); + } + function asTextDocumentIdentifier(textDocument) { + return { + uri: _uriConverter(textDocument.uri) + }; + } + function asVersionedTextDocumentIdentifier(textDocument) { + return { + uri: _uriConverter(textDocument.uri), + version: textDocument.version + }; + } + function asOpenTextDocumentParams(textDocument) { + return { + textDocument: { + uri: _uriConverter(textDocument.uri), + languageId: textDocument.languageId, + version: textDocument.version, + text: textDocument.getText() + } + }; + } + function isTextDocumentChangeEvent(value) { + let candidate = value; + return !!candidate.document && !!candidate.contentChanges; + } + function isTextDocument(value) { + let candidate = value; + return !!candidate.uri && !!candidate.version; + } + function asChangeTextDocumentParams(arg) { + if (isTextDocument(arg)) { + let result = { + textDocument: { + uri: _uriConverter(arg.uri), + version: arg.version + }, + contentChanges: [{ text: arg.getText() }] + }; + return result; + } + else if (isTextDocumentChangeEvent(arg)) { + let document = arg.document; + let result = { + textDocument: { + uri: _uriConverter(document.uri), + version: document.version + }, + contentChanges: arg.contentChanges.map((change) => { + let range = change.range; + return { + range: { + start: { line: range.start.line, character: range.start.character }, + end: { line: range.end.line, character: range.end.character } + }, + rangeLength: change.rangeLength, + text: change.text + }; + }) + }; + return result; + } + else { + throw Error('Unsupported text document change parameter'); + } + } + function asCloseTextDocumentParams(textDocument) { + return { + textDocument: asTextDocumentIdentifier(textDocument) + }; + } + function asSaveTextDocumentParams(textDocument, includeContent = false) { + let result = { + textDocument: asVersionedTextDocumentIdentifier(textDocument) + }; + if (includeContent) { + result.text = textDocument.getText(); + } + return result; + } + function asTextDocumentSaveReason(reason) { + switch (reason) { + case code.TextDocumentSaveReason.Manual: + return types.TextDocumentSaveReason.Manual; + case code.TextDocumentSaveReason.AfterDelay: + return types.TextDocumentSaveReason.AfterDelay; + case code.TextDocumentSaveReason.FocusOut: + return types.TextDocumentSaveReason.FocusOut; + } + return types.TextDocumentSaveReason.Manual; + } + function asWillSaveTextDocumentParams(event) { + return { + textDocument: asTextDocumentIdentifier(event.document), + reason: asTextDocumentSaveReason(event.reason) + }; + } + function asTextDocumentPositionParams(textDocument, position) { + return { + textDocument: asTextDocumentIdentifier(textDocument), + position: asWorkerPosition(position) + }; + } + function asWorkerPosition(position) { + return { line: position.line, character: position.character }; + } + function asPosition(value) { + if (value === void 0) { + return undefined; + } + else if (value === null) { + return null; + } + return { line: value.line, character: value.character }; + } + function asRange(value) { + if (value === void 0 || value === null) { + return value; + } + return { start: asPosition(value.start), end: asPosition(value.end) }; + } + function asDiagnosticSeverity(value) { + switch (value) { + case code.DiagnosticSeverity.Error: + return types.DiagnosticSeverity.Error; + case code.DiagnosticSeverity.Warning: + return types.DiagnosticSeverity.Warning; + case code.DiagnosticSeverity.Information: + return types.DiagnosticSeverity.Information; + case code.DiagnosticSeverity.Hint: + return types.DiagnosticSeverity.Hint; + } + } + function asDiagnostic(item) { + let result = types.Diagnostic.create(asRange(item.range), item.message); + if (item.severity) { + result.severity = asDiagnosticSeverity(item.severity); + } + if (is.number(item.code) || is.string(item.code)) { + result.code = item.code; + } + if (item.source) { + result.source = item.source; + } + return result; + } + function asDiagnostics(items) { + if (items === void 0 || items === null) { + return items; + } + return items.map(asDiagnostic); + } + function asCompletionItem(item) { + let result = { label: item.label }; + if (item.detail) { + result.detail = item.detail; + } + if (item.documentation) { + result.documentation = item.documentation; + } + if (item.filterText) { + result.filterText = item.filterText; + } + fillPrimaryInsertText(result, item); + // Protocol item kind is 1 based, codes item kind is zero based. + if (is.number(item.kind)) { + if (code.CompletionItemKind.Text <= item.kind && item.kind <= code.CompletionItemKind.Reference) { + result.kind = (item.kind + 1); + } + else { + result.kind = types.CompletionItemKind.Text; + } + } + if (item.sortText) { + result.sortText = item.sortText; + } + if (item.additionalTextEdits) { + result.additionalTextEdits = asTextEdits(item.additionalTextEdits); + } + if (item.command) { + result.command = asCommand(item.command); + } + if (item instanceof protocolCompletionItem_1.default && item.data) { + result.data = item.data; + } + return result; + } + function fillPrimaryInsertText(target, source) { + let format = types.InsertTextFormat.PlainText; + let text; + let range = undefined; + if (source.textEdit) { + text = source.textEdit.newText; + range = asRange(source.textEdit.range); + } + else if (source.insertText instanceof code.SnippetString) { + format = types.InsertTextFormat.Snippet; + text = source.insertText.value; + } + else { + text = source.insertText; + } + if (source.range) { + range = asRange(source.range); + } + target.insertTextFormat = format; + if (source.fromEdit && text && range) { + target.textEdit = { newText: text, range: range }; + } + else { + target.insertText = text; + } + } + function asTextEdit(edit) { + return { range: asRange(edit.range), newText: edit.newText }; + } + function asTextEdits(edits) { + if (edits === void 0 || edits === null) { + return edits; + } + return edits.map(asTextEdit); + } + function asReferenceParams(textDocument, position, options) { + return { + textDocument: asTextDocumentIdentifier(textDocument), + position: asWorkerPosition(position), + context: { includeDeclaration: options.includeDeclaration } + }; + } + function asCodeActionContext(context) { + if (context === void 0 || context === null) { + return context; + } + return types.CodeActionContext.create(asDiagnostics(context.diagnostics)); + } + function asCommand(item) { + let result = types.Command.create(item.title, item.command); + if (item.arguments) { + result.arguments = item.arguments; + } + return result; + } + function asCodeLens(item) { + let result = types.CodeLens.create(asRange(item.range)); + if (item.command) { + result.command = asCommand(item.command); + } + if (item instanceof protocolCodeLens_1.default) { + if (item.data) { + result.data = item.data; + } + ; + } + return result; + } + function asFormattingOptions(item) { + return { tabSize: item.tabSize, insertSpaces: item.insertSpaces }; + } + function asDocumentSymbolParams(textDocument) { + return { + textDocument: asTextDocumentIdentifier(textDocument) + }; + } + function asCodeLensParams(textDocument) { + return { + textDocument: asTextDocumentIdentifier(textDocument) + }; + } + function asDocumentLink(item) { + let result = types.DocumentLink.create(asRange(item.range)); + if (item.target) { + result.target = asUri(item.target); + } + return result; + } + function asDocumentLinkParams(textDocument) { + return { + textDocument: asTextDocumentIdentifier(textDocument) + }; + } + return { + asUri, + asTextDocumentIdentifier, + asOpenTextDocumentParams, + asChangeTextDocumentParams, + asCloseTextDocumentParams, + asSaveTextDocumentParams, + asWillSaveTextDocumentParams, + asTextDocumentPositionParams, + asWorkerPosition, + asRange, + asPosition, + asDiagnosticSeverity, + asDiagnostic, + asDiagnostics, + asCompletionItem, + asTextEdit, + asReferenceParams, + asCodeActionContext, + asCommand, + asCodeLens, + asFormattingOptions, + asDocumentSymbolParams, + asCodeLensParams, + asDocumentLink, + asDocumentLinkParams + }; +} +exports.createConverter = createConverter; diff --git a/node_modules/vscode-languageclient/lib/main.d.ts b/node_modules/vscode-languageclient/lib/main.d.ts new file mode 100644 index 0000000..b9f929d --- /dev/null +++ b/node_modules/vscode-languageclient/lib/main.d.ts @@ -0,0 +1,246 @@ +/// +import * as cp from 'child_process'; +import ChildProcess = cp.ChildProcess; +import { Disposable, OutputChannel, FileSystemWatcher, DiagnosticCollection, CancellationToken } from 'vscode'; +import { Message, MessageType as RPCMessageType, ErrorCodes, ResponseError, RequestType, RequestType0, RequestHandler, RequestHandler0, GenericRequestHandler, NotificationType, NotificationType0, NotificationHandler, NotificationHandler0, GenericNotificationHandler, Trace, Event } from 'vscode-jsonrpc'; +import { InitializeError, DocumentSelector } from './protocol'; +import * as c2p from './codeConverter'; +import * as p2c from './protocolConverter'; +export { ResponseError, InitializeError, ErrorCodes, RequestType, RequestType0, RequestHandler, RequestHandler0, GenericRequestHandler, NotificationType, NotificationType0, NotificationHandler, NotificationHandler0, GenericNotificationHandler }; +export { Converter as Code2ProtocolConverter } from './codeConverter'; +export { Converter as Protocol2CodeConverter } from './protocolConverter'; +export * from 'vscode-languageserver-types'; +export * from './protocol'; +export interface StreamInfo { + writer: NodeJS.WritableStream; + reader: NodeJS.ReadableStream; +} +export interface ExecutableOptions { + cwd?: string; + stdio?: string | string[]; + env?: any; + detached?: boolean; +} +export interface Executable { + command: string; + args?: string[]; + options?: ExecutableOptions; +} +export interface ForkOptions { + cwd?: string; + env?: any; + encoding?: string; + execArgv?: string[]; +} +export declare enum TransportKind { + stdio = 0, + ipc = 1, + pipe = 2, +} +export interface NodeModule { + module: string; + transport?: TransportKind; + args?: string[]; + runtime?: string; + options?: ForkOptions; +} +export declare type ServerOptions = Executable | { + run: Executable; + debug: Executable; +} | { + run: NodeModule; + debug: NodeModule; +} | NodeModule | (() => Thenable); +/** + * An action to be performed when the connection is producing errors. + */ +export declare enum ErrorAction { + /** + * Continue running the server. + */ + Continue = 1, + /** + * Shutdown the server. + */ + Shutdown = 2, +} +/** + * An action to be performed when the connection to a server got closed. + */ +export declare enum CloseAction { + /** + * Don't restart the server. The connection stays closed. + */ + DoNotRestart = 1, + /** + * Restart the server. + */ + Restart = 2, +} +/** + * A pluggable error handler that is invoked when the connection is either + * producing errors or got closed. + */ +export interface ErrorHandler { + /** + * An error has occurred while writing or reading from the connection. + * + * @param error - the error received + * @param message - the message to be delivered to the server if know. + * @param count - a count indicating how often an error is received. Will + * be reset if a message got successfully send or received. + */ + error(error: Error, message: Message, count: number): ErrorAction; + /** + * The connection to the server got closed. + */ + closed(): CloseAction; +} +export interface InitializationFailedHandler { + (error: ResponseError | Error | any): boolean; +} +export interface SynchronizeOptions { + configurationSection?: string | string[]; + fileEvents?: FileSystemWatcher | FileSystemWatcher[]; +} +export declare enum RevealOutputChannelOn { + Info = 1, + Warn = 2, + Error = 3, + Never = 4, +} +export interface LanguageClientOptions { + documentSelector?: DocumentSelector | string[]; + synchronize?: SynchronizeOptions; + diagnosticCollectionName?: string; + outputChannelName?: string; + revealOutputChannelOn?: RevealOutputChannelOn; + /** + * The encoding use to read stdout and stderr. Defaults + * to 'utf8' if ommitted. + */ + stdioEncoding?: string; + initializationOptions?: any | (() => any); + initializationFailedHandler?: InitializationFailedHandler; + errorHandler?: ErrorHandler; + uriConverters?: { + code2Protocol: c2p.URIConverter; + protocol2Code: p2c.URIConverter; + }; +} +export declare enum State { + Stopped = 1, + Running = 2, +} +export interface StateChangeEvent { + oldState: State; + newState: State; +} +export declare class LanguageClient { + private _id; + private _name; + private _serverOptions; + private _clientOptions; + private _forceDebug; + private _state; + private _onReady; + private _onReadyCallbacks; + private _connectionPromise; + private _resolvedConnection; + private _childProcess; + private _outputChannel; + private _capabilites; + private _listeners; + private _providers; + private _diagnostics; + private _fileEvents; + private _fileEventDelayer; + private _telemetryEmitter; + private _stateChangeEmitter; + private _trace; + private _tracer; + private _c2p; + private _p2c; + constructor(name: string, serverOptions: ServerOptions, clientOptions: LanguageClientOptions, forceDebug?: boolean); + constructor(id: string, name: string, serverOptions: ServerOptions, clientOptions: LanguageClientOptions, forceDebug?: boolean); + private state; + private getPublicState(); + sendRequest(type: RequestType0, token?: CancellationToken): Thenable; + sendRequest(type: RequestType, params: P, token?: CancellationToken): Thenable; + sendRequest(method: string, token?: CancellationToken): Thenable; + sendRequest(method: string, param: any, token?: CancellationToken): Thenable; + onRequest(type: RequestType0, handler: RequestHandler0): void; + onRequest(type: RequestType, handler: RequestHandler): void; + onRequest(method: string, handler: GenericRequestHandler): void; + sendNotification(type: NotificationType0): void; + sendNotification(type: NotificationType, params?: P): void; + sendNotification(method: string): void; + sendNotification(method: string, params: any): void; + onNotification(type: NotificationType0, handler: NotificationHandler0): void; + onNotification(type: NotificationType, handler: NotificationHandler

): void; + onNotification(method: string, handler: GenericNotificationHandler): void; + readonly protocol2CodeConverter: p2c.Converter; + readonly code2ProtocolConverter: c2p.Converter; + readonly onTelemetry: Event; + readonly onDidChangeState: Event; + readonly outputChannel: OutputChannel; + readonly diagnostics: DiagnosticCollection | undefined; + createDefaultErrorHandler(): ErrorHandler; + trace: Trace; + private data2String(data); + info(message: string, data?: any): void; + warn(message: string, data?: any): void; + error(message: string, data?: any): void; + private logTrace(message, data?); + needsStart(): boolean; + needsStop(): boolean; + onReady(): Promise; + private isConnectionActive(); + start(): Disposable; + private resolveConnection(); + private initialize(connection); + stop(): Thenable; + private cleanUp(diagnostics?); + private notifyFileEvent(event); + private forceDocumentSync(); + private handleDiagnostics(params); + private createConnection(); + private handleConnectionClosed(); + private handleConnectionError(error, message, count); + private checkProcessDied(childProcess); + private hookConfigurationChanged(connection); + private refreshTrace(connection, sendNotification?); + private onDidChangeConfiguration(connection); + private extractSettingsInformation(keys); + private hookFileEvents(_connection); + private _registeredHandlers; + private initRegistrationHandlers(_connection); + private handleRegistrationRequest(params); + private handleUnregistrationRequest(params); + private handleApplyWorkspaceEdit(params); + private hookCapabilities(_connection); + protected logFailedRequest(type: RPCMessageType, error: any): void; + private createCompletionProvider(options); + private createHoverProvider(options); + private createSignatureHelpProvider(options); + private createDefinitionProvider(options); + private createReferencesProvider(options); + private createDocumentHighlightProvider(options); + private createDocumentSymbolProvider(options); + private createWorkspaceSymbolProvider(_options); + private createCodeActionsProvider(options); + private createCodeLensProvider(options); + private createDocumentFormattingProvider(options); + private createDocumentRangeFormattingProvider(options); + private createDocumentOnTypeFormattingProvider(options); + private createRenameProvider(options); + private createDocumentLinkProvider(options); +} +export declare class SettingMonitor { + private _client; + private _setting; + private _listeners; + constructor(_client: LanguageClient, _setting: string); + start(): Disposable; + private onDidChangeConfiguration(); +} diff --git a/node_modules/vscode-languageclient/lib/main.js b/node_modules/vscode-languageclient/lib/main.js new file mode 100644 index 0000000..e58a838 --- /dev/null +++ b/node_modules/vscode-languageclient/lib/main.js @@ -0,0 +1,1658 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +'use strict'; +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +const cp = require("child_process"); +const vscode_1 = require("vscode"); +const vscode_jsonrpc_1 = require("vscode-jsonrpc"); +exports.ErrorCodes = vscode_jsonrpc_1.ErrorCodes; +exports.ResponseError = vscode_jsonrpc_1.ResponseError; +exports.RequestType = vscode_jsonrpc_1.RequestType; +exports.RequestType0 = vscode_jsonrpc_1.RequestType0; +exports.NotificationType = vscode_jsonrpc_1.NotificationType; +exports.NotificationType0 = vscode_jsonrpc_1.NotificationType0; +const protocol_1 = require("./protocol"); +exports.InitializeError = protocol_1.InitializeError; +const c2p = require("./codeConverter"); +const p2c = require("./protocolConverter"); +const is = require("./utils/is"); +const electron = require("./utils/electron"); +const processes_1 = require("./utils/processes"); +const async_1 = require("./utils/async"); +const UUID = require("./utils/uuid"); +__export(require("vscode-languageserver-types")); +__export(require("./protocol")); +class ConsoleLogger { + error(message) { + console.error(message); + } + warn(message) { + console.warn(message); + } + info(message) { + console.info(message); + } + log(message) { + console.log(message); + } +} +function createConnection(input, output, errorHandler, closeHandler) { + let logger = new ConsoleLogger(); + let connection = vscode_jsonrpc_1.createMessageConnection(input, output, logger); + connection.onError((data) => { errorHandler(data[0], data[1], data[2]); }); + connection.onClose(closeHandler); + let result = { + listen: () => connection.listen(), + sendRequest: (type, ...params) => connection.sendRequest(is.string(type) ? type : type.method, ...params), + onRequest: (type, handler) => connection.onRequest(is.string(type) ? type : type.method, handler), + sendNotification: (type, params) => connection.sendNotification(is.string(type) ? type : type.method, params), + onNotification: (type, handler) => connection.onNotification(is.string(type) ? type : type.method, handler), + trace: (value, tracer, sendNotification = false) => connection.trace(value, tracer, sendNotification), + initialize: (params) => connection.sendRequest(protocol_1.InitializeRequest.type, params), + shutdown: () => connection.sendRequest(protocol_1.ShutdownRequest.type, undefined), + exit: () => connection.sendNotification(protocol_1.ExitNotification.type), + onLogMessage: (handler) => connection.onNotification(protocol_1.LogMessageNotification.type, handler), + onShowMessage: (handler) => connection.onNotification(protocol_1.ShowMessageNotification.type, handler), + onTelemetry: (handler) => connection.onNotification(protocol_1.TelemetryEventNotification.type, handler), + didChangeConfiguration: (params) => connection.sendNotification(protocol_1.DidChangeConfigurationNotification.type, params), + didChangeWatchedFiles: (params) => connection.sendNotification(protocol_1.DidChangeWatchedFilesNotification.type, params), + didOpenTextDocument: (params) => connection.sendNotification(protocol_1.DidOpenTextDocumentNotification.type, params), + didChangeTextDocument: (params) => connection.sendNotification(protocol_1.DidChangeTextDocumentNotification.type, params), + didCloseTextDocument: (params) => connection.sendNotification(protocol_1.DidCloseTextDocumentNotification.type, params), + didSaveTextDocument: (params) => connection.sendNotification(protocol_1.DidSaveTextDocumentNotification.type, params), + onDiagnostics: (handler) => connection.onNotification(protocol_1.PublishDiagnosticsNotification.type, handler), + dispose: () => connection.dispose() + }; + return result; +} +var TransportKind; +(function (TransportKind) { + TransportKind[TransportKind["stdio"] = 0] = "stdio"; + TransportKind[TransportKind["ipc"] = 1] = "ipc"; + TransportKind[TransportKind["pipe"] = 2] = "pipe"; +})(TransportKind = exports.TransportKind || (exports.TransportKind = {})); +/** + * An action to be performed when the connection is producing errors. + */ +var ErrorAction; +(function (ErrorAction) { + /** + * Continue running the server. + */ + ErrorAction[ErrorAction["Continue"] = 1] = "Continue"; + /** + * Shutdown the server. + */ + ErrorAction[ErrorAction["Shutdown"] = 2] = "Shutdown"; +})(ErrorAction = exports.ErrorAction || (exports.ErrorAction = {})); +/** + * An action to be performed when the connection to a server got closed. + */ +var CloseAction; +(function (CloseAction) { + /** + * Don't restart the server. The connection stays closed. + */ + CloseAction[CloseAction["DoNotRestart"] = 1] = "DoNotRestart"; + /** + * Restart the server. + */ + CloseAction[CloseAction["Restart"] = 2] = "Restart"; +})(CloseAction = exports.CloseAction || (exports.CloseAction = {})); +class DefaultErrorHandler { + constructor(name) { + this.name = name; + this.restarts = []; + } + error(_error, _message, count) { + if (count && count <= 3) { + return ErrorAction.Continue; + } + return ErrorAction.Shutdown; + } + closed() { + this.restarts.push(Date.now()); + if (this.restarts.length < 5) { + return CloseAction.Restart; + } + else { + let diff = this.restarts[this.restarts.length - 1] - this.restarts[0]; + if (diff <= 3 * 60 * 1000) { + vscode_1.window.showErrorMessage(`The ${this.name} server crashed 5 times in the last 3 minutes. The server will not be restarted.`); + return CloseAction.DoNotRestart; + } + else { + this.restarts.shift(); + return CloseAction.Restart; + } + } + } +} +var RevealOutputChannelOn; +(function (RevealOutputChannelOn) { + RevealOutputChannelOn[RevealOutputChannelOn["Info"] = 1] = "Info"; + RevealOutputChannelOn[RevealOutputChannelOn["Warn"] = 2] = "Warn"; + RevealOutputChannelOn[RevealOutputChannelOn["Error"] = 3] = "Error"; + RevealOutputChannelOn[RevealOutputChannelOn["Never"] = 4] = "Never"; +})(RevealOutputChannelOn = exports.RevealOutputChannelOn || (exports.RevealOutputChannelOn = {})); +var State; +(function (State) { + State[State["Stopped"] = 1] = "Stopped"; + State[State["Running"] = 2] = "Running"; +})(State = exports.State || (exports.State = {})); +var ClientState; +(function (ClientState) { + ClientState[ClientState["Initial"] = 0] = "Initial"; + ClientState[ClientState["Starting"] = 1] = "Starting"; + ClientState[ClientState["StartFailed"] = 2] = "StartFailed"; + ClientState[ClientState["Running"] = 3] = "Running"; + ClientState[ClientState["Stopping"] = 4] = "Stopping"; + ClientState[ClientState["Stopped"] = 5] = "Stopped"; +})(ClientState || (ClientState = {})); +class DocumentNotifiactions { + constructor(_client, _event, _type, _createParams, _selectorFilter) { + this._client = _client; + this._event = _event; + this._type = _type; + this._createParams = _createParams; + this._selectorFilter = _selectorFilter; + this._selectors = new Map(); + } + static textDocumentFilter(selectors, textDocument) { + for (const selector of selectors) { + if (vscode_1.languages.match(selector, textDocument)) { + return true; + } + } + return false; + } + register(data) { + if (!data.registerOptions.documentSelector) { + return; + } + if (!this._listener) { + this._listener = this._event(this.callback, this); + } + this._selectors.set(data.id, data.registerOptions.documentSelector); + } + callback(data) { + if (!this._selectorFilter || this._selectorFilter(this._selectors.values(), data)) { + this._client.sendNotification(this._type, this._createParams(data)); + this.notificationSent(data); + } + } + notificationSent(_data) { + } + unregister(id) { + this._selectors.delete(id); + if (this._selectors.size === 0 && this._listener) { + this._listener.dispose(); + this._listener = undefined; + } + } + dispose() { + if (this._listener) { + this._listener.dispose(); + } + } +} +class DidOpenTextDocumentFeature extends DocumentNotifiactions { + constructor(client, _syncedDocuments) { + super(client, vscode_1.workspace.onDidOpenTextDocument, protocol_1.DidOpenTextDocumentNotification.type, (textDocument) => client.code2ProtocolConverter.asOpenTextDocumentParams(textDocument), DocumentNotifiactions.textDocumentFilter); + this._syncedDocuments = _syncedDocuments; + } + register(data) { + super.register(data); + if (!data.registerOptions.documentSelector) { + return; + } + let documentSelector = data.registerOptions.documentSelector; + vscode_1.workspace.textDocuments.forEach((textDocument) => { + let uri = textDocument.uri.toString(); + if (this._syncedDocuments.has(uri)) { + return; + } + if (vscode_1.languages.match(documentSelector, textDocument)) { + this._client.sendNotification(this._type, this._createParams(textDocument)); + this._syncedDocuments.set(uri, textDocument); + } + }); + } + notificationSent(textDocument) { + super.notificationSent(textDocument); + this._syncedDocuments.set(textDocument.uri.toString(), textDocument); + } +} +class DidCloseTextDocumentFeature extends DocumentNotifiactions { + constructor(client, _syncedDocuments) { + super(client, vscode_1.workspace.onDidCloseTextDocument, protocol_1.DidCloseTextDocumentNotification.type, (textDocument) => client.code2ProtocolConverter.asCloseTextDocumentParams(textDocument), DocumentNotifiactions.textDocumentFilter); + this._syncedDocuments = _syncedDocuments; + } + notificationSent(textDocument) { + super.notificationSent(textDocument); + this._syncedDocuments.delete(textDocument.uri.toString()); + } + unregister(id) { + let selector = this._selectors.get(id); + super.unregister(id); + let selectors = this._selectors.values(); + this._syncedDocuments.forEach((textDocument) => { + if (vscode_1.languages.match(selector, textDocument) && !this._selectorFilter(selectors, textDocument)) { + this._client.sendNotification(this._type, this._createParams(textDocument)); + this._syncedDocuments.delete(textDocument.uri.toString()); + } + }); + } +} +class DidChangeTextDocumentFeature { + constructor(_client) { + this._client = _client; + this._changeData = new Map(); + this._forcingDelivery = false; + } + register(data) { + if (!data.registerOptions.documentSelector) { + return; + } + if (!this._listener) { + this._listener = vscode_1.workspace.onDidChangeTextDocument(this.callback, this); + } + this._changeData.set(data.id, { + documentSelector: data.registerOptions.documentSelector, + syncKind: data.registerOptions.syncKind + }); + } + callback(event) { + for (const changeData of this._changeData.values()) { + if (vscode_1.languages.match(changeData.documentSelector, event.document)) { + if (changeData.syncKind === protocol_1.TextDocumentSyncKind.Incremental) { + this._client.sendNotification(protocol_1.DidChangeTextDocumentNotification.type, this._client.code2ProtocolConverter.asChangeTextDocumentParams(event)); + break; + } + else if (changeData.syncKind === protocol_1.TextDocumentSyncKind.Full) { + if (this._changeDelayer) { + if (this._changeDelayer.uri !== event.document.uri.toString()) { + // Use this force delivery to track boolean state. Otherwise we might call two times. + this.forceDelivery(); + this._changeDelayer.uri = event.document.uri.toString(); + } + this._changeDelayer.delayer.trigger(() => { + this._client.sendNotification(protocol_1.DidChangeTextDocumentNotification.type, this._client.code2ProtocolConverter.asChangeTextDocumentParams(event.document)); + }); + } + else { + this._changeDelayer = { + uri: event.document.uri.toString(), + delayer: new async_1.Delayer(200) + }; + this._changeDelayer.delayer.trigger(() => { + this._client.sendNotification(protocol_1.DidChangeTextDocumentNotification.type, this._client.code2ProtocolConverter.asChangeTextDocumentParams(event.document)); + }, -1); + } + break; + } + } + } + } + unregister(id) { + this._changeData.delete(id); + if (this._changeData.size === 0 && this._listener) { + this._listener.dispose(); + this._listener = undefined; + } + } + dispose() { + if (this._listener) { + this._listener.dispose(); + this._listener = undefined; + } + } + forceDelivery() { + if (this._forcingDelivery || !this._changeDelayer) { + return; + } + try { + this._forcingDelivery = true; + this._changeDelayer.delayer.forceDelivery(); + } + finally { + this._forcingDelivery = false; + } + } +} +class WillSaveWaitUntilFeature { + constructor(_client) { + this._client = _client; + this._selectors = new Map(); + } + register(data) { + if (!data.registerOptions.documentSelector) { + return; + } + if (!this._listener) { + this._listener = vscode_1.workspace.onWillSaveTextDocument(this.callback, this); + } + this._selectors.set(data.id, data.registerOptions.documentSelector); + } + callback(event) { + if (DocumentNotifiactions.textDocumentFilter(this._selectors.values(), event.document)) { + event.waitUntil(this._client.sendRequest(protocol_1.WillSaveTextDocumentWaitUntilRequest.type, this._client.code2ProtocolConverter.asWillSaveTextDocumentParams(event)).then((edits) => { + return this._client.protocol2CodeConverter.asTextEdits(edits); + })); + } + } + unregister(id) { + this._selectors.delete(id); + if (this._selectors.size === 0 && this._listener) { + this._listener.dispose(); + this._listener = undefined; + } + } + dispose() { + if (this._listener) { + this._listener.dispose(); + this._listener = undefined; + } + } +} +class DidSaveTextDocumentFeature extends DocumentNotifiactions { + constructor(client) { + super(client, vscode_1.workspace.onDidSaveTextDocument, protocol_1.DidSaveTextDocumentNotification.type, (textDocument) => client.code2ProtocolConverter.asSaveTextDocumentParams(textDocument, this._includeText), DocumentNotifiactions.textDocumentFilter); + } + register(data) { + this._includeText = !!data.registerOptions.includeText; + super.register(data); + } +} +class LanguageFeature { + constructor(_createProvider) { + this._createProvider = _createProvider; + this._providers = new Map(); + } + register(data) { + if (!data.registerOptions.documentSelector) { + return; + } + let provider = this._createProvider(data.registerOptions); + if (provider) { + this._providers.set(data.id, provider); + } + } + unregister(id) { + let provider = this._providers.get(id); + if (provider) { + provider.dispose(); + } + } + dispose() { + this._providers.forEach((value) => { + value.dispose(); + }); + } +} +class ExecuteCommandFeature { + constructor(_client, _logger) { + this._client = _client; + this._logger = _logger; + this._commands = new Map(); + } + register(data) { + if (data.registerOptions.commands) { + let disposeables = []; + for (const command of data.registerOptions.commands) { + disposeables.push(vscode_1.commands.registerCommand(command, (args) => { + let params = { + command, + arguments: args + }; + this._client.sendRequest(protocol_1.ExecuteCommandRequest.type, params).then(undefined, (error) => { this._logger(protocol_1.ExecuteCommandRequest.type, error); }); + })); + } + this._commands.set(data.id, disposeables); + } + } + unregister(id) { + let disposeables = this._commands.get(id); + if (disposeables) { + disposeables.forEach(disposable => disposable.dispose()); + } + } + dispose() { + this._commands.forEach((value) => { + value.forEach(disposable => disposable.dispose()); + }); + } +} +const clientCapabilities = { + workspace: { + applyEdit: true, + didChangeConfiguration: { + dynamicRegistration: false + }, + didChangeWatchedFiles: { + dynamicRegistration: false + }, + symbol: { + dynamicRegistration: true + }, + executeCommand: { + dynamicRegistration: true + } + }, + textDocument: { + synchronization: { + dynamicRegistration: true, + willSave: true, + willSaveWaitUntil: true, + didSave: true + }, + completion: { + dynamicRegistration: true, + completionItem: { + snippetSupport: true + } + }, + hover: { + dynamicRegistration: true + }, + signatureHelp: { + dynamicRegistration: true + }, + references: { + dynamicRegistration: true + }, + documentHighlight: { + dynamicRegistration: true + }, + documentSymbol: { + dynamicRegistration: true + }, + formatting: { + dynamicRegistration: true + }, + rangeFormatting: { + dynamicRegistration: true + }, + onTypeFormatting: { + dynamicRegistration: true + }, + definition: { + dynamicRegistration: true + }, + codeAction: { + dynamicRegistration: true + }, + codeLens: { + dynamicRegistration: true + }, + documentLink: { + dynamicRegistration: true + }, + rename: { + dynamicRegistration: true + } + } +}; +class LanguageClient { + constructor(arg1, arg2, arg3, arg4, arg5) { + this._registeredHandlers = new Map(); + let clientOptions; + let forceDebug; + if (is.string(arg2)) { + this._id = arg1; + this._name = arg2; + this._serverOptions = arg3; + clientOptions = arg4; + forceDebug = !!arg5; + } + else { + this._id = arg1.toLowerCase(); + this._name = arg1; + this._serverOptions = arg2; + clientOptions = arg3; + forceDebug = arg4; + } + if (forceDebug === void 0) { + forceDebug = false; + } + clientOptions = clientOptions || {}; + this._clientOptions = { + documentSelector: is.typedArray(clientOptions.documentSelector, is.string) + ? clientOptions.documentSelector.map(element => { return { language: element }; }) + : clientOptions.documentSelector, + synchronize: clientOptions.synchronize || {}, + diagnosticCollectionName: clientOptions.diagnosticCollectionName, + outputChannelName: clientOptions.outputChannelName || this._name, + revealOutputChannelOn: clientOptions.revealOutputChannelOn || RevealOutputChannelOn.Error, + stdioEncoding: clientOptions.stdioEncoding || 'utf8', + initializationOptions: clientOptions.initializationOptions, + initializationFailedHandler: clientOptions.initializationFailedHandler, + errorHandler: clientOptions.errorHandler || new DefaultErrorHandler(this._name), + uriConverters: clientOptions.uriConverters + }; + this._clientOptions.synchronize = this._clientOptions.synchronize || {}; + this._forceDebug = forceDebug; + this.state = ClientState.Initial; + this._connectionPromise = undefined; + this._resolvedConnection = undefined; + this._childProcess = undefined; + this._outputChannel = undefined; + this._listeners = undefined; + this._providers = undefined; + this._diagnostics = undefined; + this._fileEvents = []; + this._fileEventDelayer = new async_1.Delayer(250); + this._onReady = new Promise((resolve, reject) => { + this._onReadyCallbacks = { resolve, reject }; + }); + this._telemetryEmitter = new vscode_jsonrpc_1.Emitter(); + this._stateChangeEmitter = new vscode_jsonrpc_1.Emitter(); + this._tracer = { + log: (message, data) => { + this.logTrace(message, data); + } + }; + this._c2p = c2p.createConverter(clientOptions.uriConverters ? clientOptions.uriConverters.code2Protocol : undefined); + this._p2c = p2c.createConverter(clientOptions.uriConverters ? clientOptions.uriConverters.protocol2Code : undefined); + } + get state() { + return this._state; + } + set state(value) { + let oldState = this.getPublicState(); + this._state = value; + let newState = this.getPublicState(); + if (newState !== oldState) { + this._stateChangeEmitter.fire({ oldState, newState }); + } + } + getPublicState() { + if (this.state === ClientState.Running) { + return State.Running; + } + else { + return State.Stopped; + } + } + sendRequest(type, ...params) { + if (!this.isConnectionActive()) { + throw new Error('Language client is not ready yet'); + } + this.forceDocumentSync(); + try { + return this._resolvedConnection.sendRequest(type, ...params); + } + catch (error) { + this.error(`Sending request ${is.string(type) ? type : type.method} failed.`, error); + throw error; + } + } + onRequest(type, handler) { + if (!this.isConnectionActive()) { + throw new Error('Language client is not ready yet'); + } + try { + this._resolvedConnection.onRequest(type, handler); + } + catch (error) { + this.error(`Registering request handler ${is.string(type) ? type : type.method} failed.`, error); + throw error; + } + } + sendNotification(type, params) { + if (!this.isConnectionActive()) { + throw new Error('Language client is not ready yet'); + } + this.forceDocumentSync(); + try { + this._resolvedConnection.sendNotification(type, params); + } + catch (error) { + this.error(`Sending notification ${is.string(type) ? type : type.method} failed.`, error); + throw error; + } + } + onNotification(type, handler) { + if (!this.isConnectionActive()) { + throw new Error('Language client is not ready yet'); + } + try { + this._resolvedConnection.onNotification(type, handler); + } + catch (error) { + this.error(`Registering notification handler ${is.string(type) ? type : type.method} failed.`, error); + throw error; + } + } + get protocol2CodeConverter() { + return this._p2c; + } + get code2ProtocolConverter() { + return this._c2p; + } + get onTelemetry() { + return this._telemetryEmitter.event; + } + get onDidChangeState() { + return this._stateChangeEmitter.event; + } + get outputChannel() { + if (!this._outputChannel) { + this._outputChannel = vscode_1.window.createOutputChannel(this._clientOptions.outputChannelName ? this._clientOptions.outputChannelName : this._name); + } + return this._outputChannel; + } + get diagnostics() { + return this._diagnostics; + } + createDefaultErrorHandler() { + return new DefaultErrorHandler(this._name); + } + set trace(value) { + this._trace = value; + this.onReady().then(() => { + this.resolveConnection().then((connection) => { + connection.trace(value, this._tracer); + }); + }, () => { + }); + } + data2String(data) { + if (data instanceof vscode_jsonrpc_1.ResponseError) { + const responseError = data; + return ` Message: ${responseError.message}\n Code: ${responseError.code} ${responseError.data ? '\n' + responseError.data.toString() : ''}`; + } + if (data instanceof Error) { + if (is.string(data.stack)) { + return data.stack; + } + return data.message; + } + if (is.string(data)) { + return data; + } + return data.toString(); + } + info(message, data) { + this.outputChannel.appendLine(`[Info - ${(new Date().toLocaleTimeString())}] ${message}`); + if (data) { + this.outputChannel.appendLine(this.data2String(data)); + } + if (this._clientOptions.revealOutputChannelOn <= RevealOutputChannelOn.Info) { + this.outputChannel.show(true); + } + } + warn(message, data) { + this.outputChannel.appendLine(`[Warn - ${(new Date().toLocaleTimeString())}] ${message}`); + if (data) { + this.outputChannel.appendLine(this.data2String(data)); + } + if (this._clientOptions.revealOutputChannelOn <= RevealOutputChannelOn.Warn) { + this.outputChannel.show(true); + } + } + error(message, data) { + this.outputChannel.appendLine(`[Error - ${(new Date().toLocaleTimeString())}] ${message}`); + if (data) { + this.outputChannel.appendLine(this.data2String(data)); + } + if (this._clientOptions.revealOutputChannelOn <= RevealOutputChannelOn.Error) { + this.outputChannel.show(true); + } + } + logTrace(message, data) { + this.outputChannel.appendLine(`[Trace - ${(new Date().toLocaleTimeString())}] ${message}`); + if (data) { + this.outputChannel.appendLine(this.data2String(data)); + } + this.outputChannel.show(true); + } + needsStart() { + return this.state === ClientState.Initial || this.state === ClientState.Stopping || this.state === ClientState.Stopped; + } + needsStop() { + return this.state === ClientState.Starting || this.state === ClientState.Running; + } + onReady() { + return this._onReady; + } + isConnectionActive() { + return this.state === ClientState.Running && !!this._resolvedConnection; + } + start() { + this._listeners = []; + this._providers = []; + // If we restart then the diagnostics collection is reused. + if (!this._diagnostics) { + this._diagnostics = this._clientOptions.diagnosticCollectionName + ? vscode_1.languages.createDiagnosticCollection(this._clientOptions.diagnosticCollectionName) + : vscode_1.languages.createDiagnosticCollection(); + } + this.state = ClientState.Starting; + this.resolveConnection().then((connection) => { + connection.onLogMessage((message) => { + switch (message.type) { + case protocol_1.MessageType.Error: + this.error(message.message); + break; + case protocol_1.MessageType.Warning: + this.warn(message.message); + break; + case protocol_1.MessageType.Info: + this.info(message.message); + break; + default: + this.outputChannel.appendLine(message.message); + } + }); + connection.onShowMessage((message) => { + switch (message.type) { + case protocol_1.MessageType.Error: + vscode_1.window.showErrorMessage(message.message); + break; + case protocol_1.MessageType.Warning: + vscode_1.window.showWarningMessage(message.message); + break; + case protocol_1.MessageType.Info: + vscode_1.window.showInformationMessage(message.message); + break; + default: + vscode_1.window.showInformationMessage(message.message); + } + }); + connection.onRequest(protocol_1.ShowMessageRequest.type, (params) => { + let messageFunc; + switch (params.type) { + case protocol_1.MessageType.Error: + messageFunc = vscode_1.window.showErrorMessage; + break; + case protocol_1.MessageType.Warning: + messageFunc = vscode_1.window.showWarningMessage; + break; + case protocol_1.MessageType.Info: + messageFunc = vscode_1.window.showInformationMessage; + break; + default: + messageFunc = vscode_1.window.showInformationMessage; + } + let actions = params.actions || []; + return messageFunc(params.message, ...actions); + }); + connection.onTelemetry((data) => { + this._telemetryEmitter.fire(data); + }); + this.initRegistrationHandlers(connection); + connection.listen(); + // Error is handled in the intialize call. + this.initialize(connection).then(undefined, () => { }); + }, (error) => { + this.state = ClientState.StartFailed; + this._onReadyCallbacks.reject(error); + this.error('Starting client failed', error); + vscode_1.window.showErrorMessage(`Couldn't start client ${this._name}`); + }); + return new vscode_1.Disposable(() => { + if (this.needsStop()) { + this.stop(); + } + }); + } + resolveConnection() { + if (!this._connectionPromise) { + this._connectionPromise = this.createConnection(); + } + return this._connectionPromise; + } + initialize(connection) { + this.refreshTrace(connection, false); + let initOption = this._clientOptions.initializationOptions; + let initParams = { + processId: process.pid, + rootPath: vscode_1.workspace.rootPath ? vscode_1.workspace.rootPath : null, + rootUri: vscode_1.workspace.rootPath ? vscode_1.Uri.file(vscode_1.workspace.rootPath).toString() : null, + capabilities: clientCapabilities, + initializationOptions: is.func(initOption) ? initOption() : initOption, + trace: vscode_jsonrpc_1.Trace.toString(this._trace) + }; + return connection.initialize(initParams).then((result) => { + this._resolvedConnection = connection; + this.state = ClientState.Running; + this._capabilites = result.capabilities; + connection.onDiagnostics(params => this.handleDiagnostics(params)); + connection.onRequest(protocol_1.RegistrationRequest.type, params => this.handleRegistrationRequest(params)); + connection.onRequest(protocol_1.UnregistrationRequest.type, params => this.handleUnregistrationRequest(params)); + connection.onRequest(protocol_1.ApplyWorkspaceEditRequest.type, params => this.handleApplyWorkspaceEdit(params)); + connection.sendNotification(protocol_1.InitializedNotification.type, {}); + this.hookFileEvents(connection); + this.hookConfigurationChanged(connection); + if (this._clientOptions.documentSelector) { + let selectorOptions = { documentSelector: this._clientOptions.documentSelector }; + let textDocumentSyncOptions = undefined; + if (is.number(this._capabilites.textDocumentSync) && this._capabilites.textDocumentSync !== protocol_1.TextDocumentSyncKind.None) { + textDocumentSyncOptions = { + openClose: true, + change: this._capabilites.textDocumentSync, + save: { + includeText: false + } + }; + } + else if (this._capabilites.textDocumentSync !== void 0 && this._capabilites.textDocumentSync === null) { + textDocumentSyncOptions = this._capabilites.textDocumentSync; + } + if (textDocumentSyncOptions) { + let registeredHandlers = this._registeredHandlers; + if (textDocumentSyncOptions.openClose) { + registeredHandlers.get(protocol_1.DidOpenTextDocumentNotification.type.method).register({ id: UUID.generateUuid(), registerOptions: selectorOptions }); + registeredHandlers.get(protocol_1.DidCloseTextDocumentNotification.type.method).register({ id: UUID.generateUuid(), registerOptions: selectorOptions }); + } + if (textDocumentSyncOptions.change !== protocol_1.TextDocumentSyncKind.None) { + registeredHandlers.get(protocol_1.DidChangeTextDocumentNotification.type.method).register({ + id: UUID.generateUuid(), + registerOptions: Object.assign({}, selectorOptions, { syncKind: textDocumentSyncOptions.change }) + }); + } + if (textDocumentSyncOptions.willSave) { + registeredHandlers.get(protocol_1.WillSaveTextDocumentNotification.type.method).register({ id: UUID.generateUuid(), registerOptions: selectorOptions }); + } + if (textDocumentSyncOptions.willSaveWaitUntil) { + registeredHandlers.get(protocol_1.WillSaveTextDocumentWaitUntilRequest.type.method).register({ id: UUID.generateUuid(), registerOptions: selectorOptions }); + } + if (textDocumentSyncOptions.save) { + registeredHandlers.get(protocol_1.DidSaveTextDocumentNotification.type.method).register({ + id: UUID.generateUuid(), + registerOptions: Object.assign({}, selectorOptions, { includeText: !!textDocumentSyncOptions.save.includeText }) + }); + } + } + } + this.hookCapabilities(connection); + this._onReadyCallbacks.resolve(); + return result; + }, (error) => { + if (this._clientOptions.initializationFailedHandler) { + if (this._clientOptions.initializationFailedHandler(error)) { + this.initialize(connection); + } + else { + this.stop(); + this._onReadyCallbacks.reject(error); + } + } + else if (error instanceof vscode_jsonrpc_1.ResponseError && error.data && error.data.retry) { + vscode_1.window.showErrorMessage(error.message, { title: 'Retry', id: "retry" }).then(item => { + if (item && item.id === 'retry') { + this.initialize(connection); + } + else { + this.stop(); + this._onReadyCallbacks.reject(error); + } + }); + } + else { + if (error && error.message) { + vscode_1.window.showErrorMessage(error.message); + } + this.error('Server initialization failed.', error); + this.stop(); + this._onReadyCallbacks.reject(error); + } + }); + } + stop() { + if (!this._connectionPromise) { + this.state = ClientState.Stopped; + return Promise.resolve(); + } + this.state = ClientState.Stopping; + this.cleanUp(); + // unkook listeners + return this.resolveConnection().then(connection => { + return connection.shutdown().then(() => { + connection.exit(); + connection.dispose(); + this.state = ClientState.Stopped; + this._connectionPromise = undefined; + this._resolvedConnection = undefined; + let toCheck = this._childProcess; + this._childProcess = undefined; + // Remove all markers + this.checkProcessDied(toCheck); + }); + }); + } + cleanUp(diagnostics = true) { + if (this._listeners) { + this._listeners.forEach(listener => listener.dispose()); + this._listeners = undefined; + } + if (this._providers) { + this._providers.forEach(provider => provider.dispose()); + this._providers = undefined; + } + if (diagnostics && this._diagnostics) { + this._diagnostics.dispose(); + this._diagnostics = undefined; + } + } + notifyFileEvent(event) { + this._fileEvents.push(event); + this._fileEventDelayer.trigger(() => { + this.onReady().then(() => { + this.resolveConnection().then(connection => { + if (this.isConnectionActive()) { + connection.didChangeWatchedFiles({ changes: this._fileEvents }); + } + this._fileEvents = []; + }); + }, (error) => { + this.error(`Notify file events failed.`, error); + }); + }); + } + forceDocumentSync() { + this._registeredHandlers.get(protocol_1.DidChangeTextDocumentNotification.type.method).forceDelivery(); + } + handleDiagnostics(params) { + if (!this._diagnostics) { + return; + } + let uri = this._p2c.asUri(params.uri); + let diagnostics = this._p2c.asDiagnostics(params.diagnostics); + this._diagnostics.set(uri, diagnostics); + } + createConnection() { + function getEnvironment(env) { + if (!env) { + return process.env; + } + let result = Object.create(null); + Object.keys(process.env).forEach(key => result[key] = process.env[key]); + Object.keys(env).forEach(key => result[key] = env[key]); + } + function startedInDebugMode() { + let args = process.execArgv; + if (args) { + return args.some((arg) => /^--debug=?/.test(arg) || /^--debug-brk=?/.test(arg)); + } + ; + return false; + } + let encoding = this._clientOptions.stdioEncoding; + let errorHandler = (error, message, count) => { + this.handleConnectionError(error, message, count); + }; + let closeHandler = () => { + this.handleConnectionClosed(); + }; + let server = this._serverOptions; + // We got a function. + if (is.func(server)) { + return server().then((result) => { + let info = result; + if (info.writer && info.reader) { + return createConnection(info.reader, info.writer, errorHandler, closeHandler); + } + else { + let cp = result; + return createConnection(cp.stdout, cp.stdin, errorHandler, closeHandler); + } + }); + } + let json; + let runDebug = server; + if (runDebug.run || runDebug.debug) { + // We are under debugging. So use debug as well. + if (typeof v8debug === 'object' || this._forceDebug || startedInDebugMode()) { + json = runDebug.debug; + } + else { + json = runDebug.run; + } + } + else { + json = server; + } + if (json.module) { + let node = json; + if (node.runtime) { + let args = []; + let options = node.options || Object.create(null); + if (options.execArgv) { + options.execArgv.forEach(element => args.push(element)); + } + args.push(node.module); + if (node.args) { + node.args.forEach(element => args.push(element)); + } + let execOptions = Object.create(null); + execOptions.cwd = options.cwd || vscode_1.workspace.rootPath; + execOptions.env = getEnvironment(options.env); + let pipeName = undefined; + if (node.transport === TransportKind.ipc) { + // exec options not correctly typed in lib + execOptions.stdio = [null, null, null, 'ipc']; + args.push('--node-ipc'); + } + else if (node.transport === TransportKind.stdio) { + args.push('--stdio'); + } + else if (node.transport === TransportKind.pipe) { + pipeName = vscode_jsonrpc_1.generateRandomPipeName(); + args.push(`--pipe=${pipeName}`); + } + if (node.transport === TransportKind.ipc || node.transport === TransportKind.stdio) { + let process = cp.spawn(node.runtime, args, execOptions); + if (!process || !process.pid) { + return Promise.reject(`Launching server using runtime ${node.runtime} failed.`); + } + this._childProcess = process; + process.stderr.on('data', data => this.outputChannel.append(is.string(data) ? data : data.toString(encoding))); + if (node.transport === TransportKind.ipc) { + process.stdout.on('data', data => this.outputChannel.append(is.string(data) ? data : data.toString(encoding))); + return Promise.resolve(createConnection(new vscode_jsonrpc_1.IPCMessageReader(process), new vscode_jsonrpc_1.IPCMessageWriter(process), errorHandler, closeHandler)); + } + else { + return Promise.resolve(createConnection(process.stdout, process.stdin, errorHandler, closeHandler)); + } + } + else if (node.transport == TransportKind.pipe) { + return vscode_jsonrpc_1.createClientPipeTransport(pipeName).then((transport) => { + let process = cp.spawn(node.runtime, args, execOptions); + if (!process || !process.pid) { + return Promise.reject(`Launching server using runtime ${node.runtime} failed.`); + } + this._childProcess = process; + process.stderr.on('data', data => this.outputChannel.append(is.string(data) ? data : data.toString(encoding))); + process.stdout.on('data', data => this.outputChannel.append(is.string(data) ? data : data.toString(encoding))); + return transport.onConnected().then((protocol) => { + return createConnection(protocol[0], protocol[1], errorHandler, closeHandler); + }); + }); + } + } + else { + let pipeName = undefined; + return new Promise((resolve, reject) => { + let args = node.args && node.args.slice() || []; + if (node.transport === TransportKind.ipc) { + args.push('--node-ipc'); + } + else if (node.transport === TransportKind.stdio) { + args.push('--stdio'); + } + else if (node.transport === TransportKind.pipe) { + pipeName = vscode_jsonrpc_1.generateRandomPipeName(); + args.push(`--pipe=${pipeName}`); + } + let options = node.options || Object.create(null); + options.execArgv = options.execArgv || []; + options.cwd = options.cwd || vscode_1.workspace.rootPath; + if (node.transport === TransportKind.ipc || node.transport === TransportKind.stdio) { + electron.fork(node.module, args || [], options, (error, cp) => { + if (error || !cp) { + reject(error); + } + else { + this._childProcess = cp; + cp.stderr.on('data', data => this.outputChannel.append(is.string(data) ? data : data.toString(encoding))); + if (node.transport === TransportKind.ipc) { + cp.stdout.on('data', data => this.outputChannel.append(is.string(data) ? data : data.toString(encoding))); + resolve(createConnection(new vscode_jsonrpc_1.IPCMessageReader(this._childProcess), new vscode_jsonrpc_1.IPCMessageWriter(this._childProcess), errorHandler, closeHandler)); + } + else { + resolve(createConnection(cp.stdout, cp.stdin, errorHandler, closeHandler)); + } + } + }); + } + else if (node.transport === TransportKind.pipe) { + vscode_jsonrpc_1.createClientPipeTransport(pipeName).then((transport) => { + electron.fork(node.module, args || [], options, (error, cp) => { + if (error || !cp) { + reject(error); + } + else { + this._childProcess = cp; + cp.stderr.on('data', data => this.outputChannel.append(is.string(data) ? data : data.toString(encoding))); + cp.stdout.on('data', data => this.outputChannel.append(is.string(data) ? data : data.toString(encoding))); + transport.onConnected().then((protocol) => { + resolve(createConnection(protocol[0], protocol[1], errorHandler, closeHandler)); + }); + } + }); + }); + } + }); + } + } + else if (json.command) { + let command = json; + let options = command.options || {}; + options.cwd = options.cwd || vscode_1.workspace.rootPath; + let process = cp.spawn(command.command, command.args, command.options); + if (!process || !process.pid) { + return Promise.reject(`Launching server using command ${command.command} failed.`); + } + process.stderr.on('data', data => this.outputChannel.append(is.string(data) ? data : data.toString(encoding))); + this._childProcess = process; + return Promise.resolve(createConnection(process.stdout, process.stdin, errorHandler, closeHandler)); + } + return Promise.reject(new Error(`Unsupported server configuartion ` + JSON.stringify(server, null, 4))); + } + handleConnectionClosed() { + // Check whether this is a normal shutdown in progress or the client stopped normally. + if (this.state === ClientState.Stopping || this.state === ClientState.Stopped) { + return; + } + this._connectionPromise = undefined; + this._resolvedConnection = undefined; + this._childProcess = undefined; + let action = this._clientOptions.errorHandler.closed(); + if (action === CloseAction.DoNotRestart) { + this.error('Connection to server got closed. Server will not be restarted.'); + this.state = ClientState.Stopped; + this.cleanUp(); + } + else if (action === CloseAction.Restart) { + this.info('Connection to server got closed. Server will restart.'); + this.cleanUp(false); + this.state = ClientState.Initial; + this.start(); + } + } + handleConnectionError(error, message, count) { + let action = this._clientOptions.errorHandler.error(error, message, count); + if (action === ErrorAction.Shutdown) { + this.error('Connection to server is erroring. Shutting down server.'); + this.stop(); + } + } + checkProcessDied(childProcess) { + if (!childProcess) { + return; + } + setTimeout(() => { + // Test if the process is still alive. Throws an exception if not + try { + process.kill(childProcess.pid, 0); + processes_1.terminate(childProcess); + } + catch (error) { + } + }, 2000); + } + hookConfigurationChanged(connection) { + if (!this._clientOptions.synchronize.configurationSection) { + return; + } + vscode_1.workspace.onDidChangeConfiguration(() => this.onDidChangeConfiguration(connection), this, this._listeners); + this.onDidChangeConfiguration(connection); + } + refreshTrace(connection, sendNotification = false) { + let config = vscode_1.workspace.getConfiguration(this._id); + let trace = vscode_jsonrpc_1.Trace.Off; + if (config) { + trace = vscode_jsonrpc_1.Trace.fromString(config.get('trace.server', 'off')); + } + this._trace = trace; + connection.trace(this._trace, this._tracer, sendNotification); + } + onDidChangeConfiguration(connection) { + this.refreshTrace(connection, true); + let keys; + let configurationSection = this._clientOptions.synchronize.configurationSection; + if (is.string(configurationSection)) { + keys = [configurationSection]; + } + else if (is.stringArray(configurationSection)) { + keys = configurationSection; + } + if (keys) { + if (this.isConnectionActive()) { + connection.didChangeConfiguration({ settings: this.extractSettingsInformation(keys) }); + } + } + } + extractSettingsInformation(keys) { + function ensurePath(config, path) { + let current = config; + for (let i = 0; i < path.length - 1; i++) { + let obj = current[path[i]]; + if (!obj) { + obj = Object.create(null); + current[path[i]] = obj; + } + current = obj; + } + return current; + } + let result = Object.create(null); + for (let i = 0; i < keys.length; i++) { + let key = keys[i]; + let index = key.indexOf('.'); + let config = null; + if (index >= 0) { + config = vscode_1.workspace.getConfiguration(key.substr(0, index)).get(key.substr(index + 1)); + } + else { + config = vscode_1.workspace.getConfiguration(key); + } + if (config) { + let path = keys[i].split('.'); + ensurePath(result, path)[path[path.length - 1]] = config; + } + } + return result; + } + hookFileEvents(_connection) { + let fileEvents = this._clientOptions.synchronize.fileEvents; + if (!fileEvents) { + return; + } + let watchers; + if (is.array(fileEvents)) { + watchers = fileEvents; + } + else { + watchers = [fileEvents]; + } + if (!watchers) { + return; + } + watchers.forEach(watcher => { + watcher.onDidCreate((resource) => this.notifyFileEvent({ + uri: resource.toString(), + type: protocol_1.FileChangeType.Created + }), null, this._listeners); + watcher.onDidChange((resource) => this.notifyFileEvent({ + uri: resource.toString(), + type: protocol_1.FileChangeType.Changed + }), null, this._listeners); + watcher.onDidDelete((resource) => this.notifyFileEvent({ + uri: resource.toString(), + type: protocol_1.FileChangeType.Deleted + }), null, this._listeners); + }); + } + initRegistrationHandlers(_connection) { + const syncedDocuments = new Map(); + const logger = (type, error) => { this.logFailedRequest(type, error); }; + this._registeredHandlers.set(protocol_1.DidOpenTextDocumentNotification.type.method, new DidOpenTextDocumentFeature(this, syncedDocuments)); + this._registeredHandlers.set(protocol_1.DidChangeTextDocumentNotification.type.method, new DidChangeTextDocumentFeature(this)); + this._registeredHandlers.set(protocol_1.WillSaveTextDocumentNotification.type.method, new DocumentNotifiactions(this, vscode_1.workspace.onWillSaveTextDocument, protocol_1.WillSaveTextDocumentNotification.type, (willSaveEvent) => this._c2p.asWillSaveTextDocumentParams(willSaveEvent), (selectors, willSaveEvent) => DocumentNotifiactions.textDocumentFilter(selectors, willSaveEvent.document))); + this._registeredHandlers.set(protocol_1.WillSaveTextDocumentWaitUntilRequest.type.method, new WillSaveWaitUntilFeature(this)); + this._registeredHandlers.set(protocol_1.DidSaveTextDocumentNotification.type.method, new DidSaveTextDocumentFeature(this)); + this._registeredHandlers.set(protocol_1.DidCloseTextDocumentNotification.type.method, new DidCloseTextDocumentFeature(this, syncedDocuments)); + this._registeredHandlers.set(protocol_1.CompletionRequest.type.method, new LanguageFeature((options) => this.createCompletionProvider(options))); + this._registeredHandlers.set(protocol_1.HoverRequest.type.method, new LanguageFeature((options) => this.createHoverProvider(options))); + this._registeredHandlers.set(protocol_1.SignatureHelpRequest.type.method, new LanguageFeature((options) => this.createSignatureHelpProvider(options))); + this._registeredHandlers.set(protocol_1.DefinitionRequest.type.method, new LanguageFeature((options) => this.createDefinitionProvider(options))); + this._registeredHandlers.set(protocol_1.ReferencesRequest.type.method, new LanguageFeature((options) => this.createReferencesProvider(options))); + this._registeredHandlers.set(protocol_1.DocumentHighlightRequest.type.method, new LanguageFeature((options) => this.createDocumentHighlightProvider(options))); + this._registeredHandlers.set(protocol_1.DocumentSymbolRequest.type.method, new LanguageFeature((options) => this.createDocumentSymbolProvider(options))); + this._registeredHandlers.set(protocol_1.WorkspaceSymbolRequest.type.method, new LanguageFeature((options) => this.createWorkspaceSymbolProvider(options))); + this._registeredHandlers.set(protocol_1.CodeActionRequest.type.method, new LanguageFeature((options) => this.createCodeActionsProvider(options))); + this._registeredHandlers.set(protocol_1.CodeLensRequest.type.method, new LanguageFeature((options) => this.createCodeLensProvider(options))); + this._registeredHandlers.set(protocol_1.DocumentFormattingRequest.type.method, new LanguageFeature((options) => this.createDocumentFormattingProvider(options))); + this._registeredHandlers.set(protocol_1.DocumentRangeFormattingRequest.type.method, new LanguageFeature((options) => this.createDocumentRangeFormattingProvider(options))); + this._registeredHandlers.set(protocol_1.DocumentOnTypeFormattingRequest.type.method, new LanguageFeature((options) => this.createDocumentOnTypeFormattingProvider(options))); + this._registeredHandlers.set(protocol_1.RenameRequest.type.method, new LanguageFeature((options) => this.createRenameProvider(options))); + this._registeredHandlers.set(protocol_1.DocumentLinkRequest.type.method, new LanguageFeature((options) => this.createDocumentLinkProvider(options))); + this._registeredHandlers.set(protocol_1.ExecuteCommandRequest.type.method, new ExecuteCommandFeature(this, logger)); + } + handleRegistrationRequest(params) { + return new Promise((resolve, _reject) => { + params.registrations.forEach((element) => { + const handler = this._registeredHandlers.get(element.method); + const options = element.registerOptions || {}; + options.documentSelector = options.documentSelector || this._clientOptions.documentSelector; + const data = { + id: element.id, + registerOptions: options + }; + if (handler) { + handler.register(data); + } + }); + resolve(); + }); + } + handleUnregistrationRequest(params) { + return new Promise((resolve, _reject) => { + params.unregisterations.forEach((element) => { + const handler = this._registeredHandlers.get(element.method); + if (handler) { + handler.unregister(element.id); + } + }); + resolve(); + }); + } + handleApplyWorkspaceEdit(params) { + // This is some sort of workaround since the version check should be done by VS Code in the Workspace.applyEdit. + // However doing it here adds some safety since the server can lag more behind then an extension. + let workspaceEdit = params.edit; + let openTextDocuments = new Map(); + vscode_1.workspace.textDocuments.forEach((document) => openTextDocuments.set(document.uri.toString(), document)); + let versionMismatch = false; + if (workspaceEdit.changes) { + for (const change of workspaceEdit.changes) { + if (change.textDocument.version && change.textDocument.version >= 0) { + let textDocument = openTextDocuments.get(change.textDocument.uri); + if (textDocument && textDocument.version !== change.textDocument.version) { + versionMismatch = true; + break; + } + } + } + } + if (versionMismatch) { + return Promise.resolve({ applied: false }); + } + return vscode_1.workspace.applyEdit(this._p2c.asWorkspaceEdit(params.edit)).then((value) => { return { applied: value }; }); + } + ; + hookCapabilities(_connection) { + let documentSelector = this._clientOptions.documentSelector; + if (!documentSelector) { + return; + } + let selectorOptions = { documentSelector: documentSelector }; + let registeredHandlers = this._registeredHandlers; + if (this._capabilites.completionProvider) { + let options = Object.assign({}, selectorOptions, this._capabilites.completionProvider); + registeredHandlers.get(protocol_1.CompletionRequest.type.method).register({ id: UUID.generateUuid(), registerOptions: options }); + } + if (this._capabilites.hoverProvider) { + registeredHandlers.get(protocol_1.HoverRequest.type.method).register({ id: UUID.generateUuid(), registerOptions: Object.assign({}, selectorOptions) }); + } + if (this._capabilites.signatureHelpProvider) { + let options = Object.assign({}, selectorOptions, this._capabilites.signatureHelpProvider); + registeredHandlers.get(protocol_1.SignatureHelpRequest.type.method).register({ id: UUID.generateUuid(), registerOptions: options }); + } + if (this._capabilites.definitionProvider) { + registeredHandlers.get(protocol_1.DefinitionRequest.type.method).register({ id: UUID.generateUuid(), registerOptions: Object.assign({}, selectorOptions) }); + } + if (this._capabilites.referencesProvider) { + registeredHandlers.get(protocol_1.ReferencesRequest.type.method).register({ id: UUID.generateUuid(), registerOptions: Object.assign({}, selectorOptions) }); + } + if (this._capabilites.documentHighlightProvider) { + registeredHandlers.get(protocol_1.DocumentHighlightRequest.type.method).register({ id: UUID.generateUuid(), registerOptions: Object.assign({}, selectorOptions) }); + } + if (this._capabilites.documentSymbolProvider) { + registeredHandlers.get(protocol_1.DocumentSymbolRequest.type.method).register({ id: UUID.generateUuid(), registerOptions: Object.assign({}, selectorOptions) }); + } + if (this._capabilites.workspaceSymbolProvider) { + registeredHandlers.get(protocol_1.WorkspaceSymbolRequest.type.method).register({ id: UUID.generateUuid(), registerOptions: Object.assign({}, selectorOptions) }); + } + if (this._capabilites.codeActionProvider) { + registeredHandlers.get(protocol_1.CodeActionRequest.type.method).register({ id: UUID.generateUuid(), registerOptions: Object.assign({}, selectorOptions) }); + } + if (this._capabilites.codeLensProvider) { + let options = Object.assign({}, selectorOptions, this._capabilites.codeLensProvider); + registeredHandlers.get(protocol_1.CodeLensRequest.type.method).register({ id: UUID.generateUuid(), registerOptions: options }); + } + if (this._capabilites.documentFormattingProvider) { + registeredHandlers.get(protocol_1.DocumentFormattingRequest.type.method).register({ id: UUID.generateUuid(), registerOptions: Object.assign({}, selectorOptions) }); + } + if (this._capabilites.documentRangeFormattingProvider) { + registeredHandlers.get(protocol_1.DocumentRangeFormattingRequest.type.method).register({ id: UUID.generateUuid(), registerOptions: Object.assign({}, selectorOptions) }); + } + if (this._capabilites.documentOnTypeFormattingProvider) { + let options = Object.assign({}, selectorOptions, this._capabilites.documentOnTypeFormattingProvider); + registeredHandlers.get(protocol_1.DocumentOnTypeFormattingRequest.type.method).register({ id: UUID.generateUuid(), registerOptions: options }); + } + if (this._capabilites.renameProvider) { + registeredHandlers.get(protocol_1.RenameRequest.type.method).register({ id: UUID.generateUuid(), registerOptions: Object.assign({}, selectorOptions) }); + } + if (this._capabilites.documentLinkProvider) { + let options = Object.assign({}, selectorOptions, this._capabilites.documentLinkProvider); + registeredHandlers.get(protocol_1.DocumentLinkRequest.type.method).register({ id: UUID.generateUuid(), registerOptions: options }); + } + if (this._capabilites.executeCommandProvider) { + let options = Object.assign({}, this._capabilites.executeCommandProvider); + registeredHandlers.get(protocol_1.ExecuteCommandRequest.type.method).register({ id: UUID.generateUuid(), registerOptions: options }); + } + } + logFailedRequest(type, error) { + this.error(`Request ${type.method} failed.`, error); + } + createCompletionProvider(options) { + let triggerCharacters = options.triggerCharacters || []; + return vscode_1.languages.registerCompletionItemProvider(options.documentSelector, { + provideCompletionItems: (document, position, token) => { + return this.sendRequest(protocol_1.CompletionRequest.type, this._c2p.asTextDocumentPositionParams(document, position), token).then(this._p2c.asCompletionResult, (error) => { + this.logFailedRequest(protocol_1.CompletionRequest.type, error); + return Promise.resolve([]); + }); + }, + resolveCompletionItem: options.resolveProvider + ? (item, token) => { + return this.sendRequest(protocol_1.CompletionResolveRequest.type, this._c2p.asCompletionItem(item), token).then(this._p2c.asCompletionItem, (error) => { + this.logFailedRequest(protocol_1.CompletionResolveRequest.type, error); + return Promise.resolve(item); + }); + } + : undefined + }, ...triggerCharacters); + } + createHoverProvider(options) { + return vscode_1.languages.registerHoverProvider(options.documentSelector, { + provideHover: (document, position, token) => { + return this.sendRequest(protocol_1.HoverRequest.type, this._c2p.asTextDocumentPositionParams(document, position), token).then(this._p2c.asHover, (error) => { + this.logFailedRequest(protocol_1.HoverRequest.type, error); + return Promise.resolve(null); + }); + } + }); + } + createSignatureHelpProvider(options) { + let triggerCharacters = options.triggerCharacters || []; + return vscode_1.languages.registerSignatureHelpProvider(options.documentSelector, { + provideSignatureHelp: (document, position, token) => { + return this.sendRequest(protocol_1.SignatureHelpRequest.type, this._c2p.asTextDocumentPositionParams(document, position), token).then(this._p2c.asSignatureHelp, (error) => { + this.logFailedRequest(protocol_1.SignatureHelpRequest.type, error); + return Promise.resolve(null); + }); + } + }, ...triggerCharacters); + } + createDefinitionProvider(options) { + return vscode_1.languages.registerDefinitionProvider(options.documentSelector, { + provideDefinition: (document, position, token) => { + return this.sendRequest(protocol_1.DefinitionRequest.type, this._c2p.asTextDocumentPositionParams(document, position), token).then(this._p2c.asDefinitionResult, (error) => { + this.logFailedRequest(protocol_1.DefinitionRequest.type, error); + return Promise.resolve(null); + }); + } + }); + } + createReferencesProvider(options) { + return vscode_1.languages.registerReferenceProvider(options.documentSelector, { + provideReferences: (document, position, options, token) => { + return this.sendRequest(protocol_1.ReferencesRequest.type, this._c2p.asReferenceParams(document, position, options), token).then(this._p2c.asReferences, (error) => { + this.logFailedRequest(protocol_1.ReferencesRequest.type, error); + return Promise.resolve([]); + }); + } + }); + } + createDocumentHighlightProvider(options) { + return vscode_1.languages.registerDocumentHighlightProvider(options.documentSelector, { + provideDocumentHighlights: (document, position, token) => { + return this.sendRequest(protocol_1.DocumentHighlightRequest.type, this._c2p.asTextDocumentPositionParams(document, position), token).then(this._p2c.asDocumentHighlights, (error) => { + this.logFailedRequest(protocol_1.DocumentHighlightRequest.type, error); + return Promise.resolve([]); + }); + } + }); + } + createDocumentSymbolProvider(options) { + return vscode_1.languages.registerDocumentSymbolProvider(options.documentSelector, { + provideDocumentSymbols: (document, token) => { + return this.sendRequest(protocol_1.DocumentSymbolRequest.type, this._c2p.asDocumentSymbolParams(document), token).then(this._p2c.asSymbolInformations, (error) => { + this.logFailedRequest(protocol_1.DocumentSymbolRequest.type, error); + return Promise.resolve([]); + }); + } + }); + } + createWorkspaceSymbolProvider(_options) { + return vscode_1.languages.registerWorkspaceSymbolProvider({ + provideWorkspaceSymbols: (query, token) => { + return this.sendRequest(protocol_1.WorkspaceSymbolRequest.type, { query }, token).then(this._p2c.asSymbolInformations, (error) => { + this.logFailedRequest(protocol_1.WorkspaceSymbolRequest.type, error); + return Promise.resolve([]); + }); + } + }); + } + createCodeActionsProvider(options) { + return vscode_1.languages.registerCodeActionsProvider(options.documentSelector, { + provideCodeActions: (document, range, context, token) => { + let params = { + textDocument: this._c2p.asTextDocumentIdentifier(document), + range: this._c2p.asRange(range), + context: this._c2p.asCodeActionContext(context) + }; + return this.sendRequest(protocol_1.CodeActionRequest.type, params, token).then(this._p2c.asCommands, (error) => { + this.logFailedRequest(protocol_1.CodeActionRequest.type, error); + return Promise.resolve([]); + }); + } + }); + } + createCodeLensProvider(options) { + return vscode_1.languages.registerCodeLensProvider(options.documentSelector, { + provideCodeLenses: (document, token) => { + return this.sendRequest(protocol_1.CodeLensRequest.type, this._c2p.asCodeLensParams(document), token).then(this._p2c.asCodeLenses, (error) => { + this.logFailedRequest(protocol_1.CodeLensRequest.type, error); + return Promise.resolve([]); + }); + }, + resolveCodeLens: (options.resolveProvider) + ? (codeLens, token) => { + return this.sendRequest(protocol_1.CodeLensResolveRequest.type, this._c2p.asCodeLens(codeLens), token).then(this._p2c.asCodeLens, (error) => { + this.logFailedRequest(protocol_1.CodeLensResolveRequest.type, error); + return codeLens; + }); + } + : undefined + }); + } + createDocumentFormattingProvider(options) { + return vscode_1.languages.registerDocumentFormattingEditProvider(options.documentSelector, { + provideDocumentFormattingEdits: (document, options, token) => { + let params = { + textDocument: this._c2p.asTextDocumentIdentifier(document), + options: this._c2p.asFormattingOptions(options) + }; + return this.sendRequest(protocol_1.DocumentFormattingRequest.type, params, token).then(this._p2c.asTextEdits, (error) => { + this.logFailedRequest(protocol_1.DocumentFormattingRequest.type, error); + return Promise.resolve([]); + }); + } + }); + } + createDocumentRangeFormattingProvider(options) { + return vscode_1.languages.registerDocumentRangeFormattingEditProvider(options.documentSelector, { + provideDocumentRangeFormattingEdits: (document, range, options, token) => { + let params = { + textDocument: this._c2p.asTextDocumentIdentifier(document), + range: this._c2p.asRange(range), + options: this._c2p.asFormattingOptions(options) + }; + return this.sendRequest(protocol_1.DocumentRangeFormattingRequest.type, params, token).then(this._p2c.asTextEdits, (error) => { + this.logFailedRequest(protocol_1.DocumentRangeFormattingRequest.type, error); + return Promise.resolve([]); + }); + } + }); + } + createDocumentOnTypeFormattingProvider(options) { + let moreTriggerCharacter = options.moreTriggerCharacter || []; + return vscode_1.languages.registerOnTypeFormattingEditProvider(options.documentSelector, { + provideOnTypeFormattingEdits: (document, position, ch, options, token) => { + let params = { + textDocument: this._c2p.asTextDocumentIdentifier(document), + position: this._c2p.asPosition(position), + ch: ch, + options: this._c2p.asFormattingOptions(options) + }; + return this.sendRequest(protocol_1.DocumentOnTypeFormattingRequest.type, params, token).then(this._p2c.asTextEdits, (error) => { + this.logFailedRequest(protocol_1.DocumentOnTypeFormattingRequest.type, error); + return Promise.resolve([]); + }); + } + }, options.firstTriggerCharacter, ...moreTriggerCharacter); + } + createRenameProvider(options) { + return vscode_1.languages.registerRenameProvider(options.documentSelector, { + provideRenameEdits: (document, position, newName, token) => { + let params = { + textDocument: this._c2p.asTextDocumentIdentifier(document), + position: this._c2p.asPosition(position), + newName: newName + }; + return this.sendRequest(protocol_1.RenameRequest.type, params, token).then(this._p2c.asWorkspaceEdit, (error) => { + this.logFailedRequest(protocol_1.RenameRequest.type, error); + Promise.resolve(new Error(error.message)); + }); + } + }); + } + createDocumentLinkProvider(options) { + return vscode_1.languages.registerDocumentLinkProvider(options.documentSelector, { + provideDocumentLinks: (document, token) => { + return this.sendRequest(protocol_1.DocumentLinkRequest.type, this._c2p.asDocumentLinkParams(document), token).then(this._p2c.asDocumentLinks, (error) => { + this.logFailedRequest(protocol_1.DocumentLinkRequest.type, error); + Promise.resolve(new Error(error.message)); + }); + }, + resolveDocumentLink: options.resolveProvider + ? (link, token) => { + return this.sendRequest(protocol_1.DocumentLinkResolveRequest.type, this._c2p.asDocumentLink(link), token).then(this._p2c.asDocumentLink, (error) => { + this.logFailedRequest(protocol_1.DocumentLinkResolveRequest.type, error); + Promise.resolve(new Error(error.message)); + }); + } + : undefined + }); + } +} +exports.LanguageClient = LanguageClient; +class SettingMonitor { + constructor(_client, _setting) { + this._client = _client; + this._setting = _setting; + this._listeners = []; + } + start() { + vscode_1.workspace.onDidChangeConfiguration(this.onDidChangeConfiguration, this, this._listeners); + this.onDidChangeConfiguration(); + return new vscode_1.Disposable(() => { + if (this._client.needsStop()) { + this._client.stop(); + } + }); + } + onDidChangeConfiguration() { + let index = this._setting.indexOf('.'); + let primary = index >= 0 ? this._setting.substr(0, index) : this._setting; + let rest = index >= 0 ? this._setting.substr(index + 1) : undefined; + let enabled = rest ? vscode_1.workspace.getConfiguration(primary).get(rest, false) : vscode_1.workspace.getConfiguration(primary); + if (enabled && this._client.needsStart()) { + this._client.start(); + } + else if (!enabled && this._client.needsStop()) { + this._client.stop(); + } + } +} +exports.SettingMonitor = SettingMonitor; diff --git a/node_modules/vscode-languageclient/lib/protocol.d.ts b/node_modules/vscode-languageclient/lib/protocol.d.ts new file mode 100644 index 0000000..6549b44 --- /dev/null +++ b/node_modules/vscode-languageclient/lib/protocol.d.ts @@ -0,0 +1,1244 @@ +import { RequestType, RequestType0, NotificationType, NotificationType0 } from 'vscode-jsonrpc'; +import { TextDocumentContentChangeEvent, Position, Range, Location, Diagnostic, Command, TextEdit, WorkspaceEdit, WorkspaceSymbolParams, TextDocumentIdentifier, VersionedTextDocumentIdentifier, TextDocumentItem, TextDocumentSaveReason, CompletionItem, CompletionList, Hover, SignatureHelp, Definition, ReferenceContext, DocumentHighlight, DocumentSymbolParams, SymbolInformation, CodeLens, CodeActionContext, FormattingOptions, DocumentLink } from 'vscode-languageserver-types'; +/** + * A document filter denotes a document by different properties like + * the [language](#TextDocument.languageId), the [scheme](#Uri.scheme) of + * its resource, or a glob-pattern that is applied to the [path](#TextDocument.fileName). + * + * @sample A language filter that applies to typescript files on disk: `{ language: 'typescript', scheme: 'file' }` + * @sample A language filter that applies to all package.json paths: `{ language: 'json', pattern: '**package.json' }` + */ +export interface DocumentFilter { + /** + * A language id, like `typescript`. + */ + language?: string; + /** + * A Uri [scheme](#Uri.scheme), like `file` or `untitled`. + */ + scheme?: string; + /** + * A glob pattern, like `*.{ts,js}`. + */ + pattern?: string; +} +/** + * A document selector is the combination of one or many document filters. + * + * @sample `let sel:DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**∕tsconfig.json' }]`; + */ +export declare type DocumentSelector = DocumentFilter[]; +/** + * General paramters to to regsiter for an notification or to register a provider. + */ +export interface Registration { + /** + * The id used to register the request. The id can be used to deregister + * the request again. + */ + id: string; + /** + * The method to register for. + */ + method: string; + /** + * Options necessary for the registration. + */ + registerOptions?: any; +} +export interface RegistrationParams { + registrations: Registration[]; +} +/** + * The `client/registerFeature` request is sent from the server to the client to register a new feature + * handler on the client side. + */ +export declare namespace RegistrationRequest { + const type: RequestType; +} +/** + * General parameters to unregister a request or notification. + */ +export interface Unregistration { + /** + * The id used to unregister the request or notification. Usually an id + * provided during the register request. + */ + id: string; + /** + * The method to unregister for. + */ + method: string; +} +export interface UnregistrationParams { + unregisterations: Unregistration[]; +} +/** + * The `client/unregisterFeature` request is sent from the server to the client to unregister a previously registered feature + * handler on the client side. + */ +export declare namespace UnregistrationRequest { + const type: RequestType; +} +/** + * A parameter literal used in requests to pass a text document and a position inside that + * document. + */ +export interface TextDocumentPositionParams { + /** + * The text document. + */ + textDocument: TextDocumentIdentifier; + /** + * The position inside the text document. + */ + position: Position; +} +/** + * Workspace specific client capabilities. + */ +export interface WorkspaceClientCapabilites { + /** + * The client supports applying batch edits + * to the workspace. + */ + applyEdit?: boolean; + /** + * Capabilities specific to the `workspace/didChangeConfiguration` notification. + */ + didChangeConfiguration?: { + /** + * Did change configuration notification supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `workspace/didChangeWatchedFiles` notification. + */ + didChangeWatchedFiles?: { + /** + * Did change watched files notification supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `workspace/symbol` request. + */ + symbol?: { + /** + * Symbol request supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `workspace/executeCommand` request. + */ + executeCommand?: { + /** + * Execute command supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; +} +/** + * Text document specific client capabilities. + */ +export interface TextDocumentClientCapabilities { + synchronization?: { + /** + * Whether text document synchronization supports dynamic registration. + */ + dynamicRegistration?: boolean; + /** + * The client supports sending will save notifications. + */ + willSave?: boolean; + /** + * The client supports sending a will save request and + * waits for a response providing text edits which will + * be applied to the document before it is saved. + */ + willSaveWaitUntil?: boolean; + /** + * The client supports did save notifications. + */ + didSave?: boolean; + }; + /** + * Capabilities specific to the `textDocument/completion` + */ + completion?: { + /** + * Whether completion supports dynamic registration. + */ + dynamicRegistration?: boolean; + /** + * The client supports the following `CompletionItem` specific + * capabilities. + */ + completionItem?: { + /** + * Client supports snippets as insert text. + * + * 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. + */ + snippetSupport?: boolean; + }; + }; + /** + * Capabilities specific to the `textDocument/hover` + */ + hover?: { + /** + * Whether hover supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/signatureHelp` + */ + signatureHelp?: { + /** + * Whether signature help supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/references` + */ + references?: { + /** + * Whether references supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/documentHighlight` + */ + documentHighlight?: { + /** + * Whether document highlight supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/documentSymbol` + */ + documentSymbol?: { + /** + * Whether document symbol supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/formatting` + */ + formatting?: { + /** + * Whether formatting supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/rangeFormatting` + */ + rangeFormatting?: { + /** + * Whether range formatting supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/onTypeFormatting` + */ + onTypeFormatting?: { + /** + * Whether on type formatting supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/definition` + */ + definition?: { + /** + * Whether definition supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/codeAction` + */ + codeAction?: { + /** + * Whether code action supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/codeLens` + */ + codeLens?: { + /** + * Whether code lens supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/documentLink` + */ + documentLink?: { + /** + * Whether document link supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/rename` + */ + rename?: { + /** + * Whether rename supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; +} +/** + * Defines the capabilities provided by the client. + */ +export interface ClientCapabilities { + /** + * Workspace specific client capabilities. + */ + workspace?: WorkspaceClientCapabilites; + /** + * Text document specific client capabilities. + */ + textDocument?: TextDocumentClientCapabilities; + /** + * Experimental client capabilities. + */ + experimental?: any; +} +/** + * Defines how the host (editor) should sync + * document changes to the language server. + */ +export declare namespace TextDocumentSyncKind { + /** + * Documents should not be synced at all. + */ + const None = 0; + /** + * Documents are synced by always sending the full content + * of the document. + */ + const Full = 1; + /** + * Documents are synced by sending the full content on open. + * After that only incremental updates to the document are + * send. + */ + const Incremental = 2; +} +export declare type TextDocumentSyncKind = 0 | 1 | 2; +/** + * General text document registration options. + */ +export interface TextDocumentRegistrationOptions { + /** + * A document selector to identify the scope of the registration. If set to null + * the document selector provided on the client side will be used. + */ + documentSelector: DocumentSelector | null; +} +/** + * Completion options. + */ +export interface CompletionOptions { + /** + * The server provides support to resolve additional + * information for a completion item. + */ + resolveProvider?: boolean; + /** + * The characters that trigger completion automatically. + */ + triggerCharacters?: string[]; +} +/** + * Signature help options. + */ +export interface SignatureHelpOptions { + /** + * The characters that trigger signature help + * automatically. + */ + triggerCharacters?: string[]; +} +/** + * Code Lens options. + */ +export interface CodeLensOptions { + /** + * Code lens has a resolve provider as well. + */ + resolveProvider?: boolean; +} +/** + * Format document on type options + */ +export interface DocumentOnTypeFormattingOptions { + /** + * A character on which formatting should be triggered, like `}`. + */ + firstTriggerCharacter: string; + /** + * More trigger characters. + */ + moreTriggerCharacter?: string[]; +} +/** + * Document link options + */ +export interface DocumentLinkOptions { + /** + * Document links have a resolve provider as well. + */ + resolveProvider?: boolean; +} +/** + * Execute command options. + */ +export interface ExecuteCommandOptions { + /** + * The commands to be executed on the server + */ + commands: string[]; +} +/** + * Save options. + */ +export interface SaveOptions { + /** + * The client is supposed to include the content on save. + */ + includeText?: boolean; +} +export interface TextDocumentSyncOptions { + /** + * Open and close notifications are sent to the server. + */ + openClose?: boolean; + /** + * Change notificatins are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full + * and TextDocumentSyncKindIncremental. + */ + change?: TextDocumentSyncKind; + /** + * Will save notifications are sent to the server. + */ + willSave?: boolean; + /** + * Will save wait until requests are sent to the server. + */ + willSaveWaitUntil?: boolean; + /** + * Save notifications are sent to the server. + */ + save?: SaveOptions; +} +/** + * Defines the capabilities provided by a language + * server. + */ +export interface ServerCapabilities { + /** + * Defines how text documents are synced. Is either a detailed structure defining each notification or + * for backwards compatibility the TextDocumentSyncKind number. + */ + textDocumentSync?: TextDocumentSyncOptions | TextDocumentSyncKind; + /** + * The server provides hover support. + */ + hoverProvider?: boolean; + /** + * The server provides completion support. + */ + completionProvider?: CompletionOptions; + /** + * The server provides signature help support. + */ + signatureHelpProvider?: SignatureHelpOptions; + /** + * The server provides goto definition support. + */ + definitionProvider?: boolean; + /** + * The server provides find references support. + */ + referencesProvider?: boolean; + /** + * The server provides document highlight support. + */ + documentHighlightProvider?: boolean; + /** + * The server provides document symbol support. + */ + documentSymbolProvider?: boolean; + /** + * The server provides workspace symbol support. + */ + workspaceSymbolProvider?: boolean; + /** + * The server provides code actions. + */ + codeActionProvider?: boolean; + /** + * The server provides code lens. + */ + codeLensProvider?: CodeLensOptions; + /** + * The server provides document formatting. + */ + documentFormattingProvider?: boolean; + /** + * The server provides document range formatting. + */ + documentRangeFormattingProvider?: boolean; + /** + * The server provides document formatting on typing. + */ + documentOnTypeFormattingProvider?: { + /** + * A character on which formatting should be triggered, like `}`. + */ + firstTriggerCharacter: string; + /** + * More trigger characters. + */ + moreTriggerCharacter?: string[]; + }; + /** + * The server provides rename support. + */ + renameProvider?: boolean; + /** + * The server provides document link support. + */ + documentLinkProvider?: DocumentLinkOptions; + /** + * The server provides execute command support. + */ + executeCommandProvider?: ExecuteCommandOptions; + /** + * Experimental server capabilities. + */ + experimental?: any; +} +/** + * The initialize request is sent from the client to the server. + * It is sent once as the request after starting up the server. + * The requests parameter is of type [InitializeParams](#InitializeParams) + * the response if of type [InitializeResult](#InitializeResult) of a Thenable that + * resolves to such. + */ +export declare namespace InitializeRequest { + const type: RequestType; +} +/** + * The initialize parameters + */ +export interface InitializeParams { + /** + * The process Id of the parent process that started + * the server. + */ + processId: number; + /** + * The rootPath of the workspace. Is null + * if no folder is open. + * + * @deprecated in favour of rootUri. + */ + rootPath?: string | null; + /** + * The rootUri of the workspace. Is null if no + * folder is open. If both `rootPath` and `rootUri` are set + * `rootUri` wins. + */ + rootUri: string | null; + /** + * The capabilities provided by the client (editor or tool) + */ + capabilities: ClientCapabilities; + /** + * User provided initialization options. + */ + initializationOptions?: any; + /** + * The initial trace setting. If omitted trace is disabled ('off'). + */ + trace?: 'off' | 'messages' | 'verbose'; +} +/** + * The result returned from an initilize request. + */ +export interface InitializeResult { + /** + * The capabilities the language server provides. + */ + capabilities: ServerCapabilities; +} +/** + * Known error codes for an `InitializeError`; + */ +export declare namespace InitializeError { + /** + * If the protocol version provided by the client can't be handled by the server. + * @deprecated This initialize error got replaced by client capabilities. There is + * no version handshake in version 3.0x + */ + const unknownProtocolVersion: number; +} +/** + * The data type of the ResponseError if the + * initialize request fails. + */ +export interface InitializeError { + /** + * Indicates whether the client should retry to send the + * initialize request after showing the message provided + * in the {@link ResponseError} + */ + retry: boolean; +} +export interface InitializedParams { +} +/** + * The intialized notification is send from the client to the + * server after the client is fully initialized and the server + * is allowed to send requests from the server to the client. + */ +export declare namespace InitializedNotification { + const type: NotificationType; +} +/** + * A shutdown request is sent from the client to the server. + * It is sent once when the client descides to shutdown the + * server. The only notification that is sent after a shudown request + * is the exit event. + */ +export declare namespace ShutdownRequest { + const type: RequestType0; +} +/** + * The exit event is sent from the client to the server to + * ask the server to exit its process. + */ +export declare namespace ExitNotification { + const type: NotificationType0; +} +/** + * The configuration change notification is sent from the client to the server + * when the client's configuration has changed. The notification contains + * the changed configuration as defined by the language client. + */ +export declare namespace DidChangeConfigurationNotification { + const type: NotificationType; +} +/** + * The parameters of a change configuration notification. + */ +export interface DidChangeConfigurationParams { + /** + * The actual changed settings + */ + settings: any; +} +/** + * The message type + */ +export declare namespace MessageType { + /** + * An error message. + */ + const Error = 1; + /** + * A warning message. + */ + const Warning = 2; + /** + * An information message. + */ + const Info = 3; + /** + * A log message. + */ + const Log = 4; +} +export declare type MessageType = 1 | 2 | 3 | 4; +/** + * The parameters of a notification message. + */ +export interface ShowMessageParams { + /** + * The message type. See {@link MessageType} + */ + type: MessageType; + /** + * The actual message + */ + message: string; +} +/** + * The show message notification is sent from a server to a client to ask + * the client to display a particular message in the user interface. + */ +export declare namespace ShowMessageNotification { + const type: NotificationType; +} +export interface MessageActionItem { + /** + * A short title like 'Retry', 'Open Log' etc. + */ + title: string; +} +export interface ShowMessageRequestParams { + /** + * The message type. See {@link MessageType} + */ + type: MessageType; + /** + * The actual message + */ + message: string; + /** + * The message action items to present. + */ + actions?: MessageActionItem[]; +} +/** + * The show message request is sent from the server to the clinet to show a message + * and a set of options actions to the user. + */ +export declare namespace ShowMessageRequest { + const type: RequestType; +} +/** + * The log message notification is sent from the server to the client to ask + * the client to log a particular message. + */ +export declare namespace LogMessageNotification { + const type: NotificationType; +} +/** + * The log message parameters. + */ +export interface LogMessageParams { + /** + * The message type. See {@link MessageType} + */ + type: MessageType; + /** + * The actual message + */ + message: string; +} +/** + * The telemetry event notification is sent from the server to the client to ask + * the client to log telemetry data. + */ +export declare namespace TelemetryEventNotification { + const type: NotificationType; +} +/** + * The parameters send in a open text document notification + */ +export interface DidOpenTextDocumentParams { + /** + * The document that was opened. + */ + textDocument: TextDocumentItem; +} +/** + * The document open notification is sent from the client to the server to signal + * newly opened text documents. The document's truth is now managed by the client + * and the server must not try to read the document's truth using the document's + * uri. + */ +export declare namespace DidOpenTextDocumentNotification { + const type: NotificationType; +} +/** + * The change text document notification's parameters. + */ +export interface DidChangeTextDocumentParams { + /** + * The document that did change. The version number points + * to the version after all provided content changes have + * been applied. + */ + textDocument: VersionedTextDocumentIdentifier; + /** + * The actual content changes. + */ + contentChanges: TextDocumentContentChangeEvent[]; +} +/** + * Descibe options to be used when registered for text document change events. + */ +export interface TextDocumentChangeRegistrationOptions extends TextDocumentRegistrationOptions { + /** + * How documents are synced to the server. + */ + syncKind: TextDocumentSyncKind; +} +/** + * The document change notification is sent from the client to the server to signal + * changes to a text document. + */ +export declare namespace DidChangeTextDocumentNotification { + const type: NotificationType; +} +/** + * The parameters send in a close text document notification + */ +export interface DidCloseTextDocumentParams { + /** + * The document that was closed. + */ + textDocument: TextDocumentIdentifier; +} +/** + * The document close notification is sent from the client to the server when + * the document got closed in the client. The document's truth now exists + * where the document's uri points to (e.g. if the document's uri is a file uri + * the truth now exists on disk). + */ +export declare namespace DidCloseTextDocumentNotification { + const type: NotificationType; +} +/** + * The parameters send in a save text document notification + */ +export interface DidSaveTextDocumentParams { + /** + * The document that was closed. + */ + textDocument: VersionedTextDocumentIdentifier; + /** + * Optional the content when saved. Depends on the includeText value + * when the save notifcation was requested. + */ + text?: string; +} +/** + * Save registration options. + */ +export interface TextDocumentSaveRegistrationOptions extends TextDocumentRegistrationOptions, SaveOptions { +} +/** + * The document save notification is sent from the client to the server when + * the document got saved in the client. + */ +export declare namespace DidSaveTextDocumentNotification { + const type: NotificationType; +} +/** + * The parameters send in a will save text document notification. + */ +export interface WillSaveTextDocumentParams { + /** + * The document that will be saved. + */ + textDocument: TextDocumentIdentifier; + /** + * The 'TextDocumentSaveReason'. + */ + reason: TextDocumentSaveReason; +} +/** + * A document will save notification is sent from the client to the server before + * the document is actually saved. + */ +export declare namespace WillSaveTextDocumentNotification { + const type: NotificationType; +} +/** + * A document will save request is sent from the client to the server before + * the document is actually saved. The request can return an array of TextEdits + * which will be applied to the text document before it is saved. Please note that + * clients might drop results if computing the text edits took too long or if a + * server constantly fails on this request. This is done to keep the save fast and + * reliable. + */ +export declare namespace WillSaveTextDocumentWaitUntilRequest { + const type: RequestType; +} +/** + * The watched files notification is sent from the client to the server when + * the client detects changes to file watched by the lanaguage client. + */ +export declare namespace DidChangeWatchedFilesNotification { + const type: NotificationType; +} +/** + * The watched files change notification's parameters. + */ +export interface DidChangeWatchedFilesParams { + /** + * The actual file events. + */ + changes: FileEvent[]; +} +/** + * The file event type + */ +export declare namespace FileChangeType { + /** + * The file got created. + */ + const Created = 1; + /** + * The file got changed. + */ + const Changed = 2; + /** + * The file got deleted. + */ + const Deleted = 3; +} +export declare type FileChangeType = 1 | 2 | 3; +/** + * An event describing a file change. + */ +export interface FileEvent { + /** + * The file's uri. + */ + uri: string; + /** + * The change type. + */ + type: FileChangeType; +} +/** + * Diagnostics notification are sent from the server to the client to signal + * results of validation runs. + */ +export declare namespace PublishDiagnosticsNotification { + const type: NotificationType; +} +/** + * The publish diagnostic notification's parameters. + */ +export interface PublishDiagnosticsParams { + /** + * The URI for which diagnostic information is reported. + */ + uri: string; + /** + * An array of diagnostic information items. + */ + diagnostics: Diagnostic[]; +} +/** + * Completion registration options. + */ +export interface CompletionRegistrationOptions extends TextDocumentRegistrationOptions, CompletionOptions { +} +/** + * Request to request completion at a given text document position. The request's + * parameter is of type [TextDocumentPosition](#TextDocumentPosition) the response + * is of type [CompletionItem[]](#CompletionItem) or [CompletionList](#CompletionList) + * or a Thenable that resolves to such. + */ +export declare namespace CompletionRequest { + const type: RequestType; +} +/** + * Request to resolve additional information for a given completion item.The request's + * parameter is of type [CompletionItem](#CompletionItem) the response + * is of type [CompletionItem](#CompletionItem) or a Thenable that resolves to such. + */ +export declare namespace CompletionResolveRequest { + const type: RequestType; +} +/** + * Request to request hover information at a given text document position. The request's + * parameter is of type [TextDocumentPosition](#TextDocumentPosition) the response is of + * type [Hover](#Hover) or a Thenable that resolves to such. + */ +export declare namespace HoverRequest { + const type: RequestType; +} +/** + * Signature help registration options. + */ +export interface SignatureHelpRegistrationOptions extends TextDocumentRegistrationOptions, SignatureHelpOptions { +} +export declare namespace SignatureHelpRequest { + const type: RequestType; +} +/** + * A request to resolve the defintion location of a symbol at a given text + * document position. The request's parameter is of type [TextDocumentPosition] + * (#TextDocumentPosition) the response is of type [Definition](#Definition) or a + * Thenable that resolves to such. + */ +export declare namespace DefinitionRequest { + const type: RequestType; +} +/** + * Parameters for a [ReferencesRequest](#ReferencesRequest). + */ +export interface ReferenceParams extends TextDocumentPositionParams { + context: ReferenceContext; +} +/** + * A request to resolve project-wide references for the symbol denoted + * by the given text document position. The request's parameter is of + * type [ReferenceParams](#ReferenceParams) the response is of type + * [Location[]](#Location) or a Thenable that resolves to such. + */ +export declare namespace ReferencesRequest { + const type: RequestType; +} +/** + * Request to resolve a [DocumentHighlight](#DocumentHighlight) for a given + * text document position. The request's parameter is of type [TextDocumentPosition] + * (#TextDocumentPosition) the request reponse is of type [DocumentHighlight[]] + * (#DocumentHighlight) or a Thenable that resolves to such. + */ +export declare namespace DocumentHighlightRequest { + const type: RequestType; +} +/** + * A request to list all symbols found in a given text document. The request's + * parameter is of type [TextDocumentIdentifier](#TextDocumentIdentifier) the + * response is of type [SymbolInformation[]](#SymbolInformation) or a Thenable + * that resolves to such. + */ +export declare namespace DocumentSymbolRequest { + const type: RequestType; +} +/** + * A request to list project-wide symbols matching the query string given + * by the [WorkspaceSymbolParams](#WorkspaceSymbolParams). The response is + * of type [SymbolInformation[]](#SymbolInformation) or a Thenable that + * resolves to such. + */ +export declare namespace WorkspaceSymbolRequest { + const type: RequestType; +} +/** + * Params for the CodeActionRequest + */ +export interface CodeActionParams { + /** + * The document in which the command was invoked. + */ + textDocument: TextDocumentIdentifier; + /** + * The range for which the command was invoked. + */ + range: Range; + /** + * Context carrying additional information. + */ + context: CodeActionContext; +} +/** + * A request to provide commands for the given text document and range. + */ +export declare namespace CodeActionRequest { + const type: RequestType; +} +/** + * Params for the Code Lens request. + */ +export interface CodeLensParams { + /** + * The document to request code lens for. + */ + textDocument: TextDocumentIdentifier; +} +/** + * Code Lens registration options. + */ +export interface CodeLensRegistrationOptions extends TextDocumentRegistrationOptions, CodeLensOptions { +} +/** + * A request to provide code lens for the given text document. + */ +export declare namespace CodeLensRequest { + const type: RequestType; +} +/** + * A request to resolve a command for a given code lens. + */ +export declare namespace CodeLensResolveRequest { + const type: RequestType; +} +export interface DocumentFormattingParams { + /** + * The document to format. + */ + textDocument: TextDocumentIdentifier; + /** + * The format options + */ + options: FormattingOptions; +} +/** + * A request to to format a whole document. + */ +export declare namespace DocumentFormattingRequest { + const type: RequestType; +} +export interface DocumentRangeFormattingParams { + /** + * The document to format. + */ + textDocument: TextDocumentIdentifier; + /** + * The range to format + */ + range: Range; + /** + * The format options + */ + options: FormattingOptions; +} +/** + * A request to to format a range in a document. + */ +export declare namespace DocumentRangeFormattingRequest { + const type: RequestType; +} +export interface DocumentOnTypeFormattingParams { + /** + * The document to format. + */ + textDocument: TextDocumentIdentifier; + /** + * The position at which this request was send. + */ + position: Position; + /** + * The character that has been typed. + */ + ch: string; + /** + * The format options. + */ + options: FormattingOptions; +} +/** + * Format document on type options + */ +export interface DocumentOnTypeFormattingRegistrationOptions extends TextDocumentRegistrationOptions, DocumentOnTypeFormattingOptions { +} +/** + * A request to format a document on type. + */ +export declare namespace DocumentOnTypeFormattingRequest { + const type: RequestType; +} +export interface RenameParams { + /** + * The document to format. + */ + textDocument: TextDocumentIdentifier; + /** + * The position at which this request was send. + */ + position: Position; + /** + * The new name of the symbol. If the given name is not valid the + * request must return a [ResponseError](#ResponseError) with an + * appropriate message set. + */ + newName: string; +} +/** + * A request to rename a symbol. + */ +export declare namespace RenameRequest { + const type: RequestType; +} +export interface DocumentLinkParams { + /** + * The document to provide document links for. + */ + textDocument: TextDocumentIdentifier; +} +/** + * Document link registration options + */ +export interface DocumentLinkRegistrationOptions extends TextDocumentRegistrationOptions, DocumentLinkOptions { +} +/** + * A request to provide document links + */ +export declare namespace DocumentLinkRequest { + const type: RequestType; +} +/** + * Request to resolve additional information for a given document link. The request's + * parameter is of type [DocumentLink](#DocumentLink) the response + * is of type [DocumentLink](#DocumentLink) or a Thenable that resolves to such. + */ +export declare namespace DocumentLinkResolveRequest { + const type: RequestType; +} +export interface ExecuteCommandParams { + /** + * The identifier of the actual command handler. + */ + command: string; + /** + * Arguments that the command should be invoked with. + */ + arguments?: any[]; +} +/** + * Execute command registration options. + */ +export interface ExecuteCommandRegistrationOptions extends ExecuteCommandOptions { +} +/** + * A request send from the client to the server to execute a command. The request might return + * a workspace edit which the client will apply to the workspace. + */ +export declare namespace ExecuteCommandRequest { + const type: RequestType; +} +/** + * The parameters passed via a apply workspace edit request. + */ +export interface ApplyWorkspaceEditParams { + /** + * The edits to apply. + */ + edit: WorkspaceEdit; +} +/** + * A reponse returned from the apply workspace edit request. + */ +export interface ApplyWorkspaceEditResponse { + /** + * Indicates whether the edit was applied or not. + */ + applied: boolean; +} +/** + * A request sent from the server to the client to modified certain resources. + */ +export declare namespace ApplyWorkspaceEditRequest { + const type: RequestType; +} diff --git a/node_modules/vscode-languageclient/lib/protocol.js b/node_modules/vscode-languageclient/lib/protocol.js new file mode 100644 index 0000000..31e44f8 --- /dev/null +++ b/node_modules/vscode-languageclient/lib/protocol.js @@ -0,0 +1,421 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +'use strict'; +const vscode_jsonrpc_1 = require("vscode-jsonrpc"); +/** + * The `client/registerFeature` request is sent from the server to the client to register a new feature + * handler on the client side. + */ +var RegistrationRequest; +(function (RegistrationRequest) { + RegistrationRequest.type = new vscode_jsonrpc_1.RequestType('client/registerFeature'); +})(RegistrationRequest = exports.RegistrationRequest || (exports.RegistrationRequest = {})); +/** + * The `client/unregisterFeature` request is sent from the server to the client to unregister a previously registered feature + * handler on the client side. + */ +var UnregistrationRequest; +(function (UnregistrationRequest) { + UnregistrationRequest.type = new vscode_jsonrpc_1.RequestType('client/unregisterFeature'); +})(UnregistrationRequest = exports.UnregistrationRequest || (exports.UnregistrationRequest = {})); +/** + * Defines how the host (editor) should sync + * document changes to the language server. + */ +var TextDocumentSyncKind; +(function (TextDocumentSyncKind) { + /** + * Documents should not be synced at all. + */ + TextDocumentSyncKind.None = 0; + /** + * Documents are synced by always sending the full content + * of the document. + */ + TextDocumentSyncKind.Full = 1; + /** + * Documents are synced by sending the full content on open. + * After that only incremental updates to the document are + * send. + */ + TextDocumentSyncKind.Incremental = 2; +})(TextDocumentSyncKind = exports.TextDocumentSyncKind || (exports.TextDocumentSyncKind = {})); +/** + * The initialize request is sent from the client to the server. + * It is sent once as the request after starting up the server. + * The requests parameter is of type [InitializeParams](#InitializeParams) + * the response if of type [InitializeResult](#InitializeResult) of a Thenable that + * resolves to such. + */ +var InitializeRequest; +(function (InitializeRequest) { + InitializeRequest.type = new vscode_jsonrpc_1.RequestType('initialize'); +})(InitializeRequest = exports.InitializeRequest || (exports.InitializeRequest = {})); +/** + * Known error codes for an `InitializeError`; + */ +var InitializeError; +(function (InitializeError) { + /** + * If the protocol version provided by the client can't be handled by the server. + * @deprecated This initialize error got replaced by client capabilities. There is + * no version handshake in version 3.0x + */ + InitializeError.unknownProtocolVersion = 1; +})(InitializeError = exports.InitializeError || (exports.InitializeError = {})); +/** + * The intialized notification is send from the client to the + * server after the client is fully initialized and the server + * is allowed to send requests from the server to the client. + */ +var InitializedNotification; +(function (InitializedNotification) { + InitializedNotification.type = new vscode_jsonrpc_1.NotificationType('initialized'); +})(InitializedNotification = exports.InitializedNotification || (exports.InitializedNotification = {})); +//---- Shutdown Method ---- +/** + * A shutdown request is sent from the client to the server. + * It is sent once when the client descides to shutdown the + * server. The only notification that is sent after a shudown request + * is the exit event. + */ +var ShutdownRequest; +(function (ShutdownRequest) { + ShutdownRequest.type = new vscode_jsonrpc_1.RequestType0('shutdown'); +})(ShutdownRequest = exports.ShutdownRequest || (exports.ShutdownRequest = {})); +//---- Exit Notification ---- +/** + * The exit event is sent from the client to the server to + * ask the server to exit its process. + */ +var ExitNotification; +(function (ExitNotification) { + ExitNotification.type = new vscode_jsonrpc_1.NotificationType0('exit'); +})(ExitNotification = exports.ExitNotification || (exports.ExitNotification = {})); +//---- Configuration notification ---- +/** + * The configuration change notification is sent from the client to the server + * when the client's configuration has changed. The notification contains + * the changed configuration as defined by the language client. + */ +var DidChangeConfigurationNotification; +(function (DidChangeConfigurationNotification) { + DidChangeConfigurationNotification.type = new vscode_jsonrpc_1.NotificationType('workspace/didChangeConfiguration'); +})(DidChangeConfigurationNotification = exports.DidChangeConfigurationNotification || (exports.DidChangeConfigurationNotification = {})); +//---- Message show and log notifications ---- +/** + * The message type + */ +var MessageType; +(function (MessageType) { + /** + * An error message. + */ + MessageType.Error = 1; + /** + * A warning message. + */ + MessageType.Warning = 2; + /** + * An information message. + */ + MessageType.Info = 3; + /** + * A log message. + */ + MessageType.Log = 4; +})(MessageType = exports.MessageType || (exports.MessageType = {})); +/** + * The show message notification is sent from a server to a client to ask + * the client to display a particular message in the user interface. + */ +var ShowMessageNotification; +(function (ShowMessageNotification) { + ShowMessageNotification.type = new vscode_jsonrpc_1.NotificationType('window/showMessage'); +})(ShowMessageNotification = exports.ShowMessageNotification || (exports.ShowMessageNotification = {})); +/** + * The show message request is sent from the server to the clinet to show a message + * and a set of options actions to the user. + */ +var ShowMessageRequest; +(function (ShowMessageRequest) { + ShowMessageRequest.type = new vscode_jsonrpc_1.RequestType('window/showMessageRequest'); +})(ShowMessageRequest = exports.ShowMessageRequest || (exports.ShowMessageRequest = {})); +/** + * The log message notification is sent from the server to the client to ask + * the client to log a particular message. + */ +var LogMessageNotification; +(function (LogMessageNotification) { + LogMessageNotification.type = new vscode_jsonrpc_1.NotificationType('window/logMessage'); +})(LogMessageNotification = exports.LogMessageNotification || (exports.LogMessageNotification = {})); +//---- Telemetry notification +/** + * The telemetry event notification is sent from the server to the client to ask + * the client to log telemetry data. + */ +var TelemetryEventNotification; +(function (TelemetryEventNotification) { + TelemetryEventNotification.type = new vscode_jsonrpc_1.NotificationType('telemetry/event'); +})(TelemetryEventNotification = exports.TelemetryEventNotification || (exports.TelemetryEventNotification = {})); +/** + * The document open notification is sent from the client to the server to signal + * newly opened text documents. The document's truth is now managed by the client + * and the server must not try to read the document's truth using the document's + * uri. + */ +var DidOpenTextDocumentNotification; +(function (DidOpenTextDocumentNotification) { + DidOpenTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/didOpen'); +})(DidOpenTextDocumentNotification = exports.DidOpenTextDocumentNotification || (exports.DidOpenTextDocumentNotification = {})); +/** + * The document change notification is sent from the client to the server to signal + * changes to a text document. + */ +var DidChangeTextDocumentNotification; +(function (DidChangeTextDocumentNotification) { + DidChangeTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/didChange'); +})(DidChangeTextDocumentNotification = exports.DidChangeTextDocumentNotification || (exports.DidChangeTextDocumentNotification = {})); +/** + * The document close notification is sent from the client to the server when + * the document got closed in the client. The document's truth now exists + * where the document's uri points to (e.g. if the document's uri is a file uri + * the truth now exists on disk). + */ +var DidCloseTextDocumentNotification; +(function (DidCloseTextDocumentNotification) { + DidCloseTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/didClose'); +})(DidCloseTextDocumentNotification = exports.DidCloseTextDocumentNotification || (exports.DidCloseTextDocumentNotification = {})); +/** + * The document save notification is sent from the client to the server when + * the document got saved in the client. + */ +var DidSaveTextDocumentNotification; +(function (DidSaveTextDocumentNotification) { + DidSaveTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/didSave'); +})(DidSaveTextDocumentNotification = exports.DidSaveTextDocumentNotification || (exports.DidSaveTextDocumentNotification = {})); +/** + * A document will save notification is sent from the client to the server before + * the document is actually saved. + */ +var WillSaveTextDocumentNotification; +(function (WillSaveTextDocumentNotification) { + WillSaveTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/willSave'); +})(WillSaveTextDocumentNotification = exports.WillSaveTextDocumentNotification || (exports.WillSaveTextDocumentNotification = {})); +/** + * A document will save request is sent from the client to the server before + * the document is actually saved. The request can return an array of TextEdits + * which will be applied to the text document before it is saved. Please note that + * clients might drop results if computing the text edits took too long or if a + * server constantly fails on this request. This is done to keep the save fast and + * reliable. + */ +var WillSaveTextDocumentWaitUntilRequest; +(function (WillSaveTextDocumentWaitUntilRequest) { + WillSaveTextDocumentWaitUntilRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/willSaveWaitUntil'); +})(WillSaveTextDocumentWaitUntilRequest = exports.WillSaveTextDocumentWaitUntilRequest || (exports.WillSaveTextDocumentWaitUntilRequest = {})); +//---- File eventing ---- +/** + * The watched files notification is sent from the client to the server when + * the client detects changes to file watched by the lanaguage client. + */ +var DidChangeWatchedFilesNotification; +(function (DidChangeWatchedFilesNotification) { + DidChangeWatchedFilesNotification.type = new vscode_jsonrpc_1.NotificationType('workspace/didChangeWatchedFiles'); +})(DidChangeWatchedFilesNotification = exports.DidChangeWatchedFilesNotification || (exports.DidChangeWatchedFilesNotification = {})); +/** + * The file event type + */ +var FileChangeType; +(function (FileChangeType) { + /** + * The file got created. + */ + FileChangeType.Created = 1; + /** + * The file got changed. + */ + FileChangeType.Changed = 2; + /** + * The file got deleted. + */ + FileChangeType.Deleted = 3; +})(FileChangeType = exports.FileChangeType || (exports.FileChangeType = {})); +//---- Diagnostic notification ---- +/** + * Diagnostics notification are sent from the server to the client to signal + * results of validation runs. + */ +var PublishDiagnosticsNotification; +(function (PublishDiagnosticsNotification) { + PublishDiagnosticsNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/publishDiagnostics'); +})(PublishDiagnosticsNotification = exports.PublishDiagnosticsNotification || (exports.PublishDiagnosticsNotification = {})); +/** + * Request to request completion at a given text document position. The request's + * parameter is of type [TextDocumentPosition](#TextDocumentPosition) the response + * is of type [CompletionItem[]](#CompletionItem) or [CompletionList](#CompletionList) + * or a Thenable that resolves to such. + */ +var CompletionRequest; +(function (CompletionRequest) { + CompletionRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/completion'); +})(CompletionRequest = exports.CompletionRequest || (exports.CompletionRequest = {})); +/** + * Request to resolve additional information for a given completion item.The request's + * parameter is of type [CompletionItem](#CompletionItem) the response + * is of type [CompletionItem](#CompletionItem) or a Thenable that resolves to such. + */ +var CompletionResolveRequest; +(function (CompletionResolveRequest) { + CompletionResolveRequest.type = new vscode_jsonrpc_1.RequestType('completionItem/resolve'); +})(CompletionResolveRequest = exports.CompletionResolveRequest || (exports.CompletionResolveRequest = {})); +//---- Hover Support ------------------------------- +/** + * Request to request hover information at a given text document position. The request's + * parameter is of type [TextDocumentPosition](#TextDocumentPosition) the response is of + * type [Hover](#Hover) or a Thenable that resolves to such. + */ +var HoverRequest; +(function (HoverRequest) { + HoverRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/hover'); +})(HoverRequest = exports.HoverRequest || (exports.HoverRequest = {})); +var SignatureHelpRequest; +(function (SignatureHelpRequest) { + SignatureHelpRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/signatureHelp'); +})(SignatureHelpRequest = exports.SignatureHelpRequest || (exports.SignatureHelpRequest = {})); +//---- Goto Definition ------------------------------------- +/** + * A request to resolve the defintion location of a symbol at a given text + * document position. The request's parameter is of type [TextDocumentPosition] + * (#TextDocumentPosition) the response is of type [Definition](#Definition) or a + * Thenable that resolves to such. + */ +var DefinitionRequest; +(function (DefinitionRequest) { + DefinitionRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/definition'); +})(DefinitionRequest = exports.DefinitionRequest || (exports.DefinitionRequest = {})); +/** + * A request to resolve project-wide references for the symbol denoted + * by the given text document position. The request's parameter is of + * type [ReferenceParams](#ReferenceParams) the response is of type + * [Location[]](#Location) or a Thenable that resolves to such. + */ +var ReferencesRequest; +(function (ReferencesRequest) { + ReferencesRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/references'); +})(ReferencesRequest = exports.ReferencesRequest || (exports.ReferencesRequest = {})); +//---- Document Highlight ---------------------------------- +/** + * Request to resolve a [DocumentHighlight](#DocumentHighlight) for a given + * text document position. The request's parameter is of type [TextDocumentPosition] + * (#TextDocumentPosition) the request reponse is of type [DocumentHighlight[]] + * (#DocumentHighlight) or a Thenable that resolves to such. + */ +var DocumentHighlightRequest; +(function (DocumentHighlightRequest) { + DocumentHighlightRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/documentHighlight'); +})(DocumentHighlightRequest = exports.DocumentHighlightRequest || (exports.DocumentHighlightRequest = {})); +//---- Document Symbol Provider --------------------------- +/** + * A request to list all symbols found in a given text document. The request's + * parameter is of type [TextDocumentIdentifier](#TextDocumentIdentifier) the + * response is of type [SymbolInformation[]](#SymbolInformation) or a Thenable + * that resolves to such. + */ +var DocumentSymbolRequest; +(function (DocumentSymbolRequest) { + DocumentSymbolRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/documentSymbol'); +})(DocumentSymbolRequest = exports.DocumentSymbolRequest || (exports.DocumentSymbolRequest = {})); +//---- Workspace Symbol Provider --------------------------- +/** + * A request to list project-wide symbols matching the query string given + * by the [WorkspaceSymbolParams](#WorkspaceSymbolParams). The response is + * of type [SymbolInformation[]](#SymbolInformation) or a Thenable that + * resolves to such. + */ +var WorkspaceSymbolRequest; +(function (WorkspaceSymbolRequest) { + WorkspaceSymbolRequest.type = new vscode_jsonrpc_1.RequestType('workspace/symbol'); +})(WorkspaceSymbolRequest = exports.WorkspaceSymbolRequest || (exports.WorkspaceSymbolRequest = {})); +/** + * A request to provide commands for the given text document and range. + */ +var CodeActionRequest; +(function (CodeActionRequest) { + CodeActionRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/codeAction'); +})(CodeActionRequest = exports.CodeActionRequest || (exports.CodeActionRequest = {})); +/** + * A request to provide code lens for the given text document. + */ +var CodeLensRequest; +(function (CodeLensRequest) { + CodeLensRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/codeLens'); +})(CodeLensRequest = exports.CodeLensRequest || (exports.CodeLensRequest = {})); +/** + * A request to resolve a command for a given code lens. + */ +var CodeLensResolveRequest; +(function (CodeLensResolveRequest) { + CodeLensResolveRequest.type = new vscode_jsonrpc_1.RequestType('codeLens/resolve'); +})(CodeLensResolveRequest = exports.CodeLensResolveRequest || (exports.CodeLensResolveRequest = {})); +/** + * A request to to format a whole document. + */ +var DocumentFormattingRequest; +(function (DocumentFormattingRequest) { + DocumentFormattingRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/formatting'); +})(DocumentFormattingRequest = exports.DocumentFormattingRequest || (exports.DocumentFormattingRequest = {})); +/** + * A request to to format a range in a document. + */ +var DocumentRangeFormattingRequest; +(function (DocumentRangeFormattingRequest) { + DocumentRangeFormattingRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/rangeFormatting'); +})(DocumentRangeFormattingRequest = exports.DocumentRangeFormattingRequest || (exports.DocumentRangeFormattingRequest = {})); +/** + * A request to format a document on type. + */ +var DocumentOnTypeFormattingRequest; +(function (DocumentOnTypeFormattingRequest) { + DocumentOnTypeFormattingRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/onTypeFormatting'); +})(DocumentOnTypeFormattingRequest = exports.DocumentOnTypeFormattingRequest || (exports.DocumentOnTypeFormattingRequest = {})); +/** + * A request to rename a symbol. + */ +var RenameRequest; +(function (RenameRequest) { + RenameRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/rename'); +})(RenameRequest = exports.RenameRequest || (exports.RenameRequest = {})); +/** + * A request to provide document links + */ +var DocumentLinkRequest; +(function (DocumentLinkRequest) { + DocumentLinkRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/documentLink'); +})(DocumentLinkRequest = exports.DocumentLinkRequest || (exports.DocumentLinkRequest = {})); +/** + * Request to resolve additional information for a given document link. The request's + * parameter is of type [DocumentLink](#DocumentLink) the response + * is of type [DocumentLink](#DocumentLink) or a Thenable that resolves to such. + */ +var DocumentLinkResolveRequest; +(function (DocumentLinkResolveRequest) { + DocumentLinkResolveRequest.type = new vscode_jsonrpc_1.RequestType('documentLink/resolve'); +})(DocumentLinkResolveRequest = exports.DocumentLinkResolveRequest || (exports.DocumentLinkResolveRequest = {})); +/** + * A request send from the client to the server to execute a command. The request might return + * a workspace edit which the client will apply to the workspace. + */ +var ExecuteCommandRequest; +(function (ExecuteCommandRequest) { + ExecuteCommandRequest.type = new vscode_jsonrpc_1.RequestType('workspace/executeCommand'); +})(ExecuteCommandRequest = exports.ExecuteCommandRequest || (exports.ExecuteCommandRequest = {})); +/** + * A request sent from the server to the client to modified certain resources. + */ +var ApplyWorkspaceEditRequest; +(function (ApplyWorkspaceEditRequest) { + ApplyWorkspaceEditRequest.type = new vscode_jsonrpc_1.RequestType('workspace/applyEdit'); +})(ApplyWorkspaceEditRequest = exports.ApplyWorkspaceEditRequest || (exports.ApplyWorkspaceEditRequest = {})); diff --git a/node_modules/vscode-languageclient/lib/protocolCodeLens.d.ts b/node_modules/vscode-languageclient/lib/protocolCodeLens.d.ts new file mode 100644 index 0000000..d97ee3b --- /dev/null +++ b/node_modules/vscode-languageclient/lib/protocolCodeLens.d.ts @@ -0,0 +1,5 @@ +import * as code from 'vscode'; +export default class ProtocolCodeLens extends code.CodeLens { + data: any; + constructor(range: code.Range); +} diff --git a/node_modules/vscode-languageclient/lib/protocolCodeLens.js b/node_modules/vscode-languageclient/lib/protocolCodeLens.js new file mode 100644 index 0000000..25831aa --- /dev/null +++ b/node_modules/vscode-languageclient/lib/protocolCodeLens.js @@ -0,0 +1,13 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +'use strict'; +const code = require("vscode"); +class ProtocolCodeLens extends code.CodeLens { + constructor(range) { + super(range); + } +} +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = ProtocolCodeLens; diff --git a/node_modules/vscode-languageclient/lib/protocolCompletionItem.d.ts b/node_modules/vscode-languageclient/lib/protocolCompletionItem.d.ts new file mode 100644 index 0000000..39f0063 --- /dev/null +++ b/node_modules/vscode-languageclient/lib/protocolCompletionItem.d.ts @@ -0,0 +1,6 @@ +import * as code from 'vscode'; +export default class ProtocolCompletionItem extends code.CompletionItem { + data: any; + fromEdit: boolean; + constructor(label: string); +} diff --git a/node_modules/vscode-languageclient/lib/protocolCompletionItem.js b/node_modules/vscode-languageclient/lib/protocolCompletionItem.js new file mode 100644 index 0000000..6630cc0 --- /dev/null +++ b/node_modules/vscode-languageclient/lib/protocolCompletionItem.js @@ -0,0 +1,13 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +'use strict'; +const code = require("vscode"); +class ProtocolCompletionItem extends code.CompletionItem { + constructor(label) { + super(label); + } +} +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = ProtocolCompletionItem; diff --git a/node_modules/vscode-languageclient/lib/protocolConverter.d.ts b/node_modules/vscode-languageclient/lib/protocolConverter.d.ts new file mode 100644 index 0000000..a71ffab --- /dev/null +++ b/node_modules/vscode-languageclient/lib/protocolConverter.d.ts @@ -0,0 +1,72 @@ +import * as code from 'vscode'; +import * as ls from 'vscode-languageserver-types'; +import ProtocolCompletionItem from './protocolCompletionItem'; +export interface Converter { + asUri(value: string): code.Uri; + asDiagnostic(diagnostic: ls.Diagnostic): code.Diagnostic; + asDiagnostics(diagnostics: ls.Diagnostic[]): code.Diagnostic[]; + asPosition(value: undefined | null): undefined; + asPosition(value: ls.Position): code.Position; + asPosition(value: ls.Position | undefined | null): code.Position | undefined; + asRange(value: undefined | null): undefined; + asRange(value: ls.Range): code.Range; + asRange(value: ls.Range | undefined | null): code.Range | undefined; + asDiagnosticSeverity(value: number | undefined | null): code.DiagnosticSeverity; + asHover(hover: ls.Hover): code.Hover; + asHover(hover: undefined | null): undefined; + asHover(hover: ls.Hover | undefined | null): code.Hover | undefined; + asCompletionResult(result: ls.CompletionItem[] | ls.CompletionList): code.CompletionItem[] | code.CompletionList; + asCompletionResult(result: undefined | null): undefined; + asCompletionResult(result: ls.CompletionItem[] | ls.CompletionList | undefined | null): code.CompletionItem[] | code.CompletionList | undefined; + asCompletionItem(item: ls.CompletionItem): ProtocolCompletionItem; + asTextEdit(edit: ls.TextEdit): code.TextEdit; + asTextEdits(items: ls.TextEdit[]): code.TextEdit[]; + asTextEdits(items: undefined | null): undefined; + asTextEdits(items: ls.TextEdit[] | undefined | null): code.TextEdit[] | undefined; + asSignatureHelp(item: undefined | null): undefined; + asSignatureHelp(item: ls.SignatureHelp): code.SignatureHelp; + asSignatureHelp(item: ls.SignatureHelp | undefined | null): code.SignatureHelp | undefined; + asSignatureInformation(item: ls.SignatureInformation): code.SignatureInformation; + asSignatureInformations(items: ls.SignatureInformation[]): code.SignatureInformation[]; + asParameterInformation(item: ls.ParameterInformation): code.ParameterInformation; + asParameterInformations(item: ls.ParameterInformation[]): code.ParameterInformation[]; + asDefinitionResult(item: ls.Definition): code.Definition; + asDefinitionResult(item: undefined | null): undefined; + asDefinitionResult(item: ls.Definition | undefined | null): code.Definition | undefined; + asLocation(item: ls.Location): code.Location; + asLocation(item: undefined | null): undefined; + asLocation(item: ls.Location | undefined | null): code.Location | undefined; + asReferences(values: ls.Location[]): code.Location[]; + asReferences(values: undefined | null): code.Location[] | undefined; + asReferences(values: ls.Location[] | undefined | null): code.Location[] | undefined; + asDocumentHighlightKind(item: number): code.DocumentHighlightKind; + asDocumentHighlight(item: ls.DocumentHighlight): code.DocumentHighlight; + asDocumentHighlights(values: ls.DocumentHighlight[]): code.DocumentHighlight[]; + asDocumentHighlights(values: undefined | null): undefined; + asDocumentHighlights(values: ls.DocumentHighlight[] | undefined | null): code.DocumentHighlight[] | undefined; + asSymbolInformation(item: ls.SymbolInformation, uri?: code.Uri): code.SymbolInformation; + asSymbolInformations(values: ls.SymbolInformation[], uri?: code.Uri): code.SymbolInformation[]; + asSymbolInformations(values: undefined | null, uri?: code.Uri): undefined; + asSymbolInformations(values: ls.SymbolInformation[] | undefined | null, uri?: code.Uri): code.SymbolInformation[] | undefined; + asCommand(item: ls.Command): code.Command; + asCommands(items: ls.Command[]): code.Command[]; + asCommands(items: undefined | null): undefined; + asCommands(items: ls.Command[] | undefined | null): code.Command[] | undefined; + asCodeLens(item: ls.CodeLens): code.CodeLens; + asCodeLens(item: undefined | null): undefined; + asCodeLens(item: ls.CodeLens | undefined | null): code.CodeLens | undefined; + asCodeLenses(items: ls.CodeLens[]): code.CodeLens[]; + asCodeLenses(items: undefined | null): undefined; + asCodeLenses(items: ls.CodeLens[] | undefined | null): code.CodeLens[] | undefined; + asWorkspaceEdit(item: ls.WorkspaceEdit): code.WorkspaceEdit; + asWorkspaceEdit(item: undefined | null): undefined; + asWorkspaceEdit(item: ls.WorkspaceEdit | undefined | null): code.WorkspaceEdit | undefined; + asDocumentLink(item: ls.DocumentLink): code.DocumentLink; + asDocumentLinks(items: ls.DocumentLink[]): code.DocumentLink[]; + asDocumentLinks(items: undefined | null): undefined; + asDocumentLinks(items: ls.DocumentLink[] | undefined | null): code.DocumentLink[] | undefined; +} +export interface URIConverter { + (value: string): code.Uri; +} +export declare function createConverter(uriConverter?: URIConverter): Converter; diff --git a/node_modules/vscode-languageclient/lib/protocolConverter.js b/node_modules/vscode-languageclient/lib/protocolConverter.js new file mode 100644 index 0000000..298a489 --- /dev/null +++ b/node_modules/vscode-languageclient/lib/protocolConverter.js @@ -0,0 +1,338 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +'use strict'; +const code = require("vscode"); +const ls = require("vscode-languageserver-types"); +const is = require("./utils/is"); +const protocolCompletionItem_1 = require("./protocolCompletionItem"); +const protocolCodeLens_1 = require("./protocolCodeLens"); +function createConverter(uriConverter) { + const nullConverter = (value) => code.Uri.parse(value); + const _uriConverter = uriConverter || nullConverter; + function asUri(value) { + return _uriConverter(value); + } + function asDiagnostics(diagnostics) { + return diagnostics.map(asDiagnostic); + } + function asDiagnostic(diagnostic) { + let result = new code.Diagnostic(asRange(diagnostic.range), diagnostic.message, asDiagnosticSeverity(diagnostic.severity)); + if (is.number(diagnostic.code) || is.string(diagnostic.code)) { + result.code = diagnostic.code; + } + if (diagnostic.source) { + result.source = diagnostic.source; + } + return result; + } + function asPosition(value) { + if (!value) { + return undefined; + } + return new code.Position(value.line, value.character); + } + function asRange(value) { + if (!value) { + return undefined; + } + return new code.Range(asPosition(value.start), asPosition(value.end)); + } + function asDiagnosticSeverity(value) { + if (value === void 0 || value === null) { + return code.DiagnosticSeverity.Error; + } + switch (value) { + case ls.DiagnosticSeverity.Error: + return code.DiagnosticSeverity.Error; + case ls.DiagnosticSeverity.Warning: + return code.DiagnosticSeverity.Warning; + case ls.DiagnosticSeverity.Information: + return code.DiagnosticSeverity.Information; + case ls.DiagnosticSeverity.Hint: + return code.DiagnosticSeverity.Hint; + } + return code.DiagnosticSeverity.Error; + } + function asHover(hover) { + if (!hover) { + return undefined; + } + return new code.Hover(hover.contents, asRange(hover.range)); + } + function asCompletionResult(result) { + if (!result) { + return undefined; + } + if (Array.isArray(result)) { + let items = result; + return items.map(asCompletionItem); + } + let list = result; + return new code.CompletionList(list.items.map(asCompletionItem), list.isIncomplete); + } + function asCompletionItem(item) { + let result = new protocolCompletionItem_1.default(item.label); + if (item.detail) { + result.detail = item.detail; + } + if (item.documentation) { + result.documentation = item.documentation; + } + ; + if (item.filterText) { + result.filterText = item.filterText; + } + let insertText = asCompletionInsertText(item); + if (insertText) { + result.insertText = insertText.text; + result.range = insertText.range; + result.fromEdit = insertText.fromEdit; + } + // Protocol item kind is 1 based, codes item kind is zero based. + if (is.number(item.kind) && item.kind > 0) { + result.kind = item.kind - 1; + } + if (item.sortText) { + result.sortText = item.sortText; + } + if (item.additionalTextEdits) { + result.additionalTextEdits = asTextEdits(item.additionalTextEdits); + } + if (item.command) { + result.command = asCommand(item.command); + } + if (item.data !== void 0 && item.data !== null) { + result.data = item.data; + } + return result; + } + function asCompletionInsertText(item) { + if (item.textEdit) { + if (item.insertTextFormat === ls.InsertTextFormat.Snippet) { + return { text: new code.SnippetString(item.textEdit.newText), range: asRange(item.textEdit.range), fromEdit: true }; + } + else { + return { text: item.textEdit.newText, range: asRange(item.textEdit.range), fromEdit: true }; + } + } + else if (item.insertText) { + if (item.insertTextFormat === ls.InsertTextFormat.Snippet) { + return { text: new code.SnippetString(item.insertText), fromEdit: false }; + } + else { + return { text: item.insertText, fromEdit: false }; + } + } + else { + return undefined; + } + } + function asTextEdit(edit) { + return new code.TextEdit(asRange(edit.range), edit.newText); + } + function asTextEdits(items) { + if (!items) { + return undefined; + } + return items.map(asTextEdit); + } + function asSignatureHelp(item) { + if (!item) { + return undefined; + } + let result = new code.SignatureHelp(); + if (is.number(item.activeSignature)) { + result.activeSignature = item.activeSignature; + } + else { + // activeSignature was optional in the past + result.activeSignature = 0; + } + if (is.number(item.activeParameter)) { + result.activeParameter = item.activeParameter; + } + else { + // activeParameter was optional in the past + result.activeParameter = 0; + } + if (item.signatures) { + result.signatures = asSignatureInformations(item.signatures); + } + return result; + } + function asSignatureInformations(items) { + return items.map(asSignatureInformation); + } + function asSignatureInformation(item) { + let result = new code.SignatureInformation(item.label); + if (item.documentation) { + result.documentation = item.documentation; + } + if (item.parameters) { + result.parameters = asParameterInformations(item.parameters); + } + return result; + } + function asParameterInformations(item) { + return item.map(asParameterInformation); + } + function asParameterInformation(item) { + let result = new code.ParameterInformation(item.label); + if (item.documentation) { + result.documentation = item.documentation; + } + ; + return result; + } + function asDefinitionResult(item) { + if (!item) { + return undefined; + } + if (is.array(item)) { + return item.map((location) => asLocation(location)); + } + else { + return asLocation(item); + } + } + function asLocation(item) { + if (!item) { + return undefined; + } + return new code.Location(_uriConverter(item.uri), asRange(item.range)); + } + function asReferences(values) { + if (!values) { + return undefined; + } + return values.map(location => asLocation(location)); + } + function asDocumentHighlights(values) { + if (!values) { + return undefined; + } + return values.map(asDocumentHighlight); + } + function asDocumentHighlight(item) { + let result = new code.DocumentHighlight(asRange(item.range)); + if (is.number(item.kind)) { + result.kind = asDocumentHighlightKind(item.kind); + } + return result; + } + function asDocumentHighlightKind(item) { + switch (item) { + case ls.DocumentHighlightKind.Text: + return code.DocumentHighlightKind.Text; + case ls.DocumentHighlightKind.Read: + return code.DocumentHighlightKind.Read; + case ls.DocumentHighlightKind.Write: + return code.DocumentHighlightKind.Write; + } + return code.DocumentHighlightKind.Text; + } + function asSymbolInformations(values, uri) { + if (!values) { + return undefined; + } + return values.map(information => asSymbolInformation(information, uri)); + } + function asSymbolInformation(item, uri) { + // Symbol kind is one based in the protocol and zero based in code. + let result = new code.SymbolInformation(item.name, item.kind - 1, asRange(item.location.range), item.location.uri ? _uriConverter(item.location.uri) : uri); + if (item.containerName) { + result.containerName = item.containerName; + } + return result; + } + function asCommand(item) { + let result = { title: item.title, command: item.command }; + if (item.arguments) { + result.arguments = item.arguments; + } + return result; + } + function asCommands(items) { + if (!items) { + return undefined; + } + return items.map(asCommand); + } + function asCodeLens(item) { + if (!item) { + return undefined; + } + let result = new protocolCodeLens_1.default(asRange(item.range)); + if (item.command) { + result.command = asCommand(item.command); + } + if (item.data !== void 0 && item.data !== null) { + result.data = item.data; + } + return result; + } + function asCodeLenses(items) { + if (!items) { + return undefined; + } + return items.map((codeLens) => asCodeLens(codeLens)); + } + function asWorkspaceEdit(item) { + if (!item) { + return undefined; + } + let result = new code.WorkspaceEdit(); + item.changes.forEach(change => { + result.set(_uriConverter(change.textDocument.uri), asTextEdits(change.edits)); + }); + return result; + } + function asDocumentLink(item) { + let range = asRange(item.range); + let target = item.target ? asUri(item.target) : undefined; + // target must be optional in DocumentLink + return new code.DocumentLink(range, target); + } + function asDocumentLinks(items) { + if (!items) { + return undefined; + } + return items.map(asDocumentLink); + } + return { + asUri, + asDiagnostics, + asDiagnostic, + asRange, + asPosition, + asDiagnosticSeverity, + asHover, + asCompletionResult, + asCompletionItem, + asTextEdit, + asTextEdits, + asSignatureHelp, + asSignatureInformations, + asSignatureInformation, + asParameterInformations, + asParameterInformation, + asDefinitionResult, + asLocation, + asReferences, + asDocumentHighlights, + asDocumentHighlight, + asDocumentHighlightKind, + asSymbolInformations, + asSymbolInformation, + asCommand, + asCommands, + asCodeLens, + asCodeLenses, + asWorkspaceEdit, + asDocumentLink, + asDocumentLinks + }; +} +exports.createConverter = createConverter; diff --git a/node_modules/vscode-languageclient/lib/protocolDiagnostic.d.ts b/node_modules/vscode-languageclient/lib/protocolDiagnostic.d.ts new file mode 100644 index 0000000..87549b7 --- /dev/null +++ b/node_modules/vscode-languageclient/lib/protocolDiagnostic.d.ts @@ -0,0 +1,5 @@ +import * as code from 'vscode'; +export default class ProtocolDiagnostic extends code.Diagnostic { + data: any; + constructor(range: code.Range, message: string, severity?: code.DiagnosticSeverity); +} diff --git a/node_modules/vscode-languageclient/lib/protocolDiagnostic.js b/node_modules/vscode-languageclient/lib/protocolDiagnostic.js new file mode 100644 index 0000000..75a21b9 --- /dev/null +++ b/node_modules/vscode-languageclient/lib/protocolDiagnostic.js @@ -0,0 +1,20 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +'use strict'; +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var code = require('vscode'); +var ProtocolDiagnostic = (function (_super) { + __extends(ProtocolDiagnostic, _super); + function ProtocolDiagnostic(range, message, severity) { + _super.call(this, range, message, severity); + } + return ProtocolDiagnostic; +})(code.Diagnostic); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = ProtocolDiagnostic; diff --git a/node_modules/vscode-languageclient/lib/utils/async.d.ts b/node_modules/vscode-languageclient/lib/utils/async.d.ts new file mode 100644 index 0000000..82b0ec9 --- /dev/null +++ b/node_modules/vscode-languageclient/lib/utils/async.d.ts @@ -0,0 +1,16 @@ +export interface ITask { + (): T; +} +export declare class Delayer { + defaultDelay: number; + private timeout; + private completionPromise; + private onSuccess; + private task; + constructor(defaultDelay: number); + trigger(task: ITask, delay?: number): Promise; + forceDelivery(): T | undefined; + isTriggered(): boolean; + cancel(): void; + private cancelTimeout(); +} diff --git a/node_modules/vscode-languageclient/lib/utils/async.js b/node_modules/vscode-languageclient/lib/utils/async.js new file mode 100644 index 0000000..0fc3710 --- /dev/null +++ b/node_modules/vscode-languageclient/lib/utils/async.js @@ -0,0 +1,63 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +'use strict'; +class Delayer { + constructor(defaultDelay) { + this.defaultDelay = defaultDelay; + this.timeout = undefined; + this.completionPromise = undefined; + this.onSuccess = undefined; + this.task = undefined; + } + trigger(task, delay = this.defaultDelay) { + this.task = task; + if (delay >= 0) { + this.cancelTimeout(); + } + if (!this.completionPromise) { + this.completionPromise = new Promise((resolve) => { + this.onSuccess = resolve; + }).then(() => { + this.completionPromise = undefined; + this.onSuccess = undefined; + var result = this.task(); + this.task = undefined; + return result; + }); + } + if (delay >= 0 || this.timeout === void 0) { + this.timeout = setTimeout(() => { + this.timeout = undefined; + this.onSuccess(undefined); + }, delay >= 0 ? delay : this.defaultDelay); + } + return this.completionPromise; + } + forceDelivery() { + if (!this.completionPromise) { + return undefined; + } + this.cancelTimeout(); + let result = this.task(); + this.completionPromise = undefined; + this.onSuccess = undefined; + this.task = undefined; + return result; + } + isTriggered() { + return this.timeout !== void 0; + } + cancel() { + this.cancelTimeout(); + this.completionPromise = undefined; + } + cancelTimeout() { + if (this.timeout !== void 0) { + clearTimeout(this.timeout); + this.timeout = undefined; + } + } +} +exports.Delayer = Delayer; diff --git a/node_modules/vscode-languageclient/lib/utils/electron.d.ts b/node_modules/vscode-languageclient/lib/utils/electron.d.ts new file mode 100644 index 0000000..a9509a8 --- /dev/null +++ b/node_modules/vscode-languageclient/lib/utils/electron.d.ts @@ -0,0 +1,9 @@ +/// +import cp = require('child_process'); +export interface IForkOptions { + cwd?: string; + env?: any; + encoding?: string; + execArgv?: string[]; +} +export declare function fork(modulePath: string, args: string[], options: IForkOptions, callback: (error: any, cp: cp.ChildProcess | undefined) => void): void; diff --git a/node_modules/vscode-languageclient/lib/utils/electron.js b/node_modules/vscode-languageclient/lib/utils/electron.js new file mode 100644 index 0000000..8ac6bd9 --- /dev/null +++ b/node_modules/vscode-languageclient/lib/utils/electron.js @@ -0,0 +1,96 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +'use strict'; +const path = require("path"); +const os = require("os"); +const net = require("net"); +const cp = require("child_process"); +function makeRandomHexString(length) { + let chars = ['0', '1', '2', '3', '4', '5', '6', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f']; + let result = ''; + for (let i = 0; i < length; i++) { + let idx = Math.floor(chars.length * Math.random()); + result += chars[idx]; + } + return result; +} +function generatePipeName() { + var randomName = 'vscode-' + makeRandomHexString(40); + if (process.platform === 'win32') { + return '\\\\.\\pipe\\' + randomName + '-sock'; + } + // Mac/Unix: use socket file + return path.join(os.tmpdir(), randomName + '.sock'); +} +function generatePatchedEnv(env, stdInPipeName, stdOutPipeName) { + // Set the two unique pipe names and the electron flag as process env + var newEnv = {}; + for (var key in env) { + newEnv[key] = env[key]; + } + newEnv['STDIN_PIPE_NAME'] = stdInPipeName; + newEnv['STDOUT_PIPE_NAME'] = stdOutPipeName; + newEnv['ATOM_SHELL_INTERNAL_RUN_AS_NODE'] = '1'; + return newEnv; +} +function fork(modulePath, args, options, callback) { + var callbackCalled = false; + var resolve = (result) => { + if (callbackCalled) { + return; + } + callbackCalled = true; + callback(undefined, result); + }; + var reject = (err) => { + if (callbackCalled) { + return; + } + callbackCalled = true; + callback(err, undefined); + }; + // Generate two unique pipe names + var stdInPipeName = generatePipeName(); + var stdOutPipeName = generatePipeName(); + var newEnv = generatePatchedEnv(options.env || process.env, stdInPipeName, stdOutPipeName); + var childProcess; + // Begin listening to stdout pipe + var server = net.createServer((stream) => { + // The child process will write exactly one chunk with content `ready` when it has installed a listener to the stdin pipe + stream.once('data', (_chunk) => { + // The child process is sending me the `ready` chunk, time to connect to the stdin pipe + childProcess.stdin = net.connect(stdInPipeName); + // From now on the childProcess.stdout is available for reading + childProcess.stdout = stream; + resolve(childProcess); + }); + }); + server.listen(stdOutPipeName); + var serverClosed = false; + var closeServer = () => { + if (serverClosed) { + return; + } + serverClosed = true; + server.close(); + }; + // Create the process + let bootstrapperPath = path.join(__dirname, 'electronForkStart'); + childProcess = cp.fork(bootstrapperPath, [modulePath].concat(args), { + silent: true, + cwd: options.cwd, + env: newEnv, + execArgv: options.execArgv + }); + childProcess.once('error', (err) => { + closeServer(); + reject(err); + }); + childProcess.once('exit', (err) => { + closeServer(); + reject(err); + }); +} +exports.fork = fork; diff --git a/node_modules/vscode-languageclient/lib/utils/electronForkStart.d.ts b/node_modules/vscode-languageclient/lib/utils/electronForkStart.d.ts new file mode 100644 index 0000000..3378f8e --- /dev/null +++ b/node_modules/vscode-languageclient/lib/utils/electronForkStart.d.ts @@ -0,0 +1,5 @@ +declare var net: any, fs: any, stream: any, util: any; +declare var ENABLE_LOGGING: boolean; +declare var log: (str: string) => void; +declare var stdInPipeName: any; +declare var stdOutPipeName: any; diff --git a/node_modules/vscode-languageclient/lib/utils/electronForkStart.js b/node_modules/vscode-languageclient/lib/utils/electronForkStart.js new file mode 100644 index 0000000..6a1cff9 --- /dev/null +++ b/node_modules/vscode-languageclient/lib/utils/electronForkStart.js @@ -0,0 +1,146 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +var net = require('net'), fs = require('fs'), stream = require('stream'), util = require('util'); +var ENABLE_LOGGING = false; +var log = (function () { + if (!ENABLE_LOGGING) { + return function () { }; + } + var isFirst = true; + var LOG_LOCATION = 'C:\\stdFork.log'; + return function log(str) { + if (isFirst) { + isFirst = false; + fs.writeFileSync(LOG_LOCATION, str + '\n'); + return; + } + fs.appendFileSync(LOG_LOCATION, str + '\n'); + }; +})(); +var stdInPipeName = process.env['STDIN_PIPE_NAME']; +var stdOutPipeName = process.env['STDOUT_PIPE_NAME']; +log('STDIN_PIPE_NAME: ' + stdInPipeName); +log('STDOUT_PIPE_NAME: ' + stdOutPipeName); +log('ATOM_SHELL_INTERNAL_RUN_AS_NODE: ' + process.env['ATOM_SHELL_INTERNAL_RUN_AS_NODE']); +// stdout redirection to named pipe +(function () { + log('Beginning stdout redirection...'); + // Create a writing stream to the stdout pipe + var stdOutStream = net.connect(stdOutPipeName); + // unref stdOutStream to behave like a normal standard out + stdOutStream.unref(); + // handle process.stdout + process.__defineGetter__('stdout', function () { return stdOutStream; }); + // handle process.stderr + process.__defineGetter__('stderr', function () { return stdOutStream; }); + var fsWriteSyncString = function (fd, str, _position, encoding) { + // fs.writeSync(fd, string[, position[, encoding]]); + var buf = new Buffer(str, encoding || 'utf8'); + return fsWriteSyncBuffer(fd, buf, 0, buf.length); + }; + var fsWriteSyncBuffer = function (_fd, buffer, off, len) { + off = Math.abs(off | 0); + len = Math.abs(len | 0); + // fs.writeSync(fd, buffer, offset, length[, position]); + var buffer_length = buffer.length; + if (off > buffer_length) { + throw new Error('offset out of bounds'); + } + if (len > buffer_length) { + throw new Error('length out of bounds'); + } + if (((off + len) | 0) < off) { + throw new Error('off + len overflow'); + } + if (buffer_length - off < len) { + // Asking for more than is left over in the buffer + throw new Error('off + len > buffer.length'); + } + var slicedBuffer = buffer; + if (off !== 0 || len !== buffer_length) { + slicedBuffer = buffer.slice(off, off + len); + } + stdOutStream.write(slicedBuffer); + return slicedBuffer.length; + }; + // handle fs.writeSync(1, ...) + var originalWriteSync = fs.writeSync; + fs.writeSync = function (fd, data, _position, _encoding) { + if (fd !== 1) { + return originalWriteSync.apply(fs, arguments); + } + // usage: + // fs.writeSync(fd, buffer, offset, length[, position]); + // OR + // fs.writeSync(fd, string[, position[, encoding]]); + if (data instanceof Buffer) { + return fsWriteSyncBuffer.apply(null, arguments); + } + // For compatibility reasons with fs.writeSync, writing null will write "null", etc + if (typeof data !== 'string') { + data += ''; + } + return fsWriteSyncString.apply(null, arguments); + }; + log('Finished defining process.stdout, process.stderr and fs.writeSync'); +})(); +// stdin redirection to named pipe +(function () { + // Begin listening to stdin pipe + var server = net.createServer(function (stream) { + // Stop accepting new connections, keep the existing one alive + server.close(); + log('Parent process has connected to my stdin. All should be good now.'); + // handle process.stdin + process.__defineGetter__('stdin', function () { + return stream; + }); + // Remove myself from process.argv + process.argv.splice(1, 1); + // Load the actual program + var program = process.argv[1]; + log('Loading program: ' + program); + // Unset the custom environmental variables that should not get inherited + delete process.env['STDIN_PIPE_NAME']; + delete process.env['STDOUT_PIPE_NAME']; + delete process.env['ATOM_SHELL_INTERNAL_RUN_AS_NODE']; + require(program); + log('Finished loading program.'); + var stdinIsReferenced = true; + var timer = setInterval(function () { + var listenerCount = (stream.listeners('data').length + + stream.listeners('end').length + + stream.listeners('close').length + + stream.listeners('error').length); + // log('listenerCount: ' + listenerCount); + if (listenerCount <= 1) { + // No more "actual" listeners, only internal node + if (stdinIsReferenced) { + stdinIsReferenced = false; + // log('unreferencing stream!!!'); + stream.unref(); + } + } + else { + // There are "actual" listeners + if (!stdinIsReferenced) { + stdinIsReferenced = true; + stream.ref(); + } + } + // log( + // '' + stream.listeners('data').length + + // ' ' + stream.listeners('end').length + + // ' ' + stream.listeners('close').length + + // ' ' + stream.listeners('error').length + // ); + }, 1000); + timer.unref(); + }); + server.listen(stdInPipeName, function () { + // signal via stdout that the parent process can now begin writing to stdin pipe + process.stdout.write('ready'); + }); +})(); diff --git a/node_modules/vscode-languageclient/lib/utils/is.d.ts b/node_modules/vscode-languageclient/lib/utils/is.d.ts new file mode 100644 index 0000000..8c3812f --- /dev/null +++ b/node_modules/vscode-languageclient/lib/utils/is.d.ts @@ -0,0 +1,9 @@ +export declare function boolean(value: any): value is boolean; +export declare function string(value: any): value is string; +export declare function number(value: any): value is number; +export declare function error(value: any): value is Error; +export declare function func(value: any): value is Function; +export declare function array(value: any): value is T[]; +export declare function stringArray(value: any): value is string[]; +export declare function typedArray(value: any, check: (value: any) => boolean): value is T[]; +export declare function thenable(value: any): value is Thenable; diff --git a/node_modules/vscode-languageclient/lib/utils/is.js b/node_modules/vscode-languageclient/lib/utils/is.js new file mode 100644 index 0000000..8d5a799 --- /dev/null +++ b/node_modules/vscode-languageclient/lib/utils/is.js @@ -0,0 +1,42 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +'use strict'; +const toString = Object.prototype.toString; +function boolean(value) { + return value === true || value === false; +} +exports.boolean = boolean; +function string(value) { + return toString.call(value) === '[object String]'; +} +exports.string = string; +function number(value) { + return toString.call(value) === '[object Number]'; +} +exports.number = number; +function error(value) { + return toString.call(value) === '[object Error]'; +} +exports.error = error; +function func(value) { + return toString.call(value) === '[object Function]'; +} +exports.func = func; +function array(value) { + return Array.isArray(value); +} +exports.array = array; +function stringArray(value) { + return array(value) && value.every(elem => string(elem)); +} +exports.stringArray = stringArray; +function typedArray(value, check) { + return Array.isArray(value) && value.every(check); +} +exports.typedArray = typedArray; +function thenable(value) { + return value && func(value.then); +} +exports.thenable = thenable; diff --git a/node_modules/vscode-languageclient/lib/utils/processes.d.ts b/node_modules/vscode-languageclient/lib/utils/processes.d.ts new file mode 100644 index 0000000..18ba6a1 --- /dev/null +++ b/node_modules/vscode-languageclient/lib/utils/processes.d.ts @@ -0,0 +1,4 @@ +/// +import * as cp from 'child_process'; +import ChildProcess = cp.ChildProcess; +export declare function terminate(process: ChildProcess, cwd?: string): boolean; diff --git a/node_modules/vscode-languageclient/lib/utils/processes.js b/node_modules/vscode-languageclient/lib/utils/processes.js new file mode 100644 index 0000000..60ddfe4 --- /dev/null +++ b/node_modules/vscode-languageclient/lib/utils/processes.js @@ -0,0 +1,45 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +'use strict'; +const cp = require("child_process"); +const path_1 = require("path"); +const isWindows = (process.platform === 'win32'); +const isMacintosh = (process.platform === 'darwin'); +const isLinux = (process.platform === 'linux'); +function terminate(process, cwd) { + if (isWindows) { + try { + // This we run in Atom execFileSync is available. + // Ignore stderr since this is otherwise piped to parent.stderr + // which might be already closed. + let options = { + stdio: ['pipe', 'pipe', 'ignore'] + }; + if (cwd) { + options.cwd = cwd; + } + cp.execFileSync('taskkill', ['/T', '/F', '/PID', process.pid.toString()], options); + return true; + } + catch (err) { + return false; + } + } + else if (isLinux || isMacintosh) { + try { + var cmd = path_1.join(__dirname, 'terminateProcess.sh'); + var result = cp.spawnSync(cmd, [process.pid.toString()]); + return result.error ? false : true; + } + catch (err) { + return false; + } + } + else { + process.kill('SIGKILL'); + return true; + } +} +exports.terminate = terminate; diff --git a/node_modules/vscode-languageclient/lib/utils/uuid.d.ts b/node_modules/vscode-languageclient/lib/utils/uuid.d.ts new file mode 100644 index 0000000..bebf783 --- /dev/null +++ b/node_modules/vscode-languageclient/lib/utils/uuid.d.ts @@ -0,0 +1,22 @@ +/** + * Represents a UUID as defined by rfc4122. + */ +export interface UUID { + /** + * @returns the canonical representation in sets of hexadecimal numbers separated by dashes. + */ + asHex(): string; + equals(other: UUID): boolean; +} +/** + * An empty UUID that contains only zeros. + */ +export declare const empty: UUID; +export declare function v4(): UUID; +export declare function isUUID(value: string): boolean; +/** + * Parses a UUID that is of the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. + * @param value A uuid string. + */ +export declare function parse(value: string): UUID; +export declare function generateUuid(): string; diff --git a/node_modules/vscode-languageclient/lib/utils/uuid.js b/node_modules/vscode-languageclient/lib/utils/uuid.js new file mode 100644 index 0000000..0f74d67 --- /dev/null +++ b/node_modules/vscode-languageclient/lib/utils/uuid.js @@ -0,0 +1,95 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; +class ValueUUID { + constructor(_value) { + this._value = _value; + // empty + } + asHex() { + return this._value; + } + equals(other) { + return this.asHex() === other.asHex(); + } +} +class V4UUID extends ValueUUID { + constructor() { + super([ + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + '-', + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + '-', + '4', + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + '-', + V4UUID._oneOf(V4UUID._timeHighBits), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + '-', + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + ].join('')); + } + static _oneOf(array) { + return array[Math.floor(array.length * Math.random())]; + } + static _randomHex() { + return V4UUID._oneOf(V4UUID._chars); + } +} +V4UUID._chars = ['0', '1', '2', '3', '4', '5', '6', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f']; +V4UUID._timeHighBits = ['8', '9', 'a', 'b']; +/** + * An empty UUID that contains only zeros. + */ +exports.empty = new ValueUUID('00000000-0000-0000-0000-000000000000'); +function v4() { + return new V4UUID(); +} +exports.v4 = v4; +const _UUIDPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i; +function isUUID(value) { + return _UUIDPattern.test(value); +} +exports.isUUID = isUUID; +/** + * Parses a UUID that is of the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. + * @param value A uuid string. + */ +function parse(value) { + if (!isUUID(value)) { + throw new Error('invalid uuid'); + } + return new ValueUUID(value); +} +exports.parse = parse; +function generateUuid() { + return v4().asHex(); +} +exports.generateUuid = generateUuid; diff --git a/node_modules/vscode-languageclient/package.json b/node_modules/vscode-languageclient/package.json new file mode 100644 index 0000000..4ec0eb4 --- /dev/null +++ b/node_modules/vscode-languageclient/package.json @@ -0,0 +1,129 @@ +{ + "_args": [ + [ + { + "raw": "vscode-languageclient@^3.1.0", + "scope": null, + "escapedName": "vscode-languageclient", + "name": "vscode-languageclient", + "rawSpec": "^3.1.0", + "spec": ">=3.1.0 <4.0.0", + "type": "range" + }, + "C:\\Users\\Jan Brodersen\\.vscode\\extensions\\Examples\\vscode-languageserver-node-example\\client" + ] + ], + "_from": "vscode-languageclient@>=3.1.0 <4.0.0", + "_id": "vscode-languageclient@3.1.0", + "_inCache": true, + "_installable": true, + "_location": "/vscode-languageclient", + "_nodeVersion": "6.5.0", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/vscode-languageclient-3.1.0.tgz_1488368158197_0.4392262410838157" + }, + "_npmUser": { + "name": "dbaeumer", + "email": "dirk.baeumer@gmail.com" + }, + "_npmVersion": "3.10.8", + "_phantomChildren": {}, + "_requested": { + "raw": "vscode-languageclient@^3.1.0", + "scope": null, + "escapedName": "vscode-languageclient", + "name": "vscode-languageclient", + "rawSpec": "^3.1.0", + "spec": ">=3.1.0 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-3.1.0.tgz", + "_shasum": "c593431c8ef779814f518acad376817ceb84ddd8", + "_shrinkwrap": null, + "_spec": "vscode-languageclient@^3.1.0", + "_where": "C:\\Users\\Jan Brodersen\\.vscode\\extensions\\Examples\\vscode-languageserver-node-example\\client", + "author": { + "name": "Microsoft Corporation" + }, + "bugs": { + "url": "https://github.com/Microsoft/vscode-languageserver-node/issues" + }, + "dependencies": { + "vscode-jsonrpc": "^3.1.0", + "vscode-languageserver-types": "^3.0.3" + }, + "description": "VSCode Language client implementation", + "devDependencies": { + "@types/node": "^6.0.42", + "typescript": "^2.1.5", + "vscode": "^1.0.0" + }, + "directories": {}, + "dist": { + "shasum": "c593431c8ef779814f518acad376817ceb84ddd8", + "tarball": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-3.1.0.tgz" + }, + "engines": { + "vscode": "^1.8.0" + }, + "homepage": "https://github.com/Microsoft/vscode-languageserver-node#readme", + "license": "MIT", + "main": "./lib/main.js", + "maintainers": [ + { + "name": "aeschli", + "email": "martinae@microsoft.com" + }, + { + "name": "alexandrudima", + "email": "alexdima@microsoft.com" + }, + { + "name": "bpasero", + "email": "benjpas@microsoft.com" + }, + { + "name": "chrisdias", + "email": "cdias@microsoft.com" + }, + { + "name": "dbaeumer", + "email": "dirk.baeumer@gmail.com" + }, + { + "name": "egamma", + "email": "egamma@microsoft.com" + }, + { + "name": "isidor", + "email": "inikolic@microsoft.com" + }, + { + "name": "joaomoreno.ms", + "email": "joao.moreno@microsoft.com" + }, + { + "name": "jrieken", + "email": "jrieken@microsoft.com" + } + ], + "name": "vscode-languageclient", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/Microsoft/vscode-languageserver-node.git" + }, + "scripts": { + "compile": "tsc -p ./src", + "prepublish": "node ./node_modules/vscode/bin/install && tsc -p ./src", + "update-vscode": "node ./node_modules/vscode/bin/install", + "watch": "tsc -w -p ./src" + }, + "typings": "./lib/main", + "version": "3.1.0" +} diff --git a/node_modules/vscode-languageclient/thirdpartynotices.txt b/node_modules/vscode-languageclient/thirdpartynotices.txt new file mode 100644 index 0000000..b7a9030 --- /dev/null +++ b/node_modules/vscode-languageclient/thirdpartynotices.txt @@ -0,0 +1,31 @@ +THIRD-PARTY SOFTWARE NOTICES AND INFORMATION +For Microsoft vscode-languageclient + +This project incorporates material from the project(s) listed below (collectively, “Third Party Code”). +Microsoft is not the original author of the Third Party Code. The original copyright notice and license +under which Microsoft received such Third Party Code are set out below. This Third Party Code is licensed +to you under their original license terms set forth below. Microsoft reserves all other rights not expressly +granted, whether by implication, estoppel or otherwise. + +1. DefinitelyTyped version 0.0.1 (https://github.com/borisyankov/DefinitelyTyped) + +This project is licensed under the MIT license. +Copyrights are respective of each contributor listed at the beginning of each definition file. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/vscode-languageserver-types/.npmignore b/node_modules/vscode-languageserver-types/.npmignore new file mode 100644 index 0000000..2b1e5b1 --- /dev/null +++ b/node_modules/vscode-languageserver-types/.npmignore @@ -0,0 +1,9 @@ +.vscode/ +lib/test/ +lib/*.map +src/ +test/ +.eslintrc +.gitignore +gulpfile.js +tsd.json \ No newline at end of file diff --git a/node_modules/vscode-languageserver-types/License.txt b/node_modules/vscode-languageserver-types/License.txt new file mode 100644 index 0000000..a07e3ae --- /dev/null +++ b/node_modules/vscode-languageserver-types/License.txt @@ -0,0 +1,11 @@ +Copyright (c) Microsoft Corporation + +All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/vscode-languageserver-types/README.md b/node_modules/vscode-languageserver-types/README.md new file mode 100644 index 0000000..567c941 --- /dev/null +++ b/node_modules/vscode-languageserver-types/README.md @@ -0,0 +1,17 @@ +# VSCode Language Server + +[![NPM Version](https://img.shields.io/npm/v/vscode-languageserver-types.svg)](https://npmjs.org/package/vscode-languageserver-types) +[![NPM Downloads](https://img.shields.io/npm/dm/vscode-languageserver-types.svg)](https://npmjs.org/package/vscode-languageserver-types) +[![Build Status](https://travis-ci.org/Microsoft/vscode-languageserver-types-node.svg?branch=master)](https://travis-ci.org/Microsoft/vscode-languageserver-types-node) + +Npm module containing the types used by the VSCode language client and [Node.js](https://nodejs.org/) 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/). + +## 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) \ No newline at end of file diff --git a/node_modules/vscode-languageserver-types/lib/main.d.ts b/node_modules/vscode-languageserver-types/lib/main.d.ts new file mode 100644 index 0000000..e04a742 --- /dev/null +++ b/node_modules/vscode-languageserver-types/lib/main.d.ts @@ -0,0 +1,1067 @@ +/** + * Position in a text document expressed as zero-based line and character offset. + */ +export interface Position { + /** + * Line position in a document (zero-based). + */ + line: number; + /** + * Character offset on a line in a document (zero-based). Assuming that the line is + * represented as a string, the `character` value represents the gap between the + * `character` and `character + 1`. Given the following line: 'a𐐀c', character 0 is + * the gap between the start of the start and 'a' ('|a𐐀c'), character 1 is the gap + * between 'a' and '𐐀' ('a|𐐀c') and character 2 is the gap between '𐐀' and 'b' ('a𐐀|c'). + * + * The string 'a𐐀c' consist of 3 characters with valid character values being 0, 1, 2, 3 + * for that string. Note that the string encoded in UTF-16 is encoded using 4 code units + * (the 𐐀 is encoded using two code units). The character offset is therefore encoding + * independent. + */ + character: number; +} +/** + * The Position namespace provides helper functions to work with + * [Position](#Position) literals. + */ +export declare namespace Position { + /** + * Creates a new Position literal from the given line and character. + * @param line The position's line. + * @param character The position's character. + */ + function create(line: number, character: number): Position; + /** + * Checks whether the given liternal conforms to the [Position](#Position) interface. + */ + function is(value: any): value is Position; +} +/** + * A range in a text document expressed as (zero-based) start and end positions. + */ +export interface Range { + /** + * The range's start position + */ + start: Position; + /** + * The range's end position + */ + end: Position; +} +/** + * The Range namespace provides helper functions to work with + * [Range](#Range) literals. + */ +export declare namespace Range { + /** + * Create a new Range liternal. + * @param start The range's start position. + * @param end The range's end position. + */ + function create(start: Position, end: Position): Range; + /** + * Create a new Range liternal. + * @param startLine The start line number. + * @param startCharacter The start character. + * @param endLine The end line number. + * @param endCharacter The end character. + */ + function create(startLine: number, startCharacter: number, endLine: number, endCharacter: number): Range; + /** + * Checks whether the given literal conforms to the [Range](#Range) interface. + */ + function is(value: any): value is Range; +} +/** + * Represents a location inside a resource, such as a line + * inside a text file. + */ +export interface Location { + uri: string; + range: Range; +} +/** + * The Location namespace provides helper functions to work with + * [Location](#Location) literals. + */ +export declare namespace Location { + /** + * Creates a Location literal. + * @param uri The location's uri. + * @param range The location's range. + */ + function create(uri: string, range: Range): Location; + /** + * Checks whether the given literal conforms to the [Location](#Location) interface. + */ + function is(value: any): value is Location; +} +/** + * The diagnostic's serverity. + */ +export declare namespace DiagnosticSeverity { + /** + * Reports an error. + */ + const Error: 1; + /** + * Reports a warning. + */ + const Warning: 2; + /** + * Reports an information. + */ + const Information: 3; + /** + * Reports a hint. + */ + const Hint: 4; +} +export declare type DiagnosticSeverity = 1 | 2 | 3 | 4; +/** + * Represents a diagnostic, such as a compiler error or warning. Diagnostic objects + * are only valid in the scope of a resource. + */ +export interface Diagnostic { + /** + * The range at which the message applies + */ + range: Range; + /** + * The diagnostic's severity. Can be omitted. If omitted it is up to the + * client to interpret diagnostics as error, warning, info or hint. + */ + severity?: DiagnosticSeverity; + /** + * The diagnostic's code. Can be omitted. + */ + code?: number | string; + /** + * A human-readable string describing the source of this + * diagnostic, e.g. 'typescript' or 'super lint'. + */ + source?: string; + /** + * The diagnostic's message. + */ + message: string; +} +/** + * The Diagnostic namespace provides helper functions to work with + * [Diagnostic](#Diagnostic) literals. + */ +export declare namespace Diagnostic { + /** + * Creates a new Diagnostic literal. + */ + function create(range: Range, message: string, severity?: DiagnosticSeverity, code?: number | string, source?: string): Diagnostic; + /** + * Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface. + */ + function is(value: any): value is Diagnostic; +} +/** + * Represents a reference to a command. Provides a title which + * will be used to represent a command in the UI and, optionally, + * an array of arguments which will be passed to the command handler + * function when invoked. + */ +export interface Command { + /** + * Title of the command, like `save`. + */ + title: string; + /** + * The identifier of the actual command handler. + */ + command: string; + /** + * Arguments that the command handler should be + * invoked with. + */ + arguments?: any[]; +} +/** + * The Command namespace provides helper functions to work with + * [Command](#Command) literals. + */ +export declare namespace Command { + /** + * Creates a new Command literal. + */ + function create(title: string, command: string, ...args: any[]): Command; + /** + * Checks whether the given literal conforms to the [Command](#Command) interface. + */ + function is(value: any): value is Command; +} +/** + * A text edit applicable to a text document. + */ +export interface TextEdit { + /** + * The range of the text document to be manipulated. To insert + * text into a document create a range where start === end. + */ + range: Range; + /** + * The string to be inserted. For delete operations use an + * empty string. + */ + newText: string; +} +/** + * The TextEdit namespace provides helper function to create replace, + * insert and delete edits more easily. + */ +export declare namespace TextEdit { + /** + * Creates a replace text edit. + * @param range The range of text to be replaced. + * @param newText The new text. + */ + function replace(range: Range, newText: string): TextEdit; + /** + * Creates a insert text edit. + * @param psotion The position to insert the text at. + * @param newText The text to be inserted. + */ + function insert(position: Position, newText: string): TextEdit; + /** + * Creates a delete text edit. + * @param range The range of text to be deleted. + */ + function del(range: Range): TextEdit; +} +/** + * Describes textual changes on a text document. + */ +export interface TextDocumentEdit { + /** + * The text document to change. + */ + textDocument: VersionedTextDocumentIdentifier; + /** + * The edits to be applied. + */ + edits: TextEdit[]; +} +/** + * The TextDocumentEdit namespace provides helper function to create + * create a edit that manipulates a text document. + */ +export declare namespace TextDocumentEdit { + /** + * Creates a new `TextDocumentEdit` + */ + function create(textDocument: VersionedTextDocumentIdentifier, edits: TextEdit[]): TextDocumentEdit; + function is(value: any): value is TextDocumentEdit; +} +/** + * A workspace edit represents changes to many resources managed + * in the workspace. + */ +export interface WorkspaceEdit { + changes: TextDocumentEdit[]; +} +/** + * A change to capture text edits for existing resources. + */ +export interface TextEditChange { + /** + * Gets all text edits for this change. + * + * @return An array of text edits. + */ + all(): TextEdit[]; + /** + * Clears the edits for this change. + */ + clear(): void; + /** + * Adds a text edit. + * @param edit the text edit to add. + */ + add(edit: TextEdit): void; + /** + * Insert the given text at the given position. + * + * @param position A position. + * @param newText A string. + */ + insert(position: Position, newText: string): void; + /** + * Replace the given range with given text for the given resource. + * + * @param range A range. + * @param newText A string. + */ + replace(range: Range, newText: string): void; + /** + * Delete the text at the given range. + * + * @param range A range. + */ + delete(range: Range): void; +} +/** + * A workspace change helps constructing changes to a workspace. + */ +export declare class WorkspaceChange { + private _workspaceEdit; + private _textEditChanges; + constructor(workspaceEdit?: WorkspaceEdit); + /** + * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal + * use to be returned from a workspace edit operation like rename. + */ + readonly edit: WorkspaceEdit; + /** + * Returns the [TextEditChange](#TextEditChange) to manage text edits + * for resources. + */ + getTextEditChange(textDocument: VersionedTextDocumentIdentifier): TextEditChange; + getTextEditChange(uri: string): TextEditChange; +} +/** + * A literal to identify a text document in the client. + */ +export interface TextDocumentIdentifier { + /** + * The text document's uri. + */ + uri: string; +} +/** + * The TextDocumentIdentifier namespace provides helper functions to work with + * [TextDocumentIdentifier](#TextDocumentIdentifier) literals. + */ +export declare namespace TextDocumentIdentifier { + /** + * Creates a new TextDocumentIdentifier literal. + * @param uri The document's uri. + */ + function create(uri: string): TextDocumentIdentifier; + /** + * Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface. + */ + function is(value: any): value is TextDocumentIdentifier; +} +/** + * An identifier to denote a specific version of a text document. + */ +export interface VersionedTextDocumentIdentifier extends TextDocumentIdentifier { + /** + * The version number of this document. + */ + version: number; +} +/** + * The VersionedTextDocumentIdentifier namespace provides helper functions to work with + * [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals. + */ +export declare namespace VersionedTextDocumentIdentifier { + /** + * Creates a new VersionedTextDocumentIdentifier literal. + * @param uri The document's uri. + * @param uri The document's text. + */ + function create(uri: string, version: number): VersionedTextDocumentIdentifier; + /** + * Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface. + */ + function is(value: any): value is VersionedTextDocumentIdentifier; +} +/** + * An item to transfer a text document from the client to the + * server. + */ +export interface TextDocumentItem { + /** + * The text document's uri. + */ + uri: string; + /** + * The text document's language identifier + */ + languageId: string; + /** + * The version number of this document (it will strictly increase after each + * change, including undo/redo). + */ + version: number; + /** + * The content of the opened text document. + */ + text: string; +} +/** + * The TextDocumentItem namespace provides helper functions to work with + * [TextDocumentItem](#TextDocumentItem) literals. + */ +export declare namespace TextDocumentItem { + /** + * Creates a new TextDocumentItem literal. + * @param uri The document's uri. + * @param uri The document's language identifier. + * @param uri The document's version number. + * @param uri The document's text. + */ + function create(uri: string, languageId: string, version: number, text: string): TextDocumentItem; + /** + * Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface. + */ + function is(value: any): value is TextDocumentItem; +} +/** + * The kind of a completion entry. + */ +export declare namespace CompletionItemKind { + const Text: 1; + const Method: 2; + const Function: 3; + const Constructor: 4; + const Field: 5; + const Variable: 6; + const Class: 7; + const Interface: 8; + const Module: 9; + const Property: 10; + const Unit: 11; + const Value: 12; + const Enum: 13; + const Keyword: 14; + const Snippet: 15; + const Color: 16; + const File: 17; + const Reference: 18; +} +export declare type CompletionItemKind = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18; +/** + * Defines whether the insert text in a completion item should be interpreted as + * plain text or a snippet. + */ +export declare namespace InsertTextFormat { + /** + * The primary text to be inserted is treated as a plain string. + */ + const PlainText: 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; +} +export declare type InsertTextFormat = 1 | 2; +/** + * A completion item represents a text snippet that is + * proposed to complete text that is being typed. + */ +export interface CompletionItem { + /** + * The label of this completion item. By default + * also the text that is inserted when selecting + * this completion. + */ + label: string; + /** + * The kind of this completion item. Based of the kind + * an icon is chosen by the editor. + */ + kind?: CompletionItemKind; + /** + * A human-readable string with additional information + * about this item, like type or symbol information. + */ + detail?: string; + /** + * A human-readable string that represents a doc-comment. + */ + documentation?: string; + /** + * A string that shoud be used when comparing this item + * with other items. When `falsy` the [label](#CompletionItem.label) + * is used. + */ + sortText?: string; + /** + * A string that should be used when filtering a set of + * completion items. When `falsy` the [label](#CompletionItem.label) + * is used. + */ + filterText?: string; + /** + * A string that should be inserted a document when selecting + * this completion. When `falsy` the [label](#CompletionItem.label) + * is used. + */ + insertText?: string; + /** + * The format of the insert text. The format applies to both the `insertText` property + * and the `newText` property of a provided `textEdit`. + */ + insertTextFormat?: InsertTextFormat; + /** + * An [edit](#TextEdit) which is applied to a document when selecting + * this completion. When an edit is provided the value of + * [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 + * a [CompletionRequest](#CompletionRequest) and a [CompletionResolveRequest] + * (#CompletionResolveRequest) + */ + data?: any; +} +/** + * The CompletionItem namespace provides functions to deal with + * completion items. + */ +export declare namespace CompletionItem { + /** + * Create a completion item and seed it with a label. + * @param label The completion item's label + */ + function create(label: string): CompletionItem; +} +/** + * Represents a collection of [completion items](#CompletionItem) to be presented + * in the editor. + */ +export interface CompletionList { + /** + * This list it not complete. Further typing results in recomputing this list. + */ + isIncomplete: boolean; + /** + * The completion items. + */ + items: CompletionItem[]; +} +/** + * The CompletionList namespace provides functions to deal with + * completion lists. + */ +export declare namespace CompletionList { + /** + * Creates a new completion list. + * + * @param items The completion items. + * @param isIncomplete The list is not complete. + */ + function create(items?: CompletionItem[], isIncomplete?: boolean): CompletionList; +} +/** + * MarkedString can be used to render human readable text. It is either a markdown string + * or a code-block that provides a language and a code snippet. The language identifier + * is sematically equal to the optional language identifier in fenced code blocks in GitHub + * issues. See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting + * + * The pair of a language and a value is an equivalent to markdown: + * ```${language} + * ${value} + * ``` + * + * Note that markdown strings will be sanitized - that means html will be escaped. + */ +export declare type MarkedString = string | { + language: string; + value: string; +}; +export declare namespace MarkedString { + /** + * Creates a marked string from plain text. + * + * @param plainText The plain text. + */ + function fromPlainText(plainText: string): MarkedString; +} +/** + * The result of a hover request. + */ +export interface Hover { + /** + * The hover's content + */ + contents: MarkedString | MarkedString[]; + /** + * An optional range + */ + range?: Range; +} +/** + * Represents a parameter of a callable-signature. A parameter can + * have a label and a doc-comment. + */ +export interface ParameterInformation { + /** + * The label of this signature. Will be shown in + * the UI. + */ + label: string; + /** + * The human-readable doc-comment of this signature. Will be shown + * in the UI but can be omitted. + */ + documentation?: string; +} +/** + * The ParameterInformation namespace provides helper functions to work with + * [ParameterInformation](#ParameterInformation) literals. + */ +export declare namespace ParameterInformation { + /** + * Creates a new parameter information literal. + * + * @param label A label string. + * @param documentation A doc string. + */ + function create(label: string, documentation?: string): ParameterInformation; +} +/** + * Represents the signature of something callable. A signature + * can have a label, like a function-name, a doc-comment, and + * a set of parameters. + */ +export interface SignatureInformation { + /** + * The label of this signature. Will be shown in + * the UI. + */ + label: string; + /** + * The human-readable doc-comment of this signature. Will be shown + * in the UI but can be omitted. + */ + documentation?: string; + /** + * The parameters of this signature. + */ + parameters?: ParameterInformation[]; +} +/** + * The SignatureInformation namespace provides helper functions to work with + * [SignatureInformation](#SignatureInformation) literals. + */ +export declare namespace SignatureInformation { + function create(label: string, documentation?: string, ...parameters: ParameterInformation[]): SignatureInformation; +} +/** + * Signature help represents the signature of something + * callable. There can be multiple signature but only one + * active and only one active parameter. + */ +export interface SignatureHelp { + /** + * One or more signatures. + */ + signatures: SignatureInformation[]; + /** + * The active signature. + */ + activeSignature: number; + /** + * The active parameter of the active signature. + */ + activeParameter: number; +} +/** + * The definition of a symbol represented as one or many [locations](#Location). + * For most programming languages there is only one location at which a symbol is + * defined. + */ +export declare type Definition = Location | Location[]; +/** + * Value-object that contains additional information when + * requesting references. + */ +export interface ReferenceContext { + /** + * Include the declaration of the current symbol. + */ + includeDeclaration: boolean; +} +/** + * A document highlight kind. + */ +export declare namespace DocumentHighlightKind { + /** + * A textual occurrance. + */ + const Text: 1; + /** + * Read-access of a symbol, like reading a variable. + */ + const Read: 2; + /** + * Write-access of a symbol, like writing to a variable. + */ + const Write: 3; +} +export declare type DocumentHighlightKind = 1 | 2 | 3; +/** + * A document highlight is a range inside a text document which deserves + * special attention. Usually a document highlight is visualized by changing + * the background color of its range. + */ +export interface DocumentHighlight { + /** + * The range this highlight applies to. + */ + range: Range; + /** + * The highlight kind, default is [text](#DocumentHighlightKind.Text). + */ + kind?: DocumentHighlightKind; +} +/** + * DocumentHighlight namespace to provide helper functions to work with + * [DocumentHighlight](#DocumentHighlight) literals. + */ +export declare namespace DocumentHighlight { + /** + * Create a DocumentHighlight object. + * @param range The range the highlight applies to. + */ + function create(range: Range, kind?: DocumentHighlightKind): DocumentHighlight; +} +/** + * A symbol kind. + */ +export declare namespace SymbolKind { + const File: 1; + const Module: 2; + const Namespace: 3; + const Package: 4; + const Class: 5; + const Method: 6; + const Property: 7; + const Field: 8; + const Constructor: 9; + const Enum: 10; + const Interface: 11; + const Function: 12; + const Variable: 13; + const Constant: 14; + const String: 15; + const Number: 16; + const Boolean: 17; + const Array: 18; +} +export declare type SymbolKind = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18; +/** + * Represents information about programming constructs like variables, classes, + * interfaces etc. + */ +export interface SymbolInformation { + /** + * The name of this symbol. + */ + name: string; + /** + * The kind of this symbol. + */ + kind: SymbolKind; + /** + * The location of this symbol. + */ + location: Location; + /** + * The name of the symbol containing this symbol. + */ + containerName?: string; +} +export declare namespace SymbolInformation { + /** + * Creates a new symbol information literal. + * + * @param name The name of the symbol. + * @param kind The kind of the symbol. + * @param range The range of the location of the symbol. + * @param uri The resource of the location of symbol, defaults to the current document. + * @param containerName The name of the symbol containg the symbol. + */ + function create(name: string, kind: SymbolKind, range: Range, uri?: string, containerName?: string): SymbolInformation; +} +/** + * Parameters for a [DocumentSymbolRequest](#DocumentSymbolRequest). + */ +export interface DocumentSymbolParams { + /** + * The text document. + */ + textDocument: TextDocumentIdentifier; +} +/** + * The parameters of a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest). + */ +export interface WorkspaceSymbolParams { + /** + * A non-empty query string + */ + query: string; +} +/** + * Contains additional diagnostic information about the context in which + * a [code action](#CodeActionProvider.provideCodeActions) is run. + */ +export interface CodeActionContext { + /** + * An array of diagnostics. + */ + diagnostics: Diagnostic[]; +} +/** + * The CodeActionContext namespace provides helper functions to work with + * [CodeActionContext](#CodeActionContext) literals. + */ +export declare namespace CodeActionContext { + /** + * Creates a new CodeActionContext literal. + */ + function create(diagnostics: Diagnostic[]): CodeActionContext; + /** + * Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface. + */ + function is(value: any): value is CodeActionContext; +} +/** + * A code lens represents a [command](#Command) that should be shown along with + * source text, like the number of references, a way to run tests, etc. + * + * A code lens is _unresolved_ when no command is associated to it. For performance + * reasons the creation of a code lens and resolving should be done to two stages. + */ +export interface CodeLens { + /** + * The range in which this code lens is valid. Should only span a single line. + */ + range: Range; + /** + * The command this code lens represents. + */ + command?: Command; + /** + * An data entry field that is preserved on a code lens item between + * a [CodeLensRequest](#CodeLensRequest) and a [CodeLensResolveRequest] + * (#CodeLensResolveRequest) + */ + data?: any; +} +/** + * The CodeLens namespace provides helper functions to work with + * [CodeLens](#CodeLens) literals. + */ +export declare namespace CodeLens { + /** + * Creates a new CodeLens literal. + */ + function create(range: Range, data?: any): CodeLens; + /** + * Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface. + */ + function is(value: any): value is CodeLens; +} +/** + * Value-object describing what options formatting should use. + */ +export interface FormattingOptions { + /** + * Size of a tab in spaces. + */ + tabSize: number; + /** + * Prefer spaces over tabs. + */ + insertSpaces: boolean; + /** + * Signature for further properties. + */ + [key: string]: boolean | number | string; +} +/** + * The FormattingOptions namespace provides helper functions to work with + * [FormattingOptions](#FormattingOptions) literals. + */ +export declare namespace FormattingOptions { + /** + * Creates a new FormattingOptions literal. + */ + function create(tabSize: number, insertSpaces: boolean): FormattingOptions; + /** + * Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface. + */ + function is(value: any): value is FormattingOptions; +} +/** + * A document link is a range in a text document that links to an internal or external resource, like another + * text document or a web site. + */ +export declare class DocumentLink { + /** + * The range this link applies to. + */ + range: Range; + /** + * The uri this link points to. + */ + target?: string; +} +/** + * The DocumentLink namespace provides helper functions to work with + * [DocumentLink](#DocumentLink) literals. + */ +export declare namespace DocumentLink { + /** + * Creates a new DocumentLink literal. + */ + function create(range: Range, target?: string): DocumentLink; + /** + * Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface. + */ + function is(value: any): value is DocumentLink; +} +export declare const EOL: string[]; +/** + * A simple text document. Not to be implemenented. + */ +export interface TextDocument { + /** + * The associated URI for this document. Most documents have the __file__-scheme, indicating that they + * represent files on disk. However, some documents may have other schemes indicating that they are not + * available on disk. + * + * @readonly + */ + readonly uri: string; + /** + * The identifier of the language associated with this document. + * + * @readonly + */ + readonly languageId: string; + /** + * The version number of this document (it will strictly increase after each + * change, including undo/redo). + * + * @readonly + */ + readonly version: number; + /** + * Get the text of this document. + * + * @return The text of this document. + */ + getText(): string; + /** + * Converts a zero-based offset to a position. + * + * @param offset A zero-based offset. + * @return A valid [position](#Position). + */ + positionAt(offset: number): Position; + /** + * Converts the position to a zero-based offset. + * + * The position will be [adjusted](#TextDocument.validatePosition). + * + * @param position A position. + * @return A valid zero-based offset. + */ + offsetAt(position: Position): number; + /** + * The number of lines in this document. + * + * @readonly + */ + readonly lineCount: number; +} +export declare namespace TextDocument { + /** + * Creates a new ITextDocument literal from the given uri and content. + * @param uri The document's uri. + * @param languageId The document's language Id. + * @param content The document's content. + */ + function create(uri: string, languageId: string, version: number, content: string): TextDocument; + /** + * Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface. + */ + function is(value: any): value is TextDocument; +} +/** + * Event to signal changes to a simple text document. + */ +export interface TextDocumentChangeEvent { + /** + * The document that has changed. + */ + document: TextDocument; +} +/** + * Represents reasons why a text document is saved. + */ +export declare namespace TextDocumentSaveReason { + /** + * Manually triggered, e.g. by the user pressing save, by starting debugging, + * or by an API call. + */ + const Manual: 1; + /** + * Automatic after a delay. + */ + const AfterDelay: 2; + /** + * When the editor lost focus. + */ + const FocusOut: 3; +} +export declare type TextDocumentSaveReason = 1 | 2 | 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 + * the new text is considered to be the full content of the document. + */ +export interface TextDocumentContentChangeEvent { + /** + * The range of the document that changed. + */ + range?: Range; + /** + * The length of the range that got replaced. + */ + rangeLength?: number; + /** + * The new text of the document. + */ + text: string; +} diff --git a/node_modules/vscode-languageserver-types/lib/main.js b/node_modules/vscode-languageserver-types/lib/main.js new file mode 100644 index 0000000..5ff3264 --- /dev/null +++ b/node_modules/vscode-languageserver-types/lib/main.js @@ -0,0 +1,879 @@ +(function (factory) { + if (typeof module === "object" && typeof module.exports === "object") { + var v = factory(require, exports); + if (v !== undefined) module.exports = v; + } + else if (typeof define === "function" && define.amd) { + define(["require", "exports"], factory); + } +})(function (require, exports) { + /* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ + 'use strict'; + /** + * The Position namespace provides helper functions to work with + * [Position](#Position) literals. + */ + var Position; + (function (Position) { + /** + * Creates a new Position literal from the given line and character. + * @param line The position's line. + * @param character The position's character. + */ + function create(line, character) { + return { line: line, character: character }; + } + Position.create = create; + /** + * Checks whether the given liternal conforms to the [Position](#Position) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.number(candidate.line) && Is.number(candidate.character); + } + Position.is = is; + })(Position = exports.Position || (exports.Position = {})); + /** + * The Range namespace provides helper functions to work with + * [Range](#Range) literals. + */ + var Range; + (function (Range) { + function create(one, two, three, four) { + if (Is.number(one) && Is.number(two) && Is.number(three) && Is.number(four)) { + return { start: Position.create(one, two), end: Position.create(three, four) }; + } + else if (Position.is(one) && Position.is(two)) { + return { start: one, end: two }; + } + else { + throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]"); + } + } + Range.create = create; + /** + * Checks whether the given literal conforms to the [Range](#Range) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Position.is(candidate.start) && Position.is(candidate.end); + } + Range.is = is; + })(Range = exports.Range || (exports.Range = {})); + /** + * The Location namespace provides helper functions to work with + * [Location](#Location) literals. + */ + var Location; + (function (Location) { + /** + * Creates a Location literal. + * @param uri The location's uri. + * @param range The location's range. + */ + function create(uri, range) { + return { uri: uri, range: range }; + } + Location.create = create; + /** + * Checks whether the given literal conforms to the [Location](#Location) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri)); + } + Location.is = is; + })(Location = exports.Location || (exports.Location = {})); + /** + * The diagnostic's serverity. + */ + var DiagnosticSeverity; + (function (DiagnosticSeverity) { + /** + * Reports an error. + */ + DiagnosticSeverity.Error = 1; + /** + * Reports a warning. + */ + DiagnosticSeverity.Warning = 2; + /** + * Reports an information. + */ + DiagnosticSeverity.Information = 3; + /** + * Reports a hint. + */ + DiagnosticSeverity.Hint = 4; + })(DiagnosticSeverity = exports.DiagnosticSeverity || (exports.DiagnosticSeverity = {})); + /** + * The Diagnostic namespace provides helper functions to work with + * [Diagnostic](#Diagnostic) literals. + */ + var Diagnostic; + (function (Diagnostic) { + /** + * Creates a new Diagnostic literal. + */ + function create(range, message, severity, code, source) { + var result = { range: range, message: message }; + if (Is.defined(severity)) { + result.severity = severity; + } + if (Is.defined(code)) { + result.code = code; + } + if (Is.defined(source)) { + result.source = source; + } + return result; + } + Diagnostic.create = create; + /** + * Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) + && Range.is(candidate.range) + && Is.string(candidate.message) + && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) + && (Is.number(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) + && (Is.string(candidate.source) || Is.undefined(candidate.source)); + } + Diagnostic.is = is; + })(Diagnostic = exports.Diagnostic || (exports.Diagnostic = {})); + /** + * The Command namespace provides helper functions to work with + * [Command](#Command) literals. + */ + var Command; + (function (Command) { + /** + * Creates a new Command literal. + */ + function create(title, command) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + var result = { title: title, command: command }; + if (Is.defined(args) && args.length > 0) { + result.arguments = args; + } + return result; + } + Command.create = create; + /** + * Checks whether the given literal conforms to the [Command](#Command) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.title); + } + Command.is = is; + })(Command = exports.Command || (exports.Command = {})); + /** + * The TextEdit namespace provides helper function to create replace, + * insert and delete edits more easily. + */ + var TextEdit; + (function (TextEdit) { + /** + * Creates a replace text edit. + * @param range The range of text to be replaced. + * @param newText The new text. + */ + function replace(range, newText) { + return { range: range, newText: newText }; + } + TextEdit.replace = replace; + /** + * Creates a insert text edit. + * @param psotion The position to insert the text at. + * @param newText The text to be inserted. + */ + function insert(position, newText) { + return { range: { start: position, end: position }, newText: newText }; + } + TextEdit.insert = insert; + /** + * Creates a delete text edit. + * @param range The range of text to be deleted. + */ + function del(range) { + return { range: range, newText: '' }; + } + TextEdit.del = del; + })(TextEdit = exports.TextEdit || (exports.TextEdit = {})); + /** + * The TextDocumentEdit namespace provides helper function to create + * create a edit that manipulates a text document. + */ + var TextDocumentEdit; + (function (TextDocumentEdit) { + /** + * Creates a new `TextDocumentEdit` + */ + function create(textDocument, edits) { + return { textDocument: textDocument, edits: edits }; + } + TextDocumentEdit.create = create; + function is(value) { + var candidate = value; + return Is.defined(candidate) + && VersionedTextDocumentIdentifier.is(candidate.textDocument) + && Array.isArray(candidate.edits); + } + TextDocumentEdit.is = is; + })(TextDocumentEdit = exports.TextDocumentEdit || (exports.TextDocumentEdit = {})); + var TextEditChangeImpl = (function () { + function TextEditChangeImpl(edits) { + this.edits = edits; + } + TextEditChangeImpl.prototype.insert = function (position, newText) { + this.edits.push(TextEdit.insert(position, newText)); + }; + TextEditChangeImpl.prototype.replace = function (range, newText) { + this.edits.push(TextEdit.replace(range, newText)); + }; + TextEditChangeImpl.prototype.delete = function (range) { + this.edits.push(TextEdit.del(range)); + }; + TextEditChangeImpl.prototype.add = function (edit) { + this.edits.push(edit); + }; + TextEditChangeImpl.prototype.all = function () { + return this.edits; + }; + TextEditChangeImpl.prototype.clear = function () { + this.edits.splice(0, this.edits.length); + }; + return TextEditChangeImpl; + }()); + /** + * A workspace change helps constructing changes to a workspace. + */ + var WorkspaceChange = (function () { + function WorkspaceChange(workspaceEdit) { + var _this = this; + this._textEditChanges = Object.create(null); + if (workspaceEdit) { + this._workspaceEdit = workspaceEdit; + workspaceEdit.changes.forEach(function (textDocumentEdit) { + var textEditChange = new TextEditChangeImpl(textDocumentEdit.edits); + _this._textEditChanges[textDocumentEdit.textDocument.uri] = textEditChange; + }); + } + else { + this._workspaceEdit = { + changes: [] + }; + } + } + Object.defineProperty(WorkspaceChange.prototype, "edit", { + /** + * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal + * use to be returned from a workspace edit operation like rename. + */ + get: function () { + return this._workspaceEdit; + }, + enumerable: true, + configurable: true + }); + WorkspaceChange.prototype.getTextEditChange = function (key) { + if (VersionedTextDocumentIdentifier.is(key)) { + var textDocument = key; + var result = this._textEditChanges[textDocument.uri]; + if (!result) { + var edits = []; + var textDocumentEdit = { + textDocument: textDocument, + edits: edits + }; + this._workspaceEdit.changes.push(textDocumentEdit); + result = new TextEditChangeImpl(edits); + this._textEditChanges[textDocument.uri] = result; + } + return result; + } + else { + return this._textEditChanges[key]; + } + }; + return WorkspaceChange; + }()); + exports.WorkspaceChange = WorkspaceChange; + /** + * The TextDocumentIdentifier namespace provides helper functions to work with + * [TextDocumentIdentifier](#TextDocumentIdentifier) literals. + */ + var TextDocumentIdentifier; + (function (TextDocumentIdentifier) { + /** + * Creates a new TextDocumentIdentifier literal. + * @param uri The document's uri. + */ + function create(uri) { + return { uri: uri }; + } + TextDocumentIdentifier.create = create; + /** + * Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri); + } + TextDocumentIdentifier.is = is; + })(TextDocumentIdentifier = exports.TextDocumentIdentifier || (exports.TextDocumentIdentifier = {})); + /** + * The VersionedTextDocumentIdentifier namespace provides helper functions to work with + * [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals. + */ + var VersionedTextDocumentIdentifier; + (function (VersionedTextDocumentIdentifier) { + /** + * Creates a new VersionedTextDocumentIdentifier literal. + * @param uri The document's uri. + * @param uri The document's text. + */ + function create(uri, version) { + return { uri: uri, version: version }; + } + VersionedTextDocumentIdentifier.create = create; + /** + * Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && Is.number(candidate.version); + } + VersionedTextDocumentIdentifier.is = is; + })(VersionedTextDocumentIdentifier = exports.VersionedTextDocumentIdentifier || (exports.VersionedTextDocumentIdentifier = {})); + /** + * The TextDocumentItem namespace provides helper functions to work with + * [TextDocumentItem](#TextDocumentItem) literals. + */ + var TextDocumentItem; + (function (TextDocumentItem) { + /** + * Creates a new TextDocumentItem literal. + * @param uri The document's uri. + * @param uri The document's language identifier. + * @param uri The document's version number. + * @param uri The document's text. + */ + function create(uri, languageId, version, text) { + return { uri: uri, languageId: languageId, version: version, text: text }; + } + TextDocumentItem.create = create; + /** + * Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.number(candidate.version) && Is.string(candidate.text); + } + TextDocumentItem.is = is; + })(TextDocumentItem = exports.TextDocumentItem || (exports.TextDocumentItem = {})); + /** + * The kind of a completion entry. + */ + var CompletionItemKind; + (function (CompletionItemKind) { + CompletionItemKind.Text = 1; + CompletionItemKind.Method = 2; + CompletionItemKind.Function = 3; + CompletionItemKind.Constructor = 4; + CompletionItemKind.Field = 5; + CompletionItemKind.Variable = 6; + CompletionItemKind.Class = 7; + CompletionItemKind.Interface = 8; + CompletionItemKind.Module = 9; + CompletionItemKind.Property = 10; + CompletionItemKind.Unit = 11; + CompletionItemKind.Value = 12; + CompletionItemKind.Enum = 13; + CompletionItemKind.Keyword = 14; + CompletionItemKind.Snippet = 15; + CompletionItemKind.Color = 16; + CompletionItemKind.File = 17; + CompletionItemKind.Reference = 18; + })(CompletionItemKind = exports.CompletionItemKind || (exports.CompletionItemKind = {})); + /** + * Defines whether the insert text in a completion item should be interpreted as + * plain text or a snippet. + */ + var InsertTextFormat; + (function (InsertTextFormat) { + /** + * The primary text to be inserted is treated as a plain string. + */ + InsertTextFormat.PlainText = 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 + */ + InsertTextFormat.Snippet = 2; + })(InsertTextFormat = exports.InsertTextFormat || (exports.InsertTextFormat = {})); + /** + * The CompletionItem namespace provides functions to deal with + * completion items. + */ + var CompletionItem; + (function (CompletionItem) { + /** + * Create a completion item and seed it with a label. + * @param label The completion item's label + */ + function create(label) { + return { label: label }; + } + CompletionItem.create = create; + })(CompletionItem = exports.CompletionItem || (exports.CompletionItem = {})); + /** + * The CompletionList namespace provides functions to deal with + * completion lists. + */ + var CompletionList; + (function (CompletionList) { + /** + * Creates a new completion list. + * + * @param items The completion items. + * @param isIncomplete The list is not complete. + */ + function create(items, isIncomplete) { + return { items: items ? items : [], isIncomplete: !!isIncomplete }; + } + CompletionList.create = create; + })(CompletionList = exports.CompletionList || (exports.CompletionList = {})); + var MarkedString; + (function (MarkedString) { + /** + * Creates a marked string from plain text. + * + * @param plainText The plain text. + */ + function fromPlainText(plainText) { + return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&"); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash + } + MarkedString.fromPlainText = fromPlainText; + })(MarkedString = exports.MarkedString || (exports.MarkedString = {})); + /** + * The ParameterInformation namespace provides helper functions to work with + * [ParameterInformation](#ParameterInformation) literals. + */ + var ParameterInformation; + (function (ParameterInformation) { + /** + * Creates a new parameter information literal. + * + * @param label A label string. + * @param documentation A doc string. + */ + function create(label, documentation) { + return documentation ? { label: label, documentation: documentation } : { label: label }; + } + ParameterInformation.create = create; + ; + })(ParameterInformation = exports.ParameterInformation || (exports.ParameterInformation = {})); + /** + * The SignatureInformation namespace provides helper functions to work with + * [SignatureInformation](#SignatureInformation) literals. + */ + var SignatureInformation; + (function (SignatureInformation) { + function create(label, documentation) { + var parameters = []; + for (var _i = 2; _i < arguments.length; _i++) { + parameters[_i - 2] = arguments[_i]; + } + var result = { label: label }; + if (Is.defined(documentation)) { + result.documentation = documentation; + } + if (Is.defined(parameters)) { + result.parameters = parameters; + } + else { + result.parameters = []; + } + return result; + } + SignatureInformation.create = create; + })(SignatureInformation = exports.SignatureInformation || (exports.SignatureInformation = {})); + /** + * A document highlight kind. + */ + var DocumentHighlightKind; + (function (DocumentHighlightKind) { + /** + * A textual occurrance. + */ + DocumentHighlightKind.Text = 1; + /** + * Read-access of a symbol, like reading a variable. + */ + DocumentHighlightKind.Read = 2; + /** + * Write-access of a symbol, like writing to a variable. + */ + DocumentHighlightKind.Write = 3; + })(DocumentHighlightKind = exports.DocumentHighlightKind || (exports.DocumentHighlightKind = {})); + /** + * DocumentHighlight namespace to provide helper functions to work with + * [DocumentHighlight](#DocumentHighlight) literals. + */ + var DocumentHighlight; + (function (DocumentHighlight) { + /** + * Create a DocumentHighlight object. + * @param range The range the highlight applies to. + */ + function create(range, kind) { + var result = { range: range }; + if (Is.number(kind)) { + result.kind = kind; + } + return result; + } + DocumentHighlight.create = create; + })(DocumentHighlight = exports.DocumentHighlight || (exports.DocumentHighlight = {})); + /** + * A symbol kind. + */ + var SymbolKind; + (function (SymbolKind) { + SymbolKind.File = 1; + SymbolKind.Module = 2; + SymbolKind.Namespace = 3; + SymbolKind.Package = 4; + SymbolKind.Class = 5; + SymbolKind.Method = 6; + SymbolKind.Property = 7; + SymbolKind.Field = 8; + SymbolKind.Constructor = 9; + SymbolKind.Enum = 10; + SymbolKind.Interface = 11; + SymbolKind.Function = 12; + SymbolKind.Variable = 13; + SymbolKind.Constant = 14; + SymbolKind.String = 15; + SymbolKind.Number = 16; + SymbolKind.Boolean = 17; + SymbolKind.Array = 18; + })(SymbolKind = exports.SymbolKind || (exports.SymbolKind = {})); + var SymbolInformation; + (function (SymbolInformation) { + /** + * Creates a new symbol information literal. + * + * @param name The name of the symbol. + * @param kind The kind of the symbol. + * @param range The range of the location of the symbol. + * @param uri The resource of the location of symbol, defaults to the current document. + * @param containerName The name of the symbol containg the symbol. + */ + function create(name, kind, range, uri, containerName) { + var result = { + name: name, + kind: kind, + location: { uri: uri, range: range } + }; + if (containerName) { + result.containerName = containerName; + } + return result; + } + SymbolInformation.create = create; + })(SymbolInformation = exports.SymbolInformation || (exports.SymbolInformation = {})); + /** + * The CodeActionContext namespace provides helper functions to work with + * [CodeActionContext](#CodeActionContext) literals. + */ + var CodeActionContext; + (function (CodeActionContext) { + /** + * Creates a new CodeActionContext literal. + */ + function create(diagnostics) { + return { diagnostics: diagnostics }; + } + CodeActionContext.create = create; + /** + * Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is); + } + CodeActionContext.is = is; + })(CodeActionContext = exports.CodeActionContext || (exports.CodeActionContext = {})); + /** + * The CodeLens namespace provides helper functions to work with + * [CodeLens](#CodeLens) literals. + */ + var CodeLens; + (function (CodeLens) { + /** + * Creates a new CodeLens literal. + */ + function create(range, data) { + var result = { range: range }; + if (Is.defined(data)) + result.data = data; + return result; + } + CodeLens.create = create; + /** + * Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command)); + } + CodeLens.is = is; + })(CodeLens = exports.CodeLens || (exports.CodeLens = {})); + /** + * The FormattingOptions namespace provides helper functions to work with + * [FormattingOptions](#FormattingOptions) literals. + */ + var FormattingOptions; + (function (FormattingOptions) { + /** + * Creates a new FormattingOptions literal. + */ + function create(tabSize, insertSpaces) { + return { tabSize: tabSize, insertSpaces: insertSpaces }; + } + FormattingOptions.create = create; + /** + * Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.number(candidate.tabSize) && Is.boolean(candidate.insertSpaces); + } + FormattingOptions.is = is; + })(FormattingOptions = exports.FormattingOptions || (exports.FormattingOptions = {})); + /** + * A document link is a range in a text document that links to an internal or external resource, like another + * text document or a web site. + */ + var DocumentLink = (function () { + function DocumentLink() { + } + return DocumentLink; + }()); + exports.DocumentLink = DocumentLink; + /** + * The DocumentLink namespace provides helper functions to work with + * [DocumentLink](#DocumentLink) literals. + */ + (function (DocumentLink) { + /** + * Creates a new DocumentLink literal. + */ + function create(range, target) { + return { range: range, target: target }; + } + DocumentLink.create = create; + /** + * Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target)); + } + DocumentLink.is = is; + })(DocumentLink = exports.DocumentLink || (exports.DocumentLink = {})); + exports.DocumentLink = DocumentLink; + exports.EOL = ['\n', '\r\n', '\r']; + var TextDocument; + (function (TextDocument) { + /** + * Creates a new ITextDocument literal from the given uri and content. + * @param uri The document's uri. + * @param languageId The document's language Id. + * @param content The document's content. + */ + function create(uri, languageId, version, content) { + return new FullTextDocument(uri, languageId, version, content); + } + TextDocument.create = create; + /** + * Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount) + && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false; + } + TextDocument.is = is; + })(TextDocument = exports.TextDocument || (exports.TextDocument = {})); + /** + * Represents reasons why a text document is saved. + */ + var TextDocumentSaveReason; + (function (TextDocumentSaveReason) { + /** + * Manually triggered, e.g. by the user pressing save, by starting debugging, + * or by an API call. + */ + TextDocumentSaveReason.Manual = 1; + /** + * Automatic after a delay. + */ + TextDocumentSaveReason.AfterDelay = 2; + /** + * When the editor lost focus. + */ + TextDocumentSaveReason.FocusOut = 3; + })(TextDocumentSaveReason = exports.TextDocumentSaveReason || (exports.TextDocumentSaveReason = {})); + var FullTextDocument = (function () { + function FullTextDocument(uri, languageId, version, content) { + this._uri = uri; + this._languageId = languageId; + this._version = version; + this._content = content; + this._lineOffsets = null; + } + Object.defineProperty(FullTextDocument.prototype, "uri", { + get: function () { + return this._uri; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FullTextDocument.prototype, "languageId", { + get: function () { + return this._languageId; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FullTextDocument.prototype, "version", { + get: function () { + return this._version; + }, + enumerable: true, + configurable: true + }); + FullTextDocument.prototype.getText = function () { + return this._content; + }; + FullTextDocument.prototype.update = function (event, version) { + this._content = event.text; + this._version = version; + this._lineOffsets = null; + }; + FullTextDocument.prototype.getLineOffsets = function () { + if (this._lineOffsets === null) { + var lineOffsets = []; + var text = this._content; + var isLineStart = true; + for (var i = 0; i < text.length; i++) { + if (isLineStart) { + lineOffsets.push(i); + isLineStart = false; + } + var ch = text.charAt(i); + isLineStart = (ch === '\r' || ch === '\n'); + if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') { + i++; + } + } + if (isLineStart && text.length > 0) { + lineOffsets.push(text.length); + } + this._lineOffsets = lineOffsets; + } + return this._lineOffsets; + }; + FullTextDocument.prototype.positionAt = function (offset) { + offset = Math.max(Math.min(offset, this._content.length), 0); + var lineOffsets = this.getLineOffsets(); + var low = 0, high = lineOffsets.length; + if (high === 0) { + return Position.create(0, offset); + } + while (low < high) { + var mid = Math.floor((low + high) / 2); + if (lineOffsets[mid] > offset) { + high = mid; + } + else { + low = mid + 1; + } + } + // low is the least x for which the line offset is larger than the current offset + // or array.length if no line offset is larger than the current offset + var line = low - 1; + return Position.create(line, offset - lineOffsets[line]); + }; + FullTextDocument.prototype.offsetAt = function (position) { + var lineOffsets = this.getLineOffsets(); + if (position.line >= lineOffsets.length) { + return this._content.length; + } + else if (position.line < 0) { + return 0; + } + var lineOffset = lineOffsets[position.line]; + var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length; + return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); + }; + Object.defineProperty(FullTextDocument.prototype, "lineCount", { + get: function () { + return this.getLineOffsets().length; + }, + enumerable: true, + configurable: true + }); + return FullTextDocument; + }()); + var Is; + (function (Is) { + var toString = Object.prototype.toString; + function defined(value) { + return typeof value !== 'undefined'; + } + Is.defined = defined; + function undefined(value) { + return typeof value === 'undefined'; + } + Is.undefined = undefined; + function boolean(value) { + return value === true || value === false; + } + Is.boolean = boolean; + function string(value) { + return toString.call(value) === '[object String]'; + } + Is.string = string; + function number(value) { + return toString.call(value) === '[object Number]'; + } + Is.number = number; + function func(value) { + return toString.call(value) === '[object Function]'; + } + Is.func = func; + function typedArray(value, check) { + return Array.isArray(value) && value.every(check); + } + Is.typedArray = typedArray; + })(Is || (Is = {})); +}); diff --git a/node_modules/vscode-languageserver-types/package.json b/node_modules/vscode-languageserver-types/package.json new file mode 100644 index 0000000..318b2b8 --- /dev/null +++ b/node_modules/vscode-languageserver-types/package.json @@ -0,0 +1,116 @@ +{ + "_args": [ + [ + { + "raw": "vscode-languageserver-types@^3.0.3", + "scope": null, + "escapedName": "vscode-languageserver-types", + "name": "vscode-languageserver-types", + "rawSpec": "^3.0.3", + "spec": ">=3.0.3 <4.0.0", + "type": "range" + }, + "C:\\Users\\Jan Brodersen\\.vscode\\extensions\\Examples\\vscode-languageserver-node-example\\client\\node_modules\\vscode-languageclient" + ] + ], + "_from": "vscode-languageserver-types@>=3.0.3 <4.0.0", + "_id": "vscode-languageserver-types@3.0.3", + "_inCache": true, + "_installable": true, + "_location": "/vscode-languageserver-types", + "_nodeVersion": "6.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/vscode-languageserver-types-3.0.3.tgz_1485203696090_0.20128024648874998" + }, + "_npmUser": { + "name": "dbaeumer", + "email": "dirk.baeumer@gmail.com" + }, + "_npmVersion": "3.10.8", + "_phantomChildren": {}, + "_requested": { + "raw": "vscode-languageserver-types@^3.0.3", + "scope": null, + "escapedName": "vscode-languageserver-types", + "name": "vscode-languageserver-types", + "rawSpec": "^3.0.3", + "spec": ">=3.0.3 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/vscode-languageclient" + ], + "_resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.0.3.tgz", + "_shasum": "303b2a307c20952ff5c1f5a608f3c91146028d47", + "_shrinkwrap": null, + "_spec": "vscode-languageserver-types@^3.0.3", + "_where": "C:\\Users\\Jan Brodersen\\.vscode\\extensions\\Examples\\vscode-languageserver-node-example\\client\\node_modules\\vscode-languageclient", + "author": { + "name": "Microsoft Corporation" + }, + "bugs": { + "url": "https://github.com/Microsoft/vscode-languageserver-node/issues" + }, + "dependencies": {}, + "description": "Types used by the Language server for node", + "devDependencies": { + "@types/mocha": "^2.2.32", + "@types/node": "^6.0.42", + "mocha": "^2.4.5", + "typescript": "^2.1.5" + }, + "directories": {}, + "dist": { + "shasum": "303b2a307c20952ff5c1f5a608f3c91146028d47", + "tarball": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.0.3.tgz" + }, + "homepage": "https://github.com/Microsoft/vscode-languageserver-node#readme", + "license": "MIT", + "main": "./lib/main.js", + "maintainers": [ + { + "name": "aeschli", + "email": "martinae@microsoft.com" + }, + { + "name": "alexandrudima", + "email": "alexdima@microsoft.com" + }, + { + "name": "chrisdias", + "email": "cdias@microsoft.com" + }, + { + "name": "dbaeumer", + "email": "dirk.baeumer@gmail.com" + }, + { + "name": "egamma", + "email": "egamma@microsoft.com" + }, + { + "name": "joaomoreno.ms", + "email": "joao.moreno@microsoft.com" + }, + { + "name": "jrieken", + "email": "jrieken@microsoft.com" + } + ], + "name": "vscode-languageserver-types", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/Microsoft/vscode-languageserver-node.git" + }, + "scripts": { + "compile": "tsc -p ./src", + "prepublish": "tsc -p ./src", + "test": "mocha", + "watch": "tsc -w -p ./src" + }, + "typings": "./lib/main", + "version": "3.0.3" +} diff --git a/node_modules/vscode-languageserver/.npmignore b/node_modules/vscode-languageserver/.npmignore new file mode 100644 index 0000000..2b1e5b1 --- /dev/null +++ b/node_modules/vscode-languageserver/.npmignore @@ -0,0 +1,9 @@ +.vscode/ +lib/test/ +lib/*.map +src/ +test/ +.eslintrc +.gitignore +gulpfile.js +tsd.json \ No newline at end of file diff --git a/node_modules/vscode-languageserver/License.txt b/node_modules/vscode-languageserver/License.txt new file mode 100644 index 0000000..a07e3ae --- /dev/null +++ b/node_modules/vscode-languageserver/License.txt @@ -0,0 +1,11 @@ +Copyright (c) Microsoft Corporation + +All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/vscode-languageserver/README.md b/node_modules/vscode-languageserver/README.md new file mode 100644 index 0000000..4198157 --- /dev/null +++ b/node_modules/vscode-languageserver/README.md @@ -0,0 +1,17 @@ +# VSCode Language Server + +[![NPM Version](https://img.shields.io/npm/v/vscode-languageserver.svg)](https://npmjs.org/package/vscode-languageserver) +[![NPM Downloads](https://img.shields.io/npm/dm/vscode-languageserver.svg)](https://npmjs.org/package/vscode-languageserver) +[![Build Status](https://travis-ci.org/Microsoft/vscode-languageserver-node.svg?branch=master)](https://travis-ci.org/Microsoft/vscode-languageserver-node) + +Npm module to implement a VSCode language server using [Node.js](https://nodejs.org/) as a runtime. + +Click [here](https://code.visualstudio.com/docs/extensions/example-language-server) for a detailed document on how to use this npm module +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) \ No newline at end of file diff --git a/node_modules/vscode-languageserver/bin/installServerIntoExtension b/node_modules/vscode-languageserver/bin/installServerIntoExtension new file mode 100644 index 0000000..fa8053e --- /dev/null +++ b/node_modules/vscode-languageserver/bin/installServerIntoExtension @@ -0,0 +1,61 @@ +#!/usr/bin/env node + +var path = require('path'); +var fs = require('fs'); +var cp = require('child_process'); + +var extensionDirectory = process.argv[2]; +if (!extensionDirectory) { + console.error('No extension directory provided.'); + process.exit(1) +} +extensionDirectory = path.resolve(extensionDirectory) +if (!fs.existsSync(extensionDirectory)) { + console.error('Extension directory ' + extensionDirectory + ' doesn\'t exist on disk.'); + process.exit(1); +} + +var packageFile = process.argv[3]; +if (!packageFile) { + console.error('No package.json file provided.'); + process.exit(1); +} +packageFile = path.resolve(packageFile); +if (!fs.existsSync(packageFile)) { + console.error('Package file ' + packageFile + ' doesn\'t exist on disk.'); + process.exit(1); +} +var tsconfigFile = process.argv[4]; +if (!tsconfigFile) { + console.error('No tsconfig.json file provided'); + process.exit(1); +} +tsconfigFile = path.resolve(tsconfigFile); +if (!fs.existsSync(tsconfigFile)) { + console.error('tsconfig file ' + tsconfigFile + ' doesn\'t exist on disk.') + process.exit(1); +} + +var extensionServerDirectory = path.join(extensionDirectory, 'server') + +var json = require(tsconfigFile); +var compilerOptions = json.compilerOptions; +if (compilerOptions) { + var outDir = compilerOptions.outDir; + if (!outDir || path.join(path.dirname(tsconfigFile), outDir) !== extensionServerDirectory) { + console.error('outDir in ' + process.argv[4] + ' must point to ' + extensionServerDirectory + ' but it points to ' + path.join(path.dirname(tsconfigFile), outDir)); + console.error('Please change outDir in ' + process.argv[4] + ' to ' + path.relative(path.dirname(tsconfigFile), extensionServerDirectory).replace(/\\/g, '/')); + process.exit(1); + } +} + +if (!fs.existsSync(extensionServerDirectory)) { + fs.mkdirSync(extensionServerDirectory); +} + +var dest = path.join(extensionServerDirectory, 'package.json'); +console.log('Copying package.json to extension\'s server location...'); +fs.writeFileSync(dest, fs.readFileSync(packageFile)); + +console.log('Updating server npm modules into extension\'s server location...'); +cp.execSync('npm update --production --prefix ' + extensionServerDirectory); \ No newline at end of file diff --git a/node_modules/vscode-languageserver/lib/files.d.ts b/node_modules/vscode-languageserver/lib/files.d.ts new file mode 100644 index 0000000..cb890f5 --- /dev/null +++ b/node_modules/vscode-languageserver/lib/files.d.ts @@ -0,0 +1,14 @@ +/** + * @deprecated Use the `vscode-uri` npm module which provides a more + * complete implementation of handling VS Code URIs. + */ +export declare function uriToFilePath(uri: string): string | undefined; +export declare function resolveModule(workspaceRoot: string, moduleName: string): Thenable; +export declare function resolve(moduleName: string, nodePath: string | undefined, cwd: string, tracer: (message: string, verbose?: string) => void): Thenable; +export declare function resolveGlobalNodePath(tracer?: (message: string) => void): string | undefined; +export declare function resolveModulePath(workspaceRoot: string, moduleName: string, nodePath: string, tracer: (message: string, verbose?: string) => void): Thenable; +/** + * Resolves the given module relative to the given workspace root. In contrast to + * `resolveModule` this method considers the parent chain as well. + */ +export declare function resolveModule2(workspaceRoot: string, moduleName: string, nodePath: string, tracer: (message: string, verbose?: string) => void): Thenable; diff --git a/node_modules/vscode-languageserver/lib/files.js b/node_modules/vscode-languageserver/lib/files.js new file mode 100644 index 0000000..9b51029 --- /dev/null +++ b/node_modules/vscode-languageserver/lib/files.js @@ -0,0 +1,223 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +'use strict'; +const url = require("url"); +const path = require("path"); +const child_process_1 = require("child_process"); +/** + * @deprecated Use the `vscode-uri` npm module which provides a more + * complete implementation of handling VS Code URIs. + */ +function uriToFilePath(uri) { + let parsed = url.parse(uri); + if (parsed.protocol !== 'file:' || !parsed.path) { + return undefined; + } + let segments = parsed.path.split('/'); + for (var i = 0, len = segments.length; i < len; i++) { + segments[i] = decodeURIComponent(segments[i]); + } + if (process.platform === 'win32' && segments.length > 1) { + let first = segments[0]; + let second = segments[1]; + // Do we have a drive letter and we started with a / which is the + // case if the first segement is empty (see split above) + if (first.length === 0 && second.length > 1 && second[1] === ':') { + // Remove first slash + segments.shift(); + } + } + return path.normalize(segments.join('/')); +} +exports.uriToFilePath = uriToFilePath; +function isWindows() { + return process.platform === 'win32'; +} +function resolveModule(workspaceRoot, moduleName) { + let nodePathKey = 'NODE_PATH'; + return new Promise((resolve, reject) => { + let nodePath = []; + if (workspaceRoot) { + nodePath.push(path.join(workspaceRoot, 'node_modules')); + } + child_process_1.exec('npm config get prefix', (error, stdout, _stderr) => { + if (!error) { + let globalPath = stdout.toString().replace(/[\s\r\n]+$/, ''); + if (globalPath.length > 0) { + if (isWindows()) { + nodePath.push(path.join(globalPath, 'node_modules')); + } + else { + nodePath.push(path.join(globalPath, 'lib', 'node_modules')); + } + } + } + let separator = isWindows() ? ';' : ':'; + let env = process.env; + let newEnv = Object.create(null); + Object.keys(env).forEach(key => newEnv[key] = env[key]); + if (newEnv[nodePathKey]) { + newEnv[nodePathKey] = nodePath.join(separator) + separator + newEnv[nodePathKey]; + } + else { + newEnv[nodePathKey] = nodePath.join(separator); + } + try { + let cp = child_process_1.fork(path.join(__dirname, 'resolve.js'), [], { env: newEnv, execArgv: [] }); + cp.on('message', (message) => { + if (message.command === 'resolve') { + let toRequire = moduleName; + if (message.success) { + toRequire = message.result; + } + cp.send({ command: 'exit' }); + try { + resolve(require(toRequire)); + } + catch (error) { + reject(error); + } + } + }); + let message = { + command: 'resolve', + args: moduleName + }; + cp.send(message); + } + catch (error) { + reject(error); + } + }); + }); +} +exports.resolveModule = resolveModule; +function resolve(moduleName, nodePath, cwd, tracer) { + const nodePathKey = 'NODE_PATH'; + const app = [ + "var p = process;", + "p.on('message',function(m){", + "if(m.c==='e'){", + "p.exit(0);", + "}", + "else if(m.c==='rs'){", + "try{", + "var r=require.resolve(m.a);", + "p.send({c:'r',s:true,r:r});", + "}", + "catch(err){", + "p.send({c:'r',s:false});", + "}", + "}", + "});" + ].join(''); + return new Promise((resolve, reject) => { + let env = process.env; + let newEnv = Object.create(null); + Object.keys(env).forEach(key => newEnv[key] = env[key]); + if (nodePath) { + if (newEnv[nodePathKey]) { + newEnv[nodePathKey] = nodePath + path.delimiter + newEnv[nodePathKey]; + } + else { + newEnv[nodePathKey] = nodePath; + } + if (tracer) { + tracer(`NODE_PATH value is: ${newEnv[nodePathKey]}`); + } + } + newEnv['ATOM_SHELL_INTERNAL_RUN_AS_NODE'] = '1'; + try { + let cp = child_process_1.fork('', [], { + cwd: cwd, + env: newEnv, + execArgv: ['-e', app] + }); + cp.on('error', (error) => { + reject(error); + }); + cp.on('message', (message) => { + if (message.c === 'r') { + cp.send({ c: 'e' }); + if (message.s) { + resolve(message.r); + } + else { + reject(new Error(`Failed to resolve module: ${moduleName}`)); + } + } + }); + let message = { + c: 'rs', + a: moduleName + }; + cp.send(message); + } + catch (error) { + reject(error); + } + }); +} +exports.resolve = resolve; +function resolveGlobalNodePath(tracer) { + let npmCommand = isWindows() ? 'npm.cmd' : 'npm'; + let stdout = child_process_1.spawnSync(npmCommand, ['config', 'get', 'prefix'], { + encoding: 'utf8' + }).stdout; + if (!stdout) { + if (tracer) { + tracer(`'npm config get prefix' didn't return a value.`); + } + return undefined; + } + let prefix = stdout.trim(); + if (tracer) { + tracer(`'npm config get prefix' value is: ${prefix}`); + } + if (prefix.length > 0) { + if (isWindows()) { + return path.join(prefix, 'node_modules'); + } + else { + return path.join(prefix, 'lib', 'node_modules'); + } + } + return undefined; +} +exports.resolveGlobalNodePath = resolveGlobalNodePath; +function resolveModulePath(workspaceRoot, moduleName, nodePath, tracer) { + if (nodePath) { + if (!path.isAbsolute(nodePath)) { + nodePath = path.join(workspaceRoot, nodePath); + } + return resolve(moduleName, nodePath, nodePath, tracer).then((value) => { + if (value.indexOf(path.normalize(nodePath)) === 0) { + return value; + } + else { + return Promise.reject(new Error(`Failed to load ${moduleName} from node path location.`)); + } + }).then(undefined, (_error) => { + return resolve(moduleName, resolveGlobalNodePath(tracer), workspaceRoot, tracer); + }); + } + else { + return resolve(moduleName, resolveGlobalNodePath(tracer), workspaceRoot, tracer); + } +} +exports.resolveModulePath = resolveModulePath; +/** + * Resolves the given module relative to the given workspace root. In contrast to + * `resolveModule` this method considers the parent chain as well. + */ +function resolveModule2(workspaceRoot, moduleName, nodePath, tracer) { + return resolveModulePath(workspaceRoot, moduleName, nodePath, tracer).then((path) => { + if (tracer) { + tracer(`Module ${moduleName} got resolved to ${path}`); + } + return require(path); + }); +} +exports.resolveModule2 = resolveModule2; diff --git a/node_modules/vscode-languageserver/lib/main.d.ts b/node_modules/vscode-languageserver/lib/main.d.ts new file mode 100644 index 0000000..c52f9db --- /dev/null +++ b/node_modules/vscode-languageserver/lib/main.d.ts @@ -0,0 +1,612 @@ +/// +/// +import { RequestType, RequestType0, RequestHandler, RequestHandler0, GenericRequestHandler, NotificationType, NotificationType0, NotificationHandler, NotificationHandler0, GenericNotificationHandler, MessageType as RPCMessageType, ResponseError, ErrorCodes, MessageReader, DataCallback, StreamMessageReader, IPCMessageReader, MessageWriter, StreamMessageWriter, IPCMessageWriter, createServerPipeTransport, CancellationToken, Disposable, Event } from 'vscode-jsonrpc'; +import { TextDocument, TextDocumentChangeEvent, TextDocumentWillSaveEvent, Location, Command, TextEdit, WorkspaceEdit, CompletionItem, CompletionList, Hover, SignatureHelp, Definition, DocumentHighlight, SymbolInformation, WorkspaceSymbolParams, DocumentSymbolParams, CodeLens, DocumentLink } from 'vscode-languageserver-types'; +import { InitializeParams, InitializeResult, InitializeError, InitializedParams, MessageActionItem, DidChangeConfigurationParams, DidOpenTextDocumentParams, DidChangeTextDocumentParams, DidCloseTextDocumentParams, DidSaveTextDocumentParams, WillSaveTextDocumentParams, DidChangeWatchedFilesParams, PublishDiagnosticsParams, TextDocumentPositionParams, TextDocumentSyncKind, ReferenceParams, CodeActionParams, CodeLensParams, DocumentFormattingParams, DocumentRangeFormattingParams, DocumentOnTypeFormattingParams, RenameParams, DocumentLinkParams, ExecuteCommandParams, ApplyWorkspaceEditResponse } from './protocol'; +export { RequestType0, RequestHandler0, RequestType, RequestHandler, NotificationType0, NotificationHandler0, NotificationType, NotificationHandler, ResponseError, ErrorCodes, MessageReader, DataCallback, StreamMessageReader, IPCMessageReader, MessageWriter, StreamMessageWriter, IPCMessageWriter, Disposable, createServerPipeTransport }; +export * from 'vscode-languageserver-types'; +export * from './protocol'; +export { Event }; +import * as fm from './files'; +export declare namespace Files { + let uriToFilePath: typeof fm.uriToFilePath; + let resolveGlobalNodePath: typeof fm.resolveGlobalNodePath; + let resolve: typeof fm.resolve; + let resolveModule: typeof fm.resolveModule; + let resolveModule2: typeof fm.resolveModule2; + let resolveModulePath: typeof fm.resolveModulePath; +} +/** + * A manager for simple text documents + */ +export declare class TextDocuments { + private _documents; + private _onDidChangeContent; + private _onDidOpen; + private _onDidClose; + private _onDidSave; + private _onWillSave; + private _willSaveWaitUntil; + /** + * Create a new text document manager. + */ + constructor(); + /** + * Returns the [TextDocumentSyncKind](#TextDocumentSyncKind) used by + * this text document manager. + */ + readonly syncKind: TextDocumentSyncKind; + /** + * An event that fires when a text document managed by this manager + * has been opened or the content changes. + */ + readonly onDidChangeContent: Event; + /** + * An event that fires when a text document managed by this manager + * has been opened. + */ + readonly onDidOpen: Event; + /** + * An event that fires when a text document managed by this manager + * will be saved. + */ + readonly onWillSave: Event; + /** + * Sets a handler that will be called if a participant wants to provide + * edits during a text document save. + */ + onWillSaveWaitUntil(handler: RequestHandler): void; + /** + * An event that fires when a text document managed by this manager + * has been saved. + */ + readonly onDidSave: Event; + /** + * An event that fires when a text document managed by this manager + * has been closed. + */ + readonly onDidClose: Event; + /** + * Returns the document for the given URI. Returns undefined if + * the document is not mananged by this instance. + * + * @param uri The text document's URI to retrieve. + * @return the text document or `undefined`. + */ + get(uri: string): TextDocument; + /** + * Returns all text documents managed by this instance. + * + * @return all text documents. + */ + all(): TextDocument[]; + /** + * Returns the URIs of all text documents managed by this instance. + * + * @return the URI's of all text documents. + */ + keys(): string[]; + /** + * Listens for `low level` notification on the given connection to + * update the text documents managed by this instance. + * + * @param connection The connection to listen on. + */ + listen(connection: IConnection): void; +} +/** + * Helps tracking error message. Equal occurences of the same + * message are only stored once. This class is for example + * usefull if text documents are validated in a loop and equal + * error message should be folded into one. + */ +export declare class ErrorMessageTracker { + private _messages; + constructor(); + /** + * Add a message to the tracker. + * + * @param message The message to add. + */ + add(message: string): void; + /** + * Send all tracked messages to the conenction's window. + * + * @param connection The connection establised between client and server. + */ + sendErrors(connection: { + window: RemoteWindow; + }): void; +} +/** + * The RemoteConsole interface contains all functions to interact with + * the developer console of VS Code. + */ +export interface RemoteConsole { + /** + * Show an error message. + * + * @param message The message to show. + */ + error(message: string): void; + /** + * Show a warning message. + * + * @param message The message to show. + */ + warn(message: string): void; + /** + * Show an information message. + * + * @param message The message to show. + */ + info(message: string): void; + /** + * Log a message. + * + * @param message The message to log. + */ + log(message: string): void; +} +/** + * The RemoteWindow interface contains all functions to interact with + * the visual window of VS Code. + */ +export interface RemoteWindow { + /** + * Show an error message. + * + * @param message The message to show. + */ + showErrorMessage(message: string): void; + showErrorMessage(message: string, ...actions: T[]): Thenable; + /** + * Show a warning message. + * + * @param message The message to show. + */ + showWarningMessage(message: string): void; + showWarningMessage(message: string, ...actions: T[]): Thenable; + /** + * Show an information message. + * + * @param message The message to show. + */ + showInformationMessage(message: string): void; + showInformationMessage(message: string, ...actions: T[]): Thenable; +} +/** + * A bulk registration manages n single registration to be able to register + * for n notifications or requests using one register request. + */ +export interface BulkRegistration { + /** + * Adds a single registration. + * @param type the notification type to register for. + * @param registerParams special registration parameters. + */ + add(type: NotificationType0, registerParams: RO): void; + add(type: NotificationType, registerParams: RO): void; + /** + * Adds a single registration. + * @param type the request type to register for. + * @param registerParams special registration parameters. + */ + add(type: RequestType0, registerParams: RO): void; + add(type: RequestType, registerParams: RO): void; +} +export declare namespace BulkRegistration { + /** + * Creates a new bulk registration. + * @return an empty bulk registration. + */ + function create(): BulkRegistration; +} +/** + * A `BulkUnregistration` manages n unregistrations. + */ +export interface BulkUnregistration extends Disposable { + /** + * Disposes a single registration. It will be removed from the + * `BulkUnregistration`. + */ + disposeSingle(arg: string | RPCMessageType): boolean; +} +export declare namespace BulkUnregistration { + function create(): BulkUnregistration; +} +/** + * Interface to register and unregister `listeners` on the client / tools side. + */ +export interface RemoteClient { + /** + * Registers a listener for the given notification. + * @param type the notification type to register for. + * @param registerParams special registration parameters. + * @return a `Disposable` to unregister the listener again. + */ + register(type: NotificationType0, registerParams?: RO): Thenable; + register(type: NotificationType, registerParams?: RO): Thenable; + /** + * Registers a listener for the given notification. + * @param unregisteration the unregistration to add a corresponding unregister action to. + * @param type the notification type to register for. + * @param registerParams special registration parameters. + * @return the updated unregistration. + */ + register(unregisteration: BulkUnregistration, type: NotificationType0, registerParams?: RO): Thenable; + register(unregisteration: BulkUnregistration, type: NotificationType, registerParams?: RO): Thenable; + /** + * Registers a listener for the given request. + * @param type the request type to register for. + * @param registerParams special registration parameters. + * @return a `Disposable` to unregister the listener again. + */ + register(type: RequestType0, registerParams?: RO): Thenable; + register(type: RequestType, registerParams?: RO): Thenable; + /** + * Registers a listener for the given request. + * @param unregisteration the unregistration to add a corresponding unregister action to. + * @param type the request type to register for. + * @param registerParams special registration parameters. + * @return the updated unregistration. + */ + register(unregisteration: BulkUnregistration, type: RequestType0, registerParams?: RO): Thenable; + register(unregisteration: BulkUnregistration, type: RequestType, registerParams?: RO): Thenable; + /** + * Registers a set of listeners. + * @param registrations the bulk registration + * @return a `Disposable` to unregister the listeners again. + */ + register(registrations: BulkRegistration): Thenable; +} +/** + * Represents the workspace managed by the client. + */ +export interface RemoteWorkspace { + /** + * Applies a `WorkspaceEdit` to the workspace + * @param edit the workspace edit. + * @return a thenable that resolves to the `ApplyWorkspaceEditResponse`. + */ + applyEdit(edit: WorkspaceEdit): Thenable; +} +/** + * Interface to log telemetry events. The events are actually send to the client + * and the client needs to feed the event into a propert telemetry system. + */ +export interface Telemetry { + /** + * Log the given data to telemetry. + * + * @param data The data to log. Must be a JSON serializable object. + */ + logEvent(data: any): void; +} +/** + * Interface to log traces to the client. The events are sent to the client and the + * client needs to log the trace events. + */ +export interface Tracer { + /** + * Log the given data to the trace Log + */ + log(message: string, verbose?: string): void; +} +/** + * Interface to describe the shape of the server connection. + */ +export interface IConnection { + /** + * Start listening on the input stream for messages to process. + */ + listen(): void; + /** + * Installs a request handler described by the given [RequestType](#RequestType). + * + * @param type The [RequestType](#RequestType) describing the request. + * @param handler The handler to install + */ + onRequest(type: RequestType0, handler: RequestHandler0): void; + onRequest(type: RequestType, handler: RequestHandler): void; + /** + * Installs a request handler for the given method. + * + * @param method The method to register a request handler for. + * @param handler The handler to install. + */ + onRequest(method: string, handler: GenericRequestHandler): void; + /** + * Send a request to the client. + * + * @param type The [RequestType](#RequestType) describing the request. + * @param params The request's parameters. + */ + sendRequest(type: RequestType0, token?: CancellationToken): Thenable; + sendRequest(type: RequestType, params: P, token?: CancellationToken): Thenable; + /** + * Send a request to the client. + * + * @param method The method to invoke on the client. + * @param params The request's parameters. + */ + sendRequest(method: string, ...params: any[]): Thenable; + /** + * Installs a notification handler described by the given [NotificationType](#NotificationType). + * + * @param type The [NotificationType](#NotificationType) describing the notification. + * @param handler The handler to install. + */ + onNotification(type: NotificationType0, handler: NotificationHandler0): void; + onNotification(type: NotificationType, handler: NotificationHandler

): void; + /** + * Installs a notification handler for the given method. + * + * @param method The method to register a request handler for. + * @param handler The handler to install. + */ + onNotification(method: string, handler: GenericNotificationHandler): void; + /** + * Send a notification to the client. + * + * @param type The [NotificationType](#NotificationType) describing the notification. + * @param params The notification's parameters. + */ + sendNotification(type: NotificationType0): void; + sendNotification(type: NotificationType, params?: P): void; + /** + * Send a notification to the client. + * + * @param method The method to invoke on the client. + * @param params The notification's parameters. + */ + sendNotification(method: string, ...args: any[]): void; + /** + * Installs a handler for the intialize request. + * + * @param handler The initialize handler. + */ + onInitialize(handler: RequestHandler): void; + /** + * Installs a handler for the intialized notification. + * + * @param handler The initialized handler. + */ + onInitialized(handler: NotificationHandler): void; + /** + * Installs a handler for the shutdown request. + * + * @param handler The initialize handler. + */ + onShutdown(handler: RequestHandler0): void; + /** + * Installs a handler for the exit notification. + * + * @param handler The exit handler. + */ + onExit(handler: NotificationHandler0): void; + /** + * A proxy interface for the language client interface to register for requests or + * notifications. + */ + client: RemoteClient; + /** + * A proxy for VSCode's development console. See [RemoteConsole](#RemoteConsole) + */ + console: RemoteConsole; + /** + * A proxy for VSCode's window. See [RemoteWindow](#RemoteWindow) + */ + window: RemoteWindow; + /** + * A proxy to send telemetry events to the client. + */ + telemetry: Telemetry; + /** + * A proxy to send trace events to the client. + */ + tracer: Tracer; + /** + * A proxy to talk to the client's workspace. + */ + workspace: RemoteWorkspace; + /** + * Installs a handler for the `DidChangeConfiguration` notification. + * + * @param handler The corresponding handler. + */ + onDidChangeConfiguration(handler: NotificationHandler): void; + /** + * Installs a handler for the `DidChangeWatchedFiles` notification. + * + * @param handler The corresponding handler. + */ + onDidChangeWatchedFiles(handler: NotificationHandler): void; + /** + * Installs a handler for the `DidOpenTextDocument` notification. + * + * @param handler The corresponding handler. + */ + onDidOpenTextDocument(handler: NotificationHandler): void; + /** + * Installs a handler for the `DidChangeTextDocument` notification. + * + * @param handler The corresponding handler. + */ + onDidChangeTextDocument(handler: NotificationHandler): void; + /** + * Installs a handler for the `DidCloseTextDocument` notification. + * + * @param handler The corresponding handler. + */ + onDidCloseTextDocument(handler: NotificationHandler): void; + /** + * Installs a handler for the `DidSaveTextDocument` notification. + * + * @param handler The corresponding handler. + */ + onWillSaveTextDocument(handler: NotificationHandler): void; + /** + * Installs a handler for the `DidSaveTextDocument` notification. + * + * @param handler The corresponding handler. + */ + onWillSaveTextDocumentWaitUntil(handler: RequestHandler): void; + /** + * Installs a handler for the `DidSaveTextDocument` notification. + * + * @param handler The corresponding handler. + */ + onDidSaveTextDocument(handler: NotificationHandler): void; + /** + * Sends diagnostics computed for a given document to VSCode to render them in the + * user interface. + * + * @param params The diagnostic parameters. + */ + sendDiagnostics(params: PublishDiagnosticsParams): void; + /** + * Installs a handler for the `Hover` request. + * + * @param handler The corresponding handler. + */ + onHover(handler: RequestHandler): void; + /** + * Installs a handler for the `Completion` request. + * + * @param handler The corresponding handler. + */ + onCompletion(handler: RequestHandler): void; + /** + * Installs a handler for the `CompletionResolve` request. + * + * @param handler The corresponding handler. + */ + onCompletionResolve(handler: RequestHandler): void; + /** + * Installs a handler for the `SignatureHelp` request. + * + * @param handler The corresponding handler. + */ + onSignatureHelp(handler: RequestHandler): void; + /** + * Installs a handler for the `Definition` request. + * + * @param handler The corresponding handler. + */ + onDefinition(handler: RequestHandler): void; + /** + * Installs a handler for the `References` request. + * + * @param handler The corresponding handler. + */ + onReferences(handler: RequestHandler): void; + /** + * Installs a handler for the `DocumentHighlight` request. + * + * @param handler The corresponding handler. + */ + onDocumentHighlight(handler: RequestHandler): void; + /** + * Installs a handler for the `DocumentSymbol` request. + * + * @param handler The corresponding handler. + */ + onDocumentSymbol(handler: RequestHandler): void; + /** + * Installs a handler for the `WorkspaceSymbol` request. + * + * @param handler The corresponding handler. + */ + onWorkspaceSymbol(handler: RequestHandler): void; + /** + * Installs a handler for the `CodeAction` request. + * + * @param handler The corresponding handler. + */ + onCodeAction(handler: RequestHandler): void; + /** + * Compute a list of [lenses](#CodeLens). This call should return as fast as possible and if + * computing the commands is expensive implementors should only return code lens objects with the + * range set and handle the resolve request. + * + * @param handler The corresponding handler. + */ + onCodeLens(handler: RequestHandler): void; + /** + * This function will be called for each visible code lens, usually when scrolling and after + * the onCodeLens has been called. + * + * @param handler The corresponding handler. + */ + onCodeLensResolve(handler: RequestHandler): void; + /** + * Installs a handler for the document formatting request. + * + * @param handler The corresponding handler. + */ + onDocumentFormatting(handler: RequestHandler): void; + /** + * Installs a handler for the document range formatting request. + * + * @param handler The corresponding handler. + */ + onDocumentRangeFormatting(handler: RequestHandler): void; + /** + * Installs a handler for the document on type formatting request. + * + * @param handler The corresponding handler. + */ + onDocumentOnTypeFormatting(handler: RequestHandler): void; + /** + * Installs a handler for the rename request. + * + * @param handler The corresponding handler. + */ + onRenameRequest(handler: RequestHandler): void; + /** + * Installs a handler for the document links request. + * + * @param handler The corresponding handler. + */ + onDocumentLinks(handler: RequestHandler): void; + /** + * Installs a handler for the document links resolve request. + * + * @param handler The corresponding handler. + */ + onDocumentLinkResolve(handler: RequestHandler): void; + /** + * Installs a handler for the execute command request. + * + * @param handler The corresponding handler. + */ + onExecuteCommand(handler: RequestHandler): void; + /** + * Disposes the connection + */ + dispose(): void; +} +/** + * Creates a new connection using a the given streams. + * + * @param inputStream The stream to read messages from. + * @param outputStream The stream to write messages to. + * @return a [connection](#IConnection) + */ +export declare function createConnection(inputStream: NodeJS.ReadableStream, outputStream: NodeJS.WritableStream): IConnection; +/** + * Creates a new connection. + * + * @param reader The message reader to read messages from. + * @param writer The message writer to write message to. + */ +export declare function createConnection(reader: MessageReader, writer: MessageWriter): IConnection; +/** + * Creates a new connection based on the processes command line arguments: + * --ipc : connection using the node process ipc + * + * @param reader The message reader to read messages from. + * @param writer The message writer to write message to. + */ +export declare function createConnection(): IConnection; diff --git a/node_modules/vscode-languageserver/lib/main.js b/node_modules/vscode-languageserver/lib/main.js new file mode 100644 index 0000000..0116503 --- /dev/null +++ b/node_modules/vscode-languageserver/lib/main.js @@ -0,0 +1,672 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +/// +'use strict'; +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +const vscode_jsonrpc_1 = require("vscode-jsonrpc"); +exports.RequestType = vscode_jsonrpc_1.RequestType; +exports.RequestType0 = vscode_jsonrpc_1.RequestType0; +exports.NotificationType = vscode_jsonrpc_1.NotificationType; +exports.NotificationType0 = vscode_jsonrpc_1.NotificationType0; +exports.ResponseError = vscode_jsonrpc_1.ResponseError; +exports.ErrorCodes = vscode_jsonrpc_1.ErrorCodes; +exports.StreamMessageReader = vscode_jsonrpc_1.StreamMessageReader; +exports.IPCMessageReader = vscode_jsonrpc_1.IPCMessageReader; +exports.StreamMessageWriter = vscode_jsonrpc_1.StreamMessageWriter; +exports.IPCMessageWriter = vscode_jsonrpc_1.IPCMessageWriter; +exports.createServerPipeTransport = vscode_jsonrpc_1.createServerPipeTransport; +exports.Disposable = vscode_jsonrpc_1.Disposable; +exports.Event = vscode_jsonrpc_1.Event; +const vscode_languageserver_types_1 = require("vscode-languageserver-types"); +const protocol_1 = require("./protocol"); +const Is = require("./utils/is"); +const UUID = require("./utils/uuid"); +__export(require("vscode-languageserver-types")); +__export(require("./protocol")); +const fm = require("./files"); +const net = require("net"); +const stream = require("stream"); +var Files; +(function (Files) { + Files.uriToFilePath = fm.uriToFilePath; + Files.resolveGlobalNodePath = fm.resolveGlobalNodePath; + Files.resolve = fm.resolve; + Files.resolveModule = fm.resolveModule; + Files.resolveModule2 = fm.resolveModule2; + Files.resolveModulePath = fm.resolveModulePath; +})(Files = exports.Files || (exports.Files = {})); +/** + * A manager for simple text documents + */ +class TextDocuments { + /** + * Create a new text document manager. + */ + constructor() { + this._documents = Object.create(null); + this._onDidChangeContent = new vscode_jsonrpc_1.Emitter(); + this._onDidOpen = new vscode_jsonrpc_1.Emitter(); + this._onDidClose = new vscode_jsonrpc_1.Emitter(); + this._onDidSave = new vscode_jsonrpc_1.Emitter(); + this._onWillSave = new vscode_jsonrpc_1.Emitter(); + } + /** + * Returns the [TextDocumentSyncKind](#TextDocumentSyncKind) used by + * this text document manager. + */ + get syncKind() { + return protocol_1.TextDocumentSyncKind.Full; + } + /** + * An event that fires when a text document managed by this manager + * has been opened or the content changes. + */ + get onDidChangeContent() { + return this._onDidChangeContent.event; + } + /** + * An event that fires when a text document managed by this manager + * has been opened. + */ + get onDidOpen() { + return this._onDidOpen.event; + } + /** + * An event that fires when a text document managed by this manager + * will be saved. + */ + get onWillSave() { + return this._onWillSave.event; + } + /** + * Sets a handler that will be called if a participant wants to provide + * edits during a text document save. + */ + onWillSaveWaitUntil(handler) { + this._willSaveWaitUntil = handler; + } + /** + * An event that fires when a text document managed by this manager + * has been saved. + */ + get onDidSave() { + return this._onDidSave.event; + } + /** + * An event that fires when a text document managed by this manager + * has been closed. + */ + get onDidClose() { + return this._onDidClose.event; + } + /** + * Returns the document for the given URI. Returns undefined if + * the document is not mananged by this instance. + * + * @param uri The text document's URI to retrieve. + * @return the text document or `undefined`. + */ + get(uri) { + return this._documents[uri]; + } + /** + * Returns all text documents managed by this instance. + * + * @return all text documents. + */ + all() { + return Object.keys(this._documents).map(key => this._documents[key]); + } + /** + * Returns the URIs of all text documents managed by this instance. + * + * @return the URI's of all text documents. + */ + keys() { + return Object.keys(this._documents); + } + /** + * Listens for `low level` notification on the given connection to + * update the text documents managed by this instance. + * + * @param connection The connection to listen on. + */ + listen(connection) { + function isUpdateableDocument(value) { + return Is.func(value.update); + } + connection.__textDocumentSync = protocol_1.TextDocumentSyncKind.Full; + connection.onDidOpenTextDocument((event) => { + let td = event.textDocument; + let document = vscode_languageserver_types_1.TextDocument.create(td.uri, td.languageId, td.version, td.text); + this._documents[td.uri] = document; + let toFire = Object.freeze({ document }); + this._onDidOpen.fire(toFire); + this._onDidChangeContent.fire(toFire); + }); + connection.onDidChangeTextDocument((event) => { + let td = event.textDocument; + let changes = event.contentChanges; + let last = changes.length > 0 ? changes[changes.length - 1] : undefined; + if (last) { + let document = this._documents[td.uri]; + if (document && isUpdateableDocument(document)) { + document.update(last, td.version); + this._onDidChangeContent.fire(Object.freeze({ document })); + } + } + }); + connection.onDidCloseTextDocument((event) => { + let document = this._documents[event.textDocument.uri]; + if (document) { + delete this._documents[event.textDocument.uri]; + this._onDidClose.fire(Object.freeze({ document })); + } + }); + connection.onWillSaveTextDocument((event) => { + let document = this._documents[event.textDocument.uri]; + if (document) { + this._onWillSave.fire(Object.freeze({ document, reason: event.reason })); + } + }); + connection.onWillSaveTextDocumentWaitUntil((event, token) => { + let document = this._documents[event.textDocument.uri]; + if (document && this._willSaveWaitUntil) { + return this._willSaveWaitUntil(Object.freeze({ document, reason: event.reason }), token); + } + else { + return []; + } + }); + connection.onDidSaveTextDocument((event) => { + let document = this._documents[event.textDocument.uri]; + if (document) { + this._onDidSave.fire(Object.freeze({ document })); + } + }); + } +} +exports.TextDocuments = TextDocuments; +// ------------------------- implementation of the language server protocol --------------------------------------------- +/** + * Helps tracking error message. Equal occurences of the same + * message are only stored once. This class is for example + * usefull if text documents are validated in a loop and equal + * error message should be folded into one. + */ +class ErrorMessageTracker { + constructor() { + this._messages = Object.create(null); + } + /** + * Add a message to the tracker. + * + * @param message The message to add. + */ + add(message) { + let count = this._messages[message]; + if (!count) { + count = 0; + } + count++; + this._messages[message] = count; + } + /** + * Send all tracked messages to the conenction's window. + * + * @param connection The connection establised between client and server. + */ + sendErrors(connection) { + Object.keys(this._messages).forEach(message => { + connection.window.showErrorMessage(message); + }); + } +} +exports.ErrorMessageTracker = ErrorMessageTracker; +var BulkRegistration; +(function (BulkRegistration) { + /** + * Creates a new bulk registration. + * @return an empty bulk registration. + */ + function create() { + return new BulkRegistrationImpl(); + } + BulkRegistration.create = create; +})(BulkRegistration = exports.BulkRegistration || (exports.BulkRegistration = {})); +class BulkRegistrationImpl { + constructor() { + this._registrations = []; + this._registered = new Set(); + } + add(type, registerOptions) { + const method = Is.string(type) ? type : type.method; + if (this._registered.has(method)) { + throw new Error(`${method} is already added to this registration`); + } + const id = UUID.generateUuid(); + this._registrations.push({ + id: id, + method: method, + registerOptions: registerOptions || {} + }); + this._registered.add(method); + } + asRegistrationParams() { + return { + registrations: this._registrations + }; + } +} +var BulkUnregistration; +(function (BulkUnregistration) { + function create() { + return new BulkUnregistrationImpl(undefined, undefined, []); + } + BulkUnregistration.create = create; +})(BulkUnregistration = exports.BulkUnregistration || (exports.BulkUnregistration = {})); +class BulkUnregistrationImpl { + constructor(_connection, _console, unregistrations) { + this._connection = _connection; + this._console = _console; + this._unregistrations = new Map(); + unregistrations.forEach(unregistration => { + this._unregistrations.set(unregistration.method, unregistration); + }); + } + get isAttached() { + return !!this._connection && !!this._console; + } + attach(connection, _console) { + this._connection = connection; + this._console = _console; + } + add(unregistration) { + this._unregistrations.set(unregistration.method, unregistration); + } + dispose() { + let unregistrations = []; + for (let unregistration of this._unregistrations.values()) { + unregistrations.push(unregistration); + } + let params = { + unregisterations: unregistrations + }; + this._connection.sendRequest(protocol_1.UnregistrationRequest.type, params).then(undefined, (_error) => { + this._console.info(`Bulk unregistration failed.`); + }); + } + disposeSingle(arg) { + const method = Is.string(arg) ? arg : arg.method; + const unregistration = this._unregistrations.get(method); + if (!unregistration) { + return false; + } + let params = { + unregisterations: [unregistration] + }; + this._connection.sendRequest(protocol_1.UnregistrationRequest.type, params).then(() => { + this._unregistrations.delete(method); + }, (_error) => { + this._console.info(`Unregistering request handler for ${unregistration.id} failed.`); + }); + return true; + } +} +class ConnectionLogger { + constructor() { + } + attach(connection) { + this._connection = connection; + } + error(message) { + this.send(protocol_1.MessageType.Error, message); + } + warn(message) { + this.send(protocol_1.MessageType.Warning, message); + } + info(message) { + this.send(protocol_1.MessageType.Info, message); + } + log(message) { + this.send(protocol_1.MessageType.Log, message); + } + send(type, message) { + if (this._connection) { + this._connection.sendNotification(protocol_1.LogMessageNotification.type, { type, message }); + } + } +} +class RemoteWindowImpl { + constructor(_connection) { + this._connection = _connection; + } + showErrorMessage(message, ...actions) { + let params = { type: protocol_1.MessageType.Error, message, actions }; + return this._connection.sendRequest(protocol_1.ShowMessageRequest.type, params); + } + showWarningMessage(message, ...actions) { + let params = { type: protocol_1.MessageType.Warning, message, actions }; + return this._connection.sendRequest(protocol_1.ShowMessageRequest.type, params); + } + showInformationMessage(message, ...actions) { + let params = { type: protocol_1.MessageType.Info, message, actions }; + return this._connection.sendRequest(protocol_1.ShowMessageRequest.type, params); + } +} +class RemoteClientImpl { + constructor(_connection, _console) { + this._connection = _connection; + this._console = _console; + } + register(typeOrRegistrations, registerOptionsOrType, registerOptions) { + if (typeOrRegistrations instanceof BulkRegistrationImpl) { + return this.registerMany(typeOrRegistrations); + } + else if (typeOrRegistrations instanceof BulkUnregistrationImpl) { + return this.registerSingle1(typeOrRegistrations, registerOptionsOrType, registerOptions); + } + else { + return this.registerSingle2(typeOrRegistrations, registerOptionsOrType); + } + } + registerSingle1(unregistration, type, registerOptions) { + const method = Is.string(type) ? type : type.method; + const id = UUID.generateUuid(); + let params = { + registrations: [{ id, method, registerOptions: registerOptions || {} }] + }; + if (!unregistration.isAttached) { + unregistration.attach(this._connection, this._console); + } + return this._connection.sendRequest(protocol_1.RegistrationRequest.type, params).then((_result) => { + unregistration.add({ id: id, method: method }); + return unregistration; + }, (_error) => { + this._console.info(`Registering request handler for ${method} failed.`); + return Promise.reject(_error); + }); + } + registerSingle2(type, registerOptions) { + const method = Is.string(type) ? type : type.method; + const id = UUID.generateUuid(); + let params = { + registrations: [{ id, method, registerOptions: registerOptions || {} }] + }; + return this._connection.sendRequest(protocol_1.RegistrationRequest.type, params).then((_result) => { + return vscode_jsonrpc_1.Disposable.create(() => { + this.unregisterSingle(id, method); + }); + }, (_error) => { + this._console.info(`Registering request handler for ${method} failed.`); + return Promise.reject(_error); + }); + } + unregisterSingle(id, method) { + let params = { + unregisterations: [{ id, method }] + }; + return this._connection.sendRequest(protocol_1.UnregistrationRequest.type, params).then(undefined, (_error) => { + this._console.info(`Unregistering request handler for ${id} failed.`); + }); + } + registerMany(registrations) { + let params = registrations.asRegistrationParams(); + return this._connection.sendRequest(protocol_1.RegistrationRequest.type, params).then(() => { + return new BulkUnregistrationImpl(this._connection, this._console, params.registrations.map(registration => { return { id: registration.id, method: registration.method }; })); + }, (_error) => { + this._console.info(`Bulk registeration failed.`); + return Promise.reject(_error); + }); + } +} +class RemoteWorkspaceImpl { + constructor(_connection) { + this._connection = _connection; + } + applyEdit(edit) { + let params = { + edit + }; + return this._connection.sendRequest(protocol_1.ApplyWorkspaceEditRequest.type, params); + } +} +class TracerImpl { + constructor(_connection) { + this._connection = _connection; + this._trace = vscode_jsonrpc_1.Trace.Off; + } + set trace(value) { + this._trace = value; + } + log(message, verbose) { + if (this._trace === vscode_jsonrpc_1.Trace.Off) { + return; + } + this._connection.sendNotification(vscode_jsonrpc_1.LogTraceNotification.type, { + message: message, + verbose: this._trace === vscode_jsonrpc_1.Trace.Verbose ? verbose : undefined + }); + } +} +class TelemetryImpl { + constructor(_connection) { + this._connection = _connection; + } + logEvent(data) { + this._connection.sendNotification(protocol_1.TelemetryEventNotification.type, data); + } +} +function createConnection(input, output) { + if (!input && !output && process.argv.length > 2) { + let port = void 0; + let pipeName = void 0; + let argv = process.argv.slice(2); + for (let i = 0; i < argv.length; i++) { + let arg = argv[i]; + if (arg === '--node-ipc') { + input = new vscode_jsonrpc_1.IPCMessageReader(process); + output = new vscode_jsonrpc_1.IPCMessageWriter(process); + break; + } + else if (arg === '--stdio') { + input = process.stdin; + output = process.stdout; + break; + } + else if (arg === '--socket') { + port = parseInt(argv[i + 1]); + break; + } + else if (arg === '--pipe') { + pipeName = argv[i + 1]; + break; + } + else { + var args = arg.split('='); + if (args[0] === '--socket') { + port = parseInt(args[1]); + break; + } + else if (args[0] === '--pipe') { + pipeName = args[1]; + break; + } + } + } + if (port) { + output = new stream.PassThrough(); + input = new stream.PassThrough(); + let server = net.createServer(socket => { + server.close(); + socket.pipe(output); + input.pipe(socket); + }).listen(port); + } + else if (pipeName) { + let protocol = vscode_jsonrpc_1.createServerPipeTransport(pipeName); + input = protocol[0]; + output = protocol[1]; + } + } + var commandLineMessage = "Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'"; + if (!input) { + throw new Error("Connection input stream is not set. " + commandLineMessage); + } + if (!output) { + throw new Error("Connection output stream is not set. " + commandLineMessage); + } + let shutdownReceived; + // Backwards compatibility + if (Is.func(input.read) && Is.func(input.on)) { + let inputStream = input; + inputStream.on('end', () => { + process.exit(shutdownReceived ? 0 : 1); + }); + inputStream.on('close', () => { + process.exit(shutdownReceived ? 0 : 1); + }); + } + const logger = new ConnectionLogger(); + const connection = vscode_jsonrpc_1.createMessageConnection(input, output, logger); + logger.attach(connection); + const remoteWindow = new RemoteWindowImpl(connection); + const telemetry = new TelemetryImpl(connection); + const tracer = new TracerImpl(connection); + const client = new RemoteClientImpl(connection, logger); + const workspace = new RemoteWorkspaceImpl(connection); + function asThenable(value) { + if (Is.thenable(value)) { + return value; + } + else { + return Promise.resolve(value); + } + } + let shutdownHandler = undefined; + let initializeHandler = undefined; + let exitHandler = undefined; + let protocolConnection = { + listen: () => connection.listen(), + sendRequest: (type, ...params) => connection.sendRequest(Is.string(type) ? type : type.method, ...params), + onRequest: (type, handler) => connection.onRequest(Is.string(type) ? type : type.method, handler), + sendNotification: (type, ...params) => connection.sendNotification(Is.string(type) ? type : type.method, ...params), + onNotification: (type, handler) => connection.onNotification(Is.string(type) ? type : type.method, handler), + onInitialize: (handler) => initializeHandler = handler, + onInitialized: (handler) => connection.onNotification(protocol_1.InitializedNotification.type, handler), + onShutdown: (handler) => shutdownHandler = handler, + onExit: (handler) => exitHandler = handler, + get console() { return logger; }, + get window() { return remoteWindow; }, + get telemetry() { return telemetry; }, + get tracer() { return tracer; }, + get client() { return client; }, + get workspace() { return workspace; }, + onDidChangeConfiguration: (handler) => connection.onNotification(protocol_1.DidChangeConfigurationNotification.type, handler), + onDidChangeWatchedFiles: (handler) => connection.onNotification(protocol_1.DidChangeWatchedFilesNotification.type, handler), + __textDocumentSync: undefined, + onDidOpenTextDocument: (handler) => connection.onNotification(protocol_1.DidOpenTextDocumentNotification.type, handler), + onDidChangeTextDocument: (handler) => connection.onNotification(protocol_1.DidChangeTextDocumentNotification.type, handler), + onDidCloseTextDocument: (handler) => connection.onNotification(protocol_1.DidCloseTextDocumentNotification.type, handler), + onWillSaveTextDocument: (handler) => connection.onNotification(protocol_1.WillSaveTextDocumentNotification.type, handler), + onWillSaveTextDocumentWaitUntil: (handler) => connection.onRequest(protocol_1.WillSaveTextDocumentWaitUntilRequest.type, handler), + onDidSaveTextDocument: (handler) => connection.onNotification(protocol_1.DidSaveTextDocumentNotification.type, handler), + sendDiagnostics: (params) => connection.sendNotification(protocol_1.PublishDiagnosticsNotification.type, params), + onHover: (handler) => connection.onRequest(protocol_1.HoverRequest.type, handler), + onCompletion: (handler) => connection.onRequest(protocol_1.CompletionRequest.type, handler), + onCompletionResolve: (handler) => connection.onRequest(protocol_1.CompletionResolveRequest.type, handler), + onSignatureHelp: (handler) => connection.onRequest(protocol_1.SignatureHelpRequest.type, handler), + onDefinition: (handler) => connection.onRequest(protocol_1.DefinitionRequest.type, handler), + onReferences: (handler) => connection.onRequest(protocol_1.ReferencesRequest.type, handler), + onDocumentHighlight: (handler) => connection.onRequest(protocol_1.DocumentHighlightRequest.type, handler), + onDocumentSymbol: (handler) => connection.onRequest(protocol_1.DocumentSymbolRequest.type, handler), + onWorkspaceSymbol: (handler) => connection.onRequest(protocol_1.WorkspaceSymbolRequest.type, handler), + onCodeAction: (handler) => connection.onRequest(protocol_1.CodeActionRequest.type, handler), + onCodeLens: (handler) => connection.onRequest(protocol_1.CodeLensRequest.type, handler), + onCodeLensResolve: (handler) => connection.onRequest(protocol_1.CodeLensResolveRequest.type, handler), + onDocumentFormatting: (handler) => connection.onRequest(protocol_1.DocumentFormattingRequest.type, handler), + onDocumentRangeFormatting: (handler) => connection.onRequest(protocol_1.DocumentRangeFormattingRequest.type, handler), + onDocumentOnTypeFormatting: (handler) => connection.onRequest(protocol_1.DocumentOnTypeFormattingRequest.type, handler), + onRenameRequest: (handler) => connection.onRequest(protocol_1.RenameRequest.type, handler), + onDocumentLinks: (handler) => connection.onRequest(protocol_1.DocumentLinkRequest.type, handler), + onDocumentLinkResolve: (handler) => connection.onRequest(protocol_1.DocumentLinkResolveRequest.type, handler), + onExecuteCommand: (handler) => connection.onRequest(protocol_1.ExecuteCommandRequest.type, handler), + dispose: () => connection.dispose() + }; + connection.onRequest(protocol_1.InitializeRequest.type, (params) => { + if (Is.number(params.processId)) { + // We received a parent process id. Set up a timer to periodically check + // if the parent is still alive. + setInterval(() => { + try { + process.kill(params.processId, 0); + } + catch (ex) { + // Parent process doesn't exist anymore. Exit the server. + process.exit(shutdownReceived ? 0 : 1); + } + }, 3000); + } + if (Is.string(params.trace)) { + tracer.trace = vscode_jsonrpc_1.Trace.fromString(params.trace); + } + if (initializeHandler) { + let result = initializeHandler(params, new vscode_jsonrpc_1.CancellationTokenSource().token); + return asThenable(result).then((value) => { + if (value instanceof vscode_jsonrpc_1.ResponseError) { + return value; + } + let result = value; + if (!result) { + result = { capabilities: {} }; + } + let capabilities = result.capabilities; + if (!capabilities) { + capabilities = {}; + result.capabilities = {}; + } + if (!Is.number(capabilities.textDocumentSync)) { + capabilities.textDocumentSync = Is.number(protocolConnection.__textDocumentSync) ? protocolConnection.__textDocumentSync : protocol_1.TextDocumentSyncKind.None; + } + return result; + }); + } + else { + let result = { capabilities: { textDocumentSync: protocol_1.TextDocumentSyncKind.None } }; + return result; + } + }); + connection.onRequest(protocol_1.ShutdownRequest.type, () => { + shutdownReceived = true; + if (shutdownHandler) { + return shutdownHandler(new vscode_jsonrpc_1.CancellationTokenSource().token); + } + else { + return undefined; + } + }); + connection.onNotification(protocol_1.ExitNotification.type, () => { + try { + if (exitHandler) { + exitHandler(); + } + } + finally { + if (shutdownReceived) { + process.exit(0); + } + else { + process.exit(1); + } + } + }); + connection.onNotification(vscode_jsonrpc_1.SetTraceNotification.type, (params) => { + tracer.trace = vscode_jsonrpc_1.Trace.fromString(params.value); + }); + return protocolConnection; +} +exports.createConnection = createConnection; diff --git a/node_modules/vscode-languageserver/lib/protocol.d.ts b/node_modules/vscode-languageserver/lib/protocol.d.ts new file mode 100644 index 0000000..6549b44 --- /dev/null +++ b/node_modules/vscode-languageserver/lib/protocol.d.ts @@ -0,0 +1,1244 @@ +import { RequestType, RequestType0, NotificationType, NotificationType0 } from 'vscode-jsonrpc'; +import { TextDocumentContentChangeEvent, Position, Range, Location, Diagnostic, Command, TextEdit, WorkspaceEdit, WorkspaceSymbolParams, TextDocumentIdentifier, VersionedTextDocumentIdentifier, TextDocumentItem, TextDocumentSaveReason, CompletionItem, CompletionList, Hover, SignatureHelp, Definition, ReferenceContext, DocumentHighlight, DocumentSymbolParams, SymbolInformation, CodeLens, CodeActionContext, FormattingOptions, DocumentLink } from 'vscode-languageserver-types'; +/** + * A document filter denotes a document by different properties like + * the [language](#TextDocument.languageId), the [scheme](#Uri.scheme) of + * its resource, or a glob-pattern that is applied to the [path](#TextDocument.fileName). + * + * @sample A language filter that applies to typescript files on disk: `{ language: 'typescript', scheme: 'file' }` + * @sample A language filter that applies to all package.json paths: `{ language: 'json', pattern: '**package.json' }` + */ +export interface DocumentFilter { + /** + * A language id, like `typescript`. + */ + language?: string; + /** + * A Uri [scheme](#Uri.scheme), like `file` or `untitled`. + */ + scheme?: string; + /** + * A glob pattern, like `*.{ts,js}`. + */ + pattern?: string; +} +/** + * A document selector is the combination of one or many document filters. + * + * @sample `let sel:DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**∕tsconfig.json' }]`; + */ +export declare type DocumentSelector = DocumentFilter[]; +/** + * General paramters to to regsiter for an notification or to register a provider. + */ +export interface Registration { + /** + * The id used to register the request. The id can be used to deregister + * the request again. + */ + id: string; + /** + * The method to register for. + */ + method: string; + /** + * Options necessary for the registration. + */ + registerOptions?: any; +} +export interface RegistrationParams { + registrations: Registration[]; +} +/** + * The `client/registerFeature` request is sent from the server to the client to register a new feature + * handler on the client side. + */ +export declare namespace RegistrationRequest { + const type: RequestType; +} +/** + * General parameters to unregister a request or notification. + */ +export interface Unregistration { + /** + * The id used to unregister the request or notification. Usually an id + * provided during the register request. + */ + id: string; + /** + * The method to unregister for. + */ + method: string; +} +export interface UnregistrationParams { + unregisterations: Unregistration[]; +} +/** + * The `client/unregisterFeature` request is sent from the server to the client to unregister a previously registered feature + * handler on the client side. + */ +export declare namespace UnregistrationRequest { + const type: RequestType; +} +/** + * A parameter literal used in requests to pass a text document and a position inside that + * document. + */ +export interface TextDocumentPositionParams { + /** + * The text document. + */ + textDocument: TextDocumentIdentifier; + /** + * The position inside the text document. + */ + position: Position; +} +/** + * Workspace specific client capabilities. + */ +export interface WorkspaceClientCapabilites { + /** + * The client supports applying batch edits + * to the workspace. + */ + applyEdit?: boolean; + /** + * Capabilities specific to the `workspace/didChangeConfiguration` notification. + */ + didChangeConfiguration?: { + /** + * Did change configuration notification supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `workspace/didChangeWatchedFiles` notification. + */ + didChangeWatchedFiles?: { + /** + * Did change watched files notification supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `workspace/symbol` request. + */ + symbol?: { + /** + * Symbol request supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `workspace/executeCommand` request. + */ + executeCommand?: { + /** + * Execute command supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; +} +/** + * Text document specific client capabilities. + */ +export interface TextDocumentClientCapabilities { + synchronization?: { + /** + * Whether text document synchronization supports dynamic registration. + */ + dynamicRegistration?: boolean; + /** + * The client supports sending will save notifications. + */ + willSave?: boolean; + /** + * The client supports sending a will save request and + * waits for a response providing text edits which will + * be applied to the document before it is saved. + */ + willSaveWaitUntil?: boolean; + /** + * The client supports did save notifications. + */ + didSave?: boolean; + }; + /** + * Capabilities specific to the `textDocument/completion` + */ + completion?: { + /** + * Whether completion supports dynamic registration. + */ + dynamicRegistration?: boolean; + /** + * The client supports the following `CompletionItem` specific + * capabilities. + */ + completionItem?: { + /** + * Client supports snippets as insert text. + * + * 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. + */ + snippetSupport?: boolean; + }; + }; + /** + * Capabilities specific to the `textDocument/hover` + */ + hover?: { + /** + * Whether hover supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/signatureHelp` + */ + signatureHelp?: { + /** + * Whether signature help supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/references` + */ + references?: { + /** + * Whether references supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/documentHighlight` + */ + documentHighlight?: { + /** + * Whether document highlight supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/documentSymbol` + */ + documentSymbol?: { + /** + * Whether document symbol supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/formatting` + */ + formatting?: { + /** + * Whether formatting supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/rangeFormatting` + */ + rangeFormatting?: { + /** + * Whether range formatting supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/onTypeFormatting` + */ + onTypeFormatting?: { + /** + * Whether on type formatting supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/definition` + */ + definition?: { + /** + * Whether definition supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/codeAction` + */ + codeAction?: { + /** + * Whether code action supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/codeLens` + */ + codeLens?: { + /** + * Whether code lens supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/documentLink` + */ + documentLink?: { + /** + * Whether document link supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; + /** + * Capabilities specific to the `textDocument/rename` + */ + rename?: { + /** + * Whether rename supports dynamic registration. + */ + dynamicRegistration?: boolean; + }; +} +/** + * Defines the capabilities provided by the client. + */ +export interface ClientCapabilities { + /** + * Workspace specific client capabilities. + */ + workspace?: WorkspaceClientCapabilites; + /** + * Text document specific client capabilities. + */ + textDocument?: TextDocumentClientCapabilities; + /** + * Experimental client capabilities. + */ + experimental?: any; +} +/** + * Defines how the host (editor) should sync + * document changes to the language server. + */ +export declare namespace TextDocumentSyncKind { + /** + * Documents should not be synced at all. + */ + const None = 0; + /** + * Documents are synced by always sending the full content + * of the document. + */ + const Full = 1; + /** + * Documents are synced by sending the full content on open. + * After that only incremental updates to the document are + * send. + */ + const Incremental = 2; +} +export declare type TextDocumentSyncKind = 0 | 1 | 2; +/** + * General text document registration options. + */ +export interface TextDocumentRegistrationOptions { + /** + * A document selector to identify the scope of the registration. If set to null + * the document selector provided on the client side will be used. + */ + documentSelector: DocumentSelector | null; +} +/** + * Completion options. + */ +export interface CompletionOptions { + /** + * The server provides support to resolve additional + * information for a completion item. + */ + resolveProvider?: boolean; + /** + * The characters that trigger completion automatically. + */ + triggerCharacters?: string[]; +} +/** + * Signature help options. + */ +export interface SignatureHelpOptions { + /** + * The characters that trigger signature help + * automatically. + */ + triggerCharacters?: string[]; +} +/** + * Code Lens options. + */ +export interface CodeLensOptions { + /** + * Code lens has a resolve provider as well. + */ + resolveProvider?: boolean; +} +/** + * Format document on type options + */ +export interface DocumentOnTypeFormattingOptions { + /** + * A character on which formatting should be triggered, like `}`. + */ + firstTriggerCharacter: string; + /** + * More trigger characters. + */ + moreTriggerCharacter?: string[]; +} +/** + * Document link options + */ +export interface DocumentLinkOptions { + /** + * Document links have a resolve provider as well. + */ + resolveProvider?: boolean; +} +/** + * Execute command options. + */ +export interface ExecuteCommandOptions { + /** + * The commands to be executed on the server + */ + commands: string[]; +} +/** + * Save options. + */ +export interface SaveOptions { + /** + * The client is supposed to include the content on save. + */ + includeText?: boolean; +} +export interface TextDocumentSyncOptions { + /** + * Open and close notifications are sent to the server. + */ + openClose?: boolean; + /** + * Change notificatins are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full + * and TextDocumentSyncKindIncremental. + */ + change?: TextDocumentSyncKind; + /** + * Will save notifications are sent to the server. + */ + willSave?: boolean; + /** + * Will save wait until requests are sent to the server. + */ + willSaveWaitUntil?: boolean; + /** + * Save notifications are sent to the server. + */ + save?: SaveOptions; +} +/** + * Defines the capabilities provided by a language + * server. + */ +export interface ServerCapabilities { + /** + * Defines how text documents are synced. Is either a detailed structure defining each notification or + * for backwards compatibility the TextDocumentSyncKind number. + */ + textDocumentSync?: TextDocumentSyncOptions | TextDocumentSyncKind; + /** + * The server provides hover support. + */ + hoverProvider?: boolean; + /** + * The server provides completion support. + */ + completionProvider?: CompletionOptions; + /** + * The server provides signature help support. + */ + signatureHelpProvider?: SignatureHelpOptions; + /** + * The server provides goto definition support. + */ + definitionProvider?: boolean; + /** + * The server provides find references support. + */ + referencesProvider?: boolean; + /** + * The server provides document highlight support. + */ + documentHighlightProvider?: boolean; + /** + * The server provides document symbol support. + */ + documentSymbolProvider?: boolean; + /** + * The server provides workspace symbol support. + */ + workspaceSymbolProvider?: boolean; + /** + * The server provides code actions. + */ + codeActionProvider?: boolean; + /** + * The server provides code lens. + */ + codeLensProvider?: CodeLensOptions; + /** + * The server provides document formatting. + */ + documentFormattingProvider?: boolean; + /** + * The server provides document range formatting. + */ + documentRangeFormattingProvider?: boolean; + /** + * The server provides document formatting on typing. + */ + documentOnTypeFormattingProvider?: { + /** + * A character on which formatting should be triggered, like `}`. + */ + firstTriggerCharacter: string; + /** + * More trigger characters. + */ + moreTriggerCharacter?: string[]; + }; + /** + * The server provides rename support. + */ + renameProvider?: boolean; + /** + * The server provides document link support. + */ + documentLinkProvider?: DocumentLinkOptions; + /** + * The server provides execute command support. + */ + executeCommandProvider?: ExecuteCommandOptions; + /** + * Experimental server capabilities. + */ + experimental?: any; +} +/** + * The initialize request is sent from the client to the server. + * It is sent once as the request after starting up the server. + * The requests parameter is of type [InitializeParams](#InitializeParams) + * the response if of type [InitializeResult](#InitializeResult) of a Thenable that + * resolves to such. + */ +export declare namespace InitializeRequest { + const type: RequestType; +} +/** + * The initialize parameters + */ +export interface InitializeParams { + /** + * The process Id of the parent process that started + * the server. + */ + processId: number; + /** + * The rootPath of the workspace. Is null + * if no folder is open. + * + * @deprecated in favour of rootUri. + */ + rootPath?: string | null; + /** + * The rootUri of the workspace. Is null if no + * folder is open. If both `rootPath` and `rootUri` are set + * `rootUri` wins. + */ + rootUri: string | null; + /** + * The capabilities provided by the client (editor or tool) + */ + capabilities: ClientCapabilities; + /** + * User provided initialization options. + */ + initializationOptions?: any; + /** + * The initial trace setting. If omitted trace is disabled ('off'). + */ + trace?: 'off' | 'messages' | 'verbose'; +} +/** + * The result returned from an initilize request. + */ +export interface InitializeResult { + /** + * The capabilities the language server provides. + */ + capabilities: ServerCapabilities; +} +/** + * Known error codes for an `InitializeError`; + */ +export declare namespace InitializeError { + /** + * If the protocol version provided by the client can't be handled by the server. + * @deprecated This initialize error got replaced by client capabilities. There is + * no version handshake in version 3.0x + */ + const unknownProtocolVersion: number; +} +/** + * The data type of the ResponseError if the + * initialize request fails. + */ +export interface InitializeError { + /** + * Indicates whether the client should retry to send the + * initialize request after showing the message provided + * in the {@link ResponseError} + */ + retry: boolean; +} +export interface InitializedParams { +} +/** + * The intialized notification is send from the client to the + * server after the client is fully initialized and the server + * is allowed to send requests from the server to the client. + */ +export declare namespace InitializedNotification { + const type: NotificationType; +} +/** + * A shutdown request is sent from the client to the server. + * It is sent once when the client descides to shutdown the + * server. The only notification that is sent after a shudown request + * is the exit event. + */ +export declare namespace ShutdownRequest { + const type: RequestType0; +} +/** + * The exit event is sent from the client to the server to + * ask the server to exit its process. + */ +export declare namespace ExitNotification { + const type: NotificationType0; +} +/** + * The configuration change notification is sent from the client to the server + * when the client's configuration has changed. The notification contains + * the changed configuration as defined by the language client. + */ +export declare namespace DidChangeConfigurationNotification { + const type: NotificationType; +} +/** + * The parameters of a change configuration notification. + */ +export interface DidChangeConfigurationParams { + /** + * The actual changed settings + */ + settings: any; +} +/** + * The message type + */ +export declare namespace MessageType { + /** + * An error message. + */ + const Error = 1; + /** + * A warning message. + */ + const Warning = 2; + /** + * An information message. + */ + const Info = 3; + /** + * A log message. + */ + const Log = 4; +} +export declare type MessageType = 1 | 2 | 3 | 4; +/** + * The parameters of a notification message. + */ +export interface ShowMessageParams { + /** + * The message type. See {@link MessageType} + */ + type: MessageType; + /** + * The actual message + */ + message: string; +} +/** + * The show message notification is sent from a server to a client to ask + * the client to display a particular message in the user interface. + */ +export declare namespace ShowMessageNotification { + const type: NotificationType; +} +export interface MessageActionItem { + /** + * A short title like 'Retry', 'Open Log' etc. + */ + title: string; +} +export interface ShowMessageRequestParams { + /** + * The message type. See {@link MessageType} + */ + type: MessageType; + /** + * The actual message + */ + message: string; + /** + * The message action items to present. + */ + actions?: MessageActionItem[]; +} +/** + * The show message request is sent from the server to the clinet to show a message + * and a set of options actions to the user. + */ +export declare namespace ShowMessageRequest { + const type: RequestType; +} +/** + * The log message notification is sent from the server to the client to ask + * the client to log a particular message. + */ +export declare namespace LogMessageNotification { + const type: NotificationType; +} +/** + * The log message parameters. + */ +export interface LogMessageParams { + /** + * The message type. See {@link MessageType} + */ + type: MessageType; + /** + * The actual message + */ + message: string; +} +/** + * The telemetry event notification is sent from the server to the client to ask + * the client to log telemetry data. + */ +export declare namespace TelemetryEventNotification { + const type: NotificationType; +} +/** + * The parameters send in a open text document notification + */ +export interface DidOpenTextDocumentParams { + /** + * The document that was opened. + */ + textDocument: TextDocumentItem; +} +/** + * The document open notification is sent from the client to the server to signal + * newly opened text documents. The document's truth is now managed by the client + * and the server must not try to read the document's truth using the document's + * uri. + */ +export declare namespace DidOpenTextDocumentNotification { + const type: NotificationType; +} +/** + * The change text document notification's parameters. + */ +export interface DidChangeTextDocumentParams { + /** + * The document that did change. The version number points + * to the version after all provided content changes have + * been applied. + */ + textDocument: VersionedTextDocumentIdentifier; + /** + * The actual content changes. + */ + contentChanges: TextDocumentContentChangeEvent[]; +} +/** + * Descibe options to be used when registered for text document change events. + */ +export interface TextDocumentChangeRegistrationOptions extends TextDocumentRegistrationOptions { + /** + * How documents are synced to the server. + */ + syncKind: TextDocumentSyncKind; +} +/** + * The document change notification is sent from the client to the server to signal + * changes to a text document. + */ +export declare namespace DidChangeTextDocumentNotification { + const type: NotificationType; +} +/** + * The parameters send in a close text document notification + */ +export interface DidCloseTextDocumentParams { + /** + * The document that was closed. + */ + textDocument: TextDocumentIdentifier; +} +/** + * The document close notification is sent from the client to the server when + * the document got closed in the client. The document's truth now exists + * where the document's uri points to (e.g. if the document's uri is a file uri + * the truth now exists on disk). + */ +export declare namespace DidCloseTextDocumentNotification { + const type: NotificationType; +} +/** + * The parameters send in a save text document notification + */ +export interface DidSaveTextDocumentParams { + /** + * The document that was closed. + */ + textDocument: VersionedTextDocumentIdentifier; + /** + * Optional the content when saved. Depends on the includeText value + * when the save notifcation was requested. + */ + text?: string; +} +/** + * Save registration options. + */ +export interface TextDocumentSaveRegistrationOptions extends TextDocumentRegistrationOptions, SaveOptions { +} +/** + * The document save notification is sent from the client to the server when + * the document got saved in the client. + */ +export declare namespace DidSaveTextDocumentNotification { + const type: NotificationType; +} +/** + * The parameters send in a will save text document notification. + */ +export interface WillSaveTextDocumentParams { + /** + * The document that will be saved. + */ + textDocument: TextDocumentIdentifier; + /** + * The 'TextDocumentSaveReason'. + */ + reason: TextDocumentSaveReason; +} +/** + * A document will save notification is sent from the client to the server before + * the document is actually saved. + */ +export declare namespace WillSaveTextDocumentNotification { + const type: NotificationType; +} +/** + * A document will save request is sent from the client to the server before + * the document is actually saved. The request can return an array of TextEdits + * which will be applied to the text document before it is saved. Please note that + * clients might drop results if computing the text edits took too long or if a + * server constantly fails on this request. This is done to keep the save fast and + * reliable. + */ +export declare namespace WillSaveTextDocumentWaitUntilRequest { + const type: RequestType; +} +/** + * The watched files notification is sent from the client to the server when + * the client detects changes to file watched by the lanaguage client. + */ +export declare namespace DidChangeWatchedFilesNotification { + const type: NotificationType; +} +/** + * The watched files change notification's parameters. + */ +export interface DidChangeWatchedFilesParams { + /** + * The actual file events. + */ + changes: FileEvent[]; +} +/** + * The file event type + */ +export declare namespace FileChangeType { + /** + * The file got created. + */ + const Created = 1; + /** + * The file got changed. + */ + const Changed = 2; + /** + * The file got deleted. + */ + const Deleted = 3; +} +export declare type FileChangeType = 1 | 2 | 3; +/** + * An event describing a file change. + */ +export interface FileEvent { + /** + * The file's uri. + */ + uri: string; + /** + * The change type. + */ + type: FileChangeType; +} +/** + * Diagnostics notification are sent from the server to the client to signal + * results of validation runs. + */ +export declare namespace PublishDiagnosticsNotification { + const type: NotificationType; +} +/** + * The publish diagnostic notification's parameters. + */ +export interface PublishDiagnosticsParams { + /** + * The URI for which diagnostic information is reported. + */ + uri: string; + /** + * An array of diagnostic information items. + */ + diagnostics: Diagnostic[]; +} +/** + * Completion registration options. + */ +export interface CompletionRegistrationOptions extends TextDocumentRegistrationOptions, CompletionOptions { +} +/** + * Request to request completion at a given text document position. The request's + * parameter is of type [TextDocumentPosition](#TextDocumentPosition) the response + * is of type [CompletionItem[]](#CompletionItem) or [CompletionList](#CompletionList) + * or a Thenable that resolves to such. + */ +export declare namespace CompletionRequest { + const type: RequestType; +} +/** + * Request to resolve additional information for a given completion item.The request's + * parameter is of type [CompletionItem](#CompletionItem) the response + * is of type [CompletionItem](#CompletionItem) or a Thenable that resolves to such. + */ +export declare namespace CompletionResolveRequest { + const type: RequestType; +} +/** + * Request to request hover information at a given text document position. The request's + * parameter is of type [TextDocumentPosition](#TextDocumentPosition) the response is of + * type [Hover](#Hover) or a Thenable that resolves to such. + */ +export declare namespace HoverRequest { + const type: RequestType; +} +/** + * Signature help registration options. + */ +export interface SignatureHelpRegistrationOptions extends TextDocumentRegistrationOptions, SignatureHelpOptions { +} +export declare namespace SignatureHelpRequest { + const type: RequestType; +} +/** + * A request to resolve the defintion location of a symbol at a given text + * document position. The request's parameter is of type [TextDocumentPosition] + * (#TextDocumentPosition) the response is of type [Definition](#Definition) or a + * Thenable that resolves to such. + */ +export declare namespace DefinitionRequest { + const type: RequestType; +} +/** + * Parameters for a [ReferencesRequest](#ReferencesRequest). + */ +export interface ReferenceParams extends TextDocumentPositionParams { + context: ReferenceContext; +} +/** + * A request to resolve project-wide references for the symbol denoted + * by the given text document position. The request's parameter is of + * type [ReferenceParams](#ReferenceParams) the response is of type + * [Location[]](#Location) or a Thenable that resolves to such. + */ +export declare namespace ReferencesRequest { + const type: RequestType; +} +/** + * Request to resolve a [DocumentHighlight](#DocumentHighlight) for a given + * text document position. The request's parameter is of type [TextDocumentPosition] + * (#TextDocumentPosition) the request reponse is of type [DocumentHighlight[]] + * (#DocumentHighlight) or a Thenable that resolves to such. + */ +export declare namespace DocumentHighlightRequest { + const type: RequestType; +} +/** + * A request to list all symbols found in a given text document. The request's + * parameter is of type [TextDocumentIdentifier](#TextDocumentIdentifier) the + * response is of type [SymbolInformation[]](#SymbolInformation) or a Thenable + * that resolves to such. + */ +export declare namespace DocumentSymbolRequest { + const type: RequestType; +} +/** + * A request to list project-wide symbols matching the query string given + * by the [WorkspaceSymbolParams](#WorkspaceSymbolParams). The response is + * of type [SymbolInformation[]](#SymbolInformation) or a Thenable that + * resolves to such. + */ +export declare namespace WorkspaceSymbolRequest { + const type: RequestType; +} +/** + * Params for the CodeActionRequest + */ +export interface CodeActionParams { + /** + * The document in which the command was invoked. + */ + textDocument: TextDocumentIdentifier; + /** + * The range for which the command was invoked. + */ + range: Range; + /** + * Context carrying additional information. + */ + context: CodeActionContext; +} +/** + * A request to provide commands for the given text document and range. + */ +export declare namespace CodeActionRequest { + const type: RequestType; +} +/** + * Params for the Code Lens request. + */ +export interface CodeLensParams { + /** + * The document to request code lens for. + */ + textDocument: TextDocumentIdentifier; +} +/** + * Code Lens registration options. + */ +export interface CodeLensRegistrationOptions extends TextDocumentRegistrationOptions, CodeLensOptions { +} +/** + * A request to provide code lens for the given text document. + */ +export declare namespace CodeLensRequest { + const type: RequestType; +} +/** + * A request to resolve a command for a given code lens. + */ +export declare namespace CodeLensResolveRequest { + const type: RequestType; +} +export interface DocumentFormattingParams { + /** + * The document to format. + */ + textDocument: TextDocumentIdentifier; + /** + * The format options + */ + options: FormattingOptions; +} +/** + * A request to to format a whole document. + */ +export declare namespace DocumentFormattingRequest { + const type: RequestType; +} +export interface DocumentRangeFormattingParams { + /** + * The document to format. + */ + textDocument: TextDocumentIdentifier; + /** + * The range to format + */ + range: Range; + /** + * The format options + */ + options: FormattingOptions; +} +/** + * A request to to format a range in a document. + */ +export declare namespace DocumentRangeFormattingRequest { + const type: RequestType; +} +export interface DocumentOnTypeFormattingParams { + /** + * The document to format. + */ + textDocument: TextDocumentIdentifier; + /** + * The position at which this request was send. + */ + position: Position; + /** + * The character that has been typed. + */ + ch: string; + /** + * The format options. + */ + options: FormattingOptions; +} +/** + * Format document on type options + */ +export interface DocumentOnTypeFormattingRegistrationOptions extends TextDocumentRegistrationOptions, DocumentOnTypeFormattingOptions { +} +/** + * A request to format a document on type. + */ +export declare namespace DocumentOnTypeFormattingRequest { + const type: RequestType; +} +export interface RenameParams { + /** + * The document to format. + */ + textDocument: TextDocumentIdentifier; + /** + * The position at which this request was send. + */ + position: Position; + /** + * The new name of the symbol. If the given name is not valid the + * request must return a [ResponseError](#ResponseError) with an + * appropriate message set. + */ + newName: string; +} +/** + * A request to rename a symbol. + */ +export declare namespace RenameRequest { + const type: RequestType; +} +export interface DocumentLinkParams { + /** + * The document to provide document links for. + */ + textDocument: TextDocumentIdentifier; +} +/** + * Document link registration options + */ +export interface DocumentLinkRegistrationOptions extends TextDocumentRegistrationOptions, DocumentLinkOptions { +} +/** + * A request to provide document links + */ +export declare namespace DocumentLinkRequest { + const type: RequestType; +} +/** + * Request to resolve additional information for a given document link. The request's + * parameter is of type [DocumentLink](#DocumentLink) the response + * is of type [DocumentLink](#DocumentLink) or a Thenable that resolves to such. + */ +export declare namespace DocumentLinkResolveRequest { + const type: RequestType; +} +export interface ExecuteCommandParams { + /** + * The identifier of the actual command handler. + */ + command: string; + /** + * Arguments that the command should be invoked with. + */ + arguments?: any[]; +} +/** + * Execute command registration options. + */ +export interface ExecuteCommandRegistrationOptions extends ExecuteCommandOptions { +} +/** + * A request send from the client to the server to execute a command. The request might return + * a workspace edit which the client will apply to the workspace. + */ +export declare namespace ExecuteCommandRequest { + const type: RequestType; +} +/** + * The parameters passed via a apply workspace edit request. + */ +export interface ApplyWorkspaceEditParams { + /** + * The edits to apply. + */ + edit: WorkspaceEdit; +} +/** + * A reponse returned from the apply workspace edit request. + */ +export interface ApplyWorkspaceEditResponse { + /** + * Indicates whether the edit was applied or not. + */ + applied: boolean; +} +/** + * A request sent from the server to the client to modified certain resources. + */ +export declare namespace ApplyWorkspaceEditRequest { + const type: RequestType; +} diff --git a/node_modules/vscode-languageserver/lib/protocol.js b/node_modules/vscode-languageserver/lib/protocol.js new file mode 100644 index 0000000..31e44f8 --- /dev/null +++ b/node_modules/vscode-languageserver/lib/protocol.js @@ -0,0 +1,421 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +'use strict'; +const vscode_jsonrpc_1 = require("vscode-jsonrpc"); +/** + * The `client/registerFeature` request is sent from the server to the client to register a new feature + * handler on the client side. + */ +var RegistrationRequest; +(function (RegistrationRequest) { + RegistrationRequest.type = new vscode_jsonrpc_1.RequestType('client/registerFeature'); +})(RegistrationRequest = exports.RegistrationRequest || (exports.RegistrationRequest = {})); +/** + * The `client/unregisterFeature` request is sent from the server to the client to unregister a previously registered feature + * handler on the client side. + */ +var UnregistrationRequest; +(function (UnregistrationRequest) { + UnregistrationRequest.type = new vscode_jsonrpc_1.RequestType('client/unregisterFeature'); +})(UnregistrationRequest = exports.UnregistrationRequest || (exports.UnregistrationRequest = {})); +/** + * Defines how the host (editor) should sync + * document changes to the language server. + */ +var TextDocumentSyncKind; +(function (TextDocumentSyncKind) { + /** + * Documents should not be synced at all. + */ + TextDocumentSyncKind.None = 0; + /** + * Documents are synced by always sending the full content + * of the document. + */ + TextDocumentSyncKind.Full = 1; + /** + * Documents are synced by sending the full content on open. + * After that only incremental updates to the document are + * send. + */ + TextDocumentSyncKind.Incremental = 2; +})(TextDocumentSyncKind = exports.TextDocumentSyncKind || (exports.TextDocumentSyncKind = {})); +/** + * The initialize request is sent from the client to the server. + * It is sent once as the request after starting up the server. + * The requests parameter is of type [InitializeParams](#InitializeParams) + * the response if of type [InitializeResult](#InitializeResult) of a Thenable that + * resolves to such. + */ +var InitializeRequest; +(function (InitializeRequest) { + InitializeRequest.type = new vscode_jsonrpc_1.RequestType('initialize'); +})(InitializeRequest = exports.InitializeRequest || (exports.InitializeRequest = {})); +/** + * Known error codes for an `InitializeError`; + */ +var InitializeError; +(function (InitializeError) { + /** + * If the protocol version provided by the client can't be handled by the server. + * @deprecated This initialize error got replaced by client capabilities. There is + * no version handshake in version 3.0x + */ + InitializeError.unknownProtocolVersion = 1; +})(InitializeError = exports.InitializeError || (exports.InitializeError = {})); +/** + * The intialized notification is send from the client to the + * server after the client is fully initialized and the server + * is allowed to send requests from the server to the client. + */ +var InitializedNotification; +(function (InitializedNotification) { + InitializedNotification.type = new vscode_jsonrpc_1.NotificationType('initialized'); +})(InitializedNotification = exports.InitializedNotification || (exports.InitializedNotification = {})); +//---- Shutdown Method ---- +/** + * A shutdown request is sent from the client to the server. + * It is sent once when the client descides to shutdown the + * server. The only notification that is sent after a shudown request + * is the exit event. + */ +var ShutdownRequest; +(function (ShutdownRequest) { + ShutdownRequest.type = new vscode_jsonrpc_1.RequestType0('shutdown'); +})(ShutdownRequest = exports.ShutdownRequest || (exports.ShutdownRequest = {})); +//---- Exit Notification ---- +/** + * The exit event is sent from the client to the server to + * ask the server to exit its process. + */ +var ExitNotification; +(function (ExitNotification) { + ExitNotification.type = new vscode_jsonrpc_1.NotificationType0('exit'); +})(ExitNotification = exports.ExitNotification || (exports.ExitNotification = {})); +//---- Configuration notification ---- +/** + * The configuration change notification is sent from the client to the server + * when the client's configuration has changed. The notification contains + * the changed configuration as defined by the language client. + */ +var DidChangeConfigurationNotification; +(function (DidChangeConfigurationNotification) { + DidChangeConfigurationNotification.type = new vscode_jsonrpc_1.NotificationType('workspace/didChangeConfiguration'); +})(DidChangeConfigurationNotification = exports.DidChangeConfigurationNotification || (exports.DidChangeConfigurationNotification = {})); +//---- Message show and log notifications ---- +/** + * The message type + */ +var MessageType; +(function (MessageType) { + /** + * An error message. + */ + MessageType.Error = 1; + /** + * A warning message. + */ + MessageType.Warning = 2; + /** + * An information message. + */ + MessageType.Info = 3; + /** + * A log message. + */ + MessageType.Log = 4; +})(MessageType = exports.MessageType || (exports.MessageType = {})); +/** + * The show message notification is sent from a server to a client to ask + * the client to display a particular message in the user interface. + */ +var ShowMessageNotification; +(function (ShowMessageNotification) { + ShowMessageNotification.type = new vscode_jsonrpc_1.NotificationType('window/showMessage'); +})(ShowMessageNotification = exports.ShowMessageNotification || (exports.ShowMessageNotification = {})); +/** + * The show message request is sent from the server to the clinet to show a message + * and a set of options actions to the user. + */ +var ShowMessageRequest; +(function (ShowMessageRequest) { + ShowMessageRequest.type = new vscode_jsonrpc_1.RequestType('window/showMessageRequest'); +})(ShowMessageRequest = exports.ShowMessageRequest || (exports.ShowMessageRequest = {})); +/** + * The log message notification is sent from the server to the client to ask + * the client to log a particular message. + */ +var LogMessageNotification; +(function (LogMessageNotification) { + LogMessageNotification.type = new vscode_jsonrpc_1.NotificationType('window/logMessage'); +})(LogMessageNotification = exports.LogMessageNotification || (exports.LogMessageNotification = {})); +//---- Telemetry notification +/** + * The telemetry event notification is sent from the server to the client to ask + * the client to log telemetry data. + */ +var TelemetryEventNotification; +(function (TelemetryEventNotification) { + TelemetryEventNotification.type = new vscode_jsonrpc_1.NotificationType('telemetry/event'); +})(TelemetryEventNotification = exports.TelemetryEventNotification || (exports.TelemetryEventNotification = {})); +/** + * The document open notification is sent from the client to the server to signal + * newly opened text documents. The document's truth is now managed by the client + * and the server must not try to read the document's truth using the document's + * uri. + */ +var DidOpenTextDocumentNotification; +(function (DidOpenTextDocumentNotification) { + DidOpenTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/didOpen'); +})(DidOpenTextDocumentNotification = exports.DidOpenTextDocumentNotification || (exports.DidOpenTextDocumentNotification = {})); +/** + * The document change notification is sent from the client to the server to signal + * changes to a text document. + */ +var DidChangeTextDocumentNotification; +(function (DidChangeTextDocumentNotification) { + DidChangeTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/didChange'); +})(DidChangeTextDocumentNotification = exports.DidChangeTextDocumentNotification || (exports.DidChangeTextDocumentNotification = {})); +/** + * The document close notification is sent from the client to the server when + * the document got closed in the client. The document's truth now exists + * where the document's uri points to (e.g. if the document's uri is a file uri + * the truth now exists on disk). + */ +var DidCloseTextDocumentNotification; +(function (DidCloseTextDocumentNotification) { + DidCloseTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/didClose'); +})(DidCloseTextDocumentNotification = exports.DidCloseTextDocumentNotification || (exports.DidCloseTextDocumentNotification = {})); +/** + * The document save notification is sent from the client to the server when + * the document got saved in the client. + */ +var DidSaveTextDocumentNotification; +(function (DidSaveTextDocumentNotification) { + DidSaveTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/didSave'); +})(DidSaveTextDocumentNotification = exports.DidSaveTextDocumentNotification || (exports.DidSaveTextDocumentNotification = {})); +/** + * A document will save notification is sent from the client to the server before + * the document is actually saved. + */ +var WillSaveTextDocumentNotification; +(function (WillSaveTextDocumentNotification) { + WillSaveTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/willSave'); +})(WillSaveTextDocumentNotification = exports.WillSaveTextDocumentNotification || (exports.WillSaveTextDocumentNotification = {})); +/** + * A document will save request is sent from the client to the server before + * the document is actually saved. The request can return an array of TextEdits + * which will be applied to the text document before it is saved. Please note that + * clients might drop results if computing the text edits took too long or if a + * server constantly fails on this request. This is done to keep the save fast and + * reliable. + */ +var WillSaveTextDocumentWaitUntilRequest; +(function (WillSaveTextDocumentWaitUntilRequest) { + WillSaveTextDocumentWaitUntilRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/willSaveWaitUntil'); +})(WillSaveTextDocumentWaitUntilRequest = exports.WillSaveTextDocumentWaitUntilRequest || (exports.WillSaveTextDocumentWaitUntilRequest = {})); +//---- File eventing ---- +/** + * The watched files notification is sent from the client to the server when + * the client detects changes to file watched by the lanaguage client. + */ +var DidChangeWatchedFilesNotification; +(function (DidChangeWatchedFilesNotification) { + DidChangeWatchedFilesNotification.type = new vscode_jsonrpc_1.NotificationType('workspace/didChangeWatchedFiles'); +})(DidChangeWatchedFilesNotification = exports.DidChangeWatchedFilesNotification || (exports.DidChangeWatchedFilesNotification = {})); +/** + * The file event type + */ +var FileChangeType; +(function (FileChangeType) { + /** + * The file got created. + */ + FileChangeType.Created = 1; + /** + * The file got changed. + */ + FileChangeType.Changed = 2; + /** + * The file got deleted. + */ + FileChangeType.Deleted = 3; +})(FileChangeType = exports.FileChangeType || (exports.FileChangeType = {})); +//---- Diagnostic notification ---- +/** + * Diagnostics notification are sent from the server to the client to signal + * results of validation runs. + */ +var PublishDiagnosticsNotification; +(function (PublishDiagnosticsNotification) { + PublishDiagnosticsNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/publishDiagnostics'); +})(PublishDiagnosticsNotification = exports.PublishDiagnosticsNotification || (exports.PublishDiagnosticsNotification = {})); +/** + * Request to request completion at a given text document position. The request's + * parameter is of type [TextDocumentPosition](#TextDocumentPosition) the response + * is of type [CompletionItem[]](#CompletionItem) or [CompletionList](#CompletionList) + * or a Thenable that resolves to such. + */ +var CompletionRequest; +(function (CompletionRequest) { + CompletionRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/completion'); +})(CompletionRequest = exports.CompletionRequest || (exports.CompletionRequest = {})); +/** + * Request to resolve additional information for a given completion item.The request's + * parameter is of type [CompletionItem](#CompletionItem) the response + * is of type [CompletionItem](#CompletionItem) or a Thenable that resolves to such. + */ +var CompletionResolveRequest; +(function (CompletionResolveRequest) { + CompletionResolveRequest.type = new vscode_jsonrpc_1.RequestType('completionItem/resolve'); +})(CompletionResolveRequest = exports.CompletionResolveRequest || (exports.CompletionResolveRequest = {})); +//---- Hover Support ------------------------------- +/** + * Request to request hover information at a given text document position. The request's + * parameter is of type [TextDocumentPosition](#TextDocumentPosition) the response is of + * type [Hover](#Hover) or a Thenable that resolves to such. + */ +var HoverRequest; +(function (HoverRequest) { + HoverRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/hover'); +})(HoverRequest = exports.HoverRequest || (exports.HoverRequest = {})); +var SignatureHelpRequest; +(function (SignatureHelpRequest) { + SignatureHelpRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/signatureHelp'); +})(SignatureHelpRequest = exports.SignatureHelpRequest || (exports.SignatureHelpRequest = {})); +//---- Goto Definition ------------------------------------- +/** + * A request to resolve the defintion location of a symbol at a given text + * document position. The request's parameter is of type [TextDocumentPosition] + * (#TextDocumentPosition) the response is of type [Definition](#Definition) or a + * Thenable that resolves to such. + */ +var DefinitionRequest; +(function (DefinitionRequest) { + DefinitionRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/definition'); +})(DefinitionRequest = exports.DefinitionRequest || (exports.DefinitionRequest = {})); +/** + * A request to resolve project-wide references for the symbol denoted + * by the given text document position. The request's parameter is of + * type [ReferenceParams](#ReferenceParams) the response is of type + * [Location[]](#Location) or a Thenable that resolves to such. + */ +var ReferencesRequest; +(function (ReferencesRequest) { + ReferencesRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/references'); +})(ReferencesRequest = exports.ReferencesRequest || (exports.ReferencesRequest = {})); +//---- Document Highlight ---------------------------------- +/** + * Request to resolve a [DocumentHighlight](#DocumentHighlight) for a given + * text document position. The request's parameter is of type [TextDocumentPosition] + * (#TextDocumentPosition) the request reponse is of type [DocumentHighlight[]] + * (#DocumentHighlight) or a Thenable that resolves to such. + */ +var DocumentHighlightRequest; +(function (DocumentHighlightRequest) { + DocumentHighlightRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/documentHighlight'); +})(DocumentHighlightRequest = exports.DocumentHighlightRequest || (exports.DocumentHighlightRequest = {})); +//---- Document Symbol Provider --------------------------- +/** + * A request to list all symbols found in a given text document. The request's + * parameter is of type [TextDocumentIdentifier](#TextDocumentIdentifier) the + * response is of type [SymbolInformation[]](#SymbolInformation) or a Thenable + * that resolves to such. + */ +var DocumentSymbolRequest; +(function (DocumentSymbolRequest) { + DocumentSymbolRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/documentSymbol'); +})(DocumentSymbolRequest = exports.DocumentSymbolRequest || (exports.DocumentSymbolRequest = {})); +//---- Workspace Symbol Provider --------------------------- +/** + * A request to list project-wide symbols matching the query string given + * by the [WorkspaceSymbolParams](#WorkspaceSymbolParams). The response is + * of type [SymbolInformation[]](#SymbolInformation) or a Thenable that + * resolves to such. + */ +var WorkspaceSymbolRequest; +(function (WorkspaceSymbolRequest) { + WorkspaceSymbolRequest.type = new vscode_jsonrpc_1.RequestType('workspace/symbol'); +})(WorkspaceSymbolRequest = exports.WorkspaceSymbolRequest || (exports.WorkspaceSymbolRequest = {})); +/** + * A request to provide commands for the given text document and range. + */ +var CodeActionRequest; +(function (CodeActionRequest) { + CodeActionRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/codeAction'); +})(CodeActionRequest = exports.CodeActionRequest || (exports.CodeActionRequest = {})); +/** + * A request to provide code lens for the given text document. + */ +var CodeLensRequest; +(function (CodeLensRequest) { + CodeLensRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/codeLens'); +})(CodeLensRequest = exports.CodeLensRequest || (exports.CodeLensRequest = {})); +/** + * A request to resolve a command for a given code lens. + */ +var CodeLensResolveRequest; +(function (CodeLensResolveRequest) { + CodeLensResolveRequest.type = new vscode_jsonrpc_1.RequestType('codeLens/resolve'); +})(CodeLensResolveRequest = exports.CodeLensResolveRequest || (exports.CodeLensResolveRequest = {})); +/** + * A request to to format a whole document. + */ +var DocumentFormattingRequest; +(function (DocumentFormattingRequest) { + DocumentFormattingRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/formatting'); +})(DocumentFormattingRequest = exports.DocumentFormattingRequest || (exports.DocumentFormattingRequest = {})); +/** + * A request to to format a range in a document. + */ +var DocumentRangeFormattingRequest; +(function (DocumentRangeFormattingRequest) { + DocumentRangeFormattingRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/rangeFormatting'); +})(DocumentRangeFormattingRequest = exports.DocumentRangeFormattingRequest || (exports.DocumentRangeFormattingRequest = {})); +/** + * A request to format a document on type. + */ +var DocumentOnTypeFormattingRequest; +(function (DocumentOnTypeFormattingRequest) { + DocumentOnTypeFormattingRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/onTypeFormatting'); +})(DocumentOnTypeFormattingRequest = exports.DocumentOnTypeFormattingRequest || (exports.DocumentOnTypeFormattingRequest = {})); +/** + * A request to rename a symbol. + */ +var RenameRequest; +(function (RenameRequest) { + RenameRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/rename'); +})(RenameRequest = exports.RenameRequest || (exports.RenameRequest = {})); +/** + * A request to provide document links + */ +var DocumentLinkRequest; +(function (DocumentLinkRequest) { + DocumentLinkRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/documentLink'); +})(DocumentLinkRequest = exports.DocumentLinkRequest || (exports.DocumentLinkRequest = {})); +/** + * Request to resolve additional information for a given document link. The request's + * parameter is of type [DocumentLink](#DocumentLink) the response + * is of type [DocumentLink](#DocumentLink) or a Thenable that resolves to such. + */ +var DocumentLinkResolveRequest; +(function (DocumentLinkResolveRequest) { + DocumentLinkResolveRequest.type = new vscode_jsonrpc_1.RequestType('documentLink/resolve'); +})(DocumentLinkResolveRequest = exports.DocumentLinkResolveRequest || (exports.DocumentLinkResolveRequest = {})); +/** + * A request send from the client to the server to execute a command. The request might return + * a workspace edit which the client will apply to the workspace. + */ +var ExecuteCommandRequest; +(function (ExecuteCommandRequest) { + ExecuteCommandRequest.type = new vscode_jsonrpc_1.RequestType('workspace/executeCommand'); +})(ExecuteCommandRequest = exports.ExecuteCommandRequest || (exports.ExecuteCommandRequest = {})); +/** + * A request sent from the server to the client to modified certain resources. + */ +var ApplyWorkspaceEditRequest; +(function (ApplyWorkspaceEditRequest) { + ApplyWorkspaceEditRequest.type = new vscode_jsonrpc_1.RequestType('workspace/applyEdit'); +})(ApplyWorkspaceEditRequest = exports.ApplyWorkspaceEditRequest || (exports.ApplyWorkspaceEditRequest = {})); diff --git a/node_modules/vscode-languageserver/lib/resolve.d.ts b/node_modules/vscode-languageserver/lib/resolve.d.ts new file mode 100644 index 0000000..4e765ce --- /dev/null +++ b/node_modules/vscode-languageserver/lib/resolve.d.ts @@ -0,0 +1,6 @@ +interface Message { + command: string; + success?: boolean; + args?: any; + result?: any; +} diff --git a/node_modules/vscode-languageserver/lib/resolve.js b/node_modules/vscode-languageserver/lib/resolve.js new file mode 100644 index 0000000..a824802 --- /dev/null +++ b/node_modules/vscode-languageserver/lib/resolve.js @@ -0,0 +1,19 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +'use strict'; +process.on('message', (message) => { + if (message.command === 'exit') { + process.exit(0); + } + else if (message.command === 'resolve') { + try { + let result = require.resolve(message.args); + process.send({ command: 'resolve', success: true, result: result }); + } + catch (err) { + process.send({ command: 'resolve', success: false }); + } + } +}); diff --git a/node_modules/vscode-languageserver/lib/thenable.d.ts b/node_modules/vscode-languageserver/lib/thenable.d.ts new file mode 100644 index 0000000..a6d43eb --- /dev/null +++ b/node_modules/vscode-languageserver/lib/thenable.d.ts @@ -0,0 +1,2 @@ +interface Thenable extends PromiseLike { +} diff --git a/node_modules/vscode-languageserver/lib/thenable.js b/node_modules/vscode-languageserver/lib/thenable.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/vscode-languageserver/lib/utils/is.d.ts b/node_modules/vscode-languageserver/lib/utils/is.d.ts new file mode 100644 index 0000000..92e0adc --- /dev/null +++ b/node_modules/vscode-languageserver/lib/utils/is.d.ts @@ -0,0 +1,12 @@ +export declare function defined(value: any): boolean; +export declare function undefined(value: any): boolean; +export declare function nil(value: any): boolean; +export declare function boolean(value: any): value is boolean; +export declare function string(value: any): value is string; +export declare function number(value: any): value is number; +export declare function error(value: any): value is Error; +export declare function func(value: any): value is Function; +export declare function array(value: any): value is T[]; +export declare function stringArray(value: any): value is string[]; +export declare function typedArray(value: any, check: (value: any) => boolean): value is T[]; +export declare function thenable(value: any): value is Thenable; diff --git a/node_modules/vscode-languageserver/lib/utils/is.js b/node_modules/vscode-languageserver/lib/utils/is.js new file mode 100644 index 0000000..8af4e93 --- /dev/null +++ b/node_modules/vscode-languageserver/lib/utils/is.js @@ -0,0 +1,54 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +'use strict'; +const toString = Object.prototype.toString; +function defined(value) { + return typeof value !== 'undefined'; +} +exports.defined = defined; +function undefined(value) { + return typeof value === 'undefined'; +} +exports.undefined = undefined; +function nil(value) { + return value === null; +} +exports.nil = nil; +function boolean(value) { + return value === true || value === false; +} +exports.boolean = boolean; +function string(value) { + return toString.call(value) === '[object String]'; +} +exports.string = string; +function number(value) { + return toString.call(value) === '[object Number]'; +} +exports.number = number; +function error(value) { + return toString.call(value) === '[object Error]'; +} +exports.error = error; +function func(value) { + return toString.call(value) === '[object Function]'; +} +exports.func = func; +function array(value) { + return Array.isArray(value); +} +exports.array = array; +function stringArray(value) { + return array(value) && value.every(elem => string(elem)); +} +exports.stringArray = stringArray; +function typedArray(value, check) { + return Array.isArray(value) && value.every(check); +} +exports.typedArray = typedArray; +function thenable(value) { + return value && func(value.then); +} +exports.thenable = thenable; diff --git a/node_modules/vscode-languageserver/lib/utils/uuid.d.ts b/node_modules/vscode-languageserver/lib/utils/uuid.d.ts new file mode 100644 index 0000000..bebf783 --- /dev/null +++ b/node_modules/vscode-languageserver/lib/utils/uuid.d.ts @@ -0,0 +1,22 @@ +/** + * Represents a UUID as defined by rfc4122. + */ +export interface UUID { + /** + * @returns the canonical representation in sets of hexadecimal numbers separated by dashes. + */ + asHex(): string; + equals(other: UUID): boolean; +} +/** + * An empty UUID that contains only zeros. + */ +export declare const empty: UUID; +export declare function v4(): UUID; +export declare function isUUID(value: string): boolean; +/** + * Parses a UUID that is of the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. + * @param value A uuid string. + */ +export declare function parse(value: string): UUID; +export declare function generateUuid(): string; diff --git a/node_modules/vscode-languageserver/lib/utils/uuid.js b/node_modules/vscode-languageserver/lib/utils/uuid.js new file mode 100644 index 0000000..0f74d67 --- /dev/null +++ b/node_modules/vscode-languageserver/lib/utils/uuid.js @@ -0,0 +1,95 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; +class ValueUUID { + constructor(_value) { + this._value = _value; + // empty + } + asHex() { + return this._value; + } + equals(other) { + return this.asHex() === other.asHex(); + } +} +class V4UUID extends ValueUUID { + constructor() { + super([ + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + '-', + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + '-', + '4', + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + '-', + V4UUID._oneOf(V4UUID._timeHighBits), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + '-', + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + V4UUID._randomHex(), + ].join('')); + } + static _oneOf(array) { + return array[Math.floor(array.length * Math.random())]; + } + static _randomHex() { + return V4UUID._oneOf(V4UUID._chars); + } +} +V4UUID._chars = ['0', '1', '2', '3', '4', '5', '6', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f']; +V4UUID._timeHighBits = ['8', '9', 'a', 'b']; +/** + * An empty UUID that contains only zeros. + */ +exports.empty = new ValueUUID('00000000-0000-0000-0000-000000000000'); +function v4() { + return new V4UUID(); +} +exports.v4 = v4; +const _UUIDPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i; +function isUUID(value) { + return _UUIDPattern.test(value); +} +exports.isUUID = isUUID; +/** + * Parses a UUID that is of the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. + * @param value A uuid string. + */ +function parse(value) { + if (!isUUID(value)) { + throw new Error('invalid uuid'); + } + return new ValueUUID(value); +} +exports.parse = parse; +function generateUuid() { + return v4().asHex(); +} +exports.generateUuid = generateUuid; diff --git a/node_modules/vscode-languageserver/package.json b/node_modules/vscode-languageserver/package.json new file mode 100644 index 0000000..655c019 --- /dev/null +++ b/node_modules/vscode-languageserver/package.json @@ -0,0 +1,129 @@ +{ + "_args": [ + [ + { + "raw": "vscode-languageserver@^3.1.0", + "scope": null, + "escapedName": "vscode-languageserver", + "name": "vscode-languageserver", + "rawSpec": "^3.1.0", + "spec": ">=3.1.0 <4.0.0", + "type": "range" + }, + "C:\\Users\\Jan Brodersen\\.vscode\\extensions\\Examples\\vscode-languageserver-node-example\\client" + ] + ], + "_from": "vscode-languageserver@>=3.1.0 <4.0.0", + "_id": "vscode-languageserver@3.1.0", + "_inCache": true, + "_installable": true, + "_location": "/vscode-languageserver", + "_nodeVersion": "6.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/vscode-languageserver-3.1.0.tgz_1488368174251_0.884115063585341" + }, + "_npmUser": { + "name": "dbaeumer", + "email": "dirk.baeumer@gmail.com" + }, + "_npmVersion": "3.10.8", + "_phantomChildren": {}, + "_requested": { + "raw": "vscode-languageserver@^3.1.0", + "scope": null, + "escapedName": "vscode-languageserver", + "name": "vscode-languageserver", + "rawSpec": "^3.1.0", + "spec": ">=3.1.0 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-3.1.0.tgz", + "_shasum": "85b3b366907d36f35a4ed6b609dabd37f6ef2038", + "_shrinkwrap": null, + "_spec": "vscode-languageserver@^3.1.0", + "_where": "C:\\Users\\Jan Brodersen\\.vscode\\extensions\\Examples\\vscode-languageserver-node-example\\client", + "author": { + "name": "Microsoft Corporation" + }, + "bin": { + "installServerIntoExtension": "./bin/installServerIntoExtension" + }, + "bugs": { + "url": "https://github.com/Microsoft/vscode-languageserver-node/issues" + }, + "dependencies": { + "vscode-jsonrpc": "^3.1.0", + "vscode-languageserver-types": "^3.0.3" + }, + "description": "Language server implementation for node", + "devDependencies": { + "@types/mocha": "^2.2.32", + "@types/node": "^6.0.42", + "mocha": "3.0.2", + "typescript": "^2.1.5" + }, + "directories": {}, + "dist": { + "shasum": "85b3b366907d36f35a4ed6b609dabd37f6ef2038", + "tarball": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-3.1.0.tgz" + }, + "homepage": "https://github.com/Microsoft/vscode-languageserver-node#readme", + "license": "MIT", + "main": "./lib/main.js", + "maintainers": [ + { + "name": "aeschli", + "email": "martinae@microsoft.com" + }, + { + "name": "alexandrudima", + "email": "alexdima@microsoft.com" + }, + { + "name": "bpasero", + "email": "benjpas@microsoft.com" + }, + { + "name": "chrisdias", + "email": "cdias@microsoft.com" + }, + { + "name": "dbaeumer", + "email": "dirk.baeumer@gmail.com" + }, + { + "name": "egamma", + "email": "egamma@microsoft.com" + }, + { + "name": "isidor", + "email": "inikolic@microsoft.com" + }, + { + "name": "joaomoreno.ms", + "email": "joao.moreno@microsoft.com" + }, + { + "name": "jrieken", + "email": "jrieken@microsoft.com" + } + ], + "name": "vscode-languageserver", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/Microsoft/vscode-languageserver-node.git" + }, + "scripts": { + "compile": "tsc -p ./src", + "prepublish": "tsc -p ./src", + "watch": "tsc -w -p ./src" + }, + "typings": "./lib/main", + "version": "3.1.0" +} diff --git a/node_modules/vscode-languageserver/thirdpartynotices.txt b/node_modules/vscode-languageserver/thirdpartynotices.txt new file mode 100644 index 0000000..feffa73 --- /dev/null +++ b/node_modules/vscode-languageserver/thirdpartynotices.txt @@ -0,0 +1,31 @@ +THIRD-PARTY SOFTWARE NOTICES AND INFORMATION +For Microsoft vscode-languageserver + +This project incorporates material from the project(s) listed below (collectively, “Third Party Code”). +Microsoft is not the original author of the Third Party Code. The original copyright notice and license +under which Microsoft received such Third Party Code are set out below. This Third Party Code is licensed +to you under their original license terms set forth below. Microsoft reserves all other rights not expressly +granted, whether by implication, estoppel or otherwise. + +1. DefinitelyTyped version 0.0.1 (https://github.com/borisyankov/DefinitelyTyped) + +This project is licensed under the MIT license. +Copyrights are respective of each contributor listed at the beginning of each definition file. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/vscode/.npmignore b/node_modules/vscode/.npmignore new file mode 100644 index 0000000..7c3afda --- /dev/null +++ b/node_modules/vscode/.npmignore @@ -0,0 +1,5 @@ +.vscode +tsconfig.json +lib/*.ts +vscode.d.ts +typings/vscode.raw.d.ts \ No newline at end of file diff --git a/node_modules/vscode/LICENSE b/node_modules/vscode/LICENSE new file mode 100644 index 0000000..285053e --- /dev/null +++ b/node_modules/vscode/LICENSE @@ -0,0 +1,23 @@ +vscode-extension-vscode + +The MIT License (MIT) + +Copyright (c) Microsoft Corporation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/vscode/README.md b/node_modules/vscode/README.md new file mode 100644 index 0000000..c9fed25 --- /dev/null +++ b/node_modules/vscode/README.md @@ -0,0 +1,11 @@ +# vscode-extension-vscode +The vscode.d.ts node module + +# History + +* 1.0.0: Extension developement is based on TypeScript 2.0.3 + +* 0.10.x: Extension developement is based on TypeScript 1.8.10 + +# License +[MIT](LICENSE) diff --git a/node_modules/vscode/bin/compile b/node_modules/vscode/bin/compile new file mode 100644 index 0000000..8a4db14 --- /dev/null +++ b/node_modules/vscode/bin/compile @@ -0,0 +1,6 @@ +#!/usr/bin/env node + +console.log('The vscode extension module got updated to TypeScript 2.0.x.'); +console.log('Please see https://code.visualstudio.com/updates/v1_6#_extension-authoring for instruction on how to migrate your extension.'); + +process.exit(1); \ No newline at end of file diff --git a/node_modules/vscode/bin/install b/node_modules/vscode/bin/install new file mode 100644 index 0000000..dd693b0 --- /dev/null +++ b/node_modules/vscode/bin/install @@ -0,0 +1,127 @@ +#!/usr/bin/env node + +var semver = require('semver'); +var fs = require('fs'); +var path = require('path'); +var shared = require('../lib/shared'); + +process.on('uncaughtException', function (err) { + exitWithError(err); +}); + +var engine = process.env.npm_package_engines_vscode; +if (!engine) { + exitWithError('Missing VSCode engine declaration in package.json.'); +} + +var vscodeDtsTypescriptPath = path.join(path.dirname(__dirname), 'vscode.d.ts'); + +console.log('Detected VS Code engine version: ' + engine); + +getURLMatchingEngine(engine, function (error, data) { + console.log('Fetching vscode.d.ts from: ' + data.url); + + shared.getContents(data.url, process.env.GITHUB_TOKEN, function (error, contents) { + if (error) { + exitWithError(error); + } + + if (contents === 'Not Found') { + exitWithError(new Error('Could not find vscode.d.ts at the provided URL. Please report this to https://github.com/Microsoft/vscode/issues')); + } + + if (data.version !== '*' && semver.lt(data.version, '1.7.0')) { + // Older versions of vscode.d.ts need a massage to play nice. + contents = vscodeDtsToTypescript(contents); + } + + fs.writeFileSync(vscodeDtsTypescriptPath, contents); + + console.log('vscode.d.ts successfully installed!\n'); + }); +}); + +function vscodeDtsToTypescript(contents) { + var markerHit = false; + var lines = contents.split('\n').filter(function (line) { + if (!markerHit && (line === '// when used for JS*' || line === 'declare module \'vscode\' {')) { + markerHit = true; + } + + return !markerHit; + }); + + lines.unshift('/// ') + lines.push('export = vscode;'); // this is to enable TS module resolution support + + return lines.join('\n'); +} + +function getURLMatchingEngine(engine, callback) { + if (engine === '*') { + // master + return callback(null, { + url: 'https://raw.githubusercontent.com/Microsoft/vscode/master/src/vs/vscode.d.ts', + version: '*' + }); + } + + shared.getContents('https://vscode-update.azurewebsites.net/api/releases/stable', null, function (error, tagsRaw) { + if (error) { + exitWithError(error); + } + + var tags; + try { + tags = JSON.parse(tagsRaw); + } catch (error) { + exitWithError(error); + } + + var tag = minSatisfying(tags, engine); + + // check if master is on the version specified + if (!tag) { + return shared.getContents('https://raw.githubusercontent.com/Microsoft/vscode/master/package.json', process.env.GITHUB_TOKEN, function (error, packageJson) { + if (error) { + exitWithError(error); + } + + var version = JSON.parse(packageJson).version; + if (semver.satisfies(version, engine)) { + // master + return callback(null, { + url: 'https://raw.githubusercontent.com/Microsoft/vscode/master/src/vs/vscode.d.ts', + version: version + }); + } + + exitWithError('Could not find satifying VSCode for version ' + engine + ' in the tags: [' + tags.join(', ') + '] or on master: ' + version); + }); + } + + console.log('Found minimal version that qualifies engine range: ' + tag); + + return callback(null, { + url: 'https://raw.githubusercontent.com/Microsoft/vscode/' + tag + '/src/vs/vscode.d.ts', + version: tag + }); + }); +} + +function minSatisfying(versions, range) { + return versions.filter(function (version) { + try { + return semver.satisfies(version, range); + } catch (error) { + return false; // version might be invalid so we return as not matching + }; + }).sort(function (a, b) { + return semver.compare(a, b); + })[0] || null; +} + +function exitWithError(error) { + console.error('Error installing vscode.d.ts: ' + error.toString()); + process.exit(1); +} \ No newline at end of file diff --git a/node_modules/vscode/bin/test b/node_modules/vscode/bin/test new file mode 100644 index 0000000..c658b11 --- /dev/null +++ b/node_modules/vscode/bin/test @@ -0,0 +1,145 @@ +#!/usr/bin/env node + +var remote = require('gulp-remote-src'); +var vzip = require('gulp-vinyl-zip'); +var symdest = require('gulp-symdest'); +var untar = require('gulp-untar'); +var gunzip = require('gulp-gunzip'); +var chmod = require('gulp-chmod'); +var filter = require('gulp-filter'); +var path = require('path'); +var cp = require('child_process'); +var fs = require('fs'); +var shared = require('../lib/shared'); +var request = require('request'); +var source = require('vinyl-source-stream'); + +var testRunFolder = '.vscode-test'; +var testRunFolderAbsolute = path.join(process.cwd(), testRunFolder); + +var version = process.env.CODE_VERSION || '*'; + +var downloadPlatform = (process.platform === 'darwin') ? 'darwin' : process.platform === 'win32' ? 'win32-archive' : 'linux-x64'; + +var windowsExecutable = path.join(testRunFolderAbsolute, 'Code'); +var darwinExecutable = path.join(testRunFolderAbsolute, 'Visual Studio Code.app', 'Contents', 'MacOS', 'Electron'); +var linuxExecutable = path.join(testRunFolderAbsolute, 'VSCode-linux-x64', 'code'); +if (['0.10.1', '0.10.2', '0.10.3', '0.10.4', '0.10.5', '0.10.6', '0.10.7', '0.10.8', '0.10.9'].indexOf(version) >= 0) { + linuxExecutable = path.join(testRunFolderAbsolute, 'VSCode-linux-x64', 'Code'); +} + +var testsFolder; +if (process.env.CODE_TESTS_PATH) { + testsFolder = process.env.CODE_TESTS_PATH; +} else if (fs.existsSync(path.join(process.cwd(), 'out', 'test'))) { + testsFolder = path.join(process.cwd(), 'out', 'test'); // TS extension +} else { + testsFolder = path.join(process.cwd(), 'test'); // JS extension +} + +var testsWorkspace = process.env.CODE_TESTS_WORKSPACE || testsFolder; + +console.log('### VS Code Extension Test Run ###'); +console.log('Current working directory: ' + process.cwd()); + +function runTests() { + var executable = (process.platform === 'darwin') ? darwinExecutable : process.platform === 'win32' ? windowsExecutable : linuxExecutable; + var args = [ + testsWorkspace, + '--extensionDevelopmentPath=' + process.cwd(), + '--extensionTestsPath=' + testsFolder + ]; + + console.log('Running extension tests: ' + [executable, args.join(' ')].join(' ')); + + var cmd = cp.spawn(executable, args); + + cmd.stdout.on('data', function (data) { + console.log(data.toString()); + }); + + cmd.stderr.on('data', function (data) { + console.error(data.toString()); + }); + + cmd.on('error', function (data) { + console.log('Failed to execute tests: ' + data.toString()); + }); + + cmd.on('close', function (code) { + console.log('Tests exited with code: ' + code); + + if (code !== 0) { + process.exit(code); // propagate exit code to outer runner + } + }); +} + +function downloadExecutableAndRunTests() { + getDownloadUrl(function (downloadUrl) { + console.log('Downloading VS Code into "' + testRunFolderAbsolute + '" from: ' + downloadUrl); + + var version = downloadUrl.match(/\d+\.\d+\.\d+/)[0].split('\.'); + var isTarGz = downloadUrl.match(/linux/) && version[0] >= 1 && version[1] >= 5; + + var stream; + if (isTarGz) { + var gulpFilter = filter('VSCode-linux-x64/code', { restore: true }); + stream = request(downloadUrl) + .pipe(source(path.basename(downloadUrl))) + .pipe(gunzip()) + .pipe(untar()) + .pipe(gulpFilter) + .pipe(chmod(755)) + .pipe(gulpFilter.restore) + .pipe(symdest(testRunFolder)); + } else { + stream = remote('', { base: downloadUrl }) + .pipe(vzip.src()) + .pipe(symdest(testRunFolder)); + } + + stream.on('end', runTests); + }); +} + +function getDownloadUrl(clb) { + if (process.env.CODE_DOWNLOAD_URL) { + return clb(process.env.CODE_DOWNLOAD_URL); + } + + getTag(function (tag) { + return clb(['https://vscode-update.azurewebsites.net', tag, downloadPlatform, 'stable'].join('/')); + }); +} + +function getTag(clb) { + if (version !== '*') { + return clb(version); + } + + shared.getContents('https://vscode-update.azurewebsites.net/api/releases/stable/' + downloadPlatform, null, function (error, tagsRaw) { + if (error) { + exitWithError(error); + } + + try { + clb(JSON.parse(tagsRaw)[0]); // first one is latest + } catch (error) { + exitWithError(error); + } + }); +} + +fs.exists(testRunFolderAbsolute, function (exists) { + if (exists) { + runTests(); + } else { + downloadExecutableAndRunTests(); + } +}); + +function exitWithError(error) { + console.error('Error running tests: ' + error.toString()); + process.exit(1); +} diff --git a/node_modules/vscode/lib/shared.js b/node_modules/vscode/lib/shared.js new file mode 100644 index 0000000..a573a97 --- /dev/null +++ b/node_modules/vscode/lib/shared.js @@ -0,0 +1,25 @@ +/*--------------------------------------------------------- + * Copyright (C) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------*/ +'use strict'; +Object.defineProperty(exports, "__esModule", { value: true }); +var request = require('request'); +function getContents(url, token, callback) { + var headers = { + 'user-agent': 'nodejs' + }; + if (token) { + headers['Authorization'] = 'token ' + token; + } + var options = { + url: url, + headers: headers + }; + request.get(options, function (error, response, body) { + if (!error && response && response.statusCode >= 400) { + error = new Error('Request returned status code: ' + response.statusCode + '\nDetails: ' + response.body); + } + callback(error, body); + }); +} +exports.getContents = getContents; diff --git a/node_modules/vscode/lib/testrunner.js b/node_modules/vscode/lib/testrunner.js new file mode 100644 index 0000000..6b54d4d --- /dev/null +++ b/node_modules/vscode/lib/testrunner.js @@ -0,0 +1,44 @@ +/*--------------------------------------------------------- + * Copyright (C) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------*/ +'use strict'; +Object.defineProperty(exports, "__esModule", { value: true }); +var paths = require("path"); +var glob = require("glob"); +// Linux: prevent a weird NPE when mocha on Linux requires the window size from the TTY +// Since we are not running in a tty environment, we just implementt he method statically +var tty = require('tty'); +if (!tty.getWindowSize) { + tty.getWindowSize = function () { return [80, 75]; }; +} +var Mocha = require("mocha"); +var mocha = new Mocha({ + ui: 'tdd', + useColors: true +}); +function configure(opts) { + mocha = new Mocha(opts); +} +exports.configure = configure; +function run(testsRoot, clb) { + // Enable source map support + require('source-map-support').install(); + // Glob test files + glob('**/**.test.js', { cwd: testsRoot }, function (error, files) { + if (error) { + return clb(error); + } + try { + // Fill into Mocha + files.forEach(function (f) { return mocha.addFile(paths.join(testsRoot, f)); }); + // Run the tests + mocha.run(function (failures) { + clb(null, failures); + }); + } + catch (error) { + return clb(error); + } + }); +} +exports.run = run; diff --git a/node_modules/vscode/package.json b/node_modules/vscode/package.json new file mode 100644 index 0000000..af074c5 --- /dev/null +++ b/node_modules/vscode/package.json @@ -0,0 +1,133 @@ +{ + "_args": [ + [ + { + "raw": "vscode@^1.0.5", + "scope": null, + "escapedName": "vscode", + "name": "vscode", + "rawSpec": "^1.0.5", + "spec": ">=1.0.5 <2.0.0", + "type": "range" + }, + "C:\\Users\\Jan Brodersen\\.vscode\\extensions\\Examples\\vscode-languageserver-node-example\\client" + ] + ], + "_from": "vscode@>=1.0.5 <2.0.0", + "_id": "vscode@1.0.5", + "_inCache": true, + "_installable": true, + "_location": "/vscode", + "_nodeVersion": "6.9.2", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/vscode-1.0.5.tgz_1488440030758_0.6885614851489663" + }, + "_npmUser": { + "name": "bpasero", + "email": "benjpas@microsoft.com" + }, + "_npmVersion": "3.10.9", + "_phantomChildren": {}, + "_requested": { + "raw": "vscode@^1.0.5", + "scope": null, + "escapedName": "vscode", + "name": "vscode", + "rawSpec": "^1.0.5", + "spec": ">=1.0.5 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "#DEV:/" + ], + "_resolved": "https://registry.npmjs.org/vscode/-/vscode-1.0.5.tgz", + "_shasum": "2cabfbd55e4800882597f224390f515be0965302", + "_shrinkwrap": null, + "_spec": "vscode@^1.0.5", + "_where": "C:\\Users\\Jan Brodersen\\.vscode\\extensions\\Examples\\vscode-languageserver-node-example\\client", + "author": { + "name": "Visual Studio Code Team" + }, + "bugs": { + "url": "https://github.com/Microsoft/vscode-extension-vscode/issues" + }, + "dependencies": { + "glob": "^5.0.15", + "gulp-chmod": "^1.3.0", + "gulp-filter": "^4.0.0", + "gulp-gunzip": "0.0.3", + "gulp-remote-src": "^0.4.0", + "gulp-symdest": "^1.0.0", + "gulp-untar": "0.0.5", + "gulp-vinyl-zip": "^1.1.2", + "mocha": "^2.3.3", + "request": "^2.67.0", + "semver": "^5.1.0", + "source-map-support": "^0.3.2", + "vinyl-source-stream": "^1.1.0" + }, + "description": "The vscode.d.ts node module", + "devDependencies": { + "@types/glob": "^5.0.30", + "@types/mocha": "^2.2.32", + "@types/node": "^6.0.41", + "typescript": "^2.0.3" + }, + "directories": {}, + "dist": { + "shasum": "2cabfbd55e4800882597f224390f515be0965302", + "tarball": "https://registry.npmjs.org/vscode/-/vscode-1.0.5.tgz" + }, + "gitHead": "e196fd581af31c432a72fdbeecd09d08295daa8f", + "homepage": "https://github.com/Microsoft/vscode-extension-vscode#readme", + "license": "MIT", + "maintainers": [ + { + "name": "alexandrudima", + "email": "alexdima@microsoft.com" + }, + { + "name": "bpasero", + "email": "benjpas@microsoft.com" + }, + { + "name": "chrisdias", + "email": "cdias@microsoft.com" + }, + { + "name": "dbaeumer", + "email": "dirk.baeumer@gmail.com" + }, + { + "name": "egamma", + "email": "egamma@microsoft.com" + }, + { + "name": "joaomoreno.ms", + "email": "joao.moreno@microsoft.com" + }, + { + "name": "jrieken", + "email": "jrieken@microsoft.com" + }, + { + "name": "microsoft", + "email": "npmjs@microsoft.com" + } + ], + "name": "vscode", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/Microsoft/vscode-extension-vscode.git" + }, + "scripts": { + "compile": "tsc -p ./", + "prepublish": "tsc -p ./", + "watch": "tsc -watch -p ./" + }, + "typings": "vscode.d.ts", + "version": "1.0.5" +} diff --git a/node_modules/vscode/thenable.d.ts b/node_modules/vscode/thenable.d.ts new file mode 100644 index 0000000..11e1060 --- /dev/null +++ b/node_modules/vscode/thenable.d.ts @@ -0,0 +1,5 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +interface Thenable extends PromiseLike {} \ No newline at end of file diff --git a/node_modules/vscode/thirdpartynotices.txt b/node_modules/vscode/thirdpartynotices.txt new file mode 100644 index 0000000..860eb8a --- /dev/null +++ b/node_modules/vscode/thirdpartynotices.txt @@ -0,0 +1,27 @@ +THIRD-PARTY SOFTWARE NOTICES AND INFORMATION +For Microsoft vscode-extension-vscode + +This project incorporates material from the project(s) listed below (collectively, “Third Party Code”). Microsoft is not the original author of the Third Party Code. The original copyright notice and license under which Microsoft received such Third Party Code are set out below. This Third Party Code is licensed to you under their original license terms set forth below. Microsoft reserves all other rights not expressly granted, whether by implication, estoppel or otherwise. + +1. DefinitelyTyped version 0.0.1 (https://github.com/borisyankov/DefinitelyTyped) + +This project is licensed under the MIT license. +Copyrights are respective of each contributor listed at the beginning of each definition file. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/vscode/tslint.json b/node_modules/vscode/tslint.json new file mode 100644 index 0000000..4ea88cd --- /dev/null +++ b/node_modules/vscode/tslint.json @@ -0,0 +1,21 @@ +{ + "rules": { + "no-unused-expression": true, + "no-unreachable": true, + "no-duplicate-variable": true, + "no-duplicate-key": true, + "no-unused-variable": true, + "curly": true, + "class-name": true, + "semicolon": true, + "triple-equals": true, + "no-unexternalized-strings": [ + true, + { + "signatures": ["localize", "nls.localize"], + "keyIndex": 0, + "messageIndex": 1 + } + ] + } +} \ No newline at end of file diff --git a/node_modules/vscode/vscode.d.ts b/node_modules/vscode/vscode.d.ts new file mode 100644 index 0000000..1b82751 --- /dev/null +++ b/node_modules/vscode/vscode.d.ts @@ -0,0 +1,4536 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +declare module 'vscode' { + + /** + * The version of the editor. + */ + export const version: string; + + /** + * Represents a reference to a command. Provides a title which + * will be used to represent a command in the UI and, optionally, + * an array of arguments which will be passed to the command handler + * function when invoked. + */ + export interface Command { + /** + * Title of the command, like `save`. + */ + title: string; + + /** + * The identifier of the actual command handler. + * @see [commands.registerCommand](#commands.registerCommand). + */ + command: string; + + /** + * Arguments that the command handler should be + * invoked with. + */ + arguments?: any[]; + } + + /** + * Represents a line of text, such as a line of source code. + * + * TextLine objects are __immutable__. When a [document](#TextDocument) changes, + * previously retrieved lines will not represent the latest state. + */ + export interface TextLine { + + /** + * The zero-based line number. + */ + readonly lineNumber: number; + + /** + * The text of this line without the line separator characters. + */ + readonly text: string; + + /** + * The range this line covers without the line separator characters. + */ + readonly range: Range; + + /** + * The range this line covers with the line separator characters. + */ + readonly rangeIncludingLineBreak: Range; + + /** + * The offset of the first character which is not a whitespace character as defined + * by `/\s/`. **Note** that if a line is all whitespaces the length of the line is returned. + */ + readonly firstNonWhitespaceCharacterIndex: number; + + /** + * Whether this line is whitespace only, shorthand + * for [TextLine.firstNonWhitespaceCharacterIndex](#TextLine.firstNonWhitespaceCharacterIndex) === [TextLine.text.length](#TextLine.text). + */ + readonly isEmptyOrWhitespace: boolean; + } + + /** + * Represents a text document, such as a source file. Text documents have + * [lines](#TextLine) and knowledge about an underlying resource like a file. + */ + export interface TextDocument { + + /** + * The associated URI for this document. Most documents have the __file__-scheme, indicating that they + * represent files on disk. However, some documents may have other schemes indicating that they are not + * available on disk. + */ + readonly uri: Uri; + + /** + * The file system path of the associated resource. Shorthand + * notation for [TextDocument.uri.fsPath](#TextDocument.uri). Independent of the uri scheme. + */ + readonly fileName: string; + + /** + * Is this document representing an untitled file. + */ + readonly isUntitled: boolean; + + /** + * The identifier of the language associated with this document. + */ + readonly languageId: string; + + /** + * The version number of this document (it will strictly increase after each + * change, including undo/redo). + */ + readonly version: number; + + /** + * true if there are unpersisted changes. + */ + readonly isDirty: boolean; + + /** + * Save the underlying file. + * + * @return A promise that will resolve to true when the file + * has been saved. If the file was not dirty or the save failed, + * will return false. + */ + save(): Thenable; + + /** + * The number of lines in this document. + */ + readonly lineCount: number; + + /** + * Returns a text line denoted by the line number. Note + * that the returned object is *not* live and changes to the + * document are not reflected. + * + * @param line A line number in [0, lineCount). + * @return A [line](#TextLine). + */ + lineAt(line: number): TextLine; + + /** + * Returns a text line denoted by the position. Note + * that the returned object is *not* live and changes to the + * document are not reflected. + * + * The position will be [adjusted](#TextDocument.validatePosition). + * + * @see [TextDocument.lineAt](#TextDocument.lineAt) + * @param position A position. + * @return A [line](#TextLine). + */ + lineAt(position: Position): TextLine; + + /** + * Converts the position to a zero-based offset. + * + * The position will be [adjusted](#TextDocument.validatePosition). + * + * @param position A position. + * @return A valid zero-based offset. + */ + offsetAt(position: Position): number; + + /** + * Converts a zero-based offset to a position. + * + * @param offset A zero-based offset. + * @return A valid [position](#Position). + */ + positionAt(offset: number): Position; + + /** + * Get the text of this document. A substring can be retrieved by providing + * a range. The range will be [adjusted](#TextDocument.validateRange). + * + * @param range Include only the text included by the range. + * @return The text inside the provided range or the entire text. + */ + getText(range?: Range): string; + + /** + * Get a word-range at the given position. By default words are defined by + * common separators, like space, -, _, etc. In addition, per languge custom + * [word definitions](#LanguageConfiguration.wordPattern) can be defined. It + * is also possible to provide a custom regular expression. + * + * The position will be [adjusted](#TextDocument.validatePosition). + * + * @param position A position. + * @param regex Optional regular expression that describes what a word is. + * @return A range spanning a word, or `undefined`. + */ + getWordRangeAtPosition(position: Position, regex?: RegExp): Range | undefined; + + /** + * Ensure a range is completely contained in this document. + * + * @param range A range. + * @return The given range or a new, adjusted range. + */ + validateRange(range: Range): Range; + + /** + * Ensure a position is contained in the range of this document. + * + * @param position A position. + * @return The given position or a new, adjusted position. + */ + validatePosition(position: Position): Position; + } + + /** + * Represents a line and character position, such as + * the position of the cursor. + * + * Position objects are __immutable__. Use the [with](#Position.with) or + * [translate](#Position.translate) methods to derive new positions + * from an existing position. + */ + export class Position { + + /** + * The zero-based line value. + */ + readonly line: number; + + /** + * The zero-based character value. + */ + readonly character: number; + + /** + * @param line A zero-based line value. + * @param character A zero-based character value. + */ + constructor(line: number, character: number); + + /** + * Check if `other` is before this position. + * + * @param other A position. + * @return `true` if position is on a smaller line + * or on the same line on a smaller character. + */ + isBefore(other: Position): boolean; + + /** + * Check if `other` is before or equal to this position. + * + * @param other A position. + * @return `true` if position is on a smaller line + * or on the same line on a smaller or equal character. + */ + isBeforeOrEqual(other: Position): boolean; + + /** + * Check if `other` is after this position. + * + * @param other A position. + * @return `true` if position is on a greater line + * or on the same line on a greater character. + */ + isAfter(other: Position): boolean; + + /** + * Check if `other` is after or equal to this position. + * + * @param other A position. + * @return `true` if position is on a greater line + * or on the same line on a greater or equal character. + */ + isAfterOrEqual(other: Position): boolean; + + /** + * Check if `other` equals this position. + * + * @param other A position. + * @return `true` if the line and character of the given position are equal to + * the line and character of this position. + */ + isEqual(other: Position): boolean; + + /** + * Compare this to `other`. + * + * @param other A position. + * @return A number smaller than zero if this position is before the given position, + * a number greater than zero if this position is after the given position, or zero when + * this and the given position are equal. + */ + compareTo(other: Position): number; + + /** + * Create a new position relative to this position. + * + * @param lineDelta Delta value for the line value, default is `0`. + * @param characterDelta Delta value for the character value, default is `0`. + * @return A position which line and character is the sum of the current line and + * character and the corresponding deltas. + */ + translate(lineDelta?: number, characterDelta?: number): Position; + + /** + * Derived a new position relative to this position. + * + * @param change An object that describes a delta to this position. + * @return A position that reflects the given delta. Will return `this` position if the change + * is not changing anything. + */ + translate(change: { lineDelta?: number; characterDelta?: number; }): Position; + + /** + * Create a new position derived from this position. + * + * @param line Value that should be used as line value, default is the [existing value](#Position.line) + * @param character Value that should be used as character value, default is the [existing value](#Position.character) + * @return A position where line and character are replaced by the given values. + */ + with(line?: number, character?: number): Position; + + /** + * Derived a new position from this position. + * + * @param change An object that describes a change to this position. + * @return A position that reflects the given change. Will return `this` position if the change + * is not changing anything. + */ + with(change: { line?: number; character?: number; }): Position; + } + + /** + * A range represents an ordered pair of two positions. + * It is guaranteed that [start](#Range.start).isBeforeOrEqual([end](#Range.end)) + * + * Range objects are __immutable__. Use the [with](#Range.with), + * [intersection](#Range.intersection), or [union](#Range.union) methods + * to derive new ranges from an existing range. + */ + export class Range { + + /** + * The start position. It is before or equal to [end](#Range.end). + */ + readonly start: Position; + + /** + * The end position. It is after or equal to [start](#Range.start). + */ + readonly end: Position; + + /** + * Create a new range from two positions. If `start` is not + * before or equal to `end`, the values will be swapped. + * + * @param start A position. + * @param end A position. + */ + constructor(start: Position, end: Position); + + /** + * Create a new range from number coordinates. It is a shorter equivalent of + * using `new Range(new Position(startLine, startCharacter), new Position(endLine, endCharacter))` + * + * @param startLine A zero-based line value. + * @param startCharacter A zero-based character value. + * @param endLine A zero-based line value. + * @param endCharacter A zero-based character value. + */ + constructor(startLine: number, startCharacter: number, endLine: number, endCharacter: number); + + /** + * `true` if `start` and `end` are equal. + */ + isEmpty: boolean; + + /** + * `true` if `start.line` and `end.line` are equal. + */ + isSingleLine: boolean; + + /** + * Check if a position or a range is contained in this range. + * + * @param positionOrRange A position or a range. + * @return `true` if the position or range is inside or equal + * to this range. + */ + contains(positionOrRange: Position | Range): boolean; + + /** + * Check if `other` equals this range. + * + * @param other A range. + * @return `true` when start and end are [equal](#Position.isEqual) to + * start and end of this range. + */ + isEqual(other: Range): boolean; + + /** + * Intersect `range` with this range and returns a new range or `undefined` + * if the ranges have no overlap. + * + * @param range A range. + * @return A range of the greater start and smaller end positions. Will + * return undefined when there is no overlap. + */ + intersection(range: Range): Range | undefined; + + /** + * Compute the union of `other` with this range. + * + * @param other A range. + * @return A range of smaller start position and the greater end position. + */ + union(other: Range): Range; + + /** + * Derived a new range from this range. + * + * @param start A position that should be used as start. The default value is the [current start](#Range.start). + * @param end A position that should be used as end. The default value is the [current end](#Range.end). + * @return A range derived from this range with the given start and end position. + * If start and end are not different `this` range will be returned. + */ + with(start?: Position, end?: Position): Range; + + /** + * Derived a new range from this range. + * + * @param change An object that describes a change to this range. + * @return A range that reflects the given change. Will return `this` range if the change + * is not changing anything. + */ + with(change: { start?: Position, end?: Position }): Range; + } + + /** + * Represents a text selection in an editor. + */ + export class Selection extends Range { + + /** + * The position at which the selection starts. + * This position might be before or after [active](#Selection.active). + */ + anchor: Position; + + /** + * The position of the cursor. + * This position might be before or after [anchor](#Selection.anchor). + */ + active: Position; + + /** + * Create a selection from two postions. + * + * @param anchor A position. + * @param active A position. + */ + constructor(anchor: Position, active: Position); + + /** + * Create a selection from four coordinates. + * + * @param anchorLine A zero-based line value. + * @param anchorCharacter A zero-based character value. + * @param activeLine A zero-based line value. + * @param activeCharacter A zero-based character value. + */ + constructor(anchorLine: number, anchorCharacter: number, activeLine: number, activeCharacter: number); + + /** + * A selection is reversed if [active](#Selection.active).isBefore([anchor](#Selection.anchor)). + */ + isReversed: boolean; + } + + /** + * Represents sources that can cause [selection change events](#window.onDidChangeTextEditorSelection). + */ + export enum TextEditorSelectionChangeKind { + /** + * Selection changed due to typing in the editor. + */ + Keyboard = 1, + /** + * Selection change due to clicking in the editor. + */ + Mouse = 2, + /** + * Selection changed because a command ran. + */ + Command = 3 + } + + /** + * Represents an event describing the change in a [text editor's selections](#TextEditor.selections). + */ + export interface TextEditorSelectionChangeEvent { + /** + * The [text editor](#TextEditor) for which the selections have changed. + */ + textEditor: TextEditor; + /** + * The new value for the [text editor's selections](#TextEditor.selections). + */ + selections: Selection[]; + /** + * The [change kind](#TextEditorSelectionChangeKind) which has triggered this + * event. Can be `undefined`. + */ + kind?: TextEditorSelectionChangeKind; + } + + /** + * Represents an event describing the change in a [text editor's options](#TextEditor.options). + */ + export interface TextEditorOptionsChangeEvent { + /** + * The [text editor](#TextEditor) for which the options have changed. + */ + textEditor: TextEditor; + /** + * The new value for the [text editor's options](#TextEditor.options). + */ + options: TextEditorOptions; + } + + /** + * Represents an event describing the change of a [text editor's view column](#TextEditor.viewColumn). + */ + export interface TextEditorViewColumnChangeEvent { + /** + * The [text editor](#TextEditor) for which the options have changed. + */ + textEditor: TextEditor; + /** + * The new value for the [text editor's view column](#TextEditor.viewColumn). + */ + viewColumn: ViewColumn; + } + + /** + * Rendering style of the cursor. + */ + export enum TextEditorCursorStyle { + /** + * Render the cursor as a vertical thick line. + */ + Line = 1, + /** + * Render the cursor as a block filled. + */ + Block = 2, + /** + * Render the cursor as a thick horizontal line. + */ + Underline = 3, + /** + * Render the cursor as a vertical thin line. + */ + LineThin = 4, + /** + * Render the cursor as a block outlined. + */ + BlockOutline = 5, + /** + * Render the cursor as a thin horizontal line. + */ + UnderlineThin = 6 + } + + /** + * Rendering style of the line numbers. + */ + export enum TextEditorLineNumbersStyle { + /** + * Do not render the line numbers. + */ + Off = 0, + /** + * Render the line numbers. + */ + On = 1, + /** + * Render the line numbers with values relative to the primary cursor location. + */ + Relative = 2 + } + + /** + * Represents a [text editor](#TextEditor)'s [options](#TextEditor.options). + */ + export interface TextEditorOptions { + + /** + * The size in spaces a tab takes. This is used for two purposes: + * - the rendering width of a tab character; + * - the number of spaces to insert when [insertSpaces](#TextEditorOptions.insertSpaces) is true. + * + * When getting a text editor's options, this property will always be a number (resolved). + * When setting a text editor's options, this property is optional and it can be a number or `"auto"`. + */ + tabSize?: number | string; + + /** + * When pressing Tab insert [n](#TextEditorOptions.tabSize) spaces. + * When getting a text editor's options, this property will always be a boolean (resolved). + * When setting a text editor's options, this property is optional and it can be a boolean or `"auto"`. + */ + insertSpaces?: boolean | string; + + /** + * The rendering style of the cursor in this editor. + * When getting a text editor's options, this property will always be present. + * When setting a text editor's options, this property is optional. + */ + cursorStyle?: TextEditorCursorStyle; + + /** + * Render relative line numbers w.r.t. the current line number. + * When getting a text editor's options, this property will always be present. + * When setting a text editor's options, this property is optional. + */ + lineNumbers?: TextEditorLineNumbersStyle; + } + + /** + * Represents a handle to a set of decorations + * sharing the same [styling options](#DecorationRenderOptions) in a [text editor](#TextEditor). + * + * To get an instance of a `TextEditorDecorationType` use + * [createTextEditorDecorationType](#window.createTextEditorDecorationType). + */ + export interface TextEditorDecorationType { + + /** + * Internal representation of the handle. + */ + readonly key: string; + + /** + * Remove this decoration type and all decorations on all text editors using it. + */ + dispose(): void; + } + + /** + * Represents different [reveal](#TextEditor.revealRange) strategies in a text editor. + */ + export enum TextEditorRevealType { + /** + * The range will be revealed with as little scrolling as possible. + */ + Default = 0, + /** + * The range will always be revealed in the center of the viewport. + */ + InCenter = 1, + /** + * If the range is outside the viewport, it will be revealed in the center of the viewport. + * Otherwise, it will be revealed with as little scrolling as possible. + */ + InCenterIfOutsideViewport = 2, + /** + * The range will always be revealed at the top of the viewport. + */ + AtTop = 3 + } + + /** + * Represents different positions for rendering a decoration in an [overview ruler](#DecorationRenderOptions.overviewRulerLane). + * The overview ruler supports three lanes. + */ + export enum OverviewRulerLane { + Left = 1, + Center = 2, + Right = 4, + Full = 7 + } + + /** + * Represents theme specific rendering styles for a [text editor decoration](#TextEditorDecorationType). + */ + export interface ThemableDecorationRenderOptions { + /** + * Background color of the decoration. Use rgba() and define transparent background colors to play well with other decorations. + */ + backgroundColor?: string; + + /** + * CSS styling property that will be applied to text enclosed by a decoration. + */ + outline?: string; + + /** + * CSS styling property that will be applied to text enclosed by a decoration. + * Better use 'outline' for setting one or more of the individual outline properties. + */ + outlineColor?: string; + + /** + * CSS styling property that will be applied to text enclosed by a decoration. + * Better use 'outline' for setting one or more of the individual outline properties. + */ + outlineStyle?: string; + + /** + * CSS styling property that will be applied to text enclosed by a decoration. + * Better use 'outline' for setting one or more of the individual outline properties. + */ + outlineWidth?: string; + + /** + * CSS styling property that will be applied to text enclosed by a decoration. + */ + border?: string; + + /** + * CSS styling property that will be applied to text enclosed by a decoration. + * Better use 'border' for setting one or more of the individual border properties. + */ + borderColor?: string; + + /** + * CSS styling property that will be applied to text enclosed by a decoration. + * Better use 'border' for setting one or more of the individual border properties. + */ + borderRadius?: string; + + /** + * CSS styling property that will be applied to text enclosed by a decoration. + * Better use 'border' for setting one or more of the individual border properties. + */ + borderSpacing?: string; + + /** + * CSS styling property that will be applied to text enclosed by a decoration. + * Better use 'border' for setting one or more of the individual border properties. + */ + borderStyle?: string; + + /** + * CSS styling property that will be applied to text enclosed by a decoration. + * Better use 'border' for setting one or more of the individual border properties. + */ + borderWidth?: string; + + /** + * CSS styling property that will be applied to text enclosed by a decoration. + */ + textDecoration?: string; + + /** + * CSS styling property that will be applied to text enclosed by a decoration. + */ + cursor?: string; + + /** + * CSS styling property that will be applied to text enclosed by a decoration. + */ + color?: string; + + /** + * CSS styling property that will be applied to text enclosed by a decoration. + */ + letterSpacing?: string; + + /** + * An **absolute path** or an URI to an image to be rendered in the gutter. + */ + gutterIconPath?: string | Uri; + + /** + * Specifies the size of the gutter icon. + * Available values are 'auto', 'contain', 'cover' and any percentage value. + * For further information: https://msdn.microsoft.com/en-us/library/jj127316(v=vs.85).aspx + */ + gutterIconSize?: string; + + /** + * The color of the decoration in the overview ruler. Use rgba() and define transparent colors to play well with other decorations. + */ + overviewRulerColor?: string; + + /** + * Defines the rendering options of the attachment that is inserted before the decorated text + */ + before?: ThemableDecorationAttachmentRenderOptions; + + /** + * Defines the rendering options of the attachment that is inserted after the decorated text + */ + after?: ThemableDecorationAttachmentRenderOptions; + } + + export interface ThemableDecorationAttachmentRenderOptions { + /** + * Defines a text content that is shown in the attachment. Either an icon or a text can be shown, but not both. + */ + contentText?: string; + /** + * An **absolute path** or an URI to an image to be rendered in the attachment. Either an icon + * or a text can be shown, but not both. + */ + contentIconPath?: string | Uri; + /** + * CSS styling property that will be applied to the decoration attachment. + */ + border?: string; + /** + * CSS styling property that will be applied to the decoration attachment. + */ + textDecoration?: string; + /** + * CSS styling property that will be applied to the decoration attachment. + */ + color?: string; + /** + * CSS styling property that will be applied to the decoration attachment. + */ + backgroundColor?: string; + /** + * CSS styling property that will be applied to the decoration attachment. + */ + margin?: string; + /** + * CSS styling property that will be applied to the decoration attachment. + */ + width?: string; + /** + * CSS styling property that will be applied to the decoration attachment. + */ + height?: string; + } + + /** + * Represents rendering styles for a [text editor decoration](#TextEditorDecorationType). + */ + export interface DecorationRenderOptions extends ThemableDecorationRenderOptions { + /** + * Should the decoration be rendered also on the whitespace after the line text. + * Defaults to `false`. + */ + isWholeLine?: boolean; + + /** + * The position in the overview ruler where the decoration should be rendered. + */ + overviewRulerLane?: OverviewRulerLane; + + /** + * Overwrite options for light themes. + */ + light?: ThemableDecorationRenderOptions; + + /** + * Overwrite options for dark themes. + */ + dark?: ThemableDecorationRenderOptions; + } + + /** + * Represents options for a specific decoration in a [decoration set](#TextEditorDecorationType). + */ + export interface DecorationOptions { + + /** + * Range to which this decoration is applied. The range must not be empty. + */ + range: Range; + + /** + * A message that should be rendered when hovering over the decoration. + */ + hoverMessage?: MarkedString | MarkedString[]; + + /** + * Render options applied to the current decoration. For performance reasons, keep the + * number of decoration specific options small, and use decoration types whereever possible. + */ + renderOptions?: DecorationInstanceRenderOptions; + } + + export interface ThemableDecorationInstanceRenderOptions { + /** + * Defines the rendering options of the attachment that is inserted before the decorated text + */ + before?: ThemableDecorationAttachmentRenderOptions; + + /** + * Defines the rendering options of the attachment that is inserted after the decorated text + */ + after?: ThemableDecorationAttachmentRenderOptions; + } + + export interface DecorationInstanceRenderOptions extends ThemableDecorationInstanceRenderOptions { + /** + * Overwrite options for light themes. + */ + light?: ThemableDecorationInstanceRenderOptions; + + /** + * Overwrite options for dark themes. + */ + dark?: ThemableDecorationInstanceRenderOptions + } + + /** + * Represents an editor that is attached to a [document](#TextDocument). + */ + export interface TextEditor { + + /** + * The document associated with this text editor. The document will be the same for the entire lifetime of this text editor. + */ + document: TextDocument; + + /** + * The primary selection on this text editor. Shorthand for `TextEditor.selections[0]`. + */ + selection: Selection; + + /** + * The selections in this text editor. The primary selection is always at index 0. + */ + selections: Selection[]; + + /** + * Text editor options. + */ + options: TextEditorOptions; + + /** + * The column in which this editor shows. Will be `undefined` in case this + * isn't one of the three main editors, e.g an embedded editor. + */ + viewColumn?: ViewColumn; + + /** + * Perform an edit on the document associated with this text editor. + * + * The given callback-function is invoked with an [edit-builder](#TextEditorEdit) which must + * be used to make edits. Note that the edit-builder is only valid while the + * callback executes. + * + * @param callback A function which can create edits using an [edit-builder](#TextEditorEdit). + * @param options The undo/redo behaviour around this edit. By default, undo stops will be created before and after this edit. + * @return A promise that resolves with a value indicating if the edits could be applied. + */ + edit(callback: (editBuilder: TextEditorEdit) => void, options?: { undoStopBefore: boolean; undoStopAfter: boolean; }): Thenable; + + /** + * Insert a [snippet](#SnippetString) and put the editor into snippet mode. "Snippet mode" + * means the editor adds placeholders and additionals cursors so that the user can complete + * or accept the snippet. + * + * @param snippet The snippet to insert in this edit. + * @param location Position or range at which to insert the snippet, defaults to the current editor selection or selections. + * @param options The undo/redo behaviour around this edit. By default, undo stops will be created before and after this edit. + * @return A promise that resolves with a value indicating if the snippet could be inserted. Note that the promise does not signal + * that the snippet is completely filled-in or accepted. + */ + insertSnippet(snippet: SnippetString, location?: Position | Range | Position[] | Range[], options?: { undoStopBefore: boolean; undoStopAfter: boolean; }): Thenable; + + /** + * Adds a set of decorations to the text editor. If a set of decorations already exists with + * the given [decoration type](#TextEditorDecorationType), they will be replaced. + * + * @see [createTextEditorDecorationType](#window.createTextEditorDecorationType). + * + * @param decorationType A decoration type. + * @param rangesOrOptions Either [ranges](#Range) or more detailed [options](#DecorationOptions). + */ + setDecorations(decorationType: TextEditorDecorationType, rangesOrOptions: Range[] | DecorationOptions[]): void; + + /** + * Scroll as indicated by `revealType` in order to reveal the given range. + * + * @param range A range. + * @param revealType The scrolling strategy for revealing `range`. + */ + revealRange(range: Range, revealType?: TextEditorRevealType): void; + + /** + * Show the text editor. + * + * @deprecated **This method is deprecated.** Use [window.showTextDocument](#window.showTextDocument) + * instead. This method shows unexpected behavior and will be removed in the next major update. + * + * @param column The [column](#ViewColumn) in which to show this editor. + */ + show(column?: ViewColumn): void; + + /** + * Hide the text editor. + * + * @deprecated **This method is deprecated.** Use the command 'workbench.action.closeActiveEditor' instead. + * This method shows unexpected behavior and will be removed in the next major update. + */ + hide(): void; + } + + /** + * Represents an end of line character sequence in a [document](#TextDocument). + */ + export enum EndOfLine { + /** + * The line feed `\n` character. + */ + LF = 1, + /** + * The carriage return line feed `\r\n` sequence. + */ + CRLF = 2 + } + + /** + * A complex edit that will be applied in one transaction on a TextEditor. + * This holds a description of the edits and if the edits are valid (i.e. no overlapping regions, document was not changed in the meantime, etc.) + * they can be applied on a [document](#TextDocument) associated with a [text editor](#TextEditor). + * + */ + export interface TextEditorEdit { + /** + * Replace a certain text region with a new value. + * You can use \r\n or \n in `value` and they will be normalized to the current [document](#TextDocument). + * + * @param location The range this operation should remove. + * @param value The new text this operation should insert after removing `location`. + */ + replace(location: Position | Range | Selection, value: string): void; + + /** + * Insert text at a location. + * You can use \r\n or \n in `value` and they will be normalized to the current [document](#TextDocument). + * Although the equivalent text edit can be made with [replace](#TextEditorEdit.replace), `insert` will produce a different resulting selection (it will get moved). + * + * @param location The position where the new text should be inserted. + * @param value The new text this operation should insert. + */ + insert(location: Position, value: string): void; + + /** + * Delete a certain text region. + * + * @param location The range this operation should remove. + */ + delete(location: Range | Selection): void; + + /** + * Set the end of line sequence. + * + * @param endOfLine The new end of line for the [document](#TextDocument). + */ + setEndOfLine(endOfLine: EndOfLine): void; + } + + /** + * A universal resource identifier representing either a file on disk + * or another resource, like untitled resources. + */ + export class Uri { + + /** + * Create an URI from a file system path. The [scheme](#Uri.scheme) + * will be `file`. + * + * @param path A file system or UNC path. + * @return A new Uri instance. + */ + static file(path: string): Uri; + + /** + * Create an URI from a string. Will throw if the given value is not + * valid. + * + * @param value The string value of an Uri. + * @return A new Uri instance. + */ + static parse(value: string): Uri; + + /** + * Scheme is the `http` part of `http://www.msft.com/some/path?query#fragment`. + * The part before the first colon. + */ + readonly scheme: string; + + /** + * Authority is the `www.msft.com` part of `http://www.msft.com/some/path?query#fragment`. + * The part between the first double slashes and the next slash. + */ + readonly authority: string; + + /** + * Path is the `/some/path` part of `http://www.msft.com/some/path?query#fragment`. + */ + readonly path: string; + + /** + * Query is the `query` part of `http://www.msft.com/some/path?query#fragment`. + */ + readonly query: string; + + /** + * Fragment is the `fragment` part of `http://www.msft.com/some/path?query#fragment`. + */ + readonly fragment: string; + + /** + * The string representing the corresponding file system path of this Uri. + * + * Will handle UNC paths and normalize windows drive letters to lower-case. Also + * uses the platform specific path separator. Will *not* validate the path for + * invalid characters and semantics. Will *not* look at the scheme of this Uri. + */ + readonly fsPath: string; + + /** + * Derive a new Uri from this Uri. + * + * ```ts + * let file = Uri.parse('before:some/file/path'); + * let other = file.with({ scheme: 'after' }); + * assert.ok(other.toString() === 'after:some/file/path'); + * ``` + * + * @param change An object that describes a change to this Uri. To unset components use `null` or + * the empty string. + * @return A new Uri that reflects the given change. Will return `this` Uri if the change + * is not changing anything. + */ + with(change: { scheme?: string; authority?: string; path?: string; query?: string; fragment?: string }): Uri; + + /** + * Returns a string representation of this Uri. The representation and normalization + * of a URI depends on the scheme. The resulting string can be safely used with + * [Uri.parse](#Uri.parse). + * + * @param skipEncoding Do not percentage-encode the result, defaults to `false`. Note that + * the `#` and `?` characters occuring in the path will always be encoded. + * @returns A string representation of this Uri. + */ + toString(skipEncoding?: boolean): string; + + /** + * Returns a JSON representation of this Uri. + * + * @return An object. + */ + toJSON(): any; + } + + /** + * A cancellation token is passed to an asynchronous or long running + * operation to request cancellation, like cancelling a request + * for completion items because the user continued to type. + * + * To get an instance of a `CancellationToken` use a + * [CancellationTokenSource](#CancellationTokenSource). + */ + export interface CancellationToken { + + /** + * Is `true` when the token has been cancelled, `false` otherwise. + */ + isCancellationRequested: boolean; + + /** + * An [event](#Event) which fires upon cancellation. + */ + onCancellationRequested: Event; + } + + /** + * A cancellation source creates and controls a [cancellation token](#CancellationToken). + */ + export class CancellationTokenSource { + + /** + * The cancellation token of this source. + */ + token: CancellationToken; + + /** + * Signal cancellation on the token. + */ + cancel(): void; + + /** + * Dispose object and free resources. Will call [cancel](#CancellationTokenSource.cancel). + */ + dispose(): void; + } + + /** + * Represents a type which can release resources, such + * as event listening or a timer. + */ + export class Disposable { + + /** + * Combine many disposable-likes into one. Use this method + * when having objects with a dispose function which are not + * instances of Disposable. + * + * @param disposableLikes Objects that have at least a `dispose`-function member. + * @return Returns a new disposable which, upon dispose, will + * dispose all provided disposables. + */ + static from(...disposableLikes: { dispose: () => any }[]): Disposable; + + /** + * Creates a new Disposable calling the provided function + * on dispose. + * @param callOnDispose Function that disposes something. + */ + constructor(callOnDispose: Function); + + /** + * Dispose this object. + */ + dispose(): any; + } + + /** + * Represents a typed event. + * + * A function that represents an event to which you subscribe by calling it with + * a listener function as argument. + * + * @sample `item.onDidChange(function(event) { console.log("Event happened: " + event); });` + */ + export interface Event { + + /** + * A function that represents an event to which you subscribe by calling it with + * a listener function as argument. + * + * @param listener The listener function will be called when the event happens. + * @param thisArgs The `this`-argument which will be used when calling the event listener. + * @param disposables An array to which a [disposable](#Disposable) will be added. + * @return A disposable which unsubscribes the event listener. + */ + (listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]): Disposable; + } + + /** + * An event emitter can be used to create and manage an [event](#Event) for others + * to subscribe to. One emitter always owns one event. + * + * Use this class if you want to provide event from within your extension, for instance + * inside a [TextDocumentContentProvider](#TextDocumentContentProvider) or when providing + * API to other extensions. + */ + export class EventEmitter { + + /** + * The event listeners can subscribe to. + */ + event: Event; + + /** + * Notify all subscribers of the [event](EventEmitter#event). Failure + * of one or more listener will not fail this function call. + * + * @param data The event object. + */ + fire(data?: T): void; + + /** + * Dispose this object and free resources. + */ + dispose(): void; + } + + /** + * A file system watcher notifies about changes to files and folders + * on disk. + * + * To get an instance of a `FileSystemWatcher` use + * [createFileSystemWatcher](#workspace.createFileSystemWatcher). + */ + export interface FileSystemWatcher extends Disposable { + + /** + * true if this file system watcher has been created such that + * it ignores creation file system events. + */ + ignoreCreateEvents: boolean; + + /** + * true if this file system watcher has been created such that + * it ignores change file system events. + */ + ignoreChangeEvents: boolean; + + /** + * true if this file system watcher has been created such that + * it ignores delete file system events. + */ + ignoreDeleteEvents: boolean; + + /** + * An event which fires on file/folder creation. + */ + onDidCreate: Event; + + /** + * An event which fires on file/folder change. + */ + onDidChange: Event; + + /** + * An event which fires on file/folder deletion. + */ + onDidDelete: Event; + } + + /** + * A text document content provider allows to add readonly documents + * to the editor, such as source from a dll or generated html from md. + * + * Content providers are [registered](#workspace.registerTextDocumentContentProvider) + * for a [uri-scheme](#Uri.scheme). When a uri with that scheme is to + * be [loaded](#workspace.openTextDocument) the content provider is + * asked. + */ + export interface TextDocumentContentProvider { + + /** + * An event to signal a resource has changed. + */ + onDidChange?: Event; + + /** + * Provide textual content for a given uri. + * + * The editor will use the returned string-content to create a readonly + * [document](TextDocument). Resources allocated should be released when + * the corresponding document has been [closed](#workspace.onDidCloseTextDocument). + * + * @param uri An uri which scheme matches the scheme this provider was [registered](#workspace.registerTextDocumentContentProvider) for. + * @param token A cancellation token. + * @return A string or a thenable that resolves to such. + */ + provideTextDocumentContent(uri: Uri, token: CancellationToken): ProviderResult; + } + + /** + * Represents an item that can be selected from + * a list of items. + */ + export interface QuickPickItem { + + /** + * A human readable string which is rendered prominent. + */ + label: string; + + /** + * A human readable string which is rendered less prominent. + */ + description: string; + + /** + * A human readable string which is rendered less prominent. + */ + detail?: string; + } + + /** + * Options to configure the behavior of the quick pick UI. + */ + export interface QuickPickOptions { + /** + * An optional flag to include the description when filtering the picks. + */ + matchOnDescription?: boolean; + + /** + * An optional flag to include the detail when filtering the picks. + */ + matchOnDetail?: boolean; + + /** + * An optional string to show as place holder in the input box to guide the user what to pick on. + */ + placeHolder?: string; + + /** + * Set to `true` to keep the picker open when focus moves to another part of the editor or to another window. + */ + ignoreFocusOut?: boolean; + + /** + * An optional function that is invoked whenever an item is selected. + */ + onDidSelectItem?(item: T | string): any; + } + + /** + * Represents an action that is shown with an information, warning, or + * error message. + * + * @see [showInformationMessage](#window.showInformationMessage) + * @see [showWarningMessage](#window.showWarningMessage) + * @see [showErrorMessage](#window.showErrorMessage) + */ + export interface MessageItem { + + /** + * A short title like 'Retry', 'Open Log' etc. + */ + title: string; + + /** + * Indicates that this item replaces the default + * 'Close' action. + */ + isCloseAffordance?: boolean; + } + + /** + * Options to configure the behavior of the message. + * + * @see [showInformationMessage](#window.showInformationMessage) + * @see [showWarningMessage](#window.showWarningMessage) + * @see [showErrorMessage](#window.showErrorMessage) + */ + export interface MessageOptions { + + /** + * Indicates that this message should be modal. + */ + modal?: boolean; + } + + /** + * Options to configure the behavior of the input box UI. + */ + export interface InputBoxOptions { + + /** + * The value to prefill in the input box. + */ + value?: string; + + /** + * The text to display underneath the input box. + */ + prompt?: string; + + /** + * An optional string to show as place holder in the input box to guide the user what to type. + */ + placeHolder?: string; + + /** + * Set to `true` to show a password prompt that will not show the typed value. + */ + password?: boolean; + + /** + * Set to `true` to keep the input box open when focus moves to another part of the editor or to another window. + */ + ignoreFocusOut?: boolean; + + /** + * An optional function that will be called to validate input and to give a hint + * to the user. + * + * @param value The current value of the input box. + * @return A human readable string which is presented as diagnostic message. + * Return `undefined`, `null`, or the empty string when 'value' is valid. + */ + validateInput?(value: string): string | undefined | null; + } + + /** + * A document filter denotes a document by different properties like + * the [language](#TextDocument.languageId), the [scheme](#Uri.scheme) of + * its resource, or a glob-pattern that is applied to the [path](#TextDocument.fileName). + * + * @sample A language filter that applies to typescript files on disk: `{ language: 'typescript', scheme: 'file' }` + * @sample A language filter that applies to all package.json paths: `{ language: 'json', pattern: '**∕project.json' }` + */ + export interface DocumentFilter { + + /** + * A language id, like `typescript`. + */ + language?: string; + + /** + * A Uri [scheme](#Uri.scheme), like `file` or `untitled`. + */ + scheme?: string; + + /** + * A glob pattern, like `*.{ts,js}`. + */ + pattern?: string; + } + + /** + * A language selector is the combination of one or many language identifiers + * and [language filters](#DocumentFilter). + * + * @sample `let sel:DocumentSelector = 'typescript'`; + * @sample `let sel:DocumentSelector = ['typescript', { language: 'json', pattern: '**∕tsconfig.json' }]`; + */ + export type DocumentSelector = string | DocumentFilter | (string | DocumentFilter)[]; + + + /** + * A provider result represents the values a provider, like the [`HoverProvider`](#HoverProvider), + * may return. For once this is the actual result type `T`, like `Hover`, or a thenable that resolves + * to that type `T`. In addition, `null` and `undefined` can be returned - either directly or from a + * thenable. + * + * The snippets below are all valid implementions of the [`HoverProvider`](#HoverProvider): + * + * ```ts + * let a: HoverProvider = { + * provideHover(doc, pos, token): ProviderResult { + * return new Hover('Hello World'); + * } + * } + * + * let b: HoverProvider = { + * provideHover(doc, pos, token): ProviderResult { + * return new Promise(resolve => { + * resolve(new Hover('Hello World')); + * }); + * } + * } + * + * let c: HoverProvider = { + * provideHover(doc, pos, token): ProviderResult { + * return; // undefined + * } + * } + * ``` + */ + export type ProviderResult = T | undefined | null | Thenable + + /** + * Contains additional diagnostic information about the context in which + * a [code action](#CodeActionProvider.provideCodeActions) is run. + */ + export interface CodeActionContext { + + /** + * An array of diagnostics. + */ + readonly diagnostics: Diagnostic[]; + } + + /** + * The code action interface defines the contract between extensions and + * the [light bulb](https://code.visualstudio.com/docs/editor/editingevolved#_code-action) feature. + * + * A code action can be any command that is [known](#commands.getCommands) to the system. + */ + export interface CodeActionProvider { + + /** + * Provide commands for the given document and range. + * + * @param document The document in which the command was invoked. + * @param range The range for which the command was invoked. + * @param context Context carrying additional information. + * @param token A cancellation token. + * @return An array of commands or a thenable of such. The lack of a result can be + * signaled by returning `undefined`, `null`, or an empty array. + */ + provideCodeActions(document: TextDocument, range: Range, context: CodeActionContext, token: CancellationToken): ProviderResult; + } + + /** + * A code lens represents a [command](#Command) that should be shown along with + * source text, like the number of references, a way to run tests, etc. + * + * A code lens is _unresolved_ when no command is associated to it. For performance + * reasons the creation of a code lens and resolving should be done to two stages. + * + * @see [CodeLensProvider.provideCodeLenses](#CodeLensProvider.provideCodeLenses) + * @see [CodeLensProvider.resolveCodeLens](#CodeLensProvider.resolveCodeLens) + */ + export class CodeLens { + + /** + * The range in which this code lens is valid. Should only span a single line. + */ + range: Range; + + /** + * The command this code lens represents. + */ + command?: Command; + + /** + * `true` when there is a command associated. + */ + readonly isResolved: boolean; + + /** + * Creates a new code lens object. + * + * @param range The range to which this code lens applies. + * @param command The command associated to this code lens. + */ + constructor(range: Range, command?: Command); + } + + /** + * A code lens provider adds [commands](#Command) to source text. The commands will be shown + * as dedicated horizontal lines in between the source text. + */ + export interface CodeLensProvider { + + /** + * An optional event to signal that the code lenses from this provider have changed. + */ + onDidChangeCodeLenses?: Event; + + /** + * Compute a list of [lenses](#CodeLens). This call should return as fast as possible and if + * computing the commands is expensive implementors should only return code lens objects with the + * range set and implement [resolve](#CodeLensProvider.resolveCodeLens). + * + * @param document The document in which the command was invoked. + * @param token A cancellation token. + * @return An array of code lenses or a thenable that resolves to such. The lack of a result can be + * signaled by returning `undefined`, `null`, or an empty array. + */ + provideCodeLenses(document: TextDocument, token: CancellationToken): ProviderResult; + + /** + * This function will be called for each visible code lens, usually when scrolling and after + * calls to [compute](#CodeLensProvider.provideCodeLenses)-lenses. + * + * @param codeLens code lens that must be resolved. + * @param token A cancellation token. + * @return The given, resolved code lens or thenable that resolves to such. + */ + resolveCodeLens?(codeLens: CodeLens, token: CancellationToken): ProviderResult; + } + + /** + * The definition of a symbol represented as one or many [locations](#Location). + * For most programming languages there is only one location at which a symbol is + * defined. + */ + export type Definition = Location | Location[]; + + /** + * The definition provider interface defines the contract between extensions and + * the [go to definition](https://code.visualstudio.com/docs/editor/editingevolved#_go-to-definition) + * and peek definition features. + */ + export interface DefinitionProvider { + + /** + * Provide the definition of the symbol at the given position and document. + * + * @param document The document in which the command was invoked. + * @param position The position at which the command was invoked. + * @param token A cancellation token. + * @return A definition or a thenable that resolves to such. The lack of a result can be + * signaled by returning `undefined` or `null`. + */ + provideDefinition(document: TextDocument, position: Position, token: CancellationToken): ProviderResult; + } + + /** + * The implemenetation provider interface defines the contract between extensions and + * the go to implementation feature. + */ + export interface ImplementationProvider { + + /** + * Provide the implementations of the symbol at the given position and document. + * + * @param document The document in which the command was invoked. + * @param position The position at which the command was invoked. + * @param token A cancellation token. + * @return A definition or a thenable that resolves to such. The lack of a result can be + * signaled by returning `undefined` or `null`. + */ + provideImplementation(document: TextDocument, position: Position, token: CancellationToken): ProviderResult; + } + + /** + * The type definition provider defines the contract between extensions and + * the go to type definition feature. + */ + export interface TypeDefinitionProvider { + + /** + * Provide the type definition of the symbol at the given position and document. + * + * @param document The document in which the command was invoked. + * @param position The position at which the command was invoked. + * @param token A cancellation token. + * @return A definition or a thenable that resolves to such. The lack of a result can be + * signaled by returning `undefined` or `null`. + */ + provideTypeDefinition(document: TextDocument, position: Position, token: CancellationToken): ProviderResult; + } + + /** + * MarkedString can be used to render human readable text. It is either a markdown string + * or a code-block that provides a language and a code snippet. Note that + * markdown strings will be sanitized - that means html will be escaped. + */ + export type MarkedString = string | { language: string; value: string }; + + /** + * A hover represents additional information for a symbol or word. Hovers are + * rendered in a tooltip-like widget. + */ + export class Hover { + + /** + * The contents of this hover. + */ + contents: MarkedString[]; + + /** + * The range to which this hover applies. When missing, the + * editor will use the range at the current position or the + * current position itself. + */ + range?: Range; + + /** + * Creates a new hover object. + * + * @param contents The contents of the hover. + * @param range The range to which the hover applies. + */ + constructor(contents: MarkedString | MarkedString[], range?: Range); + } + + /** + * The hover provider interface defines the contract between extensions and + * the [hover](https://code.visualstudio.com/docs/editor/editingevolved#_hover)-feature. + */ + export interface HoverProvider { + + /** + * Provide a hover for the given position and document. Multiple hovers at the same + * position will be merged by the editor. A hover can have a range which defaults + * to the word range at the position when omitted. + * + * @param document The document in which the command was invoked. + * @param position The position at which the command was invoked. + * @param token A cancellation token. + * @return A hover or a thenable that resolves to such. The lack of a result can be + * signaled by returning `undefined` or `null`. + */ + provideHover(document: TextDocument, position: Position, token: CancellationToken): ProviderResult; + } + + /** + * A document highlight kind. + */ + export enum DocumentHighlightKind { + + /** + * A textual occurrence. + */ + Text = 0, + + /** + * Read-access of a symbol, like reading a variable. + */ + Read = 1, + + /** + * Write-access of a symbol, like writing to a variable. + */ + Write = 2 + } + + /** + * A document highlight is a range inside a text document which deserves + * special attention. Usually a document highlight is visualized by changing + * the background color of its range. + */ + export class DocumentHighlight { + + /** + * The range this highlight applies to. + */ + range: Range; + + /** + * The highlight kind, default is [text](#DocumentHighlightKind.Text). + */ + kind?: DocumentHighlightKind; + + /** + * Creates a new document highlight object. + * + * @param range The range the highlight applies to. + * @param kind The highlight kind, default is [text](#DocumentHighlightKind.Text). + */ + constructor(range: Range, kind?: DocumentHighlightKind); + } + + /** + * The document highlight provider interface defines the contract between extensions and + * the word-highlight-feature. + */ + export interface DocumentHighlightProvider { + + /** + * Provide a set of document highlights, like all occurrences of a variable or + * all exit-points of a function. + * + * @param document The document in which the command was invoked. + * @param position The position at which the command was invoked. + * @param token A cancellation token. + * @return An array of document highlights or a thenable that resolves to such. The lack of a result can be + * signaled by returning `undefined`, `null`, or an empty array. + */ + provideDocumentHighlights(document: TextDocument, position: Position, token: CancellationToken): ProviderResult; + } + + /** + * A symbol kind. + */ + export enum SymbolKind { + File = 0, + Module = 1, + Namespace = 2, + Package = 3, + Class = 4, + Method = 5, + Property = 6, + Field = 7, + Constructor = 8, + Enum = 9, + Interface = 10, + Function = 11, + Variable = 12, + Constant = 13, + String = 14, + Number = 15, + Boolean = 16, + Array = 17, + Object = 18, + Key = 19, + Null = 20 + } + + /** + * Represents information about programming constructs like variables, classes, + * interfaces etc. + */ + export class SymbolInformation { + + /** + * The name of this symbol. + */ + name: string; + + /** + * The name of the symbol containing this symbol. + */ + containerName: string; + + /** + * The kind of this symbol. + */ + kind: SymbolKind; + + /** + * The location of this symbol. + */ + location: Location; + + /** + * Creates a new symbol information object. + * + * @param name The name of the symbol. + * @param kind The kind of the symbol. + * @param containerName The name of the symbol containing the symbol. + * @param location The the location of the symbol. + */ + constructor(name: string, kind: SymbolKind, containerName: string, location: Location); + + /** + * @deprecated Please use the constructor taking a [location](#Location) object. + * + * Creates a new symbol information object. + * + * @param name The name of the symbol. + * @param kind The kind of the symbol. + * @param range The range of the location of the symbol. + * @param uri The resource of the location of symbol, defaults to the current document. + * @param containerName The name of the symbol containing the symbol. + */ + constructor(name: string, kind: SymbolKind, range: Range, uri?: Uri, containerName?: string); + } + + /** + * The document symbol provider interface defines the contract between extensions and + * the [go to symbol](https://code.visualstudio.com/docs/editor/editingevolved#_goto-symbol)-feature. + */ + export interface DocumentSymbolProvider { + + /** + * Provide symbol information for the given document. + * + * @param document The document in which the command was invoked. + * @param token A cancellation token. + * @return An array of document highlights or a thenable that resolves to such. The lack of a result can be + * signaled by returning `undefined`, `null`, or an empty array. + */ + provideDocumentSymbols(document: TextDocument, token: CancellationToken): ProviderResult; + } + + /** + * The workspace symbol provider interface defines the contract between extensions and + * the [symbol search](https://code.visualstudio.com/docs/editor/editingevolved#_open-symbol-by-name)-feature. + */ + export interface WorkspaceSymbolProvider { + + /** + * Project-wide search for a symbol matching the given query string. It is up to the provider + * how to search given the query string, like substring, indexOf etc. To improve performance implementors can + * skip the [location](#SymbolInformation.location) of symbols and implement `resolveWorkspaceSymbol` to do that + * later. + * + * @param query A non-empty query string. + * @param token A cancellation token. + * @return An array of document highlights or a thenable that resolves to such. The lack of a result can be + * signaled by returning `undefined`, `null`, or an empty array. + */ + provideWorkspaceSymbols(query: string, token: CancellationToken): ProviderResult; + + /** + * Given a symbol fill in its [location](#SymbolInformation.location). This method is called whenever a symbol + * is selected in the UI. Providers can implement this method and return incomplete symbols from + * [`provideWorkspaceSymbols`](#WorkspaceSymbolProvider.provideWorkspaceSymbols) which often helps to improve + * performance. + * + * @param symbol The symbol that is to be resolved. Guaranteed to be an instance of an object returned from an + * earlier call to `provideWorkspaceSymbols`. + * @param token A cancellation token. + * @return The resolved symbol or a thenable that resolves to that. When no result is returned, + * the given `symbol` is used. + */ + resolveWorkspaceSymbol?(symbol: SymbolInformation, token: CancellationToken): ProviderResult; + } + + /** + * Value-object that contains additional information when + * requesting references. + */ + export interface ReferenceContext { + + /** + * Include the declaration of the current symbol. + */ + includeDeclaration: boolean; + } + + /** + * The reference provider interface defines the contract between extensions and + * the [find references](https://code.visualstudio.com/docs/editor/editingevolved#_peek)-feature. + */ + export interface ReferenceProvider { + + /** + * Provide a set of project-wide references for the given position and document. + * + * @param document The document in which the command was invoked. + * @param position The position at which the command was invoked. + * @param context + * @param token A cancellation token. + * @return An array of locations or a thenable that resolves to such. The lack of a result can be + * signaled by returning `undefined`, `null`, or an empty array. + */ + provideReferences(document: TextDocument, position: Position, context: ReferenceContext, token: CancellationToken): ProviderResult; + } + + /** + * A text edit represents edits that should be applied + * to a document. + */ + export class TextEdit { + + /** + * Utility to create a replace edit. + * + * @param range A range. + * @param newText A string. + * @return A new text edit object. + */ + static replace(range: Range, newText: string): TextEdit; + + /** + * Utility to create an insert edit. + * + * @param position A position, will become an empty range. + * @param newText A string. + * @return A new text edit object. + */ + static insert(position: Position, newText: string): TextEdit; + + /** + * Utility to create a delete edit. + * + * @param range A range. + * @return A new text edit object. + */ + static delete(range: Range): TextEdit; + + /** + * The range this edit applies to. + */ + range: Range; + + /** + * The string this edit will insert. + */ + newText: string; + + /** + * Create a new TextEdit. + * + * @param range A range. + * @param newText A string. + */ + constructor(range: Range, newText: string); + } + + /** + * A workspace edit represents textual changes for many documents. + */ + export class WorkspaceEdit { + + /** + * The number of affected resources. + */ + readonly size: number; + + /** + * Replace the given range with given text for the given resource. + * + * @param uri A resource identifier. + * @param range A range. + * @param newText A string. + */ + replace(uri: Uri, range: Range, newText: string): void; + + /** + * Insert the given text at the given position. + * + * @param uri A resource identifier. + * @param position A position. + * @param newText A string. + */ + insert(uri: Uri, position: Position, newText: string): void; + + /** + * Delete the text at the given range. + * + * @param uri A resource identifier. + * @param range A range. + */ + delete(uri: Uri, range: Range): void; + + /** + * Check if this edit affects the given resource. + * @param uri A resource identifier. + * @return `true` if the given resource will be touched by this edit. + */ + has(uri: Uri): boolean; + + /** + * Set (and replace) text edits for a resource. + * + * @param uri A resource identifier. + * @param edits An array of text edits. + */ + set(uri: Uri, edits: TextEdit[]): void; + + /** + * Get the text edits for a resource. + * + * @param uri A resource identifier. + * @return An array of text edits. + */ + get(uri: Uri): TextEdit[]; + + /** + * Get all text edits grouped by resource. + * + * @return An array of `[Uri, TextEdit[]]`-tuples. + */ + entries(): [Uri, TextEdit[]][]; + } + + /** + * 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. Variables are defined with `$name` and + * `${name:default value}`. The full snippet syntax is documented + * [here](http://code.visualstudio.com/docs/customization/userdefinedsnippets#_creating-your-own-snippets). + */ + export class SnippetString { + + /** + * The snippet string. + */ + value: string; + + constructor(value?: string); + + /** + * Builder-function that appends the given string to + * the [`value`](#SnippetString.value) of this snippet string. + * + * @param string A value to append 'as given'. The string will be escaped. + * @return This snippet string. + */ + appendText(string: string): SnippetString; + + /** + * Builder-function that appends a tabstop (`$1`, `$2` etc) to + * the [`value`](#SnippetString.value) of this snippet string. + * + * @param number The number of this tabstop, defaults to an auto-incremet + * value starting at 1. + * @return This snippet string. + */ + appendTabstop(number?: number): SnippetString; + + /** + * Builder-function that appends a placeholder (`${1:value}`) to + * the [`value`](#SnippetString.value) of this snippet string. + * + * @param value The value of this placeholder - either a string or a function + * with which a nested snippet can be created. + * @param number The number of this tabstop, defaults to an auto-incremet + * value starting at 1. + * @return This snippet string. + */ + appendPlaceholder(value: string | ((snippet: SnippetString) => any), number?: number): SnippetString; + + /** + * Builder-function that appends a variable (`${VAR}`) to + * the [`value`](#SnippetString.value) of this snippet string. + * + * @param name The name of the variable - excluding the `$`. + * @param defaultValue The default value which is used when the variable name cannot + * be resolved - either a string or a function with which a nested snippet can be created. + * @return This snippet string. + */ + appendVariable(name: string, defaultValue: string | ((snippet: SnippetString) => any)): SnippetString; + } + + /** + * The rename provider interface defines the contract between extensions and + * the [rename](https://code.visualstudio.com/docs/editor/editingevolved#_rename-symbol)-feature. + */ + export interface RenameProvider { + + /** + * Provide an edit that describes changes that have to be made to one + * or many resources to rename a symbol to a different name. + * + * @param document The document in which the command was invoked. + * @param position The position at which the command was invoked. + * @param newName The new name of the symbol. If the given name is not valid, the provider must return a rejected promise. + * @param token A cancellation token. + * @return A workspace edit or a thenable that resolves to such. The lack of a result can be + * signaled by returning `undefined` or `null`. + */ + provideRenameEdits(document: TextDocument, position: Position, newName: string, token: CancellationToken): ProviderResult; + } + + /** + * Value-object describing what options formatting should use. + */ + export interface FormattingOptions { + + /** + * Size of a tab in spaces. + */ + tabSize: number; + + /** + * Prefer spaces over tabs. + */ + insertSpaces: boolean; + + /** + * Signature for further properties. + */ + [key: string]: boolean | number | string; + } + + /** + * The document formatting provider interface defines the contract between extensions and + * the formatting-feature. + */ + export interface DocumentFormattingEditProvider { + + /** + * Provide formatting edits for a whole document. + * + * @param document The document in which the command was invoked. + * @param options Options controlling formatting. + * @param token A cancellation token. + * @return A set of text edits or a thenable that resolves to such. The lack of a result can be + * signaled by returning `undefined`, `null`, or an empty array. + */ + provideDocumentFormattingEdits(document: TextDocument, options: FormattingOptions, token: CancellationToken): ProviderResult; + } + + /** + * The document formatting provider interface defines the contract between extensions and + * the formatting-feature. + */ + export interface DocumentRangeFormattingEditProvider { + + /** + * Provide formatting edits for a range in a document. + * + * The given range is a hint and providers can decide to format a smaller + * or larger range. Often this is done by adjusting the start and end + * of the range to full syntax nodes. + * + * @param document The document in which the command was invoked. + * @param range The range which should be formatted. + * @param options Options controlling formatting. + * @param token A cancellation token. + * @return A set of text edits or a thenable that resolves to such. The lack of a result can be + * signaled by returning `undefined`, `null`, or an empty array. + */ + provideDocumentRangeFormattingEdits(document: TextDocument, range: Range, options: FormattingOptions, token: CancellationToken): ProviderResult; + } + + /** + * The document formatting provider interface defines the contract between extensions and + * the formatting-feature. + */ + export interface OnTypeFormattingEditProvider { + + /** + * Provide formatting edits after a character has been typed. + * + * The given position and character should hint to the provider + * what range the position to expand to, like find the matching `{` + * when `}` has been entered. + * + * @param document The document in which the command was invoked. + * @param position The position at which the command was invoked. + * @param ch The character that has been typed. + * @param options Options controlling formatting. + * @param token A cancellation token. + * @return A set of text edits or a thenable that resolves to such. The lack of a result can be + * signaled by returning `undefined`, `null`, or an empty array. + */ + provideOnTypeFormattingEdits(document: TextDocument, position: Position, ch: string, options: FormattingOptions, token: CancellationToken): ProviderResult; + } + + /** + * Represents a parameter of a callable-signature. A parameter can + * have a label and a doc-comment. + */ + export class ParameterInformation { + + /** + * The label of this signature. Will be shown in + * the UI. + */ + label: string; + + /** + * The human-readable doc-comment of this signature. Will be shown + * in the UI but can be omitted. + */ + documentation?: string; + + /** + * Creates a new parameter information object. + * + * @param label A label string. + * @param documentation A doc string. + */ + constructor(label: string, documentation?: string); + } + + /** + * Represents the signature of something callable. A signature + * can have a label, like a function-name, a doc-comment, and + * a set of parameters. + */ + export class SignatureInformation { + + /** + * The label of this signature. Will be shown in + * the UI. + */ + label: string; + + /** + * The human-readable doc-comment of this signature. Will be shown + * in the UI but can be omitted. + */ + documentation?: string; + + /** + * The parameters of this signature. + */ + parameters: ParameterInformation[]; + + /** + * Creates a new signature information object. + * + * @param label A label string. + * @param documentation A doc string. + */ + constructor(label: string, documentation?: string); + } + + /** + * Signature help represents the signature of something + * callable. There can be multiple signatures but only one + * active and only one active parameter. + */ + export class SignatureHelp { + + /** + * One or more signatures. + */ + signatures: SignatureInformation[]; + + /** + * The active signature. + */ + activeSignature: number; + + /** + * The active parameter of the active signature. + */ + activeParameter: number; + } + + /** + * The signature help provider interface defines the contract between extensions and + * the [parameter hints](https://code.visualstudio.com/docs/editor/editingevolved#_parameter-hints)-feature. + */ + export interface SignatureHelpProvider { + + /** + * Provide help for the signature at the given position and document. + * + * @param document The document in which the command was invoked. + * @param position The position at which the command was invoked. + * @param token A cancellation token. + * @return Signature help or a thenable that resolves to such. The lack of a result can be + * signaled by returning `undefined` or `null`. + */ + provideSignatureHelp(document: TextDocument, position: Position, token: CancellationToken): ProviderResult; + } + + /** + * Completion item kinds. + */ + export enum CompletionItemKind { + Text = 0, + Method = 1, + Function = 2, + Constructor = 3, + Field = 4, + Variable = 5, + Class = 6, + Interface = 7, + Module = 8, + Property = 9, + Unit = 10, + Value = 11, + Enum = 12, + Keyword = 13, + Snippet = 14, + Color = 15, + File = 16, + Reference = 17, + Folder = 18 + } + + /** + * A completion item represents a text snippet that is proposed to complete text that is being typed. + * + * It is suffient to create a completion item from just a [label](#CompletionItem.label). In that + * case the completion item will replace the [word](#TextDocument.getWordRangeAtPosition) + * until the cursor with the given label or [insertText](#CompletionItem.insertText). Otherwise the + * the given [edit](#CompletionItem.textEdit) is used. + * + * When selecting a completion item in the editor its defined or synthesized text edit will be applied + * to *all* cursors/selections whereas [additionalTextEdits](CompletionItem.additionalTextEdits) will be + * applied as provided. + * + * @see [CompletionItemProvider.provideCompletionItems](#CompletionItemProvider.provideCompletionItems) + * @see [CompletionItemProvider.resolveCompletionItem](#CompletionItemProvider.resolveCompletionItem) + */ + export class CompletionItem { + + /** + * The label of this completion item. By default + * this is also the text that is inserted when selecting + * this completion. + */ + label: string; + + /** + * The kind of this completion item. Based on the kind + * an icon is chosen by the editor. + */ + kind?: CompletionItemKind; + + /** + * A human-readable string with additional information + * about this item, like type or symbol information. + */ + detail?: string; + + /** + * A human-readable string that represents a doc-comment. + */ + documentation?: string; + + /** + * A string that should be used when comparing this item + * with other items. When `falsy` the [label](#CompletionItem.label) + * is used. + */ + sortText?: string; + + /** + * A string that should be used when filtering a set of + * completion items. When `falsy` the [label](#CompletionItem.label) + * is used. + */ + filterText?: string; + + /** + * A string or snippet that should be inserted in a document when selecting + * this completion. When `falsy` the [label](#CompletionItem.label) + * is used. + */ + 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](#TextDocument.getWordRangeAtPosition) to the + * current position. + * + * *Note:* The range must be a [single line](#Range.isSingleLine) and it must + * [contain](#Range.contains) the position at which completion has been [requested](#CompletionItemProvider.provideCompletionItems). + */ + range?: Range; + + /** + * An optional set of characters that when pressed while this completion is active will accept it first and + * then type that character. *Note* that all commit characters should have `length=1` and that superfluous + * characters will be ignored. + */ + commitCharacters?: string[]; + + /** + * @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.~~ + * + * ~~The [range](#Range) of the edit must be single-line and on the same + * line completions were [requested](#CompletionItemProvider.provideCompletionItems) at.~~ + */ + 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; + + /** + * Creates a new completion item. + * + * Completion items must have at least a [label](#CompletionItem.label) which then + * will be used as insert text as well as for sorting and filtering. + * + * @param label The label of the completion. + * @param kind The [kind](#CompletionItemKind) of the completion. + */ + constructor(label: string, kind?: CompletionItemKind); + } + + /** + * Represents a collection of [completion items](#CompletionItem) to be presented + * in the editor. + */ + export class CompletionList { + + /** + * This list it not complete. Further typing should result in recomputing + * this list. + */ + isIncomplete?: boolean; + + /** + * The completion items. + */ + items: CompletionItem[]; + + /** + * Creates a new completion list. + * + * @param items The completion items. + * @param isIncomplete The list is not complete. + */ + constructor(items?: CompletionItem[], isIncomplete?: boolean); + } + + /** + * The completion item provider interface defines the contract between extensions and + * [IntelliSense](https://code.visualstudio.com/docs/editor/editingevolved#_intellisense). + * + * When computing *complete* completion items is expensive, providers can optionally implement + * the `resolveCompletionItem`-function. In that case it is enough to return completion + * items with a [label](#CompletionItem.label) from the + * [provideCompletionItems](#CompletionItemProvider.provideCompletionItems)-function. Subsequently, + * when a completion item is shown in the UI and gains focus this provider is asked to resolve + * the item, like adding [doc-comment](#CompletionItem.documentation) or [details](#CompletionItem.detail). + * + * Providers are asked for completions either explicitly by a user gesture or -depending on the configuration- + * implicitly when typing words or trigger characters. + */ + export interface CompletionItemProvider { + + /** + * Provide completion items for the given position and document. + * + * @param document The document in which the command was invoked. + * @param position The position at which the command was invoked. + * @param token A cancellation token. + * @return An array of completions, a [completion list](#CompletionList), or a thenable that resolves to either. + * The lack of a result can be signaled by returning `undefined`, `null`, or an empty array. + */ + provideCompletionItems(document: TextDocument, position: Position, token: CancellationToken): ProviderResult; + + /** + * Given a completion item fill in more data, like [doc-comment](#CompletionItem.documentation) + * or [details](#CompletionItem.detail). + * + * The editor will only resolve a completion item once. + * + * @param item A completion item currently active in the UI. + * @param token A cancellation token. + * @return The resolved completion item or a thenable that resolves to of such. It is OK to return the given + * `item`. When no result is returned, the given `item` will be used. + */ + resolveCompletionItem?(item: CompletionItem, token: CancellationToken): ProviderResult; + } + + + /** + * A document link is a range in a text document that links to an internal or external resource, like another + * text document or a web site. + */ + export class DocumentLink { + + /** + * The range this link applies to. + */ + range: Range; + + /** + * The uri this link points to. + */ + target?: Uri; + + /** + * Creates a new document link. + * + * @param range The range the document link applies to. Must not be empty. + * @param target The uri the document link points to. + */ + constructor(range: Range, target?: Uri); + } + + /** + * The document link provider defines the contract between extensions and feature of showing + * links in the editor. + */ + export interface DocumentLinkProvider { + + /** + * Provide links for the given document. Note that the editor ships with a default provider that detects + * `http(s)` and `file` links. + * + * @param document The document in which the command was invoked. + * @param token A cancellation token. + * @return An array of [document links](#DocumentLink) or a thenable that resolves to such. The lack of a result + * can be signaled by returning `undefined`, `null`, or an empty array. + */ + provideDocumentLinks(document: TextDocument, token: CancellationToken): ProviderResult; + + /** + * Given a link fill in its [target](#DocumentLink.target). This method is called when an incomplete + * link is selected in the UI. Providers can implement this method and return incomple links + * (without target) from the [`provideDocumentLinks`](#DocumentLinkProvider.provideDocumentLinks) method which + * often helps to improve performance. + * + * @param link The link that is to be resolved. + * @param token A cancellation token. + */ + resolveDocumentLink?(link: DocumentLink, token: CancellationToken): ProviderResult; + } + + /** + * A tuple of two characters, like a pair of + * opening and closing brackets. + */ + export type CharacterPair = [string, string]; + + /** + * Describes how comments for a language work. + */ + export interface CommentRule { + + /** + * The line comment token, like `// this is a comment` + */ + lineComment?: string; + + /** + * The block comment character pair, like `/* block comment */` + */ + blockComment?: CharacterPair; + } + + /** + * Describes indentation rules for a language. + */ + export interface IndentationRule { + /** + * If a line matches this pattern, then all the lines after it should be unindendented once (until another rule matches). + */ + decreaseIndentPattern: RegExp; + /** + * If a line matches this pattern, then all the lines after it should be indented once (until another rule matches). + */ + increaseIndentPattern: RegExp; + /** + * If a line matches this pattern, then **only the next line** after it should be indented once. + */ + indentNextLinePattern?: RegExp; + /** + * If a line matches this pattern, then its indentation should not be changed and it should not be evaluated against the other rules. + */ + unIndentedLinePattern?: RegExp; + } + + /** + * Describes what to do with the indentation when pressing Enter. + */ + export enum IndentAction { + /** + * Insert new line and copy the previous line's indentation. + */ + None = 0, + /** + * Insert new line and indent once (relative to the previous line's indentation). + */ + Indent = 1, + /** + * Insert two new lines: + * - the first one indented which will hold the cursor + * - the second one at the same indentation level + */ + IndentOutdent = 2, + /** + * Insert new line and outdent once (relative to the previous line's indentation). + */ + Outdent = 3 + } + + /** + * Describes what to do when pressing Enter. + */ + export interface EnterAction { + /** + * Describe what to do with the indentation. + */ + indentAction: IndentAction; + /** + * Describes text to be appended after the new line and after the indentation. + */ + appendText?: string; + /** + * Describes the number of characters to remove from the new line's indentation. + */ + removeText?: number; + } + + /** + * Describes a rule to be evaluated when pressing Enter. + */ + export interface OnEnterRule { + /** + * This rule will only execute if the text before the cursor matches this regular expression. + */ + beforeText: RegExp; + /** + * This rule will only execute if the text after the cursor matches this regular expression. + */ + afterText?: RegExp; + /** + * The action to execute. + */ + action: EnterAction; + } + + /** + * The language configuration interfaces defines the contract between extensions + * and various editor features, like automatic bracket insertion, automatic indentation etc. + */ + export interface LanguageConfiguration { + /** + * The language's comment settings. + */ + comments?: CommentRule; + /** + * The language's brackets. + * This configuration implicitly affects pressing Enter around these brackets. + */ + brackets?: CharacterPair[]; + /** + * The language's word definition. + * If the language supports Unicode identifiers (e.g. JavaScript), it is preferable + * to provide a word definition that uses exclusion of known separators. + * e.g.: A regex that matches anything except known separators (and dot is allowed to occur in a floating point number): + * /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g + */ + wordPattern?: RegExp; + /** + * The language's indentation settings. + */ + indentationRules?: IndentationRule; + /** + * The language's rules to be evaluated when pressing Enter. + */ + onEnterRules?: OnEnterRule[]; + + /** + * **Deprecated** Do not use. + * + * @deprecated Will be replaced by a better API soon. + */ + __electricCharacterSupport?: { + /** + * This property is deprecated and will be **ignored** from + * the editor. + * @deprecated + */ + brackets?: any; + /** + * This property is deprecated and not fully supported anymore by + * the editor (scope and lineStart are ignored). + * Use the the autoClosingPairs property in the language configuration file instead. + * @deprecated + */ + docComment?: { + scope: string; + open: string; + lineStart: string; + close?: string; + }; + }; + + /** + * **Deprecated** Do not use. + * + * @deprecated * Use the the autoClosingPairs property in the language configuration file instead. + */ + __characterPairSupport?: { + autoClosingPairs: { + open: string; + close: string; + notIn?: string[]; + }[]; + }; + } + + /** + * Represents the workspace configuration. + * + * The workspace configuration is a merged view: Configurations of the current [workspace](#workspace.rootPath) + * (if available), files like `launch.json`, and the installation-wide configuration. Workspace specific values + * shadow installation-wide values. + * + * *Note:* The merged configuration of the current [workspace](#workspace.rootPath) + * also contains settings from files like `launch.json` and `tasks.json`. Their basename will be + * part of the section identifier. The following snippets shows how to retrieve all configurations + * from `launch.json`: + * + * ```ts + * // launch.json configuration + * const config = workspace.getConfiguration('launch'); + * + * // retrieve values + * const values = config.get('configurations'); + * ``` + */ + export interface WorkspaceConfiguration { + + /** + * Return a value from this configuration. + * + * @param section Configuration name, supports _dotted_ names. + * @return The value `section` denotes or `undefined`. + */ + get(section: string): T | undefined; + + /** + * Return a value from this configuration. + * + * @param section Configuration name, supports _dotted_ names. + * @param defaultValue A value should be returned when no value could be found, is `undefined`. + * @return The value `section` denotes or the default. + */ + get(section: string, defaultValue: T): T; + + + /** + * Check if this configuration has a certain value. + * + * @param section Configuration name, supports _dotted_ names. + * @return `true` if the section doesn't resolve to `undefined`. + */ + has(section: string): boolean; + + /** + * Retrieve all information about a configuration setting. A configuration value + * often consists of a *default* value, a global or installation-wide value, and + * a workspace-specific value. The *effective* value (returned by [`get`](#WorkspaceConfiguration.get)) + * is computed like this: `defaultValue` overwritten by `globalValue`, + * `globalValue` overwritten by `workspaceValue`. + * + * *Note:* The configuration name must denote a leaf in the configuration tree + * (`editor.fontSize` vs `editor`) otherwise no result is returned. + * + * @param section Configuration name, supports _dotted_ names. + * @return Information about a configuration setting or `undefined`. + */ + inspect(section: string): { key: string; defaultValue?: T; globalValue?: T; workspaceValue?: T } | undefined; + + /** + * Update a configuration value. A value can be changed for the current + * [workspace](#workspace.rootPath) only, or globally for all instances of the + * editor. The updated configuration values are persisted. + * + * *Note 1:* Setting an installation-wide value (`global: true`) in the presence of + * a more specific workspace value has no observable effect in that workspace, but + * in others. + * + * *Note 2:* To remove a configuration value use `undefined`, like so: `config.update('somekey', undefined)` + * + * @param section Configuration name, supports _dotted_ names. + * @param value The new value. + * @param global When `true` changes the configuration value for all instances of the editor. + */ + update(section: string, value: any, global?: boolean): Thenable; + + /** + * Readable dictionary that backs this configuration. + */ + readonly [key: string]: any; + } + + /** + * Represents a location inside a resource, such as a line + * inside a text file. + */ + export class Location { + + /** + * The resource identifier of this location. + */ + uri: Uri; + + /** + * The document range of this locations. + */ + range: Range; + + /** + * Creates a new location object. + * + * @param uri The resource identifier. + * @param rangeOrPosition The range or position. Positions will be converted to an empty range. + */ + constructor(uri: Uri, rangeOrPosition: Range | Position); + } + + /** + * Represents the severity of diagnostics. + */ + export enum DiagnosticSeverity { + + /** + * Something not allowed by the rules of a language or other means. + */ + Error = 0, + + /** + * Something suspicious but allowed. + */ + Warning = 1, + + /** + * Something to inform about but not a problem. + */ + Information = 2, + + /** + * Something to hint to a better way of doing it, like proposing + * a refactoring. + */ + Hint = 3 + } + + /** + * Represents a diagnostic, such as a compiler error or warning. Diagnostic objects + * are only valid in the scope of a file. + */ + export class Diagnostic { + + /** + * The range to which this diagnostic applies. + */ + range: Range; + + /** + * The human-readable message. + */ + message: string; + + /** + * A human-readable string describing the source of this + * diagnostic, e.g. 'typescript' or 'super lint'. + */ + source: string; + + /** + * The severity, default is [error](#DiagnosticSeverity.Error). + */ + severity: DiagnosticSeverity; + + /** + * A code or identifier for this diagnostics. Will not be surfaced + * to the user, but should be used for later processing, e.g. when + * providing [code actions](#CodeActionContext). + */ + code: string | number; + + /** + * Creates a new diagnostic object. + * + * @param range The range to which this diagnostic applies. + * @param message The human-readable message. + * @param severity The severity, default is [error](#DiagnosticSeverity.Error). + */ + constructor(range: Range, message: string, severity?: DiagnosticSeverity); + } + + /** + * A diagnostics collection is a container that manages a set of + * [diagnostics](#Diagnostic). Diagnostics are always scopes to a + * diagnostics collection and a resource. + * + * To get an instance of a `DiagnosticCollection` use + * [createDiagnosticCollection](#languages.createDiagnosticCollection). + */ + export interface DiagnosticCollection { + + /** + * The name of this diagnostic collection, for instance `typescript`. Every diagnostic + * from this collection will be associated with this name. Also, the task framework uses this + * name when defining [problem matchers](https://code.visualstudio.com/docs/editor/tasks#_defining-a-problem-matcher). + */ + readonly name: string; + + /** + * Assign diagnostics for given resource. Will replace + * existing diagnostics for that resource. + * + * @param uri A resource identifier. + * @param diagnostics Array of diagnostics or `undefined` + */ + set(uri: Uri, diagnostics: Diagnostic[] | undefined): void; + + /** + * Replace all entries in this collection. + * + * Diagnostics of multiple tuples of the same uri will be merged, e.g + * `[[file1, [d1]], [file1, [d2]]]` is equivalent to `[[file1, [d1, d2]]]`. + * If a diagnostics item is `undefined` as in `[file1, undefined]` + * all previous but not subsequent diagnostics are removed. + * + * @param entries An array of tuples, like `[[file1, [d1, d2]], [file2, [d3, d4, d5]]]`, or `undefined`. + */ + set(entries: [Uri, Diagnostic[] | undefined][]): void; + + /** + * Remove all diagnostics from this collection that belong + * to the provided `uri`. The same as `#set(uri, undefined)`. + * + * @param uri A resource identifier. + */ + delete(uri: Uri): void; + + /** + * Remove all diagnostics from this collection. The same + * as calling `#set(undefined)`; + */ + clear(): void; + + /** + * Iterate over each entry in this collection. + * + * @param callback Function to execute for each entry. + * @param thisArg The `this` context used when invoking the handler function. + */ + forEach(callback: (uri: Uri, diagnostics: Diagnostic[], collection: DiagnosticCollection) => any, thisArg?: any): void; + + /** + * Get the diagnostics for a given resource. *Note* that you cannot + * modify the diagnostics-array returned from this call. + * + * @param uri A resource identifier. + * @returns An immutable array of [diagnostics](#Diagnostic) or `undefined`. + */ + get(uri: Uri): Diagnostic[] | undefined; + + /** + * Check if this collection contains diagnostics for a + * given resource. + * + * @param uri A resource identifier. + * @returns `true` if this collection has diagnostic for the given resource. + */ + has(uri: Uri): boolean; + + /** + * Dispose and free associated resources. Calls + * [clear](#DiagnosticCollection.clear). + */ + dispose(): void; + } + + /** + * Denotes a column in the VS Code window. Columns are + * used to show editors side by side. + */ + export enum ViewColumn { + One = 1, + Two = 2, + Three = 3 + } + + /** + * An output channel is a container for readonly textual information. + * + * To get an instance of an `OutputChannel` use + * [createOutputChannel](#window.createOutputChannel). + */ + export interface OutputChannel { + + /** + * The human-readable name of this output channel. + */ + readonly name: string; + + /** + * Append the given value to the channel. + * + * @param value A string, falsy values will not be printed. + */ + append(value: string): void; + + /** + * Append the given value and a line feed character + * to the channel. + * + * @param value A string, falsy values will be printed. + */ + appendLine(value: string): void; + + /** + * Removes all output from the channel. + */ + clear(): void; + + /** + * Reveal this channel in the UI. + * + * @param preserveFocus When `true` the channel will not take focus. + */ + show(preserveFocus?: boolean): void; + + /** + * Reveal this channel in the UI. + * + * @deprecated This method is **deprecated** and the overload with + * just one parameter should be used (`show(preserveFocus?: boolean): void`). + * + * @param column This argument is **deprecated** and will be ignored. + * @param preserveFocus When `true` the channel will not take focus. + */ + show(column?: ViewColumn, preserveFocus?: boolean): void; + + /** + * Hide this channel from the UI. + */ + hide(): void; + + /** + * Dispose and free associated resources. + */ + dispose(): void; + } + + /** + * Represents the alignment of status bar items. + */ + export enum StatusBarAlignment { + + /** + * Aligned to the left side. + */ + Left = 1, + + /** + * Aligned to the right side. + */ + Right = 2 + } + + /** + * A status bar item is a status bar contribution that can + * show text and icons and run a command on click. + */ + export interface StatusBarItem { + + /** + * The alignment of this item. + */ + readonly alignment: StatusBarAlignment; + + /** + * The priority of this item. Higher value means the item should + * be shown more to the left. + */ + readonly priority: number; + + /** + * The text to show for the entry. You can embed icons in the text by leveraging the syntax: + * + * `My text $(icon-name) contains icons like $(icon'name) this one.` + * + * Where the icon-name is taken from the [octicon](https://octicons.github.com) icon set, e.g. + * `light-bulb`, `thumbsup`, `zap` etc. + */ + text: string; + + /** + * The tooltip text when you hover over this entry. + */ + tooltip: string | undefined; + + /** + * The foreground color for this entry. + */ + color: string | undefined; + + /** + * The identifier of a command to run on click. The command must be + * [known](#commands.getCommands). + */ + command: string | undefined; + + /** + * Shows the entry in the status bar. + */ + show(): void; + + /** + * Hide the entry in the status bar. + */ + hide(): void; + + /** + * Dispose and free associated resources. Call + * [hide](#StatusBarItem.hide). + */ + dispose(): void; + } + + /** + * An individual terminal instance within the integrated terminal. + */ + export interface Terminal { + + /** + * The name of the terminal. + */ + readonly name: string; + + /** + * The process ID of the shell process. + */ + readonly processId: Thenable; + + /** + * Send text to the terminal. The text is written to the stdin of the underlying pty process + * (shell) of the terminal. + * + * @param text The text to send. + * @param addNewLine Whether to add a new line to the text being sent, this is normally + * required to run a command in the terminal. The character(s) added are \n or \r\n + * depending on the platform. This defaults to `true`. + */ + sendText(text: string, addNewLine?: boolean): void; + + /** + * Show the terminal panel and reveal this terminal in the UI. + * + * @param preserveFocus When `true` the terminal will not take focus. + */ + show(preserveFocus?: boolean): void; + + /** + * Hide the terminal panel if this terminal is currently showing. + */ + hide(): void; + + /** + * Dispose and free associated resources. + */ + dispose(): void; + } + + /** + * Represents an extension. + * + * To get an instance of an `Extension` use [getExtension](#extensions.getExtension). + */ + export interface Extension { + + /** + * The canonical extension identifier in the form of: `publisher.name`. + */ + readonly id: string; + + /** + * The absolute file path of the directory containing this extension. + */ + readonly extensionPath: string; + + /** + * `true` if the extension has been activated. + */ + readonly isActive: boolean; + + /** + * The parsed contents of the extension's package.json. + */ + readonly packageJSON: any; + + /** + * The public API exported by this extension. It is an invalid action + * to access this field before this extension has been activated. + */ + readonly exports: T; + + /** + * Activates this extension and returns its public API. + * + * @return A promise that will resolve when this extension has been activated. + */ + activate(): Thenable; + } + + /** + * An extension context is a collection of utilities private to an + * extension. + * + * An instance of an `ExtensionContext` is provided as the first + * parameter to the `activate`-call of an extension. + */ + export interface ExtensionContext { + + /** + * An array to which disposables can be added. When this + * extension is deactivated the disposables will be disposed. + */ + subscriptions: { dispose(): any }[]; + + /** + * A memento object that stores state in the context + * of the currently opened [workspace](#workspace.rootPath). + */ + workspaceState: Memento; + + /** + * A memento object that stores state independent + * of the current opened [workspace](#workspace.rootPath). + */ + globalState: Memento; + + /** + * The absolute file path of the directory containing the extension. + */ + extensionPath: string; + + /** + * Get the absolute path of a resource contained in the extension. + * + * @param relativePath A relative path to a resource contained in the extension. + * @return The absolute path of the resource. + */ + asAbsolutePath(relativePath: string): string; + + /** + * An absolute file path of a workspace specific directory in which the extension + * can store private state. The directory might not exist on disk and creation is + * up to the extension. However, the parent directory is guaranteed to be existent. + * + * Use [`workspaceState`](#ExtensionContext.workspaceState) or + * [`globalState`](#ExtensionContext.globalState) to store key value data. + */ + storagePath: string | undefined; + } + + /** + * A memento represents a storage utility. It can store and retrieve + * values. + */ + export interface Memento { + + /** + * Return a value. + * + * @param key A string. + * @return The stored value or `undefined`. + */ + get(key: string): T | undefined; + + /** + * Return a value. + * + * @param key A string. + * @param defaultValue A value that should be returned when there is no + * value (`undefined`) with the given key. + * @return The stored value or the defaultValue. + */ + get(key: string, defaultValue: T): T; + + /** + * Store a value. The value must be JSON-stringifyable. + * + * @param key A string. + * @param value A value. MUST not contain cyclic references. + */ + update(key: string, value: any): Thenable; + } + + /** + * Namespace describing the environment the editor runs in. + */ + export namespace env { + + /** + * The application name of the editor, like 'VS Code'. + * + * @readonly + */ + export let appName: string; + + /** + * Represents the preferred user-language, like `de-CH`, `fr`, or `en-US`. + * + * @readonly + */ + export let language: string; + + /** + * A unique identifier for the computer. + * + * @readonly + */ + export let machineId: string; + + /** + * A unique identifier for the current session. + * Changes each time the editor is started. + * + * @readonly + */ + export let sessionId: string; + } + + /** + * Namespace for dealing with commands. In short, a command is a function with a + * unique identifier. The function is sometimes also called _command handler_. + * + * Commands can be added to the editor using the [registerCommand](#commands.registerCommand) + * and [registerTextEditorCommand](#commands.registerTextEditorCommand) functions. Commands + * can be executed [manually](#commands.executeCommand) or from a UI gesture. Those are: + * + * * palette - Use the `commands`-section in `package.json` to make a command show in + * the [command palette](https://code.visualstudio.com/docs/editor/codebasics#_command-palette). + * * keybinding - Use the `keybindings`-section in `package.json` to enable + * [keybindings](https://code.visualstudio.com/docs/customization/keybindings#_customizing-shortcuts) + * for your extension. + * + * Commands from other extensions and from the editor itself are accessible to an extension. However, + * when invoking an editor command not all argument types are supported. + * + * This is a sample that registers a command handler and adds an entry for that command to the palette. First + * register a command handler with the identifier `extension.sayHello`. + * ```javascript + * commands.registerCommand('extension.sayHello', () => { + * window.showInformationMessage('Hello World!'); + * }); + * ``` + * Second, bind the command identifier to a title under which it will show in the palette (`package.json`). + * ```json + * { + * "contributes": { + * "commands": [{ + * "command": "extension.sayHello", + * "title": "Hello World" + * }] + * } + * } + * ``` + */ + export namespace commands { + + /** + * Registers a command that can be invoked via a keyboard shortcut, + * a menu item, an action, or directly. + * + * Registering a command with an existing command identifier twice + * will cause an error. + * + * @param command A unique identifier for the command. + * @param callback A command handler function. + * @param thisArg The `this` context used when invoking the handler function. + * @return Disposable which unregisters this command on disposal. + */ + export function registerCommand(command: string, callback: (...args: any[]) => any, thisArg?: any): Disposable; + + /** + * Registers a text editor command that can be invoked via a keyboard shortcut, + * a menu item, an action, or directly. + * + * Text editor commands are different from ordinary [commands](#commands.registerCommand) as + * they only execute when there is an active editor when the command is called. Also, the + * command handler of an editor command has access to the active editor and to an + * [edit](#TextEditorEdit)-builder. + * + * @param command A unique identifier for the command. + * @param callback A command handler function with access to an [editor](#TextEditor) and an [edit](#TextEditorEdit). + * @param thisArg The `this` context used when invoking the handler function. + * @return Disposable which unregisters this command on disposal. + */ + export function registerTextEditorCommand(command: string, callback: (textEditor: TextEditor, edit: TextEditorEdit, ...args: any[]) => void, thisArg?: any): Disposable; + + /** + * Executes the command denoted by the given command identifier. + * + * When executing an editor command not all types are allowed to + * be passed as arguments. Allowed are the primitive types `string`, `boolean`, + * `number`, `undefined`, and `null`, as well as classes defined in this API. + * There are no restrictions when executing commands that have been contributed + * by extensions. + * + * @param command Identifier of the command to execute. + * @param rest Parameters passed to the command function. + * @return A thenable that resolves to the returned value of the given command. `undefined` when + * the command handler function doesn't return anything. + */ + export function executeCommand(command: string, ...rest: any[]): Thenable; + + /** + * Retrieve the list of all available commands. Commands starting an underscore are + * treated as internal commands. + * + * @param filterInternal Set `true` to not see internal commands (starting with an underscore) + * @return Thenable that resolves to a list of command ids. + */ + export function getCommands(filterInternal?: boolean): Thenable; + } + + /** + * Namespace for dealing with the current window of the editor. That is visible + * and active editors, as well as, UI elements to show messages, selections, and + * asking for user input. + */ + export namespace window { + + /** + * The currently active editor or `undefined`. The active editor is the one + * that currently has focus or, when none has focus, the one that has changed + * input most recently. + */ + export let activeTextEditor: TextEditor | undefined; + + /** + * The currently visible editors or an empty array. + */ + export let visibleTextEditors: TextEditor[]; + + /** + * An [event](#Event) which fires when the [active editor](#window.activeTextEditor) + * has changed. *Note* that the event also fires when the active editor changes + * to `undefined`. + */ + export const onDidChangeActiveTextEditor: Event; + + /** + * An [event](#Event) which fires when the array of [visible editors](#window.visibleTextEditors) + * has changed. + */ + export const onDidChangeVisibleTextEditors: Event; + + /** + * An [event](#Event) which fires when the selection in an editor has changed. + */ + export const onDidChangeTextEditorSelection: Event; + + /** + * An [event](#Event) which fires when the options of an editor have changed. + */ + export const onDidChangeTextEditorOptions: Event; + + /** + * An [event](#Event) which fires when the view column of an editor has changed. + */ + export const onDidChangeTextEditorViewColumn: Event; + + /** + * An [event](#Event) which fires when a terminal is disposed. + */ + export const onDidCloseTerminal: Event; + + /** + * Show the given document in a text editor. A [column](#ViewColumn) can be provided + * to control where the editor is being shown. Might change the [active editor](#window.activeTextEditor). + * + * @param document A text document to be shown. + * @param column A view column in which the editor should be shown. The default is the [one](#ViewColumn.One), other values + * are adjusted to be __Min(column, columnCount + 1)__. + * @param preserveFocus When `true` the editor will not take focus. + * @return A promise that resolves to an [editor](#TextEditor). + */ + export function showTextDocument(document: TextDocument, column?: ViewColumn, preserveFocus?: boolean): Thenable; + + /** + * Create a TextEditorDecorationType that can be used to add decorations to text editors. + * + * @param options Rendering options for the decoration type. + * @return A new decoration type instance. + */ + export function createTextEditorDecorationType(options: DecorationRenderOptions): TextEditorDecorationType; + + /** + * Show an information message to users. Optionally provide an array of items which will be presented as + * clickable buttons. + * + * @param message The message to show. + * @param items A set of items that will be rendered as actions in the message. + * @return A thenable that resolves to the selected item or `undefined` when being dismissed. + */ + export function showInformationMessage(message: string, ...items: string[]): Thenable; + + /** + * Show an information message to users. Optionally provide an array of items which will be presented as + * clickable buttons. + * + * @param message The message to show. + * @param options Configures the behaviour of the message. + * @param items A set of items that will be rendered as actions in the message. + * @return A thenable that resolves to the selected item or `undefined` when being dismissed. + */ + export function showInformationMessage(message: string, options: MessageOptions, ...items: string[]): Thenable; + + /** + * Show an information message. + * + * @see [showInformationMessage](#window.showInformationMessage) + * + * @param message The message to show. + * @param items A set of items that will be rendered as actions in the message. + * @return A thenable that resolves to the selected item or `undefined` when being dismissed. + */ + export function showInformationMessage(message: string, ...items: T[]): Thenable; + + /** + * Show an information message. + * + * @see [showInformationMessage](#window.showInformationMessage) + * + * @param message The message to show. + * @param options Configures the behaviour of the message. + * @param items A set of items that will be rendered as actions in the message. + * @return A thenable that resolves to the selected item or `undefined` when being dismissed. + */ + export function showInformationMessage(message: string, options: MessageOptions, ...items: T[]): Thenable; + + /** + * Show a warning message. + * + * @see [showInformationMessage](#window.showInformationMessage) + * + * @param message The message to show. + * @param items A set of items that will be rendered as actions in the message. + * @return A thenable that resolves to the selected item or `undefined` when being dismissed. + */ + export function showWarningMessage(message: string, ...items: string[]): Thenable; + + /** + * Show a warning message. + * + * @see [showInformationMessage](#window.showInformationMessage) + * + * @param message The message to show. + * @param options Configures the behaviour of the message. + * @param items A set of items that will be rendered as actions in the message. + * @return A thenable that resolves to the selected item or `undefined` when being dismissed. + */ + export function showWarningMessage(message: string, options: MessageOptions, ...items: string[]): Thenable; + + /** + * Show a warning message. + * + * @see [showInformationMessage](#window.showInformationMessage) + * + * @param message The message to show. + * @param items A set of items that will be rendered as actions in the message. + * @return A thenable that resolves to the selected item or `undefined` when being dismissed. + */ + export function showWarningMessage(message: string, ...items: T[]): Thenable; + + /** + * Show a warning message. + * + * @see [showInformationMessage](#window.showInformationMessage) + * + * @param message The message to show. + * @param options Configures the behaviour of the message. + * @param items A set of items that will be rendered as actions in the message. + * @return A thenable that resolves to the selected item or `undefined` when being dismissed. + */ + export function showWarningMessage(message: string, options: MessageOptions, ...items: T[]): Thenable; + + /** + * Show an error message. + * + * @see [showInformationMessage](#window.showInformationMessage) + * + * @param message The message to show. + * @param items A set of items that will be rendered as actions in the message. + * @return A thenable that resolves to the selected item or `undefined` when being dismissed. + */ + export function showErrorMessage(message: string, ...items: string[]): Thenable; + + /** + * Show an error message. + * + * @see [showInformationMessage](#window.showInformationMessage) + * + * @param message The message to show. + * @param options Configures the behaviour of the message. + * @param items A set of items that will be rendered as actions in the message. + * @return A thenable that resolves to the selected item or `undefined` when being dismissed. + */ + export function showErrorMessage(message: string, options: MessageOptions, ...items: string[]): Thenable; + + /** + * Show an error message. + * + * @see [showInformationMessage](#window.showInformationMessage) + * + * @param message The message to show. + * @param items A set of items that will be rendered as actions in the message. + * @return A thenable that resolves to the selected item or `undefined` when being dismissed. + */ + export function showErrorMessage(message: string, ...items: T[]): Thenable; + + /** + * Show an error message. + * + * @see [showInformationMessage](#window.showInformationMessage) + * + * @param message The message to show. + * @param options Configures the behaviour of the message. + * @param items A set of items that will be rendered as actions in the message. + * @return A thenable that resolves to the selected item or `undefined` when being dismissed. + */ + export function showErrorMessage(message: string, options: MessageOptions, ...items: T[]): Thenable; + + /** + * Shows a selection list. + * + * @param items An array of strings, or a promise that resolves to an array of strings. + * @param options Configures the behavior of the selection list. + * @param token A token that can be used to signal cancellation. + * @return A promise that resolves to the selection or `undefined`. + */ + export function showQuickPick(items: string[] | Thenable, options?: QuickPickOptions, token?: CancellationToken): Thenable; + + /** + * Shows a selection list. + * + * @param items An array of items, or a promise that resolves to an array of items. + * @param options Configures the behavior of the selection list. + * @param token A token that can be used to signal cancellation. + * @return A promise that resolves to the selected item or `undefined`. + */ + export function showQuickPick(items: T[] | Thenable, options?: QuickPickOptions, token?: CancellationToken): Thenable; + + /** + * Opens an input box to ask the user for input. + * + * The returned value will be `undefined` if the input box was canceled (e.g. pressing ESC). Otherwise the + * returned value will be the string typed by the user or an empty string if the user did not type + * anything but dismissed the input box with OK. + * + * @param options Configures the behavior of the input box. + * @param token A token that can be used to signal cancellation. + * @return A promise that resolves to a string the user provided or to `undefined` in case of dismissal. + */ + export function showInputBox(options?: InputBoxOptions, token?: CancellationToken): Thenable; + + /** + * Create a new [output channel](#OutputChannel) with the given name. + * + * @param name Human-readable string which will be used to represent the channel in the UI. + */ + export function createOutputChannel(name: string): OutputChannel; + + /** + * Set a message to the status bar. This is a short hand for the more powerful + * status bar [items](#window.createStatusBarItem). + * + * @param text The message to show, supports icon substitution as in status bar [items](#StatusBarItem.text). + * @param hideAfterTimeout Timeout in milliseconds after which the message will be disposed. + * @return A disposable which hides the status bar message. + */ + export function setStatusBarMessage(text: string, hideAfterTimeout: number): Disposable; + + /** + * Set a message to the status bar. This is a short hand for the more powerful + * status bar [items](#window.createStatusBarItem). + * + * @param text The message to show, supports icon substitution as in status bar [items](#StatusBarItem.text). + * @param hideWhenDone Thenable on which completion (resolve or reject) the message will be disposed. + * @return A disposable which hides the status bar message. + */ + export function setStatusBarMessage(text: string, hideWhenDone: Thenable): Disposable; + + /** + * Set a message to the status bar. This is a short hand for the more powerful + * status bar [items](#window.createStatusBarItem). + * + * *Note* that status bar messages stack and that they must be disposed when no + * longer used. + * + * @param text The message to show, supports icon substitution as in status bar [items](#StatusBarItem.text). + * @return A disposable which hides the status bar message. + */ + export function setStatusBarMessage(text: string): Disposable; + + /** + * Creates a status bar [item](#StatusBarItem). + * + * @param alignment The alignment of the item. + * @param priority The priority of the item. Higher values mean the item should be shown more to the left. + * @return A new status bar item. + */ + export function createStatusBarItem(alignment?: StatusBarAlignment, priority?: number): StatusBarItem; + + /** + * Creates a [Terminal](#Terminal). The cwd of the terminal will be the workspace directory + * if it exists, regardless of whether an explicit customStartPath setting exists. + * + * @param name Optional human-readable string which will be used to represent the terminal in the UI. + * @param shellPath Optional path to a custom shell executable to be used in the terminal. + * @param shellArgs Optional args for the custom shell executable, this does not work on Windows (see #8429) + * @return A new Terminal. + */ + export function createTerminal(name?: string, shellPath?: string, shellArgs?: string[]): Terminal; + + /** + * Creates a [Terminal](#Terminal). The cwd of the terminal will be the workspace directory + * if it exists, regardless of whether an explicit customStartPath setting exists. + * + * @param options A TerminalOptions object describing the characteristics of the new terminal. + * @return A new Terminal. + */ + export function createTerminal(options: TerminalOptions): Terminal; + } + + /** + * Value-object describing what options formatting should use. + */ + export interface TerminalOptions { + /** + * A human-readable string which will be used to represent the terminal in the UI. + */ + name?: string; + + /** + * A path to a custom shell executable to be used in the terminal. + */ + shellPath?: string; + + /** + * Args for the custom shell executable, this does not work on Windows (see #8429) + */ + shellArgs?: string[]; + } + + /** + * An event describing an individual change in the text of a [document](#TextDocument). + */ + export interface TextDocumentContentChangeEvent { + /** + * The range that got replaced. + */ + range: Range; + /** + * The length of the range that got replaced. + */ + rangeLength: number; + /** + * The new text for the range. + */ + text: string; + } + + /** + * An event describing a transactional [document](#TextDocument) change. + */ + export interface TextDocumentChangeEvent { + + /** + * The affected document. + */ + document: TextDocument; + + /** + * An array of content changes. + */ + contentChanges: TextDocumentContentChangeEvent[]; + } + + /** + * Represents reasons why a text document is saved. + */ + export 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 + } + + /** + * An event that is fired when a [document](#TextDocument) will be saved. + * + * To make modifications to the document before it is being saved, call the + * [`waitUntil`](#TextDocumentWillSaveEvent.waitUntil)-function with a thenable + * that resolves to an array of [text edits](#TextEdit). + */ + export interface TextDocumentWillSaveEvent { + + /** + * The document that will be saved. + */ + document: TextDocument; + + /** + * The reason why save was triggered. + */ + reason: TextDocumentSaveReason; + + /** + * Allows to pause the event loop and to apply [pre-save-edits](#TextEdit). + * Edits of subsequent calls to this function will be applied in order. The + * edits will be *ignored* if concurrent modifications of the document happened. + * + * *Note:* This function can only be called during event dispatch and not + * in an asynchronous manner: + * + * ```ts + * workspace.onWillSaveTextDocument(event => { + * // async, will *throw* an error + * setTimeout(() => event.waitUntil(promise)); + * + * // sync, OK + * event.waitUntil(promise); + * }) + * ``` + * + * @param thenable A thenable that resolves to [pre-save-edits](#TextEdit). + */ + waitUntil(thenable: Thenable): void; + + /** + * Allows to pause the event loop until the provided thenable resolved. + * + * *Note:* This function can only be called during event dispatch. + * + * @param thenable A thenable that delays saving. + */ + waitUntil(thenable: Thenable): void; + } + + /** + * Namespace for dealing with the current workspace. A workspace is the representation + * of the folder that has been opened. There is no workspace when just a file but not a + * folder has been opened. + * + * The workspace offers support for [listening](#workspace.createFileSystemWatcher) to fs + * events and for [finding](#workspace.findFiles) files. Both perform well and run _outside_ + * the editor-process so that they should be always used instead of nodejs-equivalents. + */ + export namespace workspace { + + /** + * Creates a file system watcher. + * + * A glob pattern that filters the file events must be provided. Optionally, flags to ignore certain + * kinds of events can be provided. To stop listening to events the watcher must be disposed. + * + * @param globPattern A glob pattern that is applied to the names of created, changed, and deleted files. + * @param ignoreCreateEvents Ignore when files have been created. + * @param ignoreChangeEvents Ignore when files have been changed. + * @param ignoreDeleteEvents Ignore when files have been deleted. + * @return A new file system watcher instance. + */ + export function createFileSystemWatcher(globPattern: string, ignoreCreateEvents?: boolean, ignoreChangeEvents?: boolean, ignoreDeleteEvents?: boolean): FileSystemWatcher; + + /** + * The folder that is open in VS Code. `undefined` when no folder + * has been opened. + * + * @readonly + */ + export let rootPath: string | undefined; + + /** + * Returns a path that is relative to the workspace root. + * + * When there is no [workspace root](#workspace.rootPath) or when the path + * is not a child of that folder, the input is returned. + * + * @param pathOrUri A path or uri. When a uri is given its [fsPath](#Uri.fsPath) is used. + * @return A path relative to the root or the input. + */ + export function asRelativePath(pathOrUri: string | Uri): string; + + /** + * Find files in the workspace. + * + * @sample `findFiles('**∕*.js', '**∕node_modules∕**', 10)` + * @param include A glob pattern that defines the files to search for. + * @param exclude A glob pattern that defines files and folders to exclude. + * @param maxResults An upper-bound for the result. + * @param token A token that can be used to signal cancellation to the underlying search engine. + * @return A thenable that resolves to an array of resource identifiers. + */ + export function findFiles(include: string, exclude?: string, maxResults?: number, token?: CancellationToken): Thenable; + + /** + * Save all dirty files. + * + * @param includeUntitled Also save files that have been created during this session. + * @return A thenable that resolves when the files have been saved. + */ + export function saveAll(includeUntitled?: boolean): Thenable; + + /** + * Make changes to one or many resources as defined by the given + * [workspace edit](#WorkspaceEdit). + * + * When applying a workspace edit, the editor implements an 'all-or-nothing'-strategy, + * that means failure to load one document or make changes to one document will cause + * the edit to be rejected. + * + * @param edit A workspace edit. + * @return A thenable that resolves when the edit could be applied. + */ + export function applyEdit(edit: WorkspaceEdit): Thenable; + + /** + * All text documents currently known to the system. + * + * @readonly + */ + export let textDocuments: TextDocument[]; + + /** + * Opens the denoted document from disk. Will return early if the + * document is already open, otherwise the document is loaded and the + * [open document](#workspace.onDidOpenTextDocument)-event fires. + * The document to open is denoted by the [uri](#Uri). Two schemes are supported: + * + * file: A file on disk, will be rejected if the file does not exist or cannot be loaded, e.g. `file:///Users/frodo/r.ini`. + * untitled: A new file that should be saved on disk, e.g. `untitled:c:\frodo\new.js`. The language will be derived from the file name. + * + * Uris with other schemes will make this method return a rejected promise. + * + * @param uri Identifies the resource to open. + * @return A promise that resolves to a [document](#TextDocument). + */ + export function openTextDocument(uri: Uri): Thenable; + + /** + * A short-hand for `openTextDocument(Uri.file(fileName))`. + * + * @see [openTextDocument](#openTextDocument) + * @param fileName A name of a file on disk. + * @return A promise that resolves to a [document](#TextDocument). + */ + export function openTextDocument(fileName: string): Thenable; + + /** + * Opens an untitled text document. The editor will prompt the user for a file + * path when the document is to be saved. The `options` parameter allows to + * specify the *language* of the document. + * + * @param options Options to control how the document will be created. + * @return A promise that resolves to a [document](#TextDocument). + */ + export function openTextDocument(options?: { language: string; }): Thenable; + + /** + * Register a text document content provider. + * + * Only one provider can be registered per scheme. + * + * @param scheme The uri-scheme to register for. + * @param provider A content provider. + * @return A [disposable](#Disposable) that unregisters this provider when being disposed. + */ + export function registerTextDocumentContentProvider(scheme: string, provider: TextDocumentContentProvider): Disposable; + + /** + * An event that is emitted when a [text document](#TextDocument) is opened. + */ + export const onDidOpenTextDocument: Event; + + /** + * An event that is emitted when a [text document](#TextDocument) is disposed. + */ + export const onDidCloseTextDocument: Event; + + /** + * An event that is emitted when a [text document](#TextDocument) is changed. + */ + export const onDidChangeTextDocument: Event; + + /** + * An event that is emitted when a [text document](#TextDocument) will be saved to disk. + * + * *Note 1:* Subscribers can delay saving by registering asynchronous work. For the sake of data integrity the editor + * might save without firing this event. For instance when shutting down with dirty files. + * + * *Note 2:* Subscribers are called sequentially and they can [delay](#TextDocumentWillSaveEvent.waitUntil) saving + * by registering asynchronous work. Protection against misbehaving listeners is implemented as such: + * * there is an overall time budget that all listeners share and if that is exhausted no further listener is called + * * listeners that take a long time or produce errors frequently will not be called anymore + * + * The current thresholds are 1.5 seconds as overall time budget and a listener can misbehave 3 times before being ignored. + */ + export const onWillSaveTextDocument: Event; + + /** + * An event that is emitted when a [text document](#TextDocument) is saved to disk. + */ + export const onDidSaveTextDocument: Event; + + /** + * Get a configuration object. + * + * When a section-identifier is provided only that part of the configuration + * is returned. Dots in the section-identifier are interpreted as child-access, + * like `{ myExt: { setting: { doIt: true }}}` and `getConfiguration('myExt.setting').get('doIt') === true`. + * + * @param section A dot-separated identifier. + * @return The full workspace configuration or a subset. + */ + export function getConfiguration(section?: string): WorkspaceConfiguration; + + /** + * An event that is emitted when the [configuration](#WorkspaceConfiguration) changed. + */ + export const onDidChangeConfiguration: Event; + } + + /** + * Namespace for participating in language-specific editor [features](https://code.visualstudio.com/docs/editor/editingevolved), + * like IntelliSense, code actions, diagnostics etc. + * + * Many programming languages exist and there is huge variety in syntaxes, semantics, and paradigms. Despite that, features + * like automatic word-completion, code navigation, or code checking have become popular across different tools for different + * programming languages. + * + * The editor provides an API that makes it simple to provide such common features by having all UI and actions already in place and + * by allowing you to participate by providing data only. For instance, to contribute a hover all you have to do is provide a function + * that can be called with a [TextDocument](#TextDocument) and a [Position](#Position) returning hover info. The rest, like tracking the + * mouse, positioning the hover, keeping the hover stable etc. is taken care of by the editor. + * + * ```javascript + * languages.registerHoverProvider('javascript', { + * provideHover(document, position, token) { + * return new Hover('I am a hover!'); + * } + * }); + * ``` + * + * Registration is done using a [document selector](#DocumentSelector) which is either a language id, like `javascript` or + * a more complex [filter](#DocumentFilter) like `{ language: 'typescript', scheme: 'file' }`. Matching a document against such + * a selector will result in a [score](#languages.match) that is used to determine if and how a provider shall be used. When + * scores are equal the provider that came last wins. For features that allow full arity, like [hover](#languages.registerHoverProvider), + * the score is only checked to be `>0`, for other features, like [IntelliSense](#languages.registerCompletionItemProvider) the + * score is used for determining the order in which providers are asked to participate. + */ + export namespace languages { + + /** + * Return the identifiers of all known languages. + * @return Promise resolving to an array of identifier strings. + */ + export function getLanguages(): Thenable; + + /** + * Compute the match between a document [selector](#DocumentSelector) and a document. Values + * greater than zero mean the selector matches the document. The more individual matches a selector + * and a document have, the higher the score is. These are the abstract rules given a `selector`: + * + * ``` + * (1) When selector is an array, return the maximum individual result. + * (2) When selector is a string match that against the [languageId](#TextDocument.languageId). + * (2.1) When both are equal score is `10`, + * (2.2) When the selector is `*` score is `5`, + * (2.3) Else score is `0`. + * (3) When selector is a [filter](#DocumentFilter) return the maximum individual score given that each score is `>0`. + * (3.1) When [language](#DocumentFilter.language) is set apply rules from #2, when `0` the total score is `0`. + * (3.2) When [scheme](#DocumentFilter.scheme) is set and equals the [uri](#TextDocument.uri)-scheme score with `10`, else the total score is `0`. + * (3.3) When [pattern](#DocumentFilter.pattern) is set + * (3.3.1) pattern equals the [uri](#TextDocument.uri)-fsPath score with `10`, + * (3.3.1) if the pattern matches as glob-pattern score with `5`, + * (3.3.1) the total score is `0` + * ``` + * + * @param selector A document selector. + * @param document A text document. + * @return A number `>0` when the selector matches and `0` when the selector does not match. + */ + export function match(selector: DocumentSelector, document: TextDocument): number; + + /** + * Create a diagnostics collection. + * + * @param name The [name](#DiagnosticCollection.name) of the collection. + * @return A new diagnostic collection. + */ + export function createDiagnosticCollection(name?: string): DiagnosticCollection; + + /** + * Register a completion provider. + * + * Multiple providers can be registered for a language. In that case providers are sorted + * by their [score](#languages.match) and groups of equal score are sequentially asked for + * completion items. The process stops when one or many providers of a group return a + * result. A failing provider (rejected promise or exception) will not fail the whole + * operation. + * + * @param selector A selector that defines the documents this provider is applicable to. + * @param provider A completion provider. + * @param triggerCharacters Trigger completion when the user types one of the characters, like `.` or `:`. + * @return A [disposable](#Disposable) that unregisters this provider when being disposed. + */ + export function registerCompletionItemProvider(selector: DocumentSelector, provider: CompletionItemProvider, ...triggerCharacters: string[]): Disposable; + + /** + * Register a code action provider. + * + * Multiple providers can be registered for a language. In that case providers are asked in + * parallel and the results are merged. A failing provider (rejected promise or exception) will + * not cause a failure of the whole operation. + * + * @param selector A selector that defines the documents this provider is applicable to. + * @param provider A code action provider. + * @return A [disposable](#Disposable) that unregisters this provider when being disposed. + */ + export function registerCodeActionsProvider(selector: DocumentSelector, provider: CodeActionProvider): Disposable; + + /** + * Register a code lens provider. + * + * Multiple providers can be registered for a language. In that case providers are asked in + * parallel and the results are merged. A failing provider (rejected promise or exception) will + * not cause a failure of the whole operation. + * + * @param selector A selector that defines the documents this provider is applicable to. + * @param provider A code lens provider. + * @return A [disposable](#Disposable) that unregisters this provider when being disposed. + */ + export function registerCodeLensProvider(selector: DocumentSelector, provider: CodeLensProvider): Disposable; + + /** + * Register a definition provider. + * + * Multiple providers can be registered for a language. In that case providers are asked in + * parallel and the results are merged. A failing provider (rejected promise or exception) will + * not cause a failure of the whole operation. + * + * @param selector A selector that defines the documents this provider is applicable to. + * @param provider A definition provider. + * @return A [disposable](#Disposable) that unregisters this provider when being disposed. + */ + export function registerDefinitionProvider(selector: DocumentSelector, provider: DefinitionProvider): Disposable; + + /** + * Register an implementation provider. + * + * Multiple providers can be registered for a language. In that case providers are asked in + * parallel and the results are merged. A failing provider (rejected promise or exception) will + * not cause a failure of the whole operation. + * + * @param selector A selector that defines the documents this provider is applicable to. + * @param provider An implementation provider. + * @return A [disposable](#Disposable) that unregisters this provider when being disposed. + */ + export function registerImplementationProvider(selector: DocumentSelector, provider: ImplementationProvider): Disposable; + + /** + * Register a type definition provider. + * + * Multiple providers can be registered for a language. In that case providers are asked in + * parallel and the results are merged. A failing provider (rejected promise or exception) will + * not cause a failure of the whole operation. + * + * @param selector A selector that defines the documents this provider is applicable to. + * @param provider A type definition provider. + * @return A [disposable](#Disposable) that unregisters this provider when being disposed. + */ + export function registerTypeDefinitionProvider(selector: DocumentSelector, provider: TypeDefinitionProvider): Disposable; + + /** + * Register a hover provider. + * + * Multiple providers can be registered for a language. In that case providers are asked in + * parallel and the results are merged. A failing provider (rejected promise or exception) will + * not cause a failure of the whole operation. + * + * @param selector A selector that defines the documents this provider is applicable to. + * @param provider A hover provider. + * @return A [disposable](#Disposable) that unregisters this provider when being disposed. + */ + export function registerHoverProvider(selector: DocumentSelector, provider: HoverProvider): Disposable; + + /** + * Register a document highlight provider. + * + * Multiple providers can be registered for a language. In that case providers are sorted + * by their [score](#languages.match) and groups sequentially asked for document highlights. + * The process stops when a provider returns a `non-falsy` or `non-failure` result. + * + * @param selector A selector that defines the documents this provider is applicable to. + * @param provider A document highlight provider. + * @return A [disposable](#Disposable) that unregisters this provider when being disposed. + */ + export function registerDocumentHighlightProvider(selector: DocumentSelector, provider: DocumentHighlightProvider): Disposable; + + /** + * Register a document symbol provider. + * + * Multiple providers can be registered for a language. In that case providers are asked in + * parallel and the results are merged. A failing provider (rejected promise or exception) will + * not cause a failure of the whole operation. + * + * @param selector A selector that defines the documents this provider is applicable to. + * @param provider A document symbol provider. + * @return A [disposable](#Disposable) that unregisters this provider when being disposed. + */ + export function registerDocumentSymbolProvider(selector: DocumentSelector, provider: DocumentSymbolProvider): Disposable; + + /** + * Register a workspace symbol provider. + * + * Multiple providers can be registered. In that case providers are asked in parallel and + * the results are merged. A failing provider (rejected promise or exception) will not cause + * a failure of the whole operation. + * + * @param provider A workspace symbol provider. + * @return A [disposable](#Disposable) that unregisters this provider when being disposed. + */ + export function registerWorkspaceSymbolProvider(provider: WorkspaceSymbolProvider): Disposable; + + /** + * Register a reference provider. + * + * Multiple providers can be registered for a language. In that case providers are asked in + * parallel and the results are merged. A failing provider (rejected promise or exception) will + * not cause a failure of the whole operation. + * + * @param selector A selector that defines the documents this provider is applicable to. + * @param provider A reference provider. + * @return A [disposable](#Disposable) that unregisters this provider when being disposed. + */ + export function registerReferenceProvider(selector: DocumentSelector, provider: ReferenceProvider): Disposable; + + /** + * Register a reference provider. + * + * Multiple providers can be registered for a language. In that case providers are sorted + * by their [score](#languages.match) and the best-matching provider is used. Failure + * of the selected provider will cause a failure of the whole operation. + * + * @param selector A selector that defines the documents this provider is applicable to. + * @param provider A rename provider. + * @return A [disposable](#Disposable) that unregisters this provider when being disposed. + */ + export function registerRenameProvider(selector: DocumentSelector, provider: RenameProvider): Disposable; + + /** + * Register a formatting provider for a document. + * + * Multiple providers can be registered for a language. In that case providers are sorted + * by their [score](#languages.match) and the best-matching provider is used. Failure + * of the selected provider will cause a failure of the whole operation. + * + * @param selector A selector that defines the documents this provider is applicable to. + * @param provider A document formatting edit provider. + * @return A [disposable](#Disposable) that unregisters this provider when being disposed. + */ + export function registerDocumentFormattingEditProvider(selector: DocumentSelector, provider: DocumentFormattingEditProvider): Disposable; + + /** + * Register a formatting provider for a document range. + * + * *Note:* A document range provider is also a [document formatter](#DocumentFormattingEditProvider) + * which means there is no need to [register](registerDocumentFormattingEditProvider) a document + * formatter when also registering a range provider. + * + * Multiple providers can be registered for a language. In that case providers are sorted + * by their [score](#languages.match) and the best-matching provider is used. Failure + * of the selected provider will cause a failure of the whole operation. + * + * @param selector A selector that defines the documents this provider is applicable to. + * @param provider A document range formatting edit provider. + * @return A [disposable](#Disposable) that unregisters this provider when being disposed. + */ + export function registerDocumentRangeFormattingEditProvider(selector: DocumentSelector, provider: DocumentRangeFormattingEditProvider): Disposable; + + /** + * Register a formatting provider that works on type. The provider is active when the user enables the setting `editor.formatOnType`. + * + * Multiple providers can be registered for a language. In that case providers are sorted + * by their [score](#languages.match) and the best-matching provider is used. Failure + * of the selected provider will cause a failure of the whole operation. + * + * @param selector A selector that defines the documents this provider is applicable to. + * @param provider An on type formatting edit provider. + * @param firstTriggerCharacter A character on which formatting should be triggered, like `}`. + * @param moreTriggerCharacter More trigger characters. + * @return A [disposable](#Disposable) that unregisters this provider when being disposed. + */ + export function registerOnTypeFormattingEditProvider(selector: DocumentSelector, provider: OnTypeFormattingEditProvider, firstTriggerCharacter: string, ...moreTriggerCharacter: string[]): Disposable; + + /** + * Register a signature help provider. + * + * Multiple providers can be registered for a language. In that case providers are sorted + * by their [score](#languages.match) and called sequentially until a provider returns a + * valid result. + * + * @param selector A selector that defines the documents this provider is applicable to. + * @param provider A signature help provider. + * @param triggerCharacters Trigger signature help when the user types one of the characters, like `,` or `(`. + * @return A [disposable](#Disposable) that unregisters this provider when being disposed. + */ + export function registerSignatureHelpProvider(selector: DocumentSelector, provider: SignatureHelpProvider, ...triggerCharacters: string[]): Disposable; + + /** + * Register a document link provider. + * + * Multiple providers can be registered for a language. In that case providers are asked in + * parallel and the results are merged. A failing provider (rejected promise or exception) will + * not cause a failure of the whole operation. + * + * @param selector A selector that defines the documents this provider is applicable to. + * @param provider A document link provider. + * @return A [disposable](#Disposable) that unregisters this provider when being disposed. + */ + export function registerDocumentLinkProvider(selector: DocumentSelector, provider: DocumentLinkProvider): Disposable; + + /** + * Set a [language configuration](#LanguageConfiguration) for a language. + * + * @param language A language identifier like `typescript`. + * @param configuration Language configuration. + * @return A [disposable](#Disposable) that unsets this configuration. + */ + export function setLanguageConfiguration(language: string, configuration: LanguageConfiguration): Disposable; + } + + /** + * Namespace for dealing with installed extensions. Extensions are represented + * by an [extension](#Extension)-interface which allows to reflect on them. + * + * Extension writers can provide APIs to other extensions by returning their API public + * surface from the `activate`-call. + * + * ```javascript + * export function activate(context: vscode.ExtensionContext) { + * let api = { + * sum(a, b) { + * return a + b; + * }, + * mul(a, b) { + * return a * b; + * } + * }; + * // 'export' public api-surface + * return api; + * } + * ``` + * When depending on the API of another extension add an `extensionDependency`-entry + * to `package.json`, and use the [getExtension](#extensions.getExtension)-function + * and the [exports](#Extension.exports)-property, like below: + * + * ```javascript + * let mathExt = extensions.getExtension('genius.math'); + * let importedApi = mathExt.exports; + * + * console.log(importedApi.mul(42, 1)); + * ``` + */ + export namespace extensions { + + /** + * Get an extension by its full identifier in the form of: `publisher.name`. + * + * @param extensionId An extension identifier. + * @return An extension or `undefined`. + */ + export function getExtension(extensionId: string): Extension | undefined; + + /** + * Get an extension its full identifier in the form of: `publisher.name`. + * + * @param extensionId An extension identifier. + * @return An extension or `undefined`. + */ + export function getExtension(extensionId: string): Extension | undefined; + + /** + * All extensions currently known to the system. + */ + export let all: Extension[]; + } +} + +/** + * Thenable is a common denominator between ES6 promises, Q, jquery.Deferred, WinJS.Promise, + * and others. This API makes no assumption about what promise libary is being used which + * enables reusing existing code without migrating to a specific promise implementation. Still, + * we recommend the use of native promises which are available in VS Code. + */ +interface Thenable { + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: (value: T) => TResult | Thenable, onrejected?: (reason: any) => TResult | Thenable): Thenable; + then(onfulfilled?: (value: T) => TResult | Thenable, onrejected?: (reason: any) => void): Thenable; +} diff --git a/out/extension.js b/out/extension.js new file mode 100644 index 0000000..73f034e --- /dev/null +++ b/out/extension.js @@ -0,0 +1,33 @@ +'use strict'; +Object.defineProperty(exports, "__esModule", { value: true }); +const path = require("path"); +const vscode_1 = require("vscode"); +const vscode_languageclient_1 = require("vscode-languageclient"); +function activate(context) { + // The server is implemented in node + let serverModule = context.asAbsolutePath(path.join('server', 'server.js')); + // The debug options for the server + let debugOptions = { execArgv: ["--nolazy", "--debug=6009"] }; + // If the extension is launched in debug mode then the debug server options are used + // Otherwise the run options are used + let serverOptions = { + run: { module: serverModule, transport: vscode_languageclient_1.TransportKind.ipc }, + debug: { module: serverModule, transport: vscode_languageclient_1.TransportKind.ipc, options: debugOptions } + }; + // Options to control the language client + let clientOptions = { + // Register the server for plain text documents + documentSelector: ['sqf'], + synchronize: { + configurationSection: 'sqf', + fileEvents: vscode_1.workspace.createFileSystemWatcher('**/.clientrc') + } + }; + // Create the language client and start the client. + let disposable = new vscode_languageclient_1.LanguageClient('sqfLanguageServer', 'SQF Language Server', serverOptions, clientOptions).start(); + // Push the disposable to the context's subscriptions so that the + // client can be deactivated on extension deactivation + context.subscriptions.push(disposable); +} +exports.activate = activate; +//# sourceMappingURL=extension.js.map \ No newline at end of file diff --git a/package.json b/package.json index 506b4c1..28eeba2 100644 --- a/package.json +++ b/package.json @@ -3,19 +3,18 @@ "displayName": "SQF Language", "description": "Full SQF Language support for VS Code.", "icon": "img/logo.svg", - "version": "0.5.9", + "version": "1.0.0", "publisher": "Armitxes", "galleryBanner": { "color": "#647e99", "theme": "dark" }, - "license": "LICENSE.htm", + "license": "CC-BY-NC-SA-4.0", "bugs": { "url": "https://github.com/Armitxes/VSCode_SQF/issues", "email": "4rmitxes@gmail.com" }, "homepage": "https://armitxes.net/Projects/VSCodeSQF/", - "BI Forum": "https://forums.bistudio.com/topic/182917-vs-code-sqf-visual-studio-code-sqf-language-release-arma-3-arma-2/", "repository": { "type": "git", "url": "https://github.com/Armitxes/VSCode_SQF.git" @@ -23,10 +22,15 @@ "categories": [ "Languages", "Snippets", - "Themes" + "Themes", + "Linters" ], + "activationEvents": [ + "onLanguage:sqf" + ], + "main": "./out/extension", "engines": { - "vscode": "0.10.x" + "vscode": "^1.10.0" }, "contributes": { "languages": [ @@ -48,7 +52,7 @@ { "language": "sqf", "scopeName": "source.sqf", - "path": "./syntaxes/sqf.json" + "path": "./syntaxes/sqf.min.json" } ], "snippets": [ @@ -63,6 +67,78 @@ "uiTheme": "vs-dark", "path": "./themes/sqf.tmTheme" } - ] + ], + "configuration": { + "type": "object", + "title": "SQF Language", + "properties": { + "sqf.enableOFP": { + "type": "boolean", + "default": true, + "description": "Enable commands introduced with Operation Flashpoint" + }, + "sqf.enableTOH": { + "type": "boolean", + "default": false, + "description": "Enable commands introduced with Take on Helicopter" + }, + "sqf.enableARMA": { + "type": "boolean", + "default": true, + "description": "Enable commands introduced with ArmA (1)" + }, + "sqf.enableARMA2": { + "type": "boolean", + "default": true, + "description": "Enable commands introduced with ArmA 2" + }, + "sqf.enableARMA3": { + "type": "boolean", + "default": true, + "description": "Enable commands introduced with ArmA 3" + }, + "sqf.enableCBA": { + "type": "boolean", + "default": false, + "description": "Enable CBA (Community Based Addons) library" + }, + "sqf.enableACE3": { + "type": "boolean", + "default": false, + "description": "Enable ACE3 library" + }, + "sqf.maxNumberOfProblems": { + "type": "number", + "default": 100, + "description": "Controls the maximum number of problems produced by the server." + } + } + }, + "configurationDefaults": { + "[sqf]": { + "editor.quickSuggestions": true, + "editor.tabSize": 4, + "editor.insertSpaces": false, + "editor.detectIndentation": true, + "editor.trimAutoWhitespace": true, + "editor.autoClosingBrackets": true + } + } + }, + "scripts": { + "vscode:prepublish": "tsc -p ./", + "compile": "tsc -watch -p ./", + "update-vscode": "node ./node_modules/vscode/bin/install", + "postinstall": "node ./node_modules/vscode/bin/install" + }, + "devDependencies": { + "@types/mocha": "^2.2.33", + "@types/node": "^6.0.52", + "typescript": "^2.1.5", + "vscode": "^1.0.5" + }, + "dependencies": { + "vscode-languageclient": "^3.1.0", + "vscode-languageserver": "^3.1.0" } -} \ No newline at end of file +} diff --git a/server/server.js b/server/server.js new file mode 100644 index 0000000..4013bdb --- /dev/null +++ b/server/server.js @@ -0,0 +1,136 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +'use strict'; +Object.defineProperty(exports, "__esModule", { value: true }); +const vscode_languageserver_1 = require("vscode-languageserver"); +const fs = require("fs"); +// Create a connection for the server. The connection uses Node's IPC as a transport +let connection = vscode_languageserver_1.createConnection(new vscode_languageserver_1.IPCMessageReader(process), new vscode_languageserver_1.IPCMessageWriter(process)); +let documents = new vscode_languageserver_1.TextDocuments(); +documents.listen(connection); +// After the server has started the client sends an initialize request. The server receives +// in the passed params the rootPath of the workspace plus the client capabilities. +let workspaceRoot; +connection.onInitialize((params) => { + workspaceRoot = params.rootPath; + return { + capabilities: { + // Tell the client that the server works in FULL text document sync mode + textDocumentSync: documents.syncKind, + // Tell the client that the server support code complete + completionProvider: { + resolveProvider: true + } + } + }; +}); +var settings = {}; +var issueCommands = [ + { 'cmd': 'BIS_fnc_MP', 'regex': /(\b)(BIS_fnc_MP)(\b)/g, 'msg': '[ArmA 3] BIS_fnc_MP is deprecated use the engine based commands "remoteExec" or "remoteExecCall" instead.' } +]; +connection.onDidChangeConfiguration((change) => { + settings = change.settings; + settings.sqf.maxNumberOfProblems = settings.sqf.maxNumberOfProblems || 50; + /* + Check if grammar settings have changed + ToDo: Find / wait for better alternative. + */ + let sqfGrammarFile = require('../syntaxes/sqf.min.json'); + let patterns = []; + if (settings.sqf.enableOFP) { + patterns.push({ "include": "#OFP" }); + } + if (settings.sqf.enableTOH) { + patterns.push({ "include": "#TOH" }); + } + if (settings.sqf.enableARMA) { + patterns.push({ "include": "#ARMA" }); + } + if (settings.sqf.enableARMA2) { + patterns.push({ "include": "#ARMA2" }); + } + if (settings.sqf.enableARMA3) { + patterns.push({ "include": "#ARMA3" }); + } + if (settings.sqf.enableCBA) { + patterns.push({ "include": "#CBA" }); + } + if (settings.sqf.enableACE3) { + patterns.push({ "include": "#ACE3" }); + } + if ((JSON.stringify(sqfGrammarFile.repository.statements.patterns) != JSON.stringify(patterns))) { + connection.window.showInformationMessage('SQF Language configuration updated. Please restart Visual Studio Code to apply the changes.'); + sqfGrammarFile.repository.statements.patterns = patterns; + fs.truncate(__dirname + "/../syntaxes/sqf.min.json", 0, function () { + fs.writeFile(__dirname + "/../syntaxes/sqf.min.json", JSON.stringify(sqfGrammarFile)); + }); + } + // Deprecated OFP -> ArmA + if (settings.sqf.enableARMA && settings.sqf.enableARMA) { + issueCommands.push({ 'cmd': 'exec', 'regex': /(\b)(exec)(\b)/g, 'msg': '[ArmA] exec is used for SQS files which are considered deprecated. Consider using execVM and SQF instead.' }); + } + ; + // ArmA 1 -> ArmA 3 + if (settings.sqf.enableARMA && settings.sqf.enableARMA3) { + issueCommands.push({ 'cmd': 'difficultyEnabled', 'regex': /(\b)(difficultyEnabled)(\b)/g, 'msg': '[ArmA 3] difficultyEnabled is deprecated. Use "difficultyOption" instead.' }); + } + ; + // Protect CBA namespace + if (!settings.sqf.enableCBA) { + issueCommands.push({ 'cmd': 'CBA_', 'regex': /(\b)(CBA_)/g, 'msg': 'The "CBA_" namespace is reserved for the Community Based Addons. Please enable CBA commands in the settings.' }); + } + ; + // Protect ACE namespace + if (!settings.sqf.enableACE3) { + issueCommands.push({ 'cmd': 'ACE_', 'regex': /(\b)(ACE_)/g, 'msg': 'The "ACE_" namespace is reserved. Please enable ACE commands in the settings.' }); + } + ; + documents.all().forEach(validateTextDocument); +}); +// The content of a text document has changed. This event is emitted +// when the text document first opened or when its content has changed. +documents.onDidChangeContent((change) => { + validateTextDocument(change.document); +}); +function validateTextDocument(textDocument) { + let diagnostics = []; + let issues = 0; + let lines = textDocument.getText().split(/\r?\n/g); + for (var i = 0; i < lines.length && issues < settings.sqf.maxNumberOfProblems; i++) { + let line = lines[i]; + issueCommands.forEach(function (command) { + let index = line.search(command.regex); + if (index > -1) { + diagnostics.push({ + severity: vscode_languageserver_1.DiagnosticSeverity.Warning, + range: { + start: { line: i, character: index }, + end: { line: i, character: index + command.cmd.length } + }, + message: command.msg, + source: 'sqf' + }); + } + ; + }); + } + connection.sendDiagnostics({ uri: textDocument.uri, diagnostics }); +} +// This handler provides the initial list of the completion items. +connection.onCompletion((textDocumentPosition) => { + // The pass parameter contains the position of the text document in + // which code complete got requested. For the example we ignore this + // info and always provide the same completion items. + return []; +}); +// This handler resolve additional information for the item selected in +// the completion list. +connection.onCompletionResolve((item) => { + return item; +}); +let t; +// Listen on the connection +connection.listen(); +//# sourceMappingURL=server.js.map \ No newline at end of file diff --git a/syntaxes/sqf.json b/syntaxes/sqf.json index 278400d..301096a 100644 --- a/syntaxes/sqf.json +++ b/syntaxes/sqf.json @@ -71,7 +71,7 @@ "name": "comment.line.sqf" }, "comparison-operator": { - "match": "==|!=|>|<|greater|greater=|less|less=", + "match": "==|!=|>|<|greater|greater=|less|less=|not", "name": "keyword.operator.comparison.sqf" }, "condition-operator": { @@ -79,7 +79,7 @@ "name": "keyword.operator.condition.sqf" }, "control-statement": { - "match": "\\s*(?i)(then|do|else|exit|exitWith|for|forEach|if|return|switch|while|from|to|step)\\b", + "match": "\\s*(?i)(then|do|else|exit|exitWith|for|forEach|if|return|switch|while|from|to|step|forEachMember|forEachMemberAgent|forEachMemberTeam)\\b", "name": "keyword.control.sqf" }, "decl-block": { @@ -102,65 +102,37 @@ } ] }, - "BIS-functions": { - "match": "\\b(?i)(BIS_fnc_3Dcredits|BIS_fnc_AAN|BIS_fnc_absSpeed|BIS_fnc_activateAddons|BIS_fnc_addClassOO|BIS_fnc_addCommMenuItem|BIS_fnc_addCuratorAreaFromTrigger|BIS_fnc_addCuratorChallenge|BIS_fnc_addCuratorIcon|BIS_fnc_addEvidence|BIS_fnc_addRespawnInventory|BIS_fnc_addRespawnPosition|BIS_fnc_addScore|BIS_fnc_addScriptedEventHandler|BIS_fnc_addStackedEventHandler|BIS_fnc_addSupportLink|BIS_fnc_addToPairs|BIS_fnc_addVirtualBackpackCargo|BIS_fnc_addVirtualItemCargo|BIS_fnc_addVirtualMagazineCargo|BIS_fnc_addVirtualWeaponCargo|BIS_fnc_addWeapon|BIS_fnc_advHint|BIS_fnc_advHintArg|BIS_fnc_advHintCall|BIS_fnc_advHintCredits|BIS_fnc_alignTabs|BIS_fnc_allSynchronizedObjects|BIS_fnc_ambientAnim|BIS_fnc_ambientAnimCombat|BIS_fnc_ambientAnimGetParams|BIS_fnc_ambientBlacklist|BIS_fnc_ambientBlacklistAdd|BIS_fnc_ambientBoats|BIS_fnc_ambientFlyby|BIS_fnc_ambientHelicopters|BIS_fnc_ambientPlanes|BIS_fnc_ambientPostprocess|BIS_fnc_animalBehaviour|BIS_fnc_animalSiteSpawn|BIS_fnc_animateTaskWaypoint|BIS_fnc_animType|BIS_fnc_animViewer|BIS_fnc_areEqual|BIS_fnc_areFriendly|BIS_fnc_arithmeticMean|BIS_fnc_arrayCompare|BIS_fnc_arrayFindDeep|BIS_fnc_arrayInsert|BIS_fnc_arrayPop|BIS_fnc_arrayPush|BIS_fnc_arrayPushStack|BIS_fnc_arrayShift|BIS_fnc_arrayShuffle|BIS_fnc_arrayUnShift|BIS_fnc_arsenal|BIS_fnc_assignPlayerRole|BIS_fnc_baseWeapon|BIS_fnc_basicBackpack|BIS_fnc_basicTask|BIS_fnc_openFieldManual|BIS_fnc_blackIn|BIS_fnc_blackOut|BIS_fnc_bleedTickets|BIS_fnc_bloodEffect|BIS_fnc_boundingBoxCorner|BIS_fnc_boundingBoxDimensions|BIS_fnc_boundingBoxMarker|BIS_fnc_boundingCircle|BIS_fnc_briefingAnimate|BIS_fnc_briefingInit|BIS_fnc_buildingPositions|BIS_fnc_call|BIS_fnc_callScriptedEventHandler|BIS_fnc_camera|BIS_fnc_cameraOld|BIS_fnc_camFollow|BIS_fnc_changeSupportRadioChannel|BIS_fnc_cinemaBorder|BIS_fnc_classMagazine|BIS_fnc_classWeapon|BIS_fnc_codePerformance|BIS_fnc_colorConfigToRGBA|BIS_fnc_colorRGBAtoHTML|BIS_fnc_colorRGBAtoTexture|BIS_fnc_colorRGBtoHTML|BIS_fnc_commsMenuCreate|BIS_fnc_commsMenuToggleAvailability|BIS_fnc_commsMenuToggleVisibility|BIS_fnc_completedCuratorChallengesCount|BIS_fnc_conditionalSelect|BIS_fnc_configExtremes|BIS_fnc_configPath|BIS_fnc_configviewer|BIS_fnc_consolidateArray|BIS_fnc_convertUnits|BIS_fnc_countdown|BIS_fnc_counter|BIS_fnc_createLogRecord|BIS_fnc_createmenu|BIS_fnc_createObjectOO|BIS_fnc_credits|BIS_fnc_credits_movie|BIS_fnc_credits_movieConfig|BIS_fnc_credits_movieSupport|BIS_fnc_crewCount|BIS_fnc_crossProduct|BIS_fnc_crows|BIS_fnc_ctrlFitToTextHeight|BIS_fnc_ctrlSetScale|BIS_fnc_ctrlTextHeight|BIS_fnc_curatorAttachObject|BIS_fnc_curatorAttributes|BIS_fnc_curatorAutomatic|BIS_fnc_curatorAutomaticPositions|BIS_fnc_curatorChallengeDestroyVehicle|BIS_fnc_curatorChallengeFindIntel|BIS_fnc_curatorChallengeFireWeapon|BIS_fnc_curatorChallengeGetInVehicle|BIS_fnc_curatorChallengeIlluminate|BIS_fnc_curatorChallengeSpawnLightning|BIS_fnc_curatorHint|BIS_fnc_curatorObjectEdited|BIS_fnc_curatorObjectPlaced|BIS_fnc_curatorObjectRegistered|BIS_fnc_curatorObjectRegisteredTable|BIS_fnc_curatorPinged|BIS_fnc_curatorRespawn|BIS_fnc_curatorSayMessage|BIS_fnc_curatorVisionModes|BIS_fnc_curatorWaypointPlaced|BIS_fnc_customGPS|BIS_fnc_customGPSvideo|BIS_fnc_customGPSVideo|BIS_fnc_cutDecimals|BIS_fnc_damageChanged|BIS_fnc_damagePulsing|BIS_fnc_dbClassCheck|BIS_fnc_dbClassId|BIS_fnc_dbClassIndex|BIS_fnc_dbClassList|BIS_fnc_dbClassRemove|BIS_fnc_dbClassReturn|BIS_fnc_dbClassSet|BIS_fnc_dbConfigPath|BIS_fnc_dbImportConfig|BIS_fnc_dbImportXML|BIS_fnc_dbisClass|BIS_fnc_dbisValue|BIS_fnc_dbPrint|BIS_fnc_dbSymbolClass|BIS_fnc_dbSymbolValue|BIS_fnc_dbValueCheck|BIS_fnc_dbValueId|BIS_fnc_dbValueIndex|BIS_fnc_dbValueList|BIS_fnc_dbValueRemove|BIS_fnc_dbValueReturn|BIS_fnc_dbValueSet|BIS_fnc_deleteInventory|BIS_fnc_deleteTask|BIS_fnc_destroyCity|BIS_fnc_diagAAR|BIS_fnc_diagAARrecord|BIS_fnc_diagAnim|BIS_fnc_diagBulletCam|BIS_fnc_diagConfig|BIS_fnc_diagFindMissingAuthors|BIS_fnc_diagHit|BIS_fnc_diagKey|BIS_fnc_diagKeyLayout|BIS_fnc_diagKeyTest|BIS_fnc_diagKnownAsTarget|BIS_fnc_diagKnownTargets|BIS_fnc_diagLoop|BIS_fnc_diagMacros|BIS_fnc_diagMacrosAuthor|BIS_fnc_diagMacrosMapSize|BIS_fnc_diagMacrosNameSound|BIS_fnc_diagMacrosVerify|BIS_fnc_diagMissionPositions|BIS_fnc_diagMissionWeapons|BIS_fnc_diagPreview|BIS_fnc_diagPreviewCycle|BIS_fnc_diagPreviewVehicleCrew|BIS_fnc_diagRadio|BIS_fnc_diagVehicleIcons|BIS_fnc_diagWiki|BIS_fnc_diaryHints|BIS_fnc_diaryMaps|BIS_fnc_dirIndicator|BIS_fnc_dirtEffect|BIS_fnc_dirTo|BIS_fnc_disableSaving|BIS_fnc_displayClouds|BIS_fnc_displayColorGet|BIS_fnc_displayColorSet|BIS_fnc_displayControls|BIS_fnc_displayLoading|BIS_fnc_displayMission|BIS_fnc_displayName|BIS_fnc_displayResize|BIS_fnc_distance2D|BIS_fnc_distance2Dsqr|BIS_fnc_dotProduct|BIS_fnc_drawAO|BIS_fnc_drawCuratorDeaths|BIS_fnc_drawCuratorLocations|BIS_fnc_drawCuratorRespawnMarkers|BIS_fnc_drawMinefields|BIS_fnc_drawRespawnPositions|BIS_fnc_dynamicText|BIS_fnc_earthquake|BIS_fnc_effectFired|BIS_fnc_effectFiredArtillery|BIS_fnc_effectFiredFlares|BIS_fnc_effectFiredHeliRocket|BIS_fnc_effectFiredLongSmoke|BIS_fnc_effectFiredRifle|BIS_fnc_effectFiredRocket|BIS_fnc_effectFiredSmokeLauncher|BIS_fnc_effectFiredSmokeLauncher_boat|BIS_fnc_effectKilled|BIS_fnc_effectKilledAirDestruction|BIS_fnc_effectKilledAirDestructionStage2|BIS_fnc_effectKilledSecondaries|BIS_fnc_effectPlankton|BIS_fnc_enableSaving|BIS_fnc_endLoadingScreen|BIS_fnc_endMission|BIS_fnc_endMissionServer|BIS_fnc_enemyDetected|BIS_fnc_enemySides|BIS_fnc_enemyTargets|BIS_fnc_error|BIS_fnc_errorMsg|BIS_fnc_establishingShot|BIS_fnc_estimatedTimeLeft|BIS_fnc_execFSM|BIS_fnc_execRemote|BIS_fnc_executeStackedEventHandler|BIS_fnc_execVM|BIS_fnc_exportCfgGroups|BIS_fnc_exportCfgHints|BIS_fnc_exportCfgMagazines|BIS_fnc_exportCfgPatches|BIS_fnc_exportCfgVehicles|BIS_fnc_exportCfgWeapons|BIS_fnc_exportCuratorCostTable|BIS_fnc_exportFunctionsToWiki|BIS_fnc_exportGroupFormations|BIS_fnc_exportInventory|BIS_fnc_exportMapToBiTXT|BIS_fnc_fadeEffect|BIS_fnc_fatigueEffect|BIS_fnc_feedbackInit|BIS_fnc_feedbackMain|BIS_fnc_filterString|BIS_fnc_findExtreme|BIS_fnc_findInPairs|BIS_fnc_findNestedElement|BIS_fnc_findOverwatch|BIS_fnc_findSafePos|BIS_fnc_finishCuratorChallenge|BIS_fnc_fixDate|BIS_fnc_flamesEffect|BIS_fnc_flies|BIS_fnc_forceCuratorInterface|BIS_fnc_forceEnd|BIS_fnc_formatCuratorChallengeObjects|BIS_fnc_fps|BIS_fnc_friendlySides|BIS_fnc_FTLmanager|BIS_fnc_functionMeta|BIS_fnc_functionPath|BIS_fnc_functionsDebug|BIS_fnc_GC|BIS_fnc_GCinit|BIS_fnc_genericSentence|BIS_fnc_genericSentenceInit|BIS_fnc_geometricMean|BIS_fnc_getCfgData|BIS_fnc_getCfgDataArray|BIS_fnc_getCfgDataBool|BIS_fnc_getCfgDataObject|BIS_fnc_getCfgDataPool|BIS_fnc_getCfgIsClass|BIS_fnc_getCfgSubClasses|BIS_fnc_getFactions|BIS_fnc_getFromPairs|BIS_fnc_getIDC|BIS_fnc_getIDD|BIS_fnc_getLineDist|BIS_fnc_getParamValue|BIS_fnc_getPitchBank|BIS_fnc_getRespawnInventories|BIS_fnc_getRespawnMarkers|BIS_fnc_getRespawnPositions|BIS_fnc_getServerVariable|BIS_fnc_getTurrets|BIS_fnc_getUnitByUid|BIS_fnc_getUnitInsignia|BIS_fnc_getVirtualBackpackCargo|BIS_fnc_getVirtualItemCargo|BIS_fnc_getVirtualMagazineCargo|BIS_fnc_getVirtualWeaponCargo|BIS_fnc_greatestNum|BIS_fnc_groupIndicator|BIS_fnc_groupVehicles|BIS_fnc_GUIbackground|BIS_fnc_GUIeditor|BIS_fnc_guiEffectTiles|BIS_fnc_GUIgrid|BIS_fnc_GUIgridToProfile|BIS_fnc_GUIhint|BIS_fnc_guiMessage|BIS_fnc_GUInewsfeed|BIS_fnc_halo|BIS_fnc_halt|BIS_fnc_healing|BIS_fnc_healthEffects|BIS_fnc_helicopterCanFly|BIS_fnc_helicopterDamage|BIS_fnc_helicopterGetHitpoints|BIS_fnc_helicopterSeat|BIS_fnc_helicopterSeatMove|BIS_fnc_helicopterType|BIS_fnc_help|BIS_fnc_HUDLimits|BIS_fnc_importImageLinks|BIS_fnc_inAngleSector|BIS_fnc_incapacitatedEffect|BIS_fnc_indicateBleeding|BIS_fnc_infoText|BIS_fnc_initCuratorAttribute|BIS_fnc_initExpo|BIS_fnc_initIntelObject|BIS_fnc_initModules|BIS_fnc_initMultiplayer|BIS_fnc_initParams|BIS_fnc_initPlayable|BIS_fnc_initRespawn|BIS_fnc_initRespawnBackpack|BIS_fnc_initVirtualUnit|BIS_fnc_inString|BIS_fnc_InstructorFigure|BIS_fnc_interpolateWeather|BIS_fnc_inTrigger|BIS_fnc_inv|BIS_fnc_invAdd|BIS_fnc_invCodeToArray|BIS_fnc_invRemove|BIS_fnc_invSlots|BIS_fnc_invSlotsEmpty|BIS_fnc_invSlotType|BIS_fnc_invString|BIS_fnc_isBuildingEnterable|BIS_fnc_isCampaign|BIS_fnc_isCurator|BIS_fnc_isCuratorEditable|BIS_fnc_isDemo|BIS_fnc_isForcedCuratorInterface|BIS_fnc_isInFrontOf|BIS_fnc_isInsideArea|BIS_fnc_isInZoom|BIS_fnc_isLeapYear|BIS_fnc_isLoading|BIS_fnc_isLocalized|BIS_fnc_isPosBlacklisted|BIS_fnc_isUnitVirtual|BIS_fnc_itemType|BIS_fnc_jukebox|BIS_fnc_kbCanSpeak|BIS_fnc_kbCreateDummy|BIS_fnc_kbIsSpeaking|BIS_fnc_kbMenu|BIS_fnc_kbPriority|BIS_fnc_kbSentence|BIS_fnc_kbSkip|BIS_fnc_kbTell|BIS_fnc_kbTellLocal|BIS_fnc_kbTopicConfig|BIS_fnc_keyCode|BIS_fnc_keypointsExport|BIS_fnc_keypointsExportFromKML|BIS_fnc_KMLimport|BIS_fnc_limitSupport|BIS_fnc_linearConversion|BIS_fnc_listCuratorPlayers|BIS_fnc_listPlayers|BIS_fnc_liveFeed|BIS_fnc_liveFeedEffects|BIS_fnc_liveFeedModuleEffects|BIS_fnc_liveFeedModuleInit|BIS_fnc_liveFeedModuleSetSource|BIS_fnc_liveFeedModuleSetTarget|BIS_fnc_liveFeedSetSource|BIS_fnc_liveFeedSetTarget|BIS_fnc_liveFeedTerminate|BIS_fnc_loadClass|BIS_fnc_loadEntry|BIS_fnc_loadFunctions|BIS_fnc_loadInventory|BIS_fnc_localize|BIS_fnc_locationDescription|BIS_fnc_locations|BIS_fnc_locWeaponInfo|BIS_fnc_log|BIS_fnc_logFormat|BIS_fnc_loop|BIS_fnc_lowestNum|BIS_fnc_magnitude|BIS_fnc_magnitudeSqr|BIS_fnc_manageCuratorAddons|BIS_fnc_manageCuratorChallenges|BIS_fnc_mapSize|BIS_fnc_markerCreate|BIS_fnc_markerParams|BIS_fnc_markerPath|BIS_fnc_markerToTrigger|BIS_fnc_markWaypoints|BIS_fnc_maxDiffArray|BIS_fnc_mirrorCuratorSettings|BIS_fnc_miscanim|BIS_fnc_missileLaunchPositionFix|BIS_fnc_missionConversations|BIS_fnc_missionConversationsLocal|BIS_fnc_missionFlow|BIS_fnc_missionHandlers|BIS_fnc_missionRespawnType|BIS_fnc_missionTasks|BIS_fnc_missionTasksLocal|BIS_fnc_missionTimeLeft|BIS_fnc_moduleAI|BIS_fnc_moduleAmmo|BIS_fnc_moduleAnimals|BIS_fnc_moduleArsenal|BIS_fnc_moduleBleedTickets|BIS_fnc_moduleBootcampStage|BIS_fnc_moduleCAS|BIS_fnc_moduleChat|BIS_fnc_moduleCombatGetIn|BIS_fnc_moduleCountdown|BIS_fnc_moduleCoverMap|BIS_fnc_moduleCreateDiaryRecord|BIS_fnc_moduleCreateProjectile|BIS_fnc_moduleCurator|BIS_fnc_moduleCuratorAddAddons|BIS_fnc_moduleCuratorAddCameraArea|BIS_fnc_moduleCuratorAddEditableObjects|BIS_fnc_moduleCuratorAddEditingArea|BIS_fnc_moduleCuratorAddEditingAreaPlayers|BIS_fnc_moduleCuratorAddIcon|BIS_fnc_moduleCuratorAddPoints|BIS_fnc_moduleCuratorSetAttributes|BIS_fnc_moduleCuratorSetCamera|BIS_fnc_moduleCuratorSetCoefs|BIS_fnc_moduleCuratorSetCostsDefault|BIS_fnc_moduleCuratorSetCostsSide|BIS_fnc_moduleCuratorSetCostsVehicleClass|BIS_fnc_moduleCuratorSetEditingAreaType|BIS_fnc_moduleCuratorSetObjectCost|BIS_fnc_moduleDamage|BIS_fnc_moduleDate|BIS_fnc_moduleDiary|BIS_fnc_moduleDoorOpen|BIS_fnc_moduleEffectsBubbles|BIS_fnc_moduleEffectsEmitterCreator|BIS_fnc_moduleEffectsFire|BIS_fnc_moduleEffectsPlankton|BIS_fnc_moduleEffectsShells|BIS_fnc_moduleEffectsSmoke|BIS_fnc_moduleEndMission|BIS_fnc_moduleExecute|BIS_fnc_moduleFDCPClear|BIS_fnc_moduleFDCPIn|BIS_fnc_moduleFDCPOut|BIS_fnc_moduleFDFadeMarker|BIS_fnc_moduleFDSkeetDestruction|BIS_fnc_moduleFDStatsClear|BIS_fnc_moduleFiringDrill|BIS_fnc_moduleFriendlyFire|BIS_fnc_moduleFuel|BIS_fnc_moduleGenericRadio|BIS_fnc_moduleGroupID|BIS_fnc_moduleHandle|BIS_fnc_moduleHealth|BIS_fnc_moduleHint|BIS_fnc_moduleHQ|BIS_fnc_moduleInit|BIS_fnc_moduleLightning|BIS_fnc_moduleMine|BIS_fnc_moduleMissionName|BIS_fnc_moduleMode|BIS_fnc_moduleModules|BIS_fnc_moduleMPTypeDefense|BIS_fnc_moduleMPTypeGameMaster|BIS_fnc_moduleMPTypeSectorControl|BIS_fnc_moduleMPTypeSeize|BIS_fnc_moduleObjective|BIS_fnc_moduleObjectiveFind|BIS_fnc_moduleObjectiveGetIn|BIS_fnc_moduleObjectiveMove|BIS_fnc_moduleObjectiveRaceCP|BIS_fnc_moduleObjectiveRaceFinish|BIS_fnc_moduleObjectiveRaceStart|BIS_fnc_moduleObjectiveSector|BIS_fnc_moduleObjectiveTarget|BIS_fnc_modulePositioning|BIS_fnc_modulePoster|BIS_fnc_modulePostprocess|BIS_fnc_moduleProjectile|BIS_fnc_modulePunishment|BIS_fnc_moduleRadioChannelCreate|BIS_fnc_moduleRank|BIS_fnc_moduleRating|BIS_fnc_moduleRemoteControl|BIS_fnc_moduleRespawnInventory|BIS_fnc_moduleRespawnPosition|BIS_fnc_moduleRespawnTickets|BIS_fnc_moduleRespawnVehicle|BIS_fnc_moduleSaveGame|BIS_fnc_moduleSector|BIS_fnc_moduleSFX|BIS_fnc_moduleShowHide|BIS_fnc_moduleSimulationManager|BIS_fnc_moduleSkill|BIS_fnc_moduleSkiptime|BIS_fnc_moduleSound|BIS_fnc_moduleStrategicMapImage|BIS_fnc_moduleStrategicMapInit|BIS_fnc_moduleStrategicMapMission|BIS_fnc_moduleStrategicMapOpen|BIS_fnc_moduleStrategicMapORBAT|BIS_fnc_moduleTaskCreate|BIS_fnc_moduleTaskSetDescription|BIS_fnc_moduleTaskSetDestination|BIS_fnc_moduleTaskSetState|BIS_fnc_moduleTimeTrial|BIS_fnc_moduleTracers|BIS_fnc_moduleTrident|BIS_fnc_moduleTriggers|BIS_fnc_moduleTTCPClear|BIS_fnc_moduleTTCPIn|BIS_fnc_moduleTTCPOut|BIS_fnc_moduleTTCPTrigger|BIS_fnc_moduleTTCPTriggerBehind|BIS_fnc_moduleTTStatsClear|BIS_fnc_moduleUnits|BIS_fnc_moduleUnlockArea|BIS_fnc_moduleUnlockObject|BIS_fnc_moduleVolume|BIS_fnc_moduleWeather|BIS_fnc_moduleZoneProtection|BIS_fnc_moduleZoneRestriction|BIS_fnc_monthDays|BIS_fnc_moveAction|BIS_fnc_moveIn|BIS_fnc_moveToRespawnPosition|BIS_fnc_MP|BIS_fnc_MPexec|BIS_fnc_music|BIS_fnc_nearestHelipad|BIS_fnc_nearestNum|BIS_fnc_nearestPosition|BIS_fnc_nearestRoad|BIS_fnc_neutralizeUnit|BIS_fnc_noFlyZone|BIS_fnc_noFlyZonesCreate|BIS_fnc_noFlyZonesExport|BIS_fnc_numberDigits|BIS_fnc_numberText|BIS_fnc_objectHeight|BIS_fnc_ObjectsGrabber|BIS_fnc_objectSide|BIS_fnc_ObjectsMapper|BIS_fnc_objectType|BIS_fnc_objectVar|BIS_fnc_onDiaryChanged|BIS_fnc_onEnd|BIS_fnc_onLoad|BIS_fnc_onPlayerConnected|BIS_fnc_ORBATAddGroupOverlay|BIS_fnc_ORBATAnimate|BIS_fnc_ORBATConfigPreview|BIS_fnc_ORBATGetGroupParams|BIS_fnc_ORBATOpen|BIS_fnc_ORBATRemoveGroupOverlay|BIS_fnc_ORBATSetGroupFade|BIS_fnc_ORBATSetGroupParams|BIS_fnc_ORBATTooltip|BIS_fnc_ordinalNumber|BIS_fnc_overviewAuthor|BIS_fnc_overviewDifficulty|BIS_fnc_overviewMission|BIS_fnc_overviewTerrain|BIS_fnc_overviewTimeTrial|BIS_fnc_packStaticWeapon|BIS_fnc_param|BIS_fnc_paramCountdown|BIS_fnc_paramDaytime|BIS_fnc_paramGuerFriendly|BIS_fnc_paramIn|BIS_fnc_paramRespawnTickets|BIS_fnc_paramWeather|BIS_fnc_parseNumber|BIS_fnc_phoneticalWord|BIS_fnc_PIP|BIS_fnc_playEndMusic|BIS_fnc_playerName|BIS_fnc_playerSideFaction|BIS_fnc_playMusic|BIS_fnc_playSound|BIS_fnc_playVideo|BIS_fnc_posDegtoUTM|BIS_fnc_posDegToWorld|BIS_fnc_position|BIS_fnc_PosToGrid|BIS_fnc_posUTMToDeg|BIS_fnc_preload|BIS_fnc_prepareAO|BIS_fnc_progressLoadingScreen|BIS_fnc_quotations|BIS_fnc_radialRed|BIS_fnc_radialRedOut|BIS_fnc_radioSetChannel|BIS_fnc_radioSetPlaylist|BIS_fnc_radioSetTrack|BIS_fnc_randomIndex|BIS_fnc_randomInt|BIS_fnc_randomNum|BIS_fnc_randomPos|BIS_fnc_randomPosTrigger|BIS_fnc_rankParams|BIS_fnc_recompile|BIS_fnc_refreshCommMenu|BIS_fnc_registerCuratorObject|BIS_fnc_relativeDirTo|BIS_fnc_relPos|BIS_fnc_relPosObject|BIS_fnc_relScaledDist|BIS_fnc_removeAllScriptedEventHandlers|BIS_fnc_removeCommMenuItem|BIS_fnc_removeCuratorIcon|BIS_fnc_removeDestroyedCuratorEditableObjects|BIS_fnc_removeFromPairs|BIS_fnc_removeIndex|BIS_fnc_removeNestedElement|BIS_fnc_removeRespawnInventory|BIS_fnc_removeRespawnPosition|BIS_fnc_removeScriptedEventHandler|BIS_fnc_removeStackedEventHandler|BIS_fnc_removeSupportLink|BIS_fnc_removeVirtualBackpackCargo|BIS_fnc_removeVirtualItemCargo|BIS_fnc_removeVirtualMagazineCargo|BIS_fnc_removeVirtualWeaponCargo|BIS_fnc_respawnBase|BIS_fnc_respawnConfirm|BIS_fnc_respawnCounter|BIS_fnc_respawnEndMission|BIS_fnc_respawnGroup|BIS_fnc_respawnInstant|BIS_fnc_RespawnManager|BIS_fnc_respawnMenuInventory|BIS_fnc_respawnMenuPosition|BIS_fnc_respawnMenuSpectator|BIS_fnc_respawnNone|BIS_fnc_respawnRounds|BIS_fnc_respawnSeagull|BIS_fnc_respawnSide|BIS_fnc_respawnSpectator|BIS_fnc_respawnTickets|BIS_fnc_respawnTimePenalty|BIS_fnc_respawnWave|BIS_fnc_respect|BIS_fnc_returnChildren|BIS_fnc_returnConfigEntry|BIS_fnc_returnGroupComposition|BIS_fnc_returnNestedElement|BIS_fnc_returnParents|BIS_fnc_returnVehicleTurrets|BIS_fnc_romanNumeral|BIS_fnc_rotateVector2D|BIS_fnc_roundDir|BIS_fnc_roundNum|BIS_fnc_rscLayer|BIS_fnc_runLater|BIS_fnc_sandstorm|BIS_fnc_saveGame|BIS_fnc_saveInventory|BIS_fnc_sayMessage|BIS_fnc_sceneAreaClearance|BIS_fnc_sceneCheckWeapons|BIS_fnc_sceneCreateSceneTrigger|BIS_fnc_sceneCreateSoundEntities|BIS_fnc_sceneGetObjects|BIS_fnc_sceneGetParticipants|BIS_fnc_sceneGetPositionByAngle|BIS_fnc_sceneIntruderDetector|BIS_fnc_sceneMiscStuff|BIS_fnc_sceneRotate|BIS_fnc_sceneSetAnimationsForGroup|BIS_fnc_sceneSetBehaviour|BIS_fnc_sceneSetObjects|BIS_fnc_sceneSetPosFormation|BIS_fnc_scriptedMove|BIS_fnc_scriptedWaypointType|BIS_fnc_secondsToString|BIS_fnc_selectCrew|BIS_fnc_selectDiarySubject|BIS_fnc_selectRandom|BIS_fnc_selectRandomWeighted|BIS_fnc_selectRespawnTemplate|BIS_fnc_setCuratorAttributes|BIS_fnc_setCuratorCamera|BIS_fnc_setCuratorVisionModes|BIS_fnc_setDate|BIS_fnc_setFog|BIS_fnc_setHeight|BIS_fnc_setIDCStreamFriendly|BIS_fnc_setMissionStatusSlot|BIS_fnc_setNestedElement|BIS_fnc_setObjectTexture|BIS_fnc_setOvercast|BIS_fnc_setPitchBank|BIS_fnc_setPPeffectTemplate|BIS_fnc_setRank|BIS_fnc_setRespawnDelay|BIS_fnc_setRespawnInventory|BIS_fnc_setServerVariable|BIS_fnc_setTask|BIS_fnc_setTaskLocal|BIS_fnc_setToPairs|BIS_fnc_setUnitInsignia|BIS_fnc_shakeCuratorCamera|BIS_fnc_shakeGauges|BIS_fnc_showCuratorAttributes|BIS_fnc_showCuratorFeedbackMessage|BIS_fnc_showMarkers|BIS_fnc_showMissionStatus|BIS_fnc_showNotification|BIS_fnc_showRespawnMenu|BIS_fnc_showTime|BIS_fnc_showUnitInfo|BIS_fnc_shutdown|BIS_fnc_sideColor|BIS_fnc_sideID|BIS_fnc_sideName|BIS_fnc_sideType|BIS_fnc_singleMissionConfig|BIS_fnc_singleMissionKeys|BIS_fnc_singleMissionName|BIS_fnc_skirmishTrigger|BIS_fnc_sortAlphabetically|BIS_fnc_objectsGrabber|BIS_fnc_sortBy|BIS_fnc_sortNum|BIS_fnc_spawn|BIS_fnc_spawnCrew|BIS_fnc_spawnEnemy|BIS_fnc_spawnGroup|BIS_fnc_spawnObjects|BIS_fnc_spawnVehicle|BIS_fnc_splitString|BIS_fnc_spotter|BIS_fnc_startLoadingScreen|BIS_fnc_StrategicMapAnimate|BIS_fnc_StrategicMapMouseButtonClick|BIS_fnc_StrategicMapOpen|BIS_fnc_subClasses|BIS_fnc_subSelect|BIS_fnc_supplydrop|BIS_fnc_supplydropService|BIS_fnc_swapVars|BIS_fnc_target|BIS_fnc_taskAttack|BIS_fnc_taskChildren|BIS_fnc_taskCompleted|BIS_fnc_taskCreate|BIS_fnc_taskCurrent|BIS_fnc_taskDefend|BIS_fnc_taskDescription|BIS_fnc_taskDestination|BIS_fnc_taskExists|BIS_fnc_taskHandler|BIS_fnc_taskHint|BIS_fnc_taskParent|BIS_fnc_taskPatrol|BIS_fnc_taskReal|BIS_fnc_taskSetCurrent|BIS_fnc_taskSetDescription|BIS_fnc_taskSetDestination|BIS_fnc_taskSetState|BIS_fnc_taskState|BIS_fnc_tasksUnit|BIS_fnc_taskVar|BIS_fnc_teamColor|BIS_fnc_terrainGradAngle|BIS_fnc_textTiles|BIS_fnc_textureMarker|BIS_fnc_textureVehicleIcon|BIS_fnc_threat|BIS_fnc_timeToString|BIS_fnc_titlecard|BIS_fnc_titleText|BIS_fnc_toggleCuratorVisionMode|BIS_fnc_toUpperDisplayTexts|BIS_fnc_traceBullets|BIS_fnc_trackMissionTime|BIS_fnc_transportService|BIS_fnc_tridentClient|BIS_fnc_tridentExecute|BIS_fnc_tridentGetRelationship|BIS_fnc_tridentHandleDamage|BIS_fnc_tridentSetRelationship|BIS_fnc_triggerToMarker|BIS_fnc_trimString|BIS_fnc_typeText|BIS_fnc_typeText2|BIS_fnc_uniqueClasses|BIS_fnc_unitAddon|BIS_fnc_UnitCapture|BIS_fnc_UnitCaptureFiring|BIS_fnc_UnitCaptureSimple|BIS_fnc_UnitPlay|BIS_fnc_UnitPlayFiring|BIS_fnc_UnitPlaySimple|BIS_fnc_unitVector|BIS_fnc_unpackStaticWeapon|BIS_fnc_updatePlayerArray|BIS_fnc_validateParametersOO|BIS_fnc_variableSpaceAdd|BIS_fnc_variableSpaceRemove|BIS_fnc_vectorAdd|BIS_fnc_vectorDiff|BIS_fnc_vectorFromXToY|BIS_fnc_vectorMultiply|BIS_fnc_vehicleRoles|BIS_fnc_version|BIS_fnc_VRCourseBallistics1|BIS_fnc_VRCourseBallistics2|BIS_fnc_VRCourseBallistics3|BIS_fnc_VRCourseBallistics4|BIS_fnc_VRCourseCommandingActions1|BIS_fnc_VRCourseCommandingActions2|BIS_fnc_VRCourseCommandingActions3|BIS_fnc_VRCourseCommandingBehaviour1|BIS_fnc_VRCourseCommandingBehaviour2|BIS_fnc_VRCourseCommandingBehaviour3|BIS_fnc_VRCourseCommandingMovement1|BIS_fnc_VRCourseCommandingMovement2|BIS_fnc_VRCourseCommandingVehicles1|BIS_fnc_VRCourseCommandingVehicles2|BIS_fnc_VRCourseCommandingVehicles3|BIS_fnc_VRCourseLaunchers1|BIS_fnc_VRCourseLaunchers2|BIS_fnc_VRCourseLaunchers3|BIS_fnc_VRCoursePlaceables1|BIS_fnc_VRCoursePlaceables2|BIS_fnc_VRCoursePlaceables3|BIS_fnc_VRCourseTargetDesignation1|BIS_fnc_VRCourseTargetDesignation2|BIS_fnc_VRCourseTargetDesignation3|BIS_fnc_VRDrawBorder|BIS_fnc_VRDrawGrid|BIS_fnc_VREffectKilled|BIS_fnc_VRFadeIn|BIS_fnc_VRFadeOut|BIS_fnc_VRSpawnEffect|BIS_fnc_VRSpawnSelector|BIS_fnc_VRTimer|BIS_fnc_weaponAddon|BIS_fnc_weaponComponents|BIS_fnc_worldArea|BIS_fnc_wpArtillery|BIS_fnc_wpLand|BIS_fnc_wpPatrol|BIS_fnc_wpRelax|BIS_fnc_wpSuppress|BIS_fnc_zzRotate)\\b", - "name": "entity.name.function.sqf" - }, "vObject-statements": { "match": "\\s*(?i)(player|cursorTarget)\\b", "name": "variable.language.vobject.sqf" }, - "ab-key-statements": { - "match": "\\s*(?i)(abs|accTime|acos|action|actionKeys|actionKeysImages|actionKeysNames|actionKeysNamesArray|actionName|activateAddons|activatedAddons|activateKey|addAction|addBackpack|addBackpackCargo|addBackpackCargoGlobal|addBackpackGlobal|addCamShake|addCuratorAddons|addCuratorCameraArea|addCuratorEditableObjects|addCuratorEditingArea|addCuratorPoints|addEditorObject|addEventHandler|addGoggles|addGroupIcon|addHandgunItem|addHeadgear|addItem|addItemCargo|addItemCargoGlobal|addItemPool|addItemToBackpack|addItemToUniform|addItemToVest|addLiveStats|addMagazine|addMagazine|addMagazineAmmoCargo|addMagazineCargo|addMagazineCargoGlobal|addMagazineGlobal|addMagazinePool|addMagazines|addMagazineTurret|addMenu|addMenuItem|addMissionEventHandler|addMPEventHandler|addMusicEventHandler|addPrimaryWeaponItem|addPublicVariableEventHandler|addRating|addResources|addScore|addScoreSide|addSecondaryWeaponItem|addSwitchableUnit|addTeamMember|addToRemainsCollector|addUniform|addVehicle|addVest|addWaypoint|addWeapon|addWeaponCargo|addWeaponCargoGlobal|addWeaponGlobal|addWeaponPool|addWeaponTurret|agent|agents|AGLToASL|aimedAtTarget|aimPos|airDensityRTD|airportSide|AISFinishHeal|alive|allControls|allCurators|allDead|allDeadMen|allDisplays|allGroups|allMapMarkers|allMines|allMissionObjects|allow3DMode|allowCrewInImmobile|allowCuratorLogicIgnoreAreas|allowDamage|allowDammage|allowFileOperations|allowFleeing|allowGetIn|allowSprint|allSites|allTurrets|allUnits|allUnitsUAV|allVariables|ammo|animate|animateDoor|animationPhase|animationState|append|armoryPoints|asin|ASLToAGL|ASLToATL|assert|assignAsCargo|assignAsCargoIndex|assignAsCommander|assignAsDriver|assignAsGunner|assignAsTurret|assignCurator|assignedCargo|assignedCommander|assignedDriver|assignedGunner|assignedItems|assignedTarget|assignedTeam|assignedVehicle|assignedVehicleRole|assignItem|assignTeam|assignToAirport|atan|atan2|atg|ATLToASL|attachedObject|attachedObjects|attachedTo|attachObject|attachTo|attackEnabled|backpack|backpackCargo|backpackContainer|backpackItems|backpackMagazines|backpackSpaceFor|behaviour|benchmark|binocular|blufor|boundingBox|boundingBoxReal|boundingCenter|breakOut|breakTo|briefingName|buildingExit|buildingPos|buttonAction|buttonSetAction)\\b", - "name": "entity.name.function.sqf" - }, - "c-key-statements": { - "match": "\\s*(?i)(cadetMode|camCommand|camCommit|camCommitPrepared|camCommitted|camConstuctionSetParams|camCreate|camDestroy|cameraEffect|cameraEffectEnableHUD|cameraInterest|cameraOn|cameraView|campaignConfigFile|camPreload|camPreloaded|camPrepareBank|camPrepareDir|camPrepareDive|camPrepareFocus|camPrepareFov|camPrepareFovRange|camPreparePos|camPrepareRelPos|camPrepareTarget|camSetBank|camSetDir|camSetDive|camSetFocus|camSetFov|camSetFovRange|camSetPos|camSetRelPos|camSetTarget|camTarget|camUseNVG|canAdd|canAddItemToBackpack|canAddItemToUniform|canAddItemToVest|cancelSimpleTaskDestination|canFire|canMove|canSlingLoad|canStand|canUnloadInCombat|captive|captiveNum|case|catch|cbChecked|cbSetChecked|ceil|cheatsEnabled|checkAIFeature|civilian|className|clearAllItemsFromBackpack|clearBackpackCargo|clearBackpackCargoGlobal|clearGroupIcons|clearItemCargo|clearItemCargoGlobal|clearItemPool|clearMagazineCargo|clearMagazineCargoGlobal|clearMagazinePool|clearOverlay|clearRadio|clearWeaponCargo|clearWeaponCargoGlobal|clearWeaponPool|closeDialog|closeDisplay|closeOverlay|collapseObjectTree|combatMode|commandArtilleryFire|commandChat|commander|commandFire|commandFollow|commandFSM|commandGetOut|commandingMenu|commandMove|commandRadio|commandStop|commandTarget|commandWatch|comment|commitOverlay|completedFSM|composeText|configClasses|configFile|configName|configProperties|configSourceMod|configSourceModList|connectTerminalToUAV|controlNull|controlsGroupCtrl|copyFromClipboard|copyToClipboard|copyWaypoints|cos|count|countEnemy|countFriendly|countSide|countType|countUnknown|createAgent|createCenter|createDialog|createDiaryLink|createDiaryRecord|createDiarySubject|createDisplay|createGearDialog|createGroup|createGuardedPoint|createLocation|createMarker|createMarkerLocal|createMenu|createMine|createMissionDisplay|createSimpleTask|createSite|createSoundSource|createTask|createTeam|createTrigger|createUnit|createUnit|array|createVehicle|createVehicle|array|createVehicleCrew|createVehicleLocal|crew|ctrlActivate|ctrlAddEventHandler|ctrlAutoScrollDelay|ctrlAutoScrollRewind|ctrlAutoScrollSpeed|ctrlChecked|ctrlClassName|ctrlCommit|ctrlCommitted|ctrlCreate|ctrlDelete|ctrlEnable|ctrlEnabled|ctrlFade|ctrlHTMLLoaded|ctrlIDC|ctrlIDD|ctrlMapAnimAdd|ctrlMapAnimClear|ctrlMapAnimCommit|ctrlMapAnimDone|ctrlMapCursor|ctrlMapMouseOver|ctrlMapScale|ctrlMapScreenToWorld|ctrlMapWorldToScreen|ctrlModel|ctrlModelDirAndUp|ctrlModelScale|ctrlParent|ctrlPosition|ctrlRemoveAllEventHandlers|ctrlRemoveEventHandler|ctrlScale|ctrlSetActiveColor|ctrlSetAutoScrollDelay|ctrlSetAutoScrollRewind|ctrlSetAutoScrollSpeed|ctrlSetBackgroundColor|ctrlSetChecked|ctrlSetEventHandler|ctrlSetFade|ctrlSetFocus|ctrlSetFont|ctrlSetFontH1|ctrlSetFontH1B|ctrlSetFontH2|ctrlSetFontH2B|ctrlSetFontH3|ctrlSetFontH3B|ctrlSetFontH4|ctrlSetFontH4B|ctrlSetFontH5|ctrlSetFontH5B|ctrlSetFontH6|ctrlSetFontH6B|ctrlSetFontHeight|ctrlSetFontHeightH1|ctrlSetFontHeightH2|ctrlSetFontHeightH3|ctrlSetFontHeightH4|ctrlSetFontHeightH5|ctrlSetFontHeightH6|ctrlSetFontP|ctrlSetFontPB|ctrlSetForegroundColor|ctrlSetModel|ctrlSetModelDirAndUp|ctrlSetModelScale|ctrlSetPosition|ctrlSetScale|ctrlSetStructuredText|ctrlSetText|ctrlSetTextColor|ctrlSetTooltip|ctrlSetTooltipColorBox|ctrlSetTooltipColorShade|ctrlSetTooltipColorText|ctrlShow|ctrlShown|ctrlText|ctrlTextHeight|ctrlType|ctrlVisible|curatorAddons|curatorCamera|curatorCameraArea|curatorCameraAreaCeiling|curatorCoef|curatorEditableObjects|curatorEditingArea|curatorEditingAreaType|curatorMouseOver|curatorPoints|curatorRegisteredObjects|curatorSelected|curatorWaypointCost|currentCommand|currentMagazine|currentMagazineDetail|currentMagazineDetailTurret|currentMagazineTurret|currentMuzzle|currentTask|currentTasks|currentVisionMode|currentWaypoint|currentWeapon|currentWeaponMode|currentWeaponTurret|currentZeroing|customChat|customRadio|cutFadeOut|cutObj|cutRsc|cutText)\\b", - "name": "entity.name.function.sqf" - }, - "defg-key-statements": { - "match": "\\s*(?i)(damage|date|dateToNumber|daytime|deActivateKey|debriefingText|debugFSM|debugLog|default|deg|deleteAt|deleteCenter|deleteCollection|deleteEditorObject|deleteGroup|deleteIdentity|deleteLocation|deleteMarker|deleteMarkerLocal|deleteRange|deleteResources|deleteSite|deleteStatus|deleteTeam|deleteVehicle|deleteVehicleCrew|deleteWaypoint|detach|detectedMines|diag|activeSQFScripts|diag|captureFrame|diag|captureSlowFrame|diag|fps|diag|fpsmin|diag|frameno|diag|log|diag|logSlowFrame|diag|tickTime|dialog|diarySubjectExists|didJIP|didJIPOwner|difficulty|difficultyEnabled|difficultyEnabledRTD|direction|directSay|disableAI|disableCollisionWith|disableConversation|disableDebriefingStats|disableSerialization|disableTIEquipment|disableUAVConnectability|disableUserInput|displayAddEventHandler|displayCtrl|displayNull|displayRemoveAllEventHandlers|displayRemoveEventHandler|displaySetEventHandler|dissolveTeam|distance|distance2D|distanceSqr|distributionRegion|doArtilleryFire|doFire|doFollow|doFSM|doGetOut|doMove|doorPhase|doStop|doTarget|doWatch|drawArrow|drawEllipse|drawIcon|drawIcon3D|drawLine|drawLine3D|drawLink|drawLocation|drawRectangle|driver|drop|east|echo|editObject|editorSetEventHandler|effectiveCommander|emptyPositions|enableAI|enableAIFeature|enableAttack|enableCamShake|enableCaustics|enableCollisionWith|enableCopilot|enableDebriefingStats|enableDiagLegend|enableEndDialog|enableEngineArtillery|enableEnvironment|enableFatigue|enableGunLights|enableIRLasers|enableMimics|enablePersonTurret|enableRadio|enableReload|enableRopeAttach|enableSatNormalOnDetail|enableSaving|enableSentences|enableSimulation|enableSimulationGlobal|enableStamina|enableTeamSwitch|enableUAVConnectability|enableUAVWaypoints|endLoadingScreen|endMission|engineOn|enginesIsOnRTD|enginesRpmRTD|enginesTorqueRTD|entities|estimatedEndServerTime|estimatedTimeLeft|evalObjectArgument|everyBackpack|everyContainer|execEditorScript|exp|expectedDestination|eyeDirection|eyePos|face|faction|fadeMusic|fadeRadio|fadeSound|fadeSpeech|failMission|fillWeaponsFromPool|find|findCover|findDisplay|findEditorObject|findEmptyPosition|findEmptyPositionReady|findNearestEnemy|finishMissionInit|finite|fire|fireAtTarget|firstBackpack|flag|flagOwner|flagSide|flagTexture|fleeing|floor|flyInHeight|fog|fogForecast|fogParams|forceAddUniform|forceEnd|forceMap|forceRespawn|forceSpeed|forceWalk|forceWeaponFire|forceWeatherChange|forEachMember|forEachMemberAgent|forEachMemberTeam|format|formation|formationDirection|formationLeader|formationMembers|formationPosition|formationTask|formatText|formLeader|freeLook|fromEditor|fuel|fullCrew|gearSlotAmmoCount|gearSlotData|getAllHitPointsDamage|getAmmoCargo|getAnimAimPrecision|getAnimSpeedCoef|getArray|getArtilleryAmmo|getArtilleryComputerSettings|getArtilleryETA|getAssignedCuratorLogic|getAssignedCuratorUnit|getBackpackCargo|getBleedingRemaining|getBurningValue|getCargoIndex|getCenterOfMass|getClientState|getConnectedUAV|getDammage|getDescription|getDir|getDirVisual|getDLCs|getEditorCamera|getEditorMode|getEditorObjectScope|getElevationOffset|getFatigue|getFriend|getFSMVariable|getFuelCargo|getGroupIcon|getGroupIconParams|getGroupIcons|getHideFrom|getHit|getHitIndex|getHitPointDamage|getItemCargo|getMagazineCargo|getMarkerColor|getMarkerPos|getMarkerSize|getMarkerType|getMass|getModelInfo|getNumber|getObjectArgument|getObjectChildren|getObjectDLC|getObjectMaterials|getObjectProxy|getObjectTextures|getObjectType|getOxygenRemaining|getPersonUsedDLCs|getPlayerUID|getPos|getPosASL|getPosASLVisual|getPosASLW|getPosATL|getPosATLVisual|getPosVisual|getPosWorld|getRepairCargo|getResolution|getShadowDistance|getSlingLoad|getSpeed|getStamina|getSuppression|getTerrainHeightASL|getText|getVariable|getWeaponCargo|getWPPos|glanceAt|globalChat|globalRadio|goggles|goto|group|groupChat|groupFromNetId|groupIconSelectable|groupIconsVisible|groupId|groupOwner|groupRadio|groupSelectedUnits|groupSelectUnit|grpNull|gunner|gusts)\\b", - "name": "entity.name.function.sqf" - }, - "hijklmn-key-statements": { - "match": "\\s*(?i)(halt|handgunItems|handgunMagazine|handgunWeapon|handsHit|hasInterface|hasWeapon|hcAllGroups|hcGroupParams|hcLeader|hcRemoveAllGroups|hcRemoveGroup|hcSelected|hcSelectGroup|hcSetGroup|hcShowBar|hcShownBar|headgear|hideBody|hideObject|hideObjectGlobal|hint|hintC|hintCadet|hintSilent|hmd|hostMission|htmlLoad|HUDMovementLevels|humidity|image|importAllGroups|importance|in|incapacitatedState|independent|inflame|inflamed|inGameUISetEventHandler|inheritsFrom|initAmbientLife|inputAction|inRangeOfArtillery|insertEditorObject|intersect|isAbleToBreathe|isAgent|isArray|isAutoHoverOn|isAutonomous|isAutotest|isBleeding|isBurning|isClass|isCollisionLightOn|isCopilotEnabled|isDedicated|isDLCAvailable|isEngineOn|isEqualTo|isFlashlightOn|isFlatEmpty|isForcedWalk|isFormationLeader|isHidden|isInRemainsCollector|isInstructorFigureEnabled|isIRLaserOn|isKeyActive|isKindOf|isLightOn|isLocalized|isManualFire|isMarkedForCollection|isMultiplayer|isNil|isNull|isNumber|isObjectRTD|isOnRoad|isPipEnabled|isPlayer|isRealTime|isServer|isShowing3DIcons|isStaminaEnabled|isEqualType|isEqualTypeAll|isEqualTypeAny|isEqualTypeArray|isEqualTypeParams|isSprintAllowed|isSteamMission|isStreamFriendlyUIEnabled|isText|isTouchingGround|isTutHintsEnabled|isUAVConnectable|isUAVConnected|isUniformAllowed|isWalking|isWeaponDeployed|isWeaponRested|itemCargo|items|itemsWithMagazines|join|joinAs|joinAsSilent|joinSilent|kbAddDatabase|kbAddDatabaseTargets|kbAddTopic|kbHasTopic|kbReact|kbRemoveTopic|kbTell|kbWasSaid|keyImage|keyName|knowsAbout|land|landAt|landResult|language|laserTarget|lbAdd|lbClear|lbColor|lbCurSel|lbData|lbDelete|lbIsSelected|lbPicture|lbSelection|lbSetColor|lbSetCurSel|lbSetData|lbSetPicture|lbSetPictureColor|lbSetPictureColorDisabled|lbSetPictureColorSelected|lbSetSelected|lbSetTooltip|lbSetValue|lbSize|lbSort|lbSortByValue|lbText|lbValue|leader|leaderboardDeInit|leaderboardGetRows|leaderboardInit|leaveVehicle|libraryCredits|libraryDisclaimers|lifeState|lightAttachObject|lightDetachObject|lightIsOn|lightnings|limitSpeed|linearConversion|lineBreak|lineIntersects|lineIntersectsObjs|lineIntersectsSurfaces|lineIntersectsWith|linkItem|list|listObjects|ln|lnbAddArray|lnbAddColumn|lnbAddRow|lnbClear|lnbColor|lnbCurSelRow|lnbData|lnbDeleteColumn|lnbDeleteRow|lnbGetColumnsPosition|lnbPicture|lnbSetColor|lnbSetColumnsPos|lnbSetCurSelRow|lnbSetData|lnbSetPicture|lnbSetText|lnbSetValue|lnbSize|lnbText|lnbValue|load|loadAbs|loadBackpack|loadFile|loadGame|loadIdentity|loadMagazine|loadOverlay|loadStatus|loadUniform|loadVest|local|localize|locationNull|locationPosition|lock|lockCameraTo|lockCargo|lockDriver|locked|lockedCargo|lockedDriver|lockedTurret|lockTurret|lockWP|log|logEntities|lookAt|lookAtPos|magazineCargo|magazines|magazinesAmmo|magazinesAmmoCargo|magazinesAmmoFull|magazinesDetail|magazinesDetailBackpack|magazinesDetailUniform|magazinesDetailVest|magazinesTurret|magazineTurretAmmo|mapAnimAdd|mapAnimClear|mapAnimCommit|mapAnimDone|mapCenterOnCamera|mapGridPosition|markAsFinishedOnSteam|markerAlpha|markerBrush|markerColor|markerDir|markerPos|markerShape|markerSize|markerText|markerType|max|members|min|mineActive|mineDetectedBy|missionConfigFile|missionName|missionNamespace|missionStart|mod|modelToWorld|modelToWorldVisual|moonIntensity|morale|move|moveInAny|moveInCargo|moveInCommander|moveInDriver|moveInGunner|moveInTurret|moveObjectToEnd|moveOut|moveTime|moveTo|moveToCompleted|moveToFailed|musicVolume|name|nameSound|nearEntities|nearestTerrainObjects|nearestBuilding|nearestLocation|nearestLocations|nearestLocationWithDubbing|nearestObject|nearestObjects|nearObjects|nearObjectsReady|nearRoads|nearSupplies|nearTargets|needReload|netId|netObjNull|newOverlay|nextMenuItemIndex|nextWeatherChange|nil|nMenuItems|not|numberToDate)\\b", + "OFP": { + "match": "\\s*(?i)(abs|accTime|acos|action|addMagazine|addMagazineCargo|addRating|addScore|addWeapon|addWeaponCargo|alive|allowDammage|allowFleeing|allowGetIn|ammo|and|asin|assignAsCargo|assignAsCommander|assignAsDriver|assignAsGunner|atan|atan2|atg|behaviour|benchmark|buildingPos|cadetMode|camCommand|camCommit|camCommitted|camCreate|camDestroy|cameraEffect|camSetBank|camSetDir|camSetDive|camSetFov|camSetFovRange|camSetPos|camSetRelPos|camSetTarget|canFire|canMove|canStand|captive|clearMagazineCargo|clearWeaponCargo|combatMode|commander|commandFire|commandFollow|commandMove|commandStop|commandTarget|commandWatch|cos|count|countEnemy|countFriendly|countSide|countType|countUnknown|crew|cutObj|cutRsc|cutText|daytime|debugLog|deg|direction|disableAI|disableUserInput|distance|doFire|doFollow|doMove|doStop|doTarget|doWatch|driver|enableEndDialog|enableRadio|exp|fadeMusic|fadeSound|false|fire|flag|flagOwner|fleeing|flyInHeight|forceEnd|format|formation|formLeader|fuel|getDammage|getDir|getMarkerPos|getPos|globalChat|globalRadio|goto|group|groupChat|groupRadio|gunner|handsHit|hasWeapon|hint|hintC|hintCadet|in|inflame|isNull|knowsAbout|land|leader|list|ln|local|localize|lock|locked|lockWP|log|mod|move|moveInCargo|moveInCommander|moveInDriver|moveInGunner|musicVolume|name|nearestBuilding|nearestObject|objStatus|or|orderGetIn|pi|playMove|playMusic|playSound|plus|rad|random|rating|removeAllWeapons|removeMagazine|removeMagazines|removeWeapon|reveal|saveGame|saveVar|score|select|setAccTime|setAmmoCargo|setBehaviour|setCaptive|setCombatMode|setDammage|setDir|setFace|setFaceAnimation|setFlagOwner|setFlagSide|setFlagTexture|setFog|setFormation|setFormDir|setFuel|setFuelCargo|setGroupId|setIdentity|setMarkerPos|setMarkerType|setMimic|setOvercast|setPos|setRadioMsg|setRepairCargo|setSpeedMode|setUnitPos|setViewDistance|showCinemaBorder|showCompass|showGPS|showMap|shownCompass|shownGPS|shownMap|shownPad|shownRadio|shownWarrant|shownWatch|showPad|showRadio|showWarrant|showWatch|side|sideRadio|sin|skipTime|someAmmo|soundVolume|speed|speedMode|sqrt|stop|stopped|switchCamera|switchLight|switchMove|tan|textLog|tg|time|titleCut|titleObj|titleRsc|titleText|true|unassignVehicle|unitReady|units|vehicle|vehicleRadio|addMagazinePool|addWeaponPool|animate|animationPhase|cheatsEnabled|clearMagazinePool|clearWeaponPool|deleteIdentity|deleteStatus|fillWeaponsFromPool|loadIdentity|loadStatus|magazines|object|onBriefingGear|onBriefingGroup|onBriefingNotes|onBriefingPlan|pickWeaponPool|primaryWeapon|putWeaponPool|queryMagazinePool|queryWeaponPool|resize|saveIdentity|saveStatus|say|secondaryWeapon|set|setObjectTexture|setRain|setSkill|setTerrainGrid|skill|weapons|inflamed|lightIsOn|addAction|removeAction|getMarkerColor|getMarkerSize|getMarkerType|getWPPos|requiredVersion|setMarkerColor|setMarkerSize|setWPPos|forceMap|mapAnimAdd|mapAnimClear|mapAnimCommit|mapAnimDone|selectWeapon|scudState|createUnit|createVehicle|deleteVehicle|estimatedTimeLeft|join|publicVariable|sideChat|vehicleChat|buttonAction|buttonSetAction|closeDialog|createDialog|ctrlEnable|ctrlEnabled|ctrlSetText|ctrlShow|ctrlText|ctrlVisible|damage|drop|lbAdd|lbClear|lbColor|lbCurSel|lbData|lbDelete|lbPicture|lbSetColor|lbSetCurSel|lbSetData|lbSetPicture|lbSetValue|lbSize|lbText|lbValue|markerColor|markerPos|markerSize|markerType|position|setDamage|waypointPosition|getWorld|dialog|enemy|friendly|sideEnemy|sideFriendly|missionName|missionStart|playersNumber|setVelocity|velocity|addEventHandler|comment|onMapSingleClick|preprocessFile|removeAllEventHandlers|removeEventHandler|sliderPosition|sliderRange|sliderSetPosition|sliderSetRange|sliderSetSpeed|sliderSpeed|engineOn|isEngineOn|loadFile|sideLogic|typeOf)\\b", "name": "entity.name.function.sqf" }, - "opqr-key-statements": { - "match": "\\s*(?i)(objectCurators|objectFromNetId|objectParent|objNull|objStatus|onBriefingGroup|onBriefingNotes|onBriefingPlan|onBriefingTeamSwitch|onCommandModeChanged|onDoubleClick|onEachFrame|onGroupIconClick|onGroupIconOverEnter|onGroupIconOverLeave|onHCGroupSelectionChanged|onMapSingleClick|onPlayerConnected|onPlayerDisconnected|onPreloadFinished|onPreloadStarted|onShowNewObject|onTeamSwitch|openCuratorInterface|openMap|openYoutubeVideo|opfor|orderGetIn|overcast|overcastForecast|owner|parseNumber|parseText|parsingNamespace|particlesQuality|pi|pickWeaponPool|pitch|playableSlotsNumber|playableUnits|playAction|playActionNow|playerRespawnTime|playerSide|playersNumber|playGesture|playMission|playMove|playMoveNow|playMusic|playScriptedMission|playSound|playSound3D|position|positionCameraToWorld|posScreenToWorld|posWorldToScreen|ppEffectAdjust|ppEffectCommit|ppEffectCommitted|ppEffectCreate|ppEffectDestroy|ppEffectEnable|ppEffectForceInNVG|precision|preloadCamera|preloadObject|preloadSound|preloadTitleObj|preloadTitleRsc|preprocessFile|preprocessFileLineNumbers|primaryWeapon|primaryWeaponItems|primaryWeaponMagazine|priority|private|processDiaryLink|productVersion|profileName|profileNamespace|progressLoadingScreen|progressPosition|progressSetPosition|publicVariable|publicVariableClient|publicVariableServer|pushBack|putWeaponPool|queryItemsPool|queryMagazinePool|queryWeaponPool|rad|radioChannelAdd|radioChannelCreate|radioChannelRemove|radioChannelSetCallSign|radioChannelSetLabel|radioVolume|rain|rainbow|random|rank|rankId|rating|rectangular|registeredTasks|registerTask|reload|reloadEnabled|remoteControl|remoteExec|remoteExecCall|removeAction|removeAllActions|removeAllAssignedItems|removeAllContainers|removeAllCuratorAddons|removeAllCuratorCameraAreas|removeAllCuratorEditingAreas|removeAllEventHandlers|removeAllHandgunItems|removeAllItems|removeAllItemsWithMagazines|removeAllMissionEventHandlers|removeAllMPEventHandlers|removeAllMusicEventHandlers|removeAllPrimaryWeaponItems|removeAllWeapons|removeBackpack|removeBackpackGlobal|removeCuratorAddons|removeCuratorCameraArea|removeCuratorEditableObjects|removeCuratorEditingArea|removeDrawIcon|removeDrawLinks|removeEventHandler|removeFromRemainsCollector|removeGoggles|removeGroupIcon|removeHandgunItem|removeHeadgear|removeItem|removeItemFromBackpack|removeItemFromUniform|removeItemFromVest|removeItems|removeMagazine|removeMagazineGlobal|removeMagazines|removeMagazinesTurret|removeMagazineTurret|removeMenuItem|removeMissionEventHandler|removeMPEventHandler|removeMusicEventHandler|removePrimaryWeaponItem|removeSecondaryWeaponItem|removeSimpleTask|removeSwitchableUnit|removeTeamMember|removeUniform|removeVest|removeWeapon|removeWeaponGlobal|removeWeaponTurret|requiredVersion|resetCamShake|resetSubgroupDirection|resistance|resize|resources|respawnVehicle|restartEditorCamera|reveal|revealMine|reverse|reversedMouseY|roadsConnectedTo|ropeAttachedObjects|ropeAttachedTo|ropeAttachEnabled|ropeAttachTo|ropeCreate|ropeCut|ropeEndPosition|ropeLength|ropes|ropeUnwind|ropeUnwound|rotorsForcesRTD|rotorsRpmRTD|round|runInitScript)\\b", + "TOH": { + "match": "\\s*(?i)(batteryChargeRTD|BIS_fnc_ambientBlacklist|BIS_fnc_ambientBlacklistAdd|BIS_fnc_ambientBoats|BIS_fnc_ambientHelicopters|BIS_fnc_ambientPlanes|BIS_fnc_ambientPostprocess|BIS_fnc_animType|BIS_fnc_assignPlayerRole|BIS_fnc_camFollow|BIS_fnc_convertUnits|BIS_fnc_counter|BIS_fnc_credits|BIS_fnc_ctrlTextHeight|BIS_fnc_dbClassCheck|BIS_fnc_dbClassId|BIS_fnc_dbClassIndex|BIS_fnc_dbClassList|BIS_fnc_dbClassRemove|BIS_fnc_dbClassReturn|BIS_fnc_dbClassSet|BIS_fnc_dbConfigPath|BIS_fnc_dbImportConfig|BIS_fnc_dbImportXML|BIS_fnc_dbisClass|BIS_fnc_dbisValue|BIS_fnc_dbPrint|BIS_fnc_dbSymbolClass|BIS_fnc_dbSymbolValue|BIS_fnc_dbValueCheck|BIS_fnc_dbValueId|BIS_fnc_dbValueIndex|BIS_fnc_dbValueList|BIS_fnc_dbValueRemove|BIS_fnc_dbValueReturn|BIS_fnc_dbValueSet|BIS_fnc_diaryHints|BIS_fnc_diaryMaps|BIS_fnc_displayClouds|BIS_fnc_displayColorGet|BIS_fnc_displayColorSet|BIS_fnc_displayControls|BIS_fnc_displayLoading|BIS_fnc_displayMission|BIS_fnc_displayName|BIS_fnc_displayResize|BIS_fnc_errorMsg|BIS_fnc_functionPath|BIS_fnc_functionsDebug|BIS_fnc_GC|BIS_fnc_GCinit|BIS_fnc_genericSentence|BIS_fnc_genericSentenceInit|BIS_fnc_getIDC|BIS_fnc_getIDD|BIS_fnc_GUIbackground|BIS_fnc_GUIeditor|BIS_fnc_GUIgrid|BIS_fnc_GUIgridToProfile|BIS_fnc_GUIhint|BIS_fnc_guiMessage|BIS_fnc_GUInewsfeed|BIS_fnc_halt|BIS_fnc_helicopterCanFly|BIS_fnc_helicopterDamage|BIS_fnc_helicopterGetHitpoints|BIS_fnc_helicopterSeat|BIS_fnc_helicopterSeatMove|BIS_fnc_helicopterType|BIS_fnc_help|BIS_fnc_HUDLimits|BIS_fnc_isLocalized|BIS_fnc_kbCanSpeak|BIS_fnc_kbCreateDummy|BIS_fnc_kbIsSpeaking|BIS_fnc_kbMenu|BIS_fnc_kbPriority|BIS_fnc_kbSentence|BIS_fnc_kbSkip|BIS_fnc_kbTell|BIS_fnc_kbTellLocal|BIS_fnc_kbTopicConfig|BIS_fnc_keypointsExport|BIS_fnc_keypointsExportFromKML|BIS_fnc_KMLimport|BIS_fnc_markerCreate|BIS_fnc_markerParams|BIS_fnc_markerPath|BIS_fnc_moveIn|BIS_fnc_MP (Take On Helicopters)|BIS_fnc_MPexec|BIS_fnc_nearestHelipad|BIS_fnc_noFlyZone|BIS_fnc_noFlyZonesCreate|BIS_fnc_noFlyZonesExport|BIS_fnc_numberDigits|BIS_fnc_numberText|BIS_fnc_onEnd|BIS_fnc_onLoad|BIS_fnc_overviewAuthor|BIS_fnc_overviewDifficulty|BIS_fnc_overviewMission|BIS_fnc_overviewTerrain|BIS_fnc_overviewTimeTrial|BIS_fnc_paramIn|BIS_fnc_PIP|BIS_fnc_playerName|BIS_fnc_posDegToUTM|BIS_fnc_posDegtoUTM|BIS_fnc_posDegToWorld|BIS_fnc_position|BIS_fnc_posUTMToDeg|BIS_fnc_radioSetChannel|BIS_fnc_radioSetPlaylist|BIS_fnc_radioSetTrack|BIS_fnc_randomPos|BIS_fnc_randomPosTrigger|BIS_fnc_roundDir|BIS_fnc_saveGame|BIS_fnc_secondsToString|BIS_fnc_selectRandom|BIS_fnc_setHeight|BIS_fnc_shakeGauges|BIS_fnc_shutdown|BIS_fnc_singleMissionConfig|BIS_fnc_singleMissionKeys|BIS_fnc_singleMissionName|BIS_fnc_spawnGroup|BIS_fnc_spawnVehicle|BIS_fnc_titleText|BIS_fnc_worldArea|BIS_fnc_wpAngle|BIS_fnc_wpCheckpoint|BIS_fnc_wpFastRope|BIS_fnc_wpFormation|BIS_fnc_wpHover|BIS_fnc_wpLand|BIS_fnc_wpRestricted|BIS_fnc_wpSlingLoadAttach|BIS_fnc_wpSlingLoadDetach|BIS_fnc_wpSlingLoadDrop|BIS_fnc_wpSteady|BIS_fnc_wpTimed|BIS_fnc_wpTransport|BIS_fnc_wpWinchLoad|collectiveRTD|enableAutoStartUpRTD|enableAutoTrimRTD|enableCoPilot|getHitPointDamage|HUDMovementLevels|numberOfEnginesRTD|profileNamespace|radioChannelAdd|radioChannelCreate|radioChannelRemove|radioChannelSetCallSign|radioChannelSetLabel|ropeCreate|ropeDestroy|ropeDetach|ropeSetCargoMass|saveProfileNamespace|setActualCollectiveRTD|setAPURTD|setBatteryChargeRTD|setBatteryRTD|setBrakesRTD|setCustomWeightRTD|setEngineRPMRTD|setHitPointDamage|setPiPEffect|setRotorBrakeRTD|setStarterRTD|setThrottleRTD|setWantedRPMRTD|systemOfUnits|throttleRTD|wingsForcesRTD|assignAsCargoIndex|enableTraffic|isPiPEnabled|setTrafficDensity|setTrafficDistance|setTrafficGap|setTrafficSpeed)\\b", "name": "entity.name.function.sqf" }, - "s-key-statements": { - "match": "\\s*(?i)(safeZoneH|safeZoneW|safeZoneWAbs|safeZoneX|safeZoneXAbs|safeZoneY|saveGame|saveIdentity|saveJoysticks|saveOverlay|saveProfileNamespace|saveStatus|saveVar|savingEnabled|say|say2D|say3D|scopeName|score|scoreSide|screenToWorld|scriptDone|scriptName|scriptNull|scudState|secondaryWeapon|secondaryWeaponItems|secondaryWeaponMagazine|select|selectBestPlaces|selectDiarySubject|selectedEditorObjects|selectEditorObject|selectionPosition|selectLeader|selectNoPlayer|selectPlayer|selectWeapon|selectWeaponTurret|sendAUMessage|sendSimpleCommand|sendTask|sendTaskResult|sendUDPMessage|serverCommand|serverCommandAvailable|serverCommandExecutable|serverTime|set|setAccTime|setAirportSide|setAnimSpeedCoef|setCustomAimCoef|setStamina|setStaminaScheme|setAmmo|setAmmoCargo|setAperture|setApertureNew|setArmoryPoints|setAttributes|setAutonomous|setBehaviour|setBleedingRemaining|setCameraInterest|setCamShakeDefParams|setCamShakeParams|setCamUseTi|setCaptive|setCenterOfMass|setCollisionLight|setCombatMode|setCompassOscillation|setCuratorCameraAreaCeiling|setCuratorCoef|setCuratorEditingAreaType|setCuratorWaypointCost|setCurrentTask|setCurrentWaypoint|setDamage|setDammage|setDate|setDebriefingText|setDefaultCamera|setDestination|setDir|setDirection|setDrawIcon|setDropInterval|setEditorMode|setEditorObjectScope|setEffectCondition|setFace|setFaceAnimation|setFatigue|setFlagOwner|setFlagSide|setFlagTexture|setFog|setFog|array|setFormation|setFormationTask|setFormDir|setFriend|setFromEditor|setFSMVariable|setFuel|setFuelCargo|setGroupIcon|setGroupIconParams|setGroupIconsSelectable|setGroupIconsVisible|setGroupId|setGroupOwner|setGusts|setHideBehind|setHit|setHitIndex|setHitPointDamage|setHorizonParallaxCoef|setHUDMovementLevels|setIdentity|setImportance|setLeader|setLightAmbient|setLightAttenuation|setLightBrightness|setLightColor|setLightDayLight|setLightFlareMaxDistance|setLightFlareSize|setLightIntensity|setLightnings|setLightUseFlare|setLocalWindParams|setMagazineTurretAmmo|setMarkerAlpha|setMarkerAlphaLocal|setMarkerBrush|setMarkerBrushLocal|setMarkerColor|setMarkerColorLocal|setMarkerDir|setMarkerDirLocal|setMarkerPos|setMarkerPosLocal|setMarkerShape|setMarkerShapeLocal|setMarkerSize|setMarkerSizeLocal|setMarkerText|setMarkerTextLocal|setMarkerType|setMarkerTypeLocal|setMass|setMimic|setMousePosition|setMusicEffect|setMusicEventHandler|setName|setNameSound|setObjectArguments|setObjectMaterial|setObjectProxy|setObjectTexture|setObjectTextureGlobal|setObjectViewDistance|setOvercast|setOwner|setOxygenRemaining|setParticleCircle|setParticleClass|setParticleFire|setParticleParams|setParticleRandom|setPilotLight|setPiPEffect|setPitch|setPlayable|setPlayerRespawnTime|setPos|setPosASL|setPosASL2|setPosASLW|setPosATL|setPosition|setPosWorld|setRadioMsg|setRain|setRainbow|setRandomLip|setRank|setRectangular|setRepairCargo|setShadowDistance|setSide|setSimpleTaskDescription|setSimpleTaskDestination|setSimpleTaskTarget|setSimulWeatherLayers|setSize|setSkill|setSkill|array|setSlingLoad|setSoundEffect|setSpeaker|setSpeech|setSpeedMode|setStatValue|setSuppression|setSystemOfUnits|setTargetAge|setTaskResult|setTaskState|setTerrainGrid|setText|setTimeMultiplier|setTitleEffect|setTriggerActivation|setTriggerArea|setTriggerStatements|setTriggerText|setTriggerTimeout|setTriggerType|setType|setUnconscious|setUnitAbility|setUnitPos|setUnitPosWeak|setUnitRank|setUnitRecoilCoefficient|setUnloadInCombat|setUserActionText|setVariable|setVectorDir|setVectorDirAndUp|setVectorUp|setVehicleAmmo|setVehicleAmmoDef|setVehicleArmor|setVehicleId|setVehicleLock|setVehiclePosition|setVehicleTiPars|setVehicleVarName|setVelocity|setVelocityTransformation|setViewDistance|setVisibleIfTreeCollapsed|setWaves|setWaypointBehaviour|setWaypointCombatMode|setWaypointCompletionRadius|setWaypointDescription|setWaypointFormation|setWaypointHousePosition|setWaypointLoiterRadius|setWaypointLoiterType|setWaypointName|setWaypointPosition|setWaypointScript|setWaypointSpeed|setWaypointStatements|setWaypointTimeout|setWaypointType|setWaypointVisible|setWeaponReloadingTime|setWind|setWindDir|setWindForce|setWindStr|setWPPos|show3DIcons|showChat|showCinemaBorder|showCommandingMenu|showCompass|showCuratorCompass|showGPS|showHUD|showLegend|showMap|shownArtilleryComputer|shownChat|shownCompass|shownCuratorCompass|showNewEditorObject|shownGPS|shownMap|shownPad|shownRadio|shownUAVFeed|shownWarrant|shownWatch|showPad|showRadio|showSubtitles|showUAVFeed|showWarrant|showWatch|showWaypoint|side|sideChat|sideEnemy|sideFriendly|sideLogic|sideRadio|sideUnknown|simpleTasks|simulationEnabled|simulCloudDensity|simulCloudOcclusion|simulInClouds|simulWeatherSync|sin|size|sizeOf|skill|skillFinal|skipTime|sleep|sliderPosition|sliderRange|sliderSetPosition|sliderSetRange|sliderSetSpeed|sliderSpeed|slingLoadAssistantShown|soldierMagazines|someAmmo|sort|soundVolume|spawn|speaker|speed|speedMode|sqrt|splitString|squadParams|stance|startLoadingScreen|step|stop|stopped|str|sunOrMoon|supportInfo|suppressFor|surfaceIsWater|surfaceNormal|surfaceType|swimInDepth|switch|switchableUnits|switchAction|switchCamera|switchGesture|switchLight|switchMove|synchronizedObjects|synchronizedTriggers|synchronizedWaypoints|synchronizeObjectsAdd|synchronizeObjectsRemove|synchronizeTrigger|synchronizeWaypoint|synchronizeWaypoint|trigger|systemChat|systemOfUnits)\\b", + "ARMA": { + "match": "\\s*(?i)(actionKeys|actionKeysImages|actionKeysNames|activateAddons|activateKey|addSwitchableUnit|addWaypoint|animationState|assert|assignedTarget|assignTeam|attackEnabled|boundingBox|breakOut|breakTo|camCommitPrepared|cameraInterest|cameraOn|campaignConfigFile|camPreload|camPreloaded|camPrepareBank|camPrepareDir|camPrepareDive|camPrepareFocus|camPrepareFov|camPrepareFovRange|camPreparePos|camPrepareRelPos|camPrepareTarget|camSetFocus|camUseNVG|case|catch|ceil|clearRadio|closeDisplay|commandFSM|commandGetOut|compile|composeText|configFile|configName|createCenter|createDisplay|createGroup|createGuardedPoint|createMarker|createMine|createSoundSource|createTarget|createTrigger|createUnit array|createVehicleLocal|ctrlActivate|ctrlCommit|ctrlCommitted|ctrlFade|ctrlMapAnimAdd|ctrlMapAnimClear|ctrlMapAnimCommit|ctrlMapAnimDone|ctrlMapScale|ctrlParent|ctrlPosition|ctrlScale|ctrlSetActiveColor|ctrlSetBackgroundColor|ctrlSetEventHandler|ctrlSetFade|ctrlSetFocus|ctrlSetFont|ctrlSetFontH1|ctrlSetFontH1B|ctrlSetFontH2|ctrlSetFontH2B|ctrlSetFontH3|ctrlSetFontH3B|ctrlSetFontH4|ctrlSetFontH4B|ctrlSetFontH5|ctrlSetFontH5B|ctrlSetFontH6|ctrlSetFontH6B|ctrlSetFontHeight|ctrlSetFontHeightH1|ctrlSetFontHeightH2|ctrlSetFontHeightH3|ctrlSetFontHeightH4|ctrlSetFontHeightH5|ctrlSetFontHeightH6|ctrlSetFontP|ctrlSetFontPB|ctrlSetForegroundColor|ctrlSetPosition|ctrlSetScale|ctrlSetStructuredText|ctrlSetTextColor|ctrlSetTooltip|ctrlSetTooltipColorBox|ctrlSetTooltipColorShade|ctrlSetTooltipColorText|ctrlShown|ctrlType|currentCommand|date|default|deleteCenter|deleteCollection|deleteGroup|deleteMarker|deleteTarget|deleteWaypoint|displayCtrl|displaySetEventHandler|dissolveTeam|doFSM|doGetOut|drawArrow|drawEllipse|drawIcon|drawLine|drawRectangle|echo|effectiveCommander|emptyPositions|enableAI|enableAttack|enableEnvironment|enableReload|enableTeamSwitch|expectedDestination|exportLandscapeXYZ|fadeRadio|find|findCover|findDisplay|findNearestEnemy|finishMissionInit|finite|floor|fog|fogForecast|forceSpeed|formationDirection|formationLeader|formationMembers|formationPosition|formationTask|formatText|from|getArray|getHideFrom|getNumber|getPosASL|getSpeed|getText|getVariable|glanceAt|halt|hideBehindScripted|hideBody|hierarchyObjectsCount|htmlLoad|image|inGameUISetEventHandler|inheritsFrom|initAmbientLife|intersect|isArray|isClass|isFormationLeader|isHidden|isHideBehindScripted|isKeyActive|isKindOf|isMarkedForCollection|isNil|isNumber|isPlayer|isText|keyImage|keyName|lbIsSelected|lbSelection|lbSetSelected|lightAttachObject|lightDetachObject|limitSpeed|lineBreak|lookAt|max|min|missionConfigFile|modelToWorld|moveInTurret|moveTarget|moveTo|moveToCompleted|moveToFailed|nearestObjects|nearObjects|needReload|nextWeatherChange|onBriefingTeamSwitch|onPlayerConnected|onPlayerDisconnected|overcast|overcastForecast|parseNumber|parseText|playerRespawnTime|playerSide|playMission|positionCameraToWorld|posScreenToWorld|posWorldToScreen|precision|preloadCamera|preloadObject|preloadSound|preloadTitleObj|preloadTitleRsc|preprocessFileLineNumbers|processInitCommands|radioVolume|rain|rank|reload|reloadEnabled|removeSwitchableUnit|respawnVehicle|round|runInitScript|scopeName|scriptDone|selectionPosition|selectLeader|selectPlayer|sendSimpleCommand|setAperture|setAttributes|setCameraEffect|setCameraInterest|setDate|setDestination|setDropInterval|setEffectCondition|setFormationTask|setFriend|setHideBehind|setLightAmbient|setLightBrightness|setLightColor|setMarkerBrush|setMarkerDir|setMarkerShape|setMarkerText|setMousePosition|setMusicEffect|setParticleCircle|setParticleParams|setParticleRandom|setPlayable|setPosASL|setRank|setSkill|setSoundEffect|setTargetAge|setTitleEffect|setTriggerActivation|setTriggerArea|setTriggerStatements|setTriggerText|setTriggerTimeout|setTriggerType|setUnitAbility|setUnitRank|setVariable|setVectorDir|setVectorUp|setVehicleAmmo|setVehicleArmor|setVehicleId|setVehicleInit|setVehicleLock|setVehiclePosition|setVehicleVarName|setWaypointBehaviour|setWaypointCombatMode|setWaypointDescription|setWaypointFormation|setWaypointHousePosition|setWaypointPosition|setWaypointScript|setWaypointSpeed|setWaypointStatements|setWaypointTimeout|setWaypointType|showWaypoint|skill|sleep|step|str|supportInfo|surfaceIsWater|surfaceType|switchableUnits|synchronizeWaypoint|synchronizeWaypoint trigger|teamSwitch|teamSwitchEnabled|terminate|text|throw|to|triggerAttachObject|triggerAttachVehicle|try|typeName|unassignTeam|unitPos|vectorDir|vectorUp|vehicles|vehicleVarName|verifySignature|waitUntil|waypointAttachObject|waypointAttachVehicle|weaponDirection|wind|worldName|worldToModel|createMarkerLocal|deleteMarkerLocal|markerDir|markerText|setMarkerBrushLocal|setMarkerColorLocal|setMarkerDirLocal|setMarkerPosLocal|setMarkerShapeLocal|setMarkerSizeLocal|setMarkerTextLocal|setMarkerTypeLocal|setUnitPosWeak|addVehicle|assignedVehicle|assignedVehicleRole|ctrlMapScreenToWorld|ctrlMapWorldToScreen|cutFadeOut|difficultyEnabled|distributionRegion|setCurrentWaypoint|titleFadeOut|waypoints|isServer|joinSilent|nearTargets|airportSide|assignToAirport|attachedObject|attachObject|clearVehicleInit|createLocation|createMissionDisplay|deleteLocation|drawLocation|importance|landAt|lbSort|lbSortByValue|locationPosition|name|nearestLocation|nearestLocations|position location|rectangular|setAirportSide|setDirection|setImportance|setName|setPosition|setRectangular|setSide|setSize|setText|setType|size|sizeOf|text|type|addPublicVariableEventHandler|setVectorDirAndUp|toArray|toLower|toString|toUpper)\\b", "name": "entity.name.function.sqf" }, - "tuvw-key-statements": { - "match": "\\s*(?i)(tan|targetKnowledge|targetsAggregate|targetsQuery|taskChildren|taskCompleted|taskDescription|taskDestination|taskHint|taskNull|taskParent|taskResult|taskState|teamMember|teamMemberNull|teamName|teams|teamSwitch|teamSwitchEnabled|teamType|terminate|terrainIntersect|terrainIntersectASL|text|text|location|textLog|textLogFormat|tg|then|throw|time|timeMultiplier|titleCut|titleFadeOut|titleObj|titleRsc|titleText|to|toArray|toLower|toString|toUpper|triggerActivated|triggerActivation|triggerArea|triggerAttachedVehicle|triggerAttachObject|triggerAttachVehicle|triggerStatements|triggerText|triggerTimeout|triggerTimeoutCurrent|triggerType|try|turretLocal|turretOwner|turretUnit|tvAdd|tvClear|tvCollapse|tvCount|tvCurSel|tvData|tvDelete|tvExpand|tvPicture|tvSetCurSel|tvSetData|tvSetPicture|tvSetValue|tvSort|tvSortByValue|tvText|tvValue|type|typeName|typeOf|UAVControl|uiNamespace|uiSleep|unassignCurator|unassignItem|unassignTeam|unassignVehicle|underwater|uniform|uniformContainer|uniformItems|uniformMagazines|unitAddons|unitBackpack|unitPos|unitReady|unitRecoilCoefficient|units|unitsBelowHeight|unlinkItem|unlockAchievement|unregisterTask|updateDrawIcon|updateMenuItem|updateObjectTree|useAudioTimeForMoves|vectorAdd|vectorCos|vectorCrossProduct|vectorDiff|vectorDir|vectorDirVisual|vectorDistance|vectorDistanceSqr|vectorDotProduct|vectorFromTo|vectorMagnitude|vectorMagnitudeSqr|vectorMultiply|vectorNormalized|vectorUp|vectorUpVisual|vehicle|vehicleChat|vehicleRadio|vehicles|vehicleVarName|velocity|velocityModelSpace|verifySignature|vest|vestContainer|vestItems|vestMagazines|viewDistance|visibleCompass|visibleGPS|visibleMap|visiblePosition|visiblePositionASL|visibleWatch|waitUntil|waves|waypointAttachedObject|waypointAttachedVehicle|waypointAttachObject|waypointAttachVehicle|waypointBehaviour|waypointCombatMode|waypointCompletionRadius|waypointDescription|waypointFormation|waypointHousePosition|waypointLoiterRadius|waypointLoiterType|waypointName|waypointPosition|waypoints|waypointScript|waypointsEnabledUAV|waypointShow|waypointSpeed|waypointStatements|waypointTimeout|waypointTimeoutCurrent|waypointType|waypointVisible|weaponAccessories|weaponCargo|weaponDirection|weaponLowered|weapons|weaponsItems|weaponsItemsCargo|weaponState|weaponsTurret|weightRTD|west|WFSideText|while|wind|windDir|windStr|wingsForcesRTD|with|worldName|worldToModel|worldToModelVisual|worldToScreen)\\b", + "ARMA2": { + "match": "\\s*(?i)(addEditorObject|addGroupIcon|addLiveStats|addMenu|addMenuItem|addResources|addTeamMember|agent|agents|AISFinishHeal|allGroups|allow3DMode|allowDamage|allowFileOperations|allUnits|armoryPoints|assignedCargo|assignedCommander|assignedDriver|assignedGunner|attachTo|BIS_fnc_absSpeed|BIS_fnc_addEvidence|BIS_fnc_areEqual|BIS_fnc_arithmeticMean|BIS_fnc_arrayCompare|BIS_fnc_arrayFindDeep|BIS_fnc_arrayInsert|BIS_fnc_arrayPop|BIS_fnc_arrayPush|BIS_fnc_arrayPushStack|BIS_fnc_arrayShift|BIS_fnc_arrayUnShift|BIS_fnc_classMagazine|BIS_fnc_classWeapon|BIS_fnc_colorRGBtoHTML|BIS_fnc_commsMenuCreate|BIS_fnc_commsMenuToggleAvailability|BIS_fnc_commsMenuToggleVisibility|BIS_fnc_conditionalSelect|BIS_fnc_createmenu|BIS_fnc_crossProduct|BIS_fnc_cutDecimals|BIS_fnc_diagAnim|BIS_fnc_dirTo|BIS_fnc_distance2D|BIS_fnc_distance2Dsqr|BIS_fnc_dotProduct|BIS_fnc_findNestedElement|BIS_fnc_findSafePos|BIS_fnc_fps|BIS_fnc_geometricMean|BIS_fnc_getFactions|BIS_fnc_getLineDist|BIS_fnc_getPitchBank|BIS_fnc_greatestNum|BIS_fnc_help|BIS_fnc_inAngleSector|BIS_fnc_inTrigger|BIS_fnc_inv|BIS_fnc_invAdd|BIS_fnc_invCodeToArray|BIS_fnc_invRemove|BIS_fnc_invSlots|BIS_fnc_invSlotsEmpty|BIS_fnc_invSlotType|BIS_fnc_invString|BIS_fnc_isInFrontOf|BIS_fnc_isPosBlacklisted|BIS_fnc_listPlayers|BIS_fnc_locations|BIS_fnc_lowestNum|BIS_fnc_magnitude|BIS_fnc_magnitudeSqr|BIS_fnc_maxDiffArray|BIS_fnc_miscanim|BIS_fnc_nearestNum|BIS_fnc_nearestPosition|BIS_fnc_ObjectsGrabber|BIS_fnc_ObjectsMapper|BIS_fnc_parseNumber|BIS_fnc_PosToGrid|BIS_fnc_randomIndex|BIS_fnc_randomInt|BIS_fnc_randomNum|BIS_fnc_recompile|BIS_fnc_relativeDirTo|BIS_fnc_relPos|BIS_fnc_removeIndex|BIS_fnc_removeNestedElement|BIS_fnc_respect|BIS_fnc_returnConfigEntry|BIS_fnc_returnGroupComposition|BIS_fnc_returnNestedElement|BIS_fnc_returnParents|BIS_fnc_returnVehicleTurrets|BIS_fnc_rotateVector2D|BIS_fnc_roundNum|BIS_fnc_sceneAreaClearance|BIS_fnc_sceneCheckWeapons|BIS_fnc_sceneCreateSceneTrigger|BIS_fnc_sceneCreateSoundEntities|BIS_fnc_sceneGetObjects|BIS_fnc_sceneGetParticipants|BIS_fnc_sceneGetPositionByAngle|BIS_fnc_sceneIntruderDetector|BIS_fnc_sceneMiscStuff|BIS_fnc_sceneRotate|BIS_fnc_sceneSetAnimationsForGroup|BIS_fnc_sceneSetBehaviour|BIS_fnc_sceneSetObjects|BIS_fnc_sceneSetPosFormation|BIS_fnc_selectCrew|BIS_fnc_selectRandom|BIS_fnc_selectRandomWeighted|BIS_fnc_setNestedElement|BIS_fnc_setPitchBank|BIS_fnc_showTime|BIS_fnc_sortNum|BIS_fnc_spawnCrew|BIS_fnc_spawnGroup|BIS_fnc_spawnVehicle|BIS_fnc_subSelect|BIS_fnc_supplydrop|BIS_fnc_supplydropService|BIS_fnc_swapVars|BIS_fnc_taskAttack|BIS_fnc_taskDefend|BIS_fnc_taskHandler|BIS_fnc_taskPatrol|BIS_fnc_threat|BIS_fnc_transportService|BIS_fnc_unitVector|BIS_fnc_variableSpaceAdd|BIS_fnc_variableSpaceRemove|BIS_fnc_vectorAdd|BIS_fnc_vectorDiff|BIS_fnc_vectorFromXToY|BIS_fnc_vectorMultiply|BIS_fnc_version|BIS_fnc_zzRotate|boundingCenter|buildingExit|camConstuctionSetParams|cameraEffectEnableHUD|cameraView|camTarget|canUnloadInCombat|captiveNum|clearGroupIcons|clearOverlay|closeOverlay|collapseObjectTree|commandChat|commandingMenu|commandRadio|commitOverlay|completedFSM|copyFromClipboard|copyToClipboard|copyWaypoints|createAgent|createDiaryLink|createDiaryRecord|createDiarySubject|createGearDialog|createMenu|createSimpleTask|createTask|createTeam|ctrlAddEventHandler|ctrlAutoScrollDelay|ctrlAutoScrollRewind|ctrlAutoScrollSpeed|ctrlMapCursor|ctrlMapMouseOver|ctrlRemoveAllEventHandlers|ctrlRemoveEventHandler|ctrlSetAutoScrollDelay|ctrlSetAutoScrollRewind|ctrlSetAutoScrollSpeed|currentMagazine|currentTask|currentTasks|currentWaypoint|currentWeapon|dateToNumber|deleteEditorObject|deleteResources|deleteTeam|detach|diag_fps|diag_fpsMin|diag_frameNo|diag_log|diag_tickTime|diarySubjectExists|directSay|disableConversation|disableSerialization|displayAddEventHandler|displayRemoveAllEventHandlers|displayRemoveEventHandler|drawLink|editObject|editorSetEventHandler|enableSaving|enableSentences|enableSimulation|endLoadingScreen|endMission|estimatedEndServerTime|evalObjectArgument|execEditorScript|execFSM|faction|failMission|findEditorObject|findEmptyPosition|findEmptyPositionReady|fromEditor|gearSlotData|getEditorCamera|getEditorMode|getEditorObjectScope|getFriend|getFSMVariable|getGroupIcon|getGroupIconParams|getGroupIcons|getObjectArgument|getObjectChildren|getObjectProxy|groupIconSelectable|groupIconsVisible|groupSelectedUnits|groupSelectUnit|hcAllGroups|hcGroupParams|hcLeader|hcRemoveAllGroups|hcRemoveGroup|hcSelected|hcSelectGroup|hcSetGroup|hcShowBar|hcShownBar|hintSilent|importAllGroups|inputAction|insertEditorObject|isAgent|isDedicated|isFlatEmpty|isMultiplayer|isOnRoad|isRealTime|isShowing3DIcons|items|joinAs|joinAsSilent|kbAddDatabase|kbAddDatabaseTargets|kbAddTopic|kbHasTopic|kbReact|kbRemoveTopic|kbTell|kbWasSaid|landResult|leaveVehicle|lifeState|listObjects|lnbAddArray|lnbAddColumn|lnbAddRow|lnbClear|lnbColor|lnbCurSelRow|lnbData|lnbDeleteColumn|lnbDeleteRow|lnbGetColumnsPosition|lnbPicture|lnbSetColor|lnbSetColumnsPos|lnbSetCurSelRow|lnbSetData|lnbSetPicture|lnbSetText|lnbSetValue|lnbSize|lnbText|lnbValue|loadGame|loadOverlay|lockCargo|lockDriver|lockedCargo|lockedDriver|lockedTurret|lockTurret|lookAtPos|markerAlpha|markerBrush|markerShape|members|missionNamespace|morale|moveObjectToEnd|moveOut|moveTime|nearEntities|nearestLocationWithDubbing|nearObjectsReady|nearRoads|newOverlay|nextMenuItemIndex|nMenuItems|numberToDate|onCommandModeChanged|onDoubleClick|onGroupIconClick|onGroupIconOverEnter|onGroupIconOverLeave|onHCGroupSelectionChanged|onPreloadFinished|onPreloadStarted|onShowNewObject|onTeamSwitch|owner|parsingNamespace|playableUnits|playAction|playActionNow|playGesture|playMoveNow|playScriptedMission|ppEffectAdjust|ppEffectCommit|ppEffectCommitted|ppEffectCreate|ppEffectDestroy|ppEffectEnable|priority|processDiaryLink|progressLoadingScreen|progressPosition|progressSetPosition|rankId|registeredTasks|registerTask|remoteControl|removeAllItems|removeDrawIcon|removeDrawLinks|removeGroupIcon|removeMenuItem|removeSimpleTask|removeTeamMember|resources|restartEditorCamera|reversedMouseY|roadsConnectedTo|safeZoneH|safeZoneW|safeZoneX|safeZoneY|saveOverlay|savingEnabled|say2D|say3D|screenToWorld|scriptName|selectBestPlaces|selectDiarySubject|selectedEditorObjects|selectEditorObject|selectNoPlayer|sendTask|sendTaskResult|serverTime|setArmoryPoints|setCurrentTask|setDrawIcon|setEditorMode|setEditorObjectScope|setFromEditor|setFSMVariable|setGroupIcon|setGroupIconParams|setGroupIconsSelectable|setGroupIconsVisible|setHit|setLeader|setMarkerAlpha|setMarkerAlphaLocal|setObjectArguments|setObjectProxy|setPosASL2|setSimpleTaskDescription|setSimpleTaskDestination|setTaskResult|setTaskState|setUnconscious|setVisibleIfTreeCollapsed|setWaypointCompletionRadius|setWind|show3DIcons|showCommandingMenu|showHUD|showLegend|showNewEditorObject|showSubtitles|sideUnknown|simpleTasks|simulationEnabled|startLoadingScreen|switchAction|switchGesture|synchronizedObjects|synchronizeObjectsAdd|synchronizeObjectsRemove|synchronizeTrigger|targetsAggregate|targetsQuery|taskChildren|taskCompleted|taskDescription|taskDestination|taskHint|taskParent|taskResult|taskState|teamMember|teamName|teams|teamType|triggerActivated|triggerActivation|triggerArea|triggerAttachedVehicle|triggerStatements|triggerText|triggerTimeout|triggerType|turretUnit|uiNamespace|unlockAchievement|unregisterTask|updateDrawIcon|updateMenuItem|updateObjectTree|useAudioTimeForMoves|viewDistance|visibleMap|waypointAttachedObject|waypointAttachedVehicle|waypointBehaviour|waypointCombatMode|waypointCompletionRadius|waypointDescription|waypointFormation|waypointHousePosition|waypointScript|waypointShow|waypointSpeed|waypointStatements|waypointTimeout|waypointType|with|worldToScreen|actionKeysNamesArray|addBackpack|addCamShake|aimedAtTarget|backpackSpaceFor|BIS_fnc_AAN|BIS_fnc_boundingBoxCorner|BIS_fnc_infoText|currentMuzzle|currentVisionMode|currentWeaponMode|currentZeroing|enableCamShake|enableGunLights|enableIRLasers|fadeSpeech|fireAtTarget|forceWalk|getElevationOffset|isAutoHoverOn|isForcedWalk|isManualFire|isWalking|laserTarget|removeBackpack|resetCamShake|scoreSide|sendUDPMessage|setCamShakeDefParams|setCamShakeParams|setCamUseTi|setVehicleTiPars|setVelocityTransformation|unitBackpack|getPlayerUID|mapCenterOnCamera|getPosATL|openMap|safeZoneWAbs|safeZoneXAbs|setPosATL|mapGridPosition|unitsBelowHeight|WFSideText|checkAIFeature|debugFSM|enableAIFeature|openDSInterface|serverCommand|serverCommandAvailable|suppressFor|textLogFormat|uiSleep|hideObject|addMagazineTurret|magazinesTurret|removeMagazinesTurret|removeMagazineTurret|weaponsTurret|disableTIEquipment|enableEngineArtillery|getMagazineCargo|getWeaponCargo|addBackpackCargo|addBackpackCargoGlobal|addMagazineCargoGlobal|addMPEventHandler|addWeaponCargoGlobal|clearBackpackCargoGlobal|clearMagazineCargoGlobal|clearWeaponCargoGlobal|getBackpackCargo|getResolution|getTerrainHeightASL|hostMission|removeAllMPEventHandlers|removeMPEventHandler|setSimpleTaskTarget|setWaypointVisible|waypointVisible|BIS_fnc_3Dcredits|BIS_fnc_crows|BIS_fnc_customGPS|BIS_fnc_customGPSvideo|BIS_fnc_destroyCity|BIS_fnc_dirIndicator|BIS_fnc_flies|BIS_fnc_playVideo|BIS_fnc_sandstorm|allDead|allMissionObjects|setPlayerRespawnTime|allowCrewInImmobile|assignedTeam|callExtension|entities|loadMagazine|setWeaponReloadingTime|surfaceNormal|visiblePosition|weaponState|addMagazine|aimPos|ASLToATL|ATLToASL|deActivateKey|eyePos|libraryCredits|libraryDisclaimers|lineIntersects|lineIntersectsWith|moonIntensity|productVersion|publicVariableClient|publicVariableServer|setOwner|setToneMapping|setToneMappingParams|setUnitRecoilCoefficient|sunOrMoon|terrainIntersect|terrainIntersectASL|unitRecoilCoefficient|visiblePositionASL|diag_captureFrame|diag_captureSlowFrame|diag_logSlowFrame|getPlayerUIDOld|hasInterface|onEachFrame|systemChat)\\b", "name": "entity.name.function.sqf" }, - "ArmA3_1-56": { - "match": "\\s*(?i)(add3DENConnection|add3DENEventHandler|add3DENLayer|all3DENEntities|apply|BIS fnc sideIsEnemy|BIS fnc sideIsFriendly|checkVisibility|clientOwner|collect3DENHistory|configNull|create3DENComposition|create3DENEntity|current3DENOperation|cursorObject|delete3DENEntities|do3DENAction|edit3DENMissionAttributes|exportJIPMessages|get3DENActionState|get3DENAttribute|get3DENCamera|get3DENConnections|get3DENEntity|get3DENEntityID|get3DENGrid|get3DENIconsVisible|get3DENLayerEntities|get3DENLinesVisible|get3DENMissionAttribute|get3DENMouseOver|get3DENSelected|getClientStateNumber|getMissionConfig|getMissionConfigValue|getPlayerScores|getRelDir|getRelPos|is3DEN|is3DENMultiplayer|isFilePatchingEnabled|leaderboardDeInit|leaderboardGetRows|leaderboardInit|lockIdentity|logNetwork|logNetworkTerminate|menuAction|menuAdd|menuChecked|menuClear|menuCollapse|menuData|menuDelete|menuEnable|menuEnabled|menuExpand|menuHover|menuPicture|menuSetAction|menuSetCheck|menuSetData|menuSetPicture|menuSetValue|menuShortcut|menuShortcutText|menuSize|menuSort|menuText|menuURL|menuValue|missionVersion|move3DENCamera|ppEffectEnabled|pushBackUnique|remove3DENConnection|remove3DENEventHandler|remove3DENLayer|removeAll3DENEventHandlers|save3DENInventory|selectRandom|set3DENAttribute|set3DENAttributes|set3DENGrid|set3DENIconsVisible|set3DENLayer|set3DENLinesVisible|set3DENMissionAttributes|set3DENModelsVisible|set3DENObjectType|set3DENSelected|tvSetText)\\b", + "ARMA3": { + "match": "\\s*(?i)(actionName|addGoggles|addHandgunItem|addHeadgear|addItem|addItemCargo|addItemCargoGlobal|addMagazines|addMissionEventHandler|addMusicEventHandler|addPrimaryWeaponItem|addSecondaryWeaponItem|addUniform|addVest|allDeadMen|allMapMarkers|allSites|animateDoor|assignAsTurret|assignedItems|assignItem|backpack|backpackCargo|backpackItems|backpackMagazines|BIS_fnc_addCommMenuItem|BIS_fnc_addRespawnPosition|BIS_fnc_call|BIS_fnc_codePerformance|BIS_fnc_endMission|BIS_fnc_error|BIS_fnc_log|BIS_fnc_MP|BIS_fnc_param|BIS_fnc_removeCommMenuItem|BIS_fnc_removeRespawnPosition|BIS_fnc_showNotification|BIS_fnc_timeToString|boundingBoxReal|buldozer_LoadNewRoads|buldozer_reloadOperMap|cancelSimpleTaskDestination|className|clearAllItemsFromBackpack|clearBackpackCargo|clearItemCargo|clearItemCargoGlobal|commandArtilleryFire|createSite|ctrlChecked|ctrlHTMLLoaded|ctrlIDC|ctrlIDD|ctrlSetChecked|ctrlTextHeight|currentMagazineDetail|customChat|customRadio|debriefingText|deleteSite|disableCollisionWith|distanceSqr|doArtilleryFire|doorPhase|drawIcon3D|drawLine3D|enableCaustics|enableCollisionWith|enableCopilot|enableFatigue|eyeDirection|firstBackpack|forceWeaponFire|freeLook|getArtilleryAmmo|getArtilleryComputerSettings|getBleedingRemaining|getBurningValue|getDescription|getFatigue|getItemCargo|getOxygenRemaining|getPosASLW|goggles|groupFromNetId|groupId|gusts|handgunItems|handgunWeapon|headgear|humidity|independent|inRangeOfArtillery|isAbleToBreathe|isBleeding|isBurning|isCopilotEnabled|isFlashlightOn|isIRLaserOn|isLocalized|isPipEnabled|isTouchingGround|isTutHintsEnabled|itemCargo|language|lightnings|linearConversion|linkItem|load|loadAbs|loadBackpack|loadUniform|loadVest|magazineCargo|magazinesDetail|mineActive|nearSupplies|netId|objectFromNetId|particlesQuality|playSound3D|ppEffectForceInNVG|primaryWeaponItems|profileName|rainbow|removeAllActions|removeAllAssignedItems|removeAllContainers|removeAllMissionEventHandlers|removeAllMusicEventHandlers|removeGoggles|removeHeadgear|removeItem|removeItems|removeMissionEventHandler|removeMusicEventHandler|removeUniform|removeVest|resetSubgroupDirection|revealMine|saveJoysticks|secondaryWeaponItems|sendAUMessage|setAmmo|setApertureNew|setBleedingRemaining|setCompassOscillation|setDebriefingText|setFatigue|setGusts|setHorizonParallaxCoef|setHUDMovementLevels|setLightAttenuation|setLightDayLight|setLightFlareMaxDistance|setLightFlareSize|setLightIntensity|setLightnings|setLightUseFlare|setLocalWindParams|setObjectMaterial|setObjectViewDistance|setOxygenRemaining|setParticleClass|setPosASLW|setRainbow|setRandomLip|setShadowDistance|setSystemOfUnits|setUserActionText|setVehicleAmmoDef|setWaves|setWaypointName|setWindDir|setWindForce|setWindStr|showChat|shownArtilleryComputer|simulSetHumidity|simulWeatherSync|soldierMagazines|stance|swimInDepth|synchronizedTriggers|synchronizedWaypoints|unassignItem|underwater|uniform|uniformItems|uniformMagazines|velocityModelSpace|vest|vestItems|vestMagazines|waves|waypointName|weaponAccessories|weaponCargo|weaponLowered|windDir|windStr|BIS_fnc_spawn|compileFinal|difficulty|getAmmoCargo|getArtilleryETA|getFuelCargo|getRepairCargo|BIS_fnc_arrayShuffle|BIS_fnc_endLoadingScreen|BIS_fnc_loadInventory|BIS_fnc_sortBy|BIS_fnc_startLoadingScreen|lbSetTooltip|canAdd|handgunMagazine|isStreamFriendlyUIEnabled|primaryWeaponMagazine|removeAllHandgunItems|removeAllPrimaryWeaponItems|removeHandgunItem|removePrimaryWeaponItem|secondaryWeaponMagazine|BIS_fnc_addRespawnInventory|BIS_fnc_removeRespawnInventory|BIS_fnc_respawnTickets|isSteamMission|markAsFinishedOnSteam|tvAdd|tvClear|tvCollapse|tvCount|tvCurSel|tvData|tvDelete|tvExpand|tvPicture|tvSetCurSel|tvSetData|tvSetPicture|tvSetPictureColor|tvSetTooltip|tvSetValue|tvSort|tvSortByValue|tvText|tvValue|addMagazineGlobal|addWeaponGlobal|allUnitsUAV|BIS_fnc_addToPairs|BIS_fnc_consolidateArray|BIS_fnc_findInPairs|BIS_fnc_groupVehicles|BIS_fnc_moduleSector|BIS_fnc_nearestRoad|BIS_fnc_removeSupportLink|BIS_fnc_taskState|connectTerminalToUAV|createVehicleCrew|getConnectedUAV|isUAVConnected|magazinesAmmo|magazinesAmmoFull|removeMagazineGlobal|removeWeaponGlobal|weaponsItems|BIS_fnc_activateAddons|BIS_fnc_addClassOO|BIS_fnc_addScore|BIS_fnc_addScriptedEventHandler|BIS_fnc_addStackedEventHandler|BIS_fnc_addSupportLink|BIS_fnc_addVirtualBackpackCargo|BIS_fnc_addVirtualItemCargo|BIS_fnc_addVirtualMagazineCargo|BIS_fnc_addVirtualWeaponCargo|BIS_fnc_addWeapon|BIS_fnc_advHint|BIS_fnc_advHintArg|BIS_fnc_advHintCall|BIS_fnc_advHintCredits|BIS_fnc_alignTabs|BIS_fnc_allSynchronizedObjects|BIS_fnc_ambientAnim|BIS_fnc_ambientAnimCombat|BIS_fnc_ambientAnimGetParams|BIS_fnc_ambientFlyby|BIS_fnc_animalBehaviour|BIS_fnc_animalSiteSpawn|BIS_fnc_animViewer|BIS_fnc_areFriendly|BIS_fnc_baseWeapon|BIS_fnc_basicBackpack|BIS_fnc_basicTask|BIS_fnc_blackIn|BIS_fnc_blackOut|BIS_fnc_bloodEffect|BIS_fnc_briefingAnimate|BIS_fnc_briefingInit|BIS_fnc_buildingPositions|BIS_fnc_callScriptedEventHandler|BIS_fnc_camera|BIS_fnc_cameraOld|BIS_fnc_changeSupportRadioChannel|BIS_fnc_cinemaBorder|BIS_fnc_colorConfigToRGBA|BIS_fnc_colorRGBAtoHTML|BIS_fnc_colorRGBAtoTexture|BIS_fnc_configPath|BIS_fnc_createLogRecord|BIS_fnc_createObjectOO|BIS_fnc_credits_movie|BIS_fnc_credits_movieConfig|BIS_fnc_credits_movieSupport|BIS_fnc_ctrlFitToTextHeight|BIS_fnc_ctrlSetScale|BIS_fnc_damageChanged|BIS_fnc_damagePulsing|BIS_fnc_deleteInventory|BIS_fnc_diagAAR|BIS_fnc_diagAARrecord|BIS_fnc_diagBulletCam|BIS_fnc_diagConfig|BIS_fnc_diagFindMissingAuthors|BIS_fnc_diagHit|BIS_fnc_diagKey|BIS_fnc_diagKeyLayout|BIS_fnc_diagKeyTest|BIS_fnc_diagKnownAsTarget|BIS_fnc_diagKnownTargets|BIS_fnc_diagLoop|BIS_fnc_diagMacros|BIS_fnc_diagMacrosAuthor|BIS_fnc_diagMacrosMapSize|BIS_fnc_diagMacrosNameSound|BIS_fnc_diagMacrosVerify|BIS_fnc_diagMissionPositions|BIS_fnc_diagMissionWeapons|BIS_fnc_diagPreview|BIS_fnc_diagPreviewCycle|BIS_fnc_diagPreviewVehicleCrew|BIS_fnc_diagRadio|BIS_fnc_diagVehicleIcons|BIS_fnc_diagWiki|BIS_fnc_dirtEffect|BIS_fnc_disableSaving|BIS_fnc_drawAO|BIS_fnc_drawMinefields|BIS_fnc_drawRespawnPositions|BIS_fnc_earthquake|BIS_fnc_effectFired|BIS_fnc_effectFiredArtillery|BIS_fnc_effectFiredFlares|BIS_fnc_effectFiredHeliRocket|BIS_fnc_effectFiredLongSmoke|BIS_fnc_effectFiredRifle|BIS_fnc_effectFiredRocket|BIS_fnc_effectFiredSmokeLauncher|BIS_fnc_effectFiredSmokeLauncher_boat|BIS_fnc_effectKilled|BIS_fnc_effectKilledAirDestruction|BIS_fnc_effectKilledAirDestructionStage2|BIS_fnc_effectKilledSecondaries|BIS_fnc_effectPlankton|BIS_fnc_enableSaving|BIS_fnc_endMissionServer|BIS_fnc_enemyDetected|BIS_fnc_enemySides|BIS_fnc_enemyTargets|BIS_fnc_establishingShot|BIS_fnc_estimatedTimeLeft|BIS_fnc_execFSM|BIS_fnc_execRemote|BIS_fnc_executeStackedEventHandler|BIS_fnc_execVM|BIS_fnc_exportCfgGroups|BIS_fnc_exportCfgHints|BIS_fnc_exportCfgMagazines|BIS_fnc_exportCfgPatches|BIS_fnc_exportCfgWeapons|BIS_fnc_exportFunctionsToWiki|BIS_fnc_exportGroupFormations|BIS_fnc_exportInventory|BIS_fnc_exportMapToBiTXT|BIS_fnc_fadeEffect|BIS_fnc_fatigueEffect|BIS_fnc_feedbackInit|BIS_fnc_feedbackMain|BIS_fnc_filterString|BIS_fnc_findOverwatch|BIS_fnc_flamesEffect|BIS_fnc_forceEnd|BIS_fnc_friendlySides|BIS_fnc_functionMeta|BIS_fnc_getCfgData|BIS_fnc_getCfgDataArray|BIS_fnc_getCfgDataBool|BIS_fnc_getCfgDataObject|BIS_fnc_getCfgDataPool|BIS_fnc_getCfgIsClass|BIS_fnc_getCfgSubClasses|BIS_fnc_getParamValue|BIS_fnc_getRespawnInventories|BIS_fnc_getRespawnMarkers|BIS_fnc_getRespawnPositions|BIS_fnc_getServerVariable|BIS_fnc_getTurrets|BIS_fnc_getUnitByUid|BIS_fnc_getVirtualBackpackCargo|BIS_fnc_getVirtualItemCargo|BIS_fnc_getVirtualMagazineCargo|BIS_fnc_getVirtualWeaponCargo|BIS_fnc_groupIndicator|BIS_fnc_guiEffectTiles|BIS_fnc_healing|BIS_fnc_healthEffects|BIS_fnc_incapacitatedEffect|BIS_fnc_indicateBleeding|BIS_fnc_initExpo|BIS_fnc_initIntelObject|BIS_fnc_initModules|BIS_fnc_initMultiplayer|BIS_fnc_initParams|BIS_fnc_initPlayable|BIS_fnc_initRespawn|BIS_fnc_initRespawnBackpack|BIS_fnc_initVirtualUnit|BIS_fnc_inString|BIS_fnc_InstructorFigure|BIS_fnc_interpolateWeather|BIS_fnc_isBuildingEnterable|BIS_fnc_isCampaign|BIS_fnc_isDemo|BIS_fnc_isInsideArea|BIS_fnc_isInZoom|BIS_fnc_isLoading|BIS_fnc_isUnitVirtual|BIS_fnc_keyCode|BIS_fnc_limitSupport|BIS_fnc_liveFeed|BIS_fnc_liveFeedEffects|BIS_fnc_liveFeedModuleEffects|BIS_fnc_liveFeedModuleInit|BIS_fnc_liveFeedModuleSetSource|BIS_fnc_liveFeedModuleSetTarget|BIS_fnc_liveFeedSetSource|BIS_fnc_liveFeedSetTarget|BIS_fnc_liveFeedTerminate|BIS_fnc_loadClass|BIS_fnc_loadEntry|BIS_fnc_loadFunctions|BIS_fnc_localize|BIS_fnc_locationDescription|BIS_fnc_locWeaponInfo|BIS_fnc_logFormat|BIS_fnc_mapSize|BIS_fnc_markerToTrigger|BIS_fnc_markWaypoints|BIS_fnc_missileLaunchPositionFix|BIS_fnc_missionConversations|BIS_fnc_missionConversationsLocal|BIS_fnc_missionFlow|BIS_fnc_missionHandlers|BIS_fnc_missionRespawnType|BIS_fnc_missionTasks|BIS_fnc_missionTasksLocal|BIS_fnc_missionTimeLeft|BIS_fnc_moduleAI|BIS_fnc_moduleAmmo|BIS_fnc_moduleAnimals|BIS_fnc_moduleArsenal|BIS_fnc_moduleBleedTickets|BIS_fnc_moduleBootcampStage|BIS_fnc_moduleCAS|BIS_fnc_moduleChat|BIS_fnc_moduleCombatGetIn|BIS_fnc_moduleCountdown|BIS_fnc_moduleCoverMap|BIS_fnc_moduleCreateDiaryRecord|BIS_fnc_moduleCreateProjectile|BIS_fnc_moduleCurator|BIS_fnc_moduleCuratorAddAddons|BIS_fnc_moduleCuratorAddCameraArea|BIS_fnc_moduleCuratorAddEditableObjects|BIS_fnc_moduleCuratorAddEditingArea|BIS_fnc_moduleCuratorAddEditingAreaPlayers|BIS_fnc_moduleCuratorAddIcon|BIS_fnc_moduleCuratorAddPoints|BIS_fnc_moduleCuratorSetAttributes|BIS_fnc_moduleCuratorSetCamera|BIS_fnc_moduleCuratorSetCoefs|BIS_fnc_moduleCuratorSetCostsDefault|BIS_fnc_moduleCuratorSetCostsSide|BIS_fnc_moduleCuratorSetCostsVehicleClass|BIS_fnc_moduleCuratorSetEditingAreaType|BIS_fnc_moduleCuratorSetObjectCost|BIS_fnc_moduleDamage|BIS_fnc_moduleDate|BIS_fnc_moduleDiary|BIS_fnc_moduleDoorOpen|BIS_fnc_moduleEffectsBubbles|BIS_fnc_moduleEffectsEmitterCreator|BIS_fnc_moduleEffectsFire|BIS_fnc_moduleEffectsPlankton|BIS_fnc_moduleEffectsShells|BIS_fnc_moduleEffectsSmoke|BIS_fnc_moduleEndMission|BIS_fnc_moduleExecute|BIS_fnc_moduleFDCPClear|BIS_fnc_moduleFDCPIn|BIS_fnc_moduleFDCPOut|BIS_fnc_moduleFDFadeMarker|BIS_fnc_moduleFDSkeetDestruction|BIS_fnc_moduleFDStatsClear|BIS_fnc_moduleFiringDrill|BIS_fnc_moduleFriendlyFire|BIS_fnc_moduleFuel|BIS_fnc_moduleGenericRadio|BIS_fnc_moduleGroupID|BIS_fnc_moduleHandle|BIS_fnc_moduleHealth|BIS_fnc_moduleHint|BIS_fnc_moduleHQ|BIS_fnc_moduleInit|BIS_fnc_moduleLightning|BIS_fnc_moduleMine|BIS_fnc_moduleMissionName|BIS_fnc_moduleMode|BIS_fnc_moduleModules|BIS_fnc_moduleMPTypeDefense|BIS_fnc_moduleMPTypeGameMaster|BIS_fnc_moduleMPTypeSectorControl|BIS_fnc_moduleMPTypeSeize|BIS_fnc_moduleObjective|BIS_fnc_moduleObjectiveFind|BIS_fnc_moduleObjectiveGetIn|BIS_fnc_moduleObjectiveMove|BIS_fnc_moduleObjectiveRaceCP|BIS_fnc_moduleObjectiveRaceFinish|BIS_fnc_moduleObjectiveRaceStart|BIS_fnc_moduleObjectiveSector|BIS_fnc_moduleObjectiveTarget|BIS_fnc_modulePositioning|BIS_fnc_modulePoster|BIS_fnc_modulePostprocess|BIS_fnc_moduleProjectile|BIS_fnc_modulePunishment|BIS_fnc_moduleRadioChannelCreate|BIS_fnc_moduleRank|BIS_fnc_moduleRating|BIS_fnc_moduleRemoteControl|BIS_fnc_moduleRespawnInventory|BIS_fnc_moduleRespawnPosition|BIS_fnc_moduleRespawnTickets|BIS_fnc_moduleRespawnVehicle|BIS_fnc_moduleSaveGame|BIS_fnc_moduleSFX|BIS_fnc_moduleShowHide|BIS_fnc_moduleSimulationManager|BIS_fnc_moduleSkill|BIS_fnc_moduleSkiptime|BIS_fnc_moduleSound|BIS_fnc_moduleStrategicMapImage|BIS_fnc_moduleStrategicMapInit|BIS_fnc_moduleStrategicMapMission|BIS_fnc_moduleStrategicMapOpen|BIS_fnc_moduleStrategicMapORBAT|BIS_fnc_moduleTaskCreate|BIS_fnc_moduleTaskSetDescription|BIS_fnc_moduleTaskSetDestination|BIS_fnc_moduleTaskSetState|BIS_fnc_moduleTimeTrial|BIS_fnc_moduleTracers|BIS_fnc_moduleTrident|BIS_fnc_moduleTriggers|BIS_fnc_moduleTTCPClear|BIS_fnc_moduleTTCPIn|BIS_fnc_moduleTTCPOut|BIS_fnc_moduleTTCPTrigger|BIS_fnc_moduleTTCPTriggerBehind|BIS_fnc_moduleTTStatsClear|BIS_fnc_moduleUnits|BIS_fnc_moduleUnlockArea|BIS_fnc_moduleUnlockObject|BIS_fnc_moduleVolume|BIS_fnc_moduleWeather|BIS_fnc_moduleZoneProtection|BIS_fnc_moduleZoneRestriction|BIS_fnc_moveAction|BIS_fnc_moveToRespawnPosition|BIS_fnc_neutralizeUnit|BIS_fnc_objectHeight|BIS_fnc_objectSide|BIS_fnc_objectVar|BIS_fnc_onDiaryChanged|BIS_fnc_onPlayerConnected|BIS_fnc_ORBATAddGroupOverlay|BIS_fnc_ORBATAnimate|BIS_fnc_ORBATConfigPreview|BIS_fnc_ORBATGetGroupParams|BIS_fnc_ORBATOpen|BIS_fnc_ORBATRemoveGroupOverlay|BIS_fnc_ORBATSetGroupFade|BIS_fnc_ORBATSetGroupParams|BIS_fnc_ORBATTooltip|BIS_fnc_ordinalNumber|BIS_fnc_packStaticWeapon|BIS_fnc_paramCountdown|BIS_fnc_paramDaytime|BIS_fnc_paramGuerFriendly|BIS_fnc_paramRespawnTickets|BIS_fnc_paramWeather|BIS_fnc_phoneticalWord|BIS_fnc_playEndMusic|BIS_fnc_playMusic|BIS_fnc_playSound|BIS_fnc_preload|BIS_fnc_prepareAO|BIS_fnc_progressLoadingScreen|BIS_fnc_quotations|BIS_fnc_radialRed|BIS_fnc_radialRedOut|BIS_fnc_randomPos|BIS_fnc_rankParams|BIS_fnc_refreshCommMenu|BIS_fnc_relPosObject|BIS_fnc_relScaledDist|BIS_fnc_removeAllScriptedEventHandlers|BIS_fnc_removeFromPairs|BIS_fnc_removeScriptedEventHandler|BIS_fnc_removeStackedEventHandler|BIS_fnc_removeVirtualBackpackCargo|BIS_fnc_removeVirtualItemCargo|BIS_fnc_removeVirtualMagazineCargo|BIS_fnc_removeVirtualWeaponCargo|BIS_fnc_respawnBase|BIS_fnc_respawnConfirm|BIS_fnc_respawnCounter|BIS_fnc_respawnEndMission|BIS_fnc_respawnGroup|BIS_fnc_respawnInstant|BIS_fnc_respawnMenuInventory|BIS_fnc_respawnMenuPosition|BIS_fnc_respawnMenuSpectator|BIS_fnc_respawnNone|BIS_fnc_respawnRounds|BIS_fnc_respawnSeagull|BIS_fnc_respawnSide|BIS_fnc_respawnSpectator|BIS_fnc_respawnTimePenalty|BIS_fnc_respawnWave|BIS_fnc_returnChildren|BIS_fnc_romanNumeral|BIS_fnc_rscLayer|BIS_fnc_saveInventory|BIS_fnc_sayMessage|BIS_fnc_scriptedWaypointType|BIS_fnc_selectDiarySubject|BIS_fnc_selectRespawnTemplate|BIS_fnc_setDate|BIS_fnc_setFog|BIS_fnc_setIDCStreamFriendly|BIS_fnc_setObjectTexture|BIS_fnc_setOvercast|BIS_fnc_setPPeffectTemplate|BIS_fnc_setRank|BIS_fnc_setRespawnDelay|BIS_fnc_setRespawnInventory|BIS_fnc_setServerVariable|BIS_fnc_setTask|BIS_fnc_setTaskLocal|BIS_fnc_setToPairs|BIS_fnc_showMarkers|BIS_fnc_showRespawnMenu|BIS_fnc_showUnitInfo|BIS_fnc_sideColor|BIS_fnc_sideID|BIS_fnc_sideName|BIS_fnc_sideType|BIS_fnc_skirmishTrigger|BIS_fnc_spawnObjects|BIS_fnc_splitString|BIS_fnc_StrategicMapAnimate|BIS_fnc_StrategicMapMouseButtonClick|BIS_fnc_StrategicMapOpen|BIS_fnc_subClasses|BIS_fnc_target|BIS_fnc_taskAlwaysVisible|BIS_fnc_taskChildren|BIS_fnc_taskCompleted|BIS_fnc_taskCreate|BIS_fnc_taskCurrent|BIS_fnc_taskDescription|BIS_fnc_taskDestination|BIS_fnc_taskExists|BIS_fnc_taskHint|BIS_fnc_taskParent|BIS_fnc_taskReal|BIS_fnc_taskSetAlwaysVisible|BIS_fnc_taskSetCurrent|BIS_fnc_taskSetDescription|BIS_fnc_taskSetDestination|BIS_fnc_taskSetState|BIS_fnc_taskSetType|BIS_fnc_tasksUnit|BIS_fnc_taskType|BIS_fnc_taskVar|BIS_fnc_teamColor|BIS_fnc_terrainGradAngle|BIS_fnc_textTiles|BIS_fnc_textureMarker|BIS_fnc_textureVehicleIcon|BIS_fnc_titlecard|BIS_fnc_toUpperDisplayTexts|BIS_fnc_traceBullets|BIS_fnc_trackMissionTime|BIS_fnc_tridentClient|BIS_fnc_tridentExecute|BIS_fnc_tridentGetRelationship|BIS_fnc_tridentHandleDamage|BIS_fnc_tridentSetRelationship|BIS_fnc_triggerToMarker|BIS_fnc_trimString|BIS_fnc_typeText|BIS_fnc_typeText2|BIS_fnc_uniqueClasses|BIS_fnc_unitAddon|BIS_fnc_unpackStaticWeapon|BIS_fnc_updatePlayerArray|BIS_fnc_validateParametersOO|BIS_fnc_vehicleRoles|BIS_fnc_VRCourseBallistics1|BIS_fnc_VRCourseBallistics2|BIS_fnc_VRCourseBallistics3|BIS_fnc_VRCourseBallistics4|BIS_fnc_VRCourseCommandingActions1|BIS_fnc_VRCourseCommandingActions2|BIS_fnc_VRCourseCommandingActions3|BIS_fnc_VRCourseCommandingBehaviour1|BIS_fnc_VRCourseCommandingBehaviour2|BIS_fnc_VRCourseCommandingBehaviour3|BIS_fnc_VRCourseCommandingMovement1|BIS_fnc_VRCourseCommandingMovement2|BIS_fnc_VRCourseCommandingVehicles1|BIS_fnc_VRCourseCommandingVehicles2|BIS_fnc_VRCourseCommandingVehicles3|BIS_fnc_VRCourseLaunchers1|BIS_fnc_VRCourseLaunchers2|BIS_fnc_VRCourseLaunchers3|BIS_fnc_VRCoursePlaceables1|BIS_fnc_VRCoursePlaceables2|BIS_fnc_VRCoursePlaceables3|BIS_fnc_VRCourseTargetDesignation1|BIS_fnc_VRCourseTargetDesignation2|BIS_fnc_VRCourseTargetDesignation3|BIS_fnc_VRDrawBorder|BIS_fnc_VRDrawGrid|BIS_fnc_VREffectKilled|BIS_fnc_VRFadeIn|BIS_fnc_VRFadeOut|BIS_fnc_VRSpawnEffect|BIS_fnc_VRSpawnSelector|BIS_fnc_VRTimer|BIS_fnc_weaponAddon|BIS_fnc_weaponComponents|BIS_fnc_wpArtillery|BIS_fnc_wpPatrol|BIS_fnc_wpRelax|BIS_fnc_wpSuppress|clearItemPool|disableDebriefingStats|enableDebriefingStats|enableSatNormalOnDetail|fogParams|getShadowDistance|incapacitatedState|isDLCAvailable|setSimulWeatherLayers|setWaypointLoiterRadius|setWaypointLoiterType|simulCloudDensity|simulCloudOcclusion|simulInClouds|UAVControl|unitAddons|unlinkItem|waypointLoiterRadius|waypointLoiterType|BIS_fnc_countdown|BIS_fnc_getFromPairs|face|nameSound|pitch|setCenterOfMass|setDetailMapBlendPars|setMass|setMusicEventHandler|setNameSound|setPitch|setSpeaker|speaker|addItemPool|addItemToBackpack|addItemToUniform|addItemToVest|backpackContainer|canAddItemToBackpack|canAddItemToUniform|canAddItemToVest|everyBackpack|forceRespawn|isInstructorFigureEnabled|itemsWithMagazines|magazinesDetailBackpack|magazinesDetailUniform|magazinesDetailVest|removeAllItemsWithMagazines|removeItemFromBackpack|removeItemFromUniform|removeItemFromVest|uniformContainer|vestContainer|BIS_fnc_deleteTask|BIS_fnc_playerSideFaction|playableSlotsNumber|setObjectTextureGlobal|BIS_fnc_crewCount|BIS_fnc_importImageLinks|BIS_fnc_itemType|BIS_fnc_jukebox|BIS_fnc_objectType|getClientState|setParticleFire|skillFinal|triggerTimeoutCurrent|waypointTimeoutCurrent|BIS_fnc_bleedTickets|BIS_fnc_fixDate|BIS_fnc_isLeapYear|BIS_fnc_monthDays|BIS_fnc_sortAlphabetically|lineIntersectsObjs|setDefaultCamera|addScoreSide|binocular|briefingName|cbChecked|cbSetChecked|currentMagazineDetailTurret|currentMagazineTurret|currentWeaponTurret|enableDiagLegend|enableSimulationGlobal|getCenterOfMass|getMass|hideObjectGlobal|hmd|queryItemsPool|selectWeaponTurret|setSpeech|activatedAddons|attachedObjects|attachedTo|addCuratorAddons|addCuratorCameraArea|addCuratorEditableObjects|addCuratorEditingArea|addCuratorPoints|allCurators|allowCuratorLogicIgnoreAreas|assignCurator|BIS_fnc_addCuratorAreaFromTrigger|BIS_fnc_addCuratorChallenge|BIS_fnc_addCuratorIcon|BIS_fnc_completedCuratorChallengesCount|BIS_fnc_curatorAttachObject|BIS_fnc_curatorAttributes|BIS_fnc_curatorAutomatic|BIS_fnc_curatorAutomaticPositions|BIS_fnc_curatorChallengeDestroyVehicle|BIS_fnc_curatorChallengeFindIntel|BIS_fnc_curatorChallengeFireWeapon|BIS_fnc_curatorChallengeGetInVehicle|BIS_fnc_curatorChallengeIlluminate|BIS_fnc_curatorChallengeSpawnLightning|BIS_fnc_curatorHint|BIS_fnc_curatorObjectEdited|BIS_fnc_curatorObjectPlaced|BIS_fnc_curatorObjectRegistered|BIS_fnc_curatorObjectRegisteredTable|BIS_fnc_curatorPinged|BIS_fnc_curatorRespawn|BIS_fnc_curatorSayMessage|BIS_fnc_curatorVisionModes|BIS_fnc_curatorWaypointPlaced|BIS_fnc_drawCuratorDeaths|BIS_fnc_drawCuratorLocations|BIS_fnc_drawCuratorRespawnMarkers|BIS_fnc_exportCfgVehicles|BIS_fnc_exportCuratorCostTable|BIS_fnc_finishCuratorChallenge|BIS_fnc_forceCuratorInterface|BIS_fnc_formatCuratorChallengeObjects|BIS_fnc_initCuratorAttribute|BIS_fnc_isCurator|BIS_fnc_isCuratorEditable|BIS_fnc_isForcedCuratorInterface|BIS_fnc_listCuratorPlayers|BIS_fnc_loop|BIS_fnc_manageCuratorAddons|BIS_fnc_manageCuratorChallenges|BIS_fnc_mirrorCuratorSettings|BIS_fnc_registerCuratorObject|BIS_fnc_removeCuratorIcon|BIS_fnc_removeDestroyedCuratorEditableObjects|BIS_fnc_runLater|BIS_fnc_setCuratorAttributes|BIS_fnc_setCuratorCamera|BIS_fnc_setCuratorVisionModes|BIS_fnc_shakeCuratorCamera|BIS_fnc_showCuratorAttributes|BIS_fnc_showCuratorFeedbackMessage|BIS_fnc_toggleCuratorVisionMode|curatorAddons|curatorCamera|curatorCameraArea|curatorCameraAreaCeiling|curatorCoef|curatorEditableObjects|curatorEditingArea|curatorEditingAreaType|curatorMouseOver|curatorPoints|curatorRegisteredObjects|curatorSelected|curatorWaypointCost|forceWeatherChange|getAssignedCuratorLogic|getAssignedCuratorUnit|getDLCs|isAutonomous|isEqualTo|objectCurators|openCuratorInterface|removeAllCuratorAddons|removeAllCuratorCameraAreas|removeAllCuratorEditingAreas|removeCuratorAddons|removeCuratorCameraArea|removeCuratorEditableObjects|removeCuratorEditingArea|setAutonomous|setCuratorCameraAreaCeiling|setCuratorCoef|setCuratorEditingAreaType|setCuratorWaypointCost|showCuratorCompass|shownCuratorCompass|shownUAVFeed|showUAVFeed|unassignCurator|logEntities|moveInAny|setStatValue|squadParams|lbSetPictureColorDisabled|lbSetPictureColorSelected|enableMimics|everyContainer|forceAddUniform|isUniformAllowed|lbSetPictureColor|magazinesAmmoCargo|openYoutubeVideo|vectorAdd|vectorCos|vectorCrossProduct|vectorDiff|vectorDistance|vectorDistanceSqr|vectorDotProduct|vectorMagnitude|vectorMagnitudeSqr|vectorMultiply|visibleCompass|visibleGPS|visibleWatch|weaponsItemsCargo|allMines|BIS_fnc_animateTaskWaypoint|BIS_fnc_arsenal|BIS_fnc_getUnitInsignia|BIS_fnc_setUnitInsignia|configClasses|detectedMines|disableUAVConnectability|enableUAVConnectability|isAutotest|isUAVConnectable|mineDetectedBy|reverse|ctrlClassName|ctrlCreate|ctrlDelete|getCargoIndex|lockCameraTo|pushBack|setTimeMultiplier|timeMultiplier|vectorFromTo|vectorNormalized|addBackpackGlobal|addMagazineAmmoCargo|addToRemainsCollector|addWeaponTurret|BIS_fnc_setMissionStatusSlot|BIS_fnc_showMissionStatus|ctrlModel|ctrlModelDirAndUp|ctrlModelScale|ctrlSetModel|ctrlSetModelDirAndUp|ctrlSetModelScale|deleteAt|deleteRange|deleteVehicleCrew|getDirVisual|getHit|getPosASLVisual|getPosATLVisual|getPosVisual|getPosWorld|isCollisionLightOn|isInRemainsCollector|isLightOn|modelToWorldVisual|removeBackpackGlobal|removeFromRemainsCollector|removeWeaponTurret|setCollisionLight|setPilotLight|setPosWorld|turretLocal|vectorDirVisual|vectorUpVisual|worldToModelVisual|airDensityRTD|allTurrets|BIS_fnc_didJIP|canSlingLoad|difficultyEnabledRTD|enablePersonTurret|enableRopeAttach|enginesIsOnRTD|enginesRpmRTD|enginesTorqueRTD|fullCrew|getSlingLoad|isObjectRTD|magazineTurretAmmo|ropeAttachedObjects|ropeAttachedTo|ropeAttachEnabled|ropeAttachTo|ropeCreate|ropeCut|ropeDestroy|ropeDetach|ropeEndPosition|ropeLength|ropes|ropeUnwind|ropeUnwound|rotorsForcesRTD|rotorsRpmRTD|serverCommandExecutable|setCustomWeightRTD|setMagazineTurretAmmo|setSlingLoad|slingLoadAssistantShown|weightRTD|wingsForcesRTD|BIS_fnc_configExtremes|BIS_fnc_openFieldManual|configProperties|getObjectDLC|getPersonUsedDLCs|setUnloadInCombat|shownChat|addWeaponItem|allControls|allDisplays|allVariables|configSourceMod|getObjectMaterials|getObjectTextures|removeSecondaryWeaponItem|turretOwner|append|configSourceModList|enableUAVWaypoints|groupOwner|setGroupOwner|waypointsEnabledUAV|BIS_fnc_dynamicGroups|BIS_fnc_garage|BIS_fnc_initVehicle|channelEnabled|controlsGroupCtrl|currentChannel|Dynamic_Groups|enableChannel|getPlayerChannel|getSuppression|isTurnedOut|isWeaponDeployed|isWeaponRested|leaderboardRequestRowsFriends|MP_End_Game|Revive|setCurrentChannel|setSuppression|BIS_fnc_dynamicGroups|BIS_fnc_garage|BIS_fnc_initVehicle|channelEnabled|controlsGroupCtrl|currentChannel|Dynamic_Groups|enableChannel|getPlayerChannel|getSuppression|isTurnedOut|isWeaponDeployed|isWeaponRested|leaderboardRequestRowsFriends|Revive|setCurrentChannel|setSuppression|diag_activeMissionFSMs|diag_activeSQFScripts|diag_activeSQSScripts|sort|lbSetSelectColor|lbSetSelectColorRight|profileNameSteam|allPlayers|arrayIntersect|BIS_fnc_unitHeadgear|configHierarchy|currentNamespace|currentThrowable|getObjectViewDistance|isObjectHidden|param|params|roleDescription|serverName|setGroupIdGlobal|worldSize|AGLToASL|ASLToAGL|CfgRemoteExec|didJIP|didJIPOwner|distance2D|getAllHitPointsDamage|getHitIndex|getModelInfo|getObjectType|joinString|lineIntersectsSurfaces|objectParent|remoteExec|remoteExecCall|setHitIndex|splitString|targetKnowledge|ctrlAngle|disableNVGEquipment|disableRemoteSensors|getRemoteSensorsDisabled|magazinesAllTurrets|shownHUD|allowSprint|enableStamina|flagSide|flagTexture|getAnimAimPrecision|getAnimSpeedCoef|getMousePosition|getStamina|inPolygon|isEqualType|isEqualTypeAll|isEqualTypeAny|isEqualTypeArray|isEqualTypeParams|isSprintAllowed|isStaminaEnabled|nearestTerrainObjects|setAnimSpeedCoef|setCustomAimCoef|setObjectMaterialGlobal|setStamina|setStaminaScheme|add3DENConnection|add3DENEventHandler|add3DENLayer|all3DENEntities|apply|BIS_fnc_sideIsEnemy|BIS_fnc_sideIsFriendly|checkVisibility|clientOwner|collect3DENHistory|create3DENComposition|create3DENEntity|current3DENOperation|cursorObject|delete3DENEntities|do3DENAction|edit3DENMissionAttributes|exportJIPMessages|get3DENActionState|get3DENAttribute|get3DENCamera|get3DENConnections|get3DENEntity|get3DENEntityID|get3DENGrid|get3DENIconsVisible|get3DENLayerEntities|get3DENLinesVisible|get3DENMissionAttribute|get3DENMouseOver|get3DENSelected|getClientStateNumber|getMissionConfig|getMissionConfigValue|getPlayerScores|getRelDir|getRelPos|is3DEN|is3DENMultiplayer|isFilePatchingEnabled|leaderboardDeInit|leaderboardGetRows|leaderboardInit|lockIdentity|logNetwork|logNetworkTerminate|missionVersion|move3DENCamera|ppEffectEnabled|pushBackUnique|remove3DENConnection|remove3DENEventHandler|remove3DENLayer|removeAll3DENEventHandlers|selectRandom|set3DENAttribute|set3DENAttributes|set3DENGrid|set3DENIconsVisible|set3DENLayer|set3DENLinesVisible|set3DENMissionAttributes|set3DENObjectType|tvSetText|animateSource|animationNames|animationSourcePhase|BIS_fnc_groupFromNetId|BIS_fnc_netId|BIS_fnc_objectFromNetId|canSuspend|createSimpleObject|ctrlParentControlsGroup|diag_codePerformance|difficultyOption|displayParent|drawPolygon|getCameraViewDirection|getUnitLoadout|getUnitTrait|hideSelection|inArea|moonPhase|roadAt|selectionNames|setSimpleTaskCustomData|setSimpleTaskType|setUnitLoadout|setUnitTrait|setWaypointForceBehaviour|sideAmbientLife|sideEmpty|taskAlwaysVisible|taskCustomData|taskType|waypointForceBehaviour|BIS_fnc_exportEditorPreviews|BIS_fnc_showRespawnMenuDisableItem|commandSuppressiveFire|doSuppressiveFire|getTerrainGrid|Pixel_Grid_System|pixelGrid|pixelH|pixelW|screenshot|shownScoretable|showScoretable|useAISteeringComponent|userInputDisabled|addOwnedMine|addPlayerScores|Arma_3_Revive|BIS_fnc_adjustSimpleObject|BIS_fnc_createSimpleObject|BIS_fnc_EXP_camp_playSubtitles|BIS_fnc_holdActionAdd|BIS_fnc_holdActionRemove|BIS_fnc_isThrowable|BIS_fnc_replaceWithSimpleObject|BIS_fnc_simpleObjectData|canVehicleCargo|createMPCampaignDisplay|ctrlSetAngle|ctrlSetFontHeightSecondary|ctrlSetFontSecondary|enableAimPrecision|enableVehicleCargo|flyInHeightASL|forcedMap|getAimingCoef|getAllOwnedMines|getCustomAimingCoef|getMissionDLCs|getShotParents|getVehicleCargo|getWeaponSway|isVehicleCargo|missionDifficulty|modParams|openDLCPage|pixelGridBase|pixelGridNoUIScale|removeAllOwnedMines|removeOwnedMine|setVehicleCargo|tvSetPictureColorDisabled|tvSetPictureColorSelected|tvSetPictureRight|tvSetPictureRightColor|tvSetPictureRightColorDisabled|tvSetPictureRightColorSelected|vehicleCargoEnabled|getPilotCameraDirection|getPilotCameraPosition|getPilotCameraRotation|getPilotCameraTarget|hasPilotCamera|setPilotCameraDirection|setPilotCameraRotation|setPilotCameraTarget|inAreaArray|selectMax|selectMin|toFixed|actionIDs|actionParams|allCutLayers|allSimpleObjects|ctAddHeader|ctAddRow|ctClear|ctCurSel|ctData|ctFindHeaderRows|ctFindRowHeader|ctHeaderControls|ctHeaderCount|ctRemoveHeaders|ctRemoveRows|ctRowControls|ctRowCount|ctSetCurSel|ctSetData|ctSetHeaderTemplate|ctSetRowTemplate|ctSetValue|ctValue|deleteGroupWhenEmpty|diag_activeScripts|diag_drawMode|diag_list|diag_mergeConfigFile|diag_recordTurretLimits|enableAudioFeature|enableWeaponDisassembly|endl|environmentEnabled|flagAnimationPhase|getAllEnvSoundControllers|getAllSoundControllers|getEnvSoundController|getSoundController|getSoundControllerResult|isGroupDeletedWhenEmpty|isMultiplayerSolo|isRemoteExecuted|isRemoteExecutedJIP|isSimpleObject|parseSimpleArray|ReportRemoteTarget|setFlagAnimationPhase|setShotParents|setVehicleRadar|setVehicleReceiveRemoteTargets|setVehicleReportOwnPosition|setVehicleReportRemoteTargets|setVelocityModelSpace|targets|terrainIntersectAtASL|unitAimPosition|unitAimPositionVisual|unitIsUAV|vehicleReceiveRemoteTargets|vehicleReportOwnPosition|vehicleReportRemoteTargets|visibleScoretable)\\b", "name": "entity.name.function.sqf" }, - "ArmA3_1-58": { - "match": "\\s*(?i)(animateSource|animationNames|animationSourcePhase|Arma 3 Tasks Overhaul|BIS fnc groupFromNetId|BIS fnc netId|BIS fnc objectFromNetId|BIS fnc sunriseSunsetTime|canSuspend|configSourceAddonList|createSimpleObject|ctrlParentControlsGroup|diag codePerformance|difficultyOption|displayParent|drawPolygon|getCameraViewDirection|getUnitLoadout|getUnitTrait|hideSelection|inArea|moonPhase|roadAt|selectionNames|setSimpleTaskAlwaysVisible|setSimpleTaskCustomData|setSimpleTaskType|setUnitLoadout|setUnitTrait|setWaypointForceBehaviour|sideAmbientLife|sideEmpty|taskAlwaysVisible|taskCustomData|taskMarkerOffset|taskType|waypointForceBehaviour)\\b", - "name": "entity.name.function.sqf" - }, - "ArmA3_1-60": { - "match": "\\s*(?i)(BIS fnc exportEditorPreviews|BIS fnc showRespawnMenuDisableItem|commandSuppressiveFire|doSuppressiveFire|getTerrainGrid|pixelGrid|pixelH|pixelW|screenshot|shownScoretable|showScoretable|userInputDisabled)\\b", - "name": "entity.name.function.sqf" - }, - "ArmA3_1-62": { - "match": "\\s*(?i)(addOwnedMine|addPlayerScores|BIS fnc isThrowable|canVehicleCargo|createMPCampaignDisplay|ctrlSetAngle|ctrlSetFontHeightSecondary|ctrlSetFontSecondary|enableAimPrecision|enableVehicleCargo|flyInHeightASL|forcedMap|getAimingCoef|getAllOwnedMines|getCustomAimingCoef|getMissionDLCs|getShotParents|getVehicleCargo|getWeaponSway|isVehicleCargo|missionDifficulty|modParams|openDLCPage|pixelGridBase|pixelGridNoUIScale|registerRemoteExecFunc|removeAllOwnedMines|removeOwnedMine|setVehicleCargo|tvSetPictureColorDisabled|tvSetPictureColorSelected|tvSetPictureRight|tvSetPictureRightColor|tvSetPictureRightColorDisabled|tvSetPictureRightColorSelected|vehicleCargoEnabled|useAISteeringComponent)\\b", - "name": "entity.name.function.sqf" - }, - "ArmA3_1-64_1-66": { - "match": "\\s*(?i)(getPilotCameraDirection|getPilotCameraPosition|getPilotCameraRotation|getPilotCameraTarget|hasPilotCamera|setPilotCameraDirection|setPilotCameraRotation|setPilotCameraTarget|inAreaArray|selectMax|selectMin|toFixed)\\b", - "name": "entity.name.function.sqf" + "CBA": { + "match": "\\s*(?i)(CBA_fnc_(actionArgument|addBackpackCargo|addBinocularMagazine|addBISEventHandler|addClassEventHandler|addDisplayHandler|addEventHandler|addEventHandlerArgs|addItem|addItemCargo|addKeybind|addKeybindToFleximenu|addKeyHandler|addKeyHandlerFromConfig|addMagazine|addMagazineCargo|addPerFrameHandler|addPlayerAction|addPlayerEventHandler|addWaypoint|addWeapon|addWeaponCargo|benchmarkFunction|binocularMagazine|canUseWeapon|capitalize|CBA_help_fnc_setCreditsLine|CBA_help_fnc_setVersionLine|CBA_statemachine_fnc_addState|CBA_statemachine_fnc_addTransition|CBA_statemachine_fnc_clockwork|CBA_statemachine_fnc_create|CBA_statemachine_fnc_createFromConfig|CBA_statemachine_fnc_delete|CBA_statemachine_fnc_toString|CBA_statemachine_fnc_updateList|changeKeyHandler|clearWaypoints|compatibleItems|createMarker|createNamespace|createTrigger|currentMagazineIndex|currentUnit|debug|deleteEntity|deleteNamespace|directCall|dropItem|dropMagazine|dropWeapon|error|execNextFrame|filter|find|findEntity|findMax|findMin|findNil|findNull|findTypeName|findTypeOf|floatToString|formatElapsedTime|formatNumber|getAlive|getAnimType|getArg|getArrayDiff|getArrayElements|getAspectRatio|getConfigEntry|getDistance|getFirer|getFov|getGroup|getGroupIndex|getItemConfig|getKeybind|getMagazineIndex|getMarkerPersistent|getMuzzles|getNearest|getNearestBuilding|getObjectConfig|getPos|getPosFromString|getSharedGroup|getTerrainProfile|getTurret|getUISize|getUnitAnim|getUnitDeathAnim|getVolume|getWeaponModes|globalEvent|globalEventJIP|globalExecute|globalSay|globalSay3d|hashCreate|hashEachPair|hashGet|hashHasKey|hashRem|hashSet|headDir|inArea|inheritsFrom|inject|isAlive|isHash|isPerson|isRecompileEnabled|isScheduled|isTurnedOut|isUnitGetOutAnim|join|leftTrim|localEvent|log|mapDirTo|mapGridToPos|mapRelPos|modelHeadDir|moduleAttack|moduleDefend|modulePatrol|nearPlayer|northingReversed|objectRandom|ownerEvent|parseYAML|peek|players|polar2vect|publicVariable|randPos|randPosArea|readKeyFromConfig|realHeight|registerKeybind|registerKeybindModPrettyName|registerKeybindToFleximenu|reject|remoteEvent|removeBackpackCargo|removeBinocularMagazine|removeDisplayHandler|removeEventHandler|removeItem|removeItemCargo|removeKeyHandler|removeMagazine|removeMagazineCargo|removePerFrameHandler|removePlayerAction|removePlayerEventHandler|removeWeapon|removeWeaponCargo|replace|rightTrim|scaleVect|scaleVectTo|searchNearby|select|selectWeapon|serverEvent|setHeight|setMarkerPersistent|setPos|setVarNet|shuffle|simplifyAngle|simplifyAngle180|sortNestedArray|split|strLen|substr|substring|switchPlayer|targetEvent|taskAttack|taskDefend|taskPatrol|taskSearchArea|test|trim|turretDir|turretPath|turretPathWeapon|vect2Polar|vectAdd|vectCross|vectCross2D|vectDir|vectDot|vectElev|vectMagn|vectMagn2D|vectRotate2D|vectSubtract|vehicleRole|viewDir|waitAndExecute|waitUntilAndExecute|weaponComponents))\\b", + "name": "entity.name.function.sqf.cba" }, - "ArmA3_dev": { - "match": "\\s*(?i)(actionIDs|actionParams|allCutLayers|diag_activeScripts|diag_drawMode|diag_list|diag_mergeConfigFile|diag_recordTurretLimits|enableAudioFeature|getAllEnvSoundControllers|getAllSoundControllers|getEnvSoundController|getSoundController|getSoundControllerResult|isMultiplayerSolo|isRemoteExecuted|isRemoteExecutedJIP|setShotParents|unitAimPosition|unitAimPositionVisual|unitIsUAV|visibleScoretable)\\b", - "name": "entity.name.function.sqf" + "ACE3": { + "match": "\\s*(?i)(ace_(backpacks_fnc_isBackpack|cargo_fnc_makeLoadable|common_fnc_addMapMarkerCreatedEventHandler|common_fnc_addSyncedEventHandler|common_fnc_addToInventory|common_fnc_ambientBrightness|common_fnc_arithmeticGetResult|common_fnc_arithmeticSetSource|common_fnc_binarizeNumber|common_fnc_blurScreen|common_fnc_canInteractWith|common_fnc_checkPBOs|common_fnc_codeToString|common_fnc_createOrthonormalReference|common_fnc_currentChannel|common_fnc_debug|common_fnc_defineVariable|common_fnc_displayIcon|common_fnc_displayText|common_fnc_displayTextPicture|common_fnc_displayTextStructured|common_fnc_doAnimation|common_fnc_dropBackpack|common_fnc_getAllDefinedSetVariables|common_fnc_getChildren|common_fnc_getConfigCommander|common_fnc_getConfigGunner|common_fnc_getDefinedVariableDefault|common_fnc_getDisplayConfigName|common_fnc_getDoorTurrets|common_fnc_getFirstObjectIntersection|common_fnc_getFirstTerrainIntersection|common_fnc_getGunner|common_fnc_getInPosition|common_fnc_getItemType|common_fnc_getLightProperties|common_fnc_getLightPropertiesWeapon|common_fnc_getMapGridFromPos|common_fnc_getMapPosFromGrid|common_fnc_getName|common_fnc_getPitchBankYaw|common_fnc_getReflectorsWithSelections|common_fnc_getTargetAzimuthAndInclination|common_fnc_getTargetDistance|common_fnc_getTargetObject|common_fnc_getTurnedOnLights|common_fnc_getTurretCommander|common_fnc_getTurretConfigPath|common_fnc_getTurretCopilot|common_fnc_getTurretDirection|common_fnc_getTurretGunner|common_fnc_getTurretIndex|common_fnc_getTurretsFFV|common_fnc_getTurretsOther|common_fnc_getUavControlPosition|common_fnc_getVehicleCargo|common_fnc_getVehicleCodriver|common_fnc_getVehicleCrew|common_fnc_getVehicleUAVCrew|common_fnc_getVersion|common_fnc_getWeaponAzimuthAndInclination|common_fnc_getWeaponIndex|common_fnc_getWeaponModes|common_fnc_getWeaponMuzzles|common_fnc_getWeaponState|common_fnc_getWeaponType|common_fnc_getWindDirection|common_fnc_getZoom|common_fnc_hadamardProduct|common_fnc_hasHatch|common_fnc_hasItem|common_fnc_hasMagazine|common_fnc_headBugFix|common_fnc_hideUnit|common_fnc_interpolateFromArray|common_fnc_inTransitionAnim|common_fnc_isAwake|common_fnc_isEngineer|common_fnc_isEOD|common_fnc_isFeatureCameraActive|common_fnc_isInBuilding|common_fnc_isModLoaded|common_fnc_isPlayer|common_fnc_isUnderwater|common_fnc_lightIntensityFromObject|common_fnc_loadPerson|common_fnc_loadPersonLocal|common_fnc_monitor|common_fnc_muteUnit|common_fnc_numberToDigits|common_fnc_numberToDigitsString|common_fnc_numberToString|common_fnc_playConfigSound3D|common_fnc_player|common_fnc_playerSide|common_fnc_positionToASL|common_fnc_progressBar|common_fnc_removeMapMarkerCreatedEventHandler|common_fnc_sanitizeString|common_fnc_sendRequest|common_fnc_setDefinedVariable|common_fnc_setDisableUserInputStatus|common_fnc_setHearingCapability|common_fnc_setParameter|common_fnc_setPitchBankYaw|common_fnc_setProne|common_fnc_setVolume|common_fnc_showHud|common_fnc_statusEffect_get|common_fnc_statusEffect_set|common_fnc_stringCompare|common_fnc_stringRemoveWhiteSpace|common_fnc_stringToColoredText|common_fnc_switchToGroupSide|common_fnc_toBin|common_fnc_toBitmask|common_fnc_toHex|common_fnc_toNumber|common_fnc_unhideUnit|common_fnc_uniqueElements|common_fnc_unmuteUnit|common_fnc_useItem|common_fnc_useMagazine|common_fnc_watchVariable|dogtags_fnc_disableFactionDogtags|dragging_fnc_setCarryable|dragging_fnc_setDraggable|explosives_fnc_addClacker|explosives_fnc_addToSpeedDial|explosives_fnc_canDefuse|explosives_fnc_canDetonate|explosives_fnc_connectExplosive|explosives_fnc_defuseExplosive|explosives_fnc_detonateExplosive|explosives_fnc_dialPhone|explosives_fnc_getDetonators|explosives_fnc_getPlacedExplosives|explosives_fnc_getSpeedDialExplosive|explosives_fnc_hasExplosives|explosives_fnc_hasPlacedExplosives|explosives_fnc_interactEH|explosives_fnc_placeExplosive|explosives_fnc_removeFromSpeedDial|explosives_fnc_scriptedExplosive|explosives_fnc_setupExplosive|explosives_fnc_startDefuse|explosives_fnc_startTimer|explosives_fnc_triggerType|fastroping_fnc_deployAI|goggles_fnc_applyDirtEffect|goggles_fnc_applyDustEffect|goggles_fnc_clearGlasses|goggles_fnc_externalCamera|goggles_fnc_isDivingGoggles|goggles_fnc_isGogglesVisible|goggles_fnc_isInRotorWash|goggles_fnc_removeDirtEffect|goggles_fnc_removeDustEffect|goggles_fnc_removeGlassesEffect|goggles_fnc_removeRainEffect|interact_menu_fnc_addActionToClass|interact_menu_fnc_createAction|logistics_wirecutter_fnc_interactEH|map_gestures_fnc_addGroupColorMapping|medical_fnc_actionPlaceInBodyBag|medical_fnc_actionRemoveTourniquet|medical_fnc_addDamageToUnit|medical_fnc_addHeartRateAdjustment|medical_fnc_addToLog|medical_fnc_addToTriageCard|medical_fnc_addUnconsciousCondition|medical_fnc_addVitalLoop|medical_fnc_adjustPainLevel|medical_fnc_canAccessMedicalEquipment|medical_fnc_canTreat|medical_fnc_displayTriageCard|medical_fnc_dropDownTriageCard|medical_fnc_getTriageStatus|medical_fnc_getUnconsciousCondition|medical_fnc_hasItem|medical_fnc_hasItems|medical_fnc_hasTourniquetAppliedTo|medical_fnc_isInMedicalFacility|medical_fnc_isInMedicalVehicle|medical_fnc_isMedic|medical_fnc_isMedicalVehicle|medical_fnc_itemCheck|medical_fnc_selectionNameToNumber|medical_fnc_setCardiacArrest|medical_fnc_setDead|medical_fnc_setHitPointDamage|medical_fnc_setUnconscious|medical_fnc_showBloodEffect|medical_fnc_treatment|medical_fnc_treatmentAdvanced_bandage|medical_fnc_treatmentAdvanced_CPR|medical_fnc_treatmentAdvanced_CPRLocal|medical_fnc_treatmentAdvanced_medication|medical_fnc_treatmentAdvanced_medicationLocal|medical_fnc_treatmentIV|medical_fnc_treatmentIVLocal|medical_fnc_unconsciousPFH|medical_fnc_useItem|medical_fnc_useItems|mk6mortar_fnc_canLoadMagazine|mk6mortar_fnc_canUnloadMagazine|mk6mortar_fnc_loadMagazine|mk6mortar_fnc_loadMagazineTimer|mk6mortar_fnc_unloadMagazine|mk6mortar_fnc_unloadMagazineTimer|nametags_fnc_setFactionRankIcons|parachute_fnc_showAltimeter|rearm_fnc_disable|refuel_fnc_getFuel|refuel_fnc_makeJerryCan|refuel_fnc_reset|refuel_fnc_setFuel|repair_fnc_canRepair|repair_fnc_getClaimObjects|repair_fnc_hasItems|repair_fnc_isEngineer|repair_fnc_isInRepairFacility|repair_fnc_isNearRepairVehicle|repair_fnc_isRepairVehicle|repair_fnc_repair|repair_fnc_useItem|repair_fnc_useItems|slideshow_fnc_createSlideshow|spectator_fnc_interrupt|spectator_fnc_setCameraAttributes|spectator_fnc_setSpectator|spectator_fnc_stageSpectator|spectator_fnc_updateCameraModes|spectator_fnc_updateSpectatableSides|spectator_fnc_updateUnits|spectator_fnc_updateVisionModes|switchunits_fnc_isValidAi|switchunits_fnc_nearestPlayers|switchunits_fnc_switchBack|switchunits_fnc_switchUnit|tagging_fnc_addCustomTag|tagging_fnc_tag|ui_fnc_setElementVisibility|vehiclelock_fnc_addKeyForVehicle|vehiclelock_fnc_serverSetupCustomKeyEH|vehiclelock_fnc_setVehicleLockEH|weaponselect_fnc_putWeaponAway|weaponselect_fnc_selectNextGrenade))\\b", + "name": "entity.name.function.sqf.ace3" }, "expression": { "name": "meta.expression.sqf", @@ -184,21 +156,10 @@ "statements": { "name": "meta.expression.sqf", "patterns": [ - { "include": "#BIS-functions" }, - { "include": "#vObject-statements" }, - { "include": "#ab-key-statements" }, - { "include": "#c-key-statements" }, - { "include": "#defg-key-statements" }, - { "include": "#hijklmn-key-statements" }, - { "include": "#opqr-key-statements" }, - { "include": "#s-key-statements" }, - { "include": "#tuvw-key-statements" }, - { "include": "#ArmA3_1-56" }, - { "include": "#ArmA3_1-58" }, - { "include": "#ArmA3_1-60" }, - { "include": "#ArmA3_1-62" }, - { "include": "#ArmA3_1-64_1-66" }, - { "include": "#ArmA3_dev" } + { "include": "#OFP" }, + { "include": "#ARMA" }, + { "include": "#ARMA2" }, + { "include": "#ARMA3" } ] }, "declaration": { @@ -323,7 +284,7 @@ "name": "keyword.operator.manipulative.sqf" }, "null-literal": { - "match": "\\b(null|nil)\\b", + "match": "\\b(null|nil|controlNull|displayNull|grpNull|locationNull|netObjNull|objNull|scriptNull|taskNull|teamMemberNull|configNull)\\b", "name": "constant.language.null.sqf" }, "numeric-literal": { @@ -401,7 +362,7 @@ ] }, "reserved-literal": { - "match": "\\s*(?i)(this|_this|_x|_forEachIndex|_exception|_thisScript|_thisFSM|thisList|thisTrigger)\\b", + "match": "\\s*(?i)(this|_this|_x|_forEachIndex|_exception|_thisScript|_thisFSM|thisList|thisTrigger|west|east|resistance|civilian|independent|blufor|opfor)\\b", "name": "variable.language.reserved.sqf" }, "type": { diff --git a/syntaxes/sqf.min.json b/syntaxes/sqf.min.json new file mode 100644 index 0000000..d36ddaa --- /dev/null +++ b/syntaxes/sqf.min.json @@ -0,0 +1 @@ +{"fileTypes":["sqf"],"name":"sqf","patterns":[{"include":"#expression"}],"repository":{"access-modifier":{"match":"\\b(private)\\b","name":"storage.modifier.sqf"},"array-literal":{"begin":"\\[","beginCaptures":{"0":{"name":"meta.brace.square.sqf"}},"end":"\\]","endCaptures":{"0":{"name":"meta.brace.square.sqf"}},"name":"meta.array.literal.sqf","patterns":[{"include":"#expression"}]},"assignment-operator":{"match":"=","name":"keyword.operator.assignment.sqf"},"block":{"begin":"\\{","beginCaptures":{"0":{"name":"meta.brace.curly.sqf"}},"end":"\\}","endCaptures":{"0":{"name":"meta.brace.curly.sqf"}},"name":"meta.block.sqf","patterns":[{"include":"#expression"},{"include":"#object-member"}]},"boolean-literal":{"match":"(\\s*)(false|true)\\b","name":"constant.language.boolean.sqf"},"comment":{"name":"comment.sqf","patterns":[{"include":"#comment-block"},{"include":"#comment-line"}]},"comment-block":{"begin":"/\\*","end":"\\*/","name":"comment.block.sqf"},"comment-line":{"match":"(//).*$\\n?","name":"comment.line.sqf"},"comparison-operator":{"match":"==|!=|>|<|greater|greater=|less|less=|not","name":"keyword.operator.comparison.sqf"},"condition-operator":{"match":"!|&&|\\|\\||:|([^A-Za-z0-9]|\\b)and([^A-Za-z0-9]|\\b)|([^A-Za-z0-9])or([^A-Za-z0-9])","name":"keyword.operator.condition.sqf"},"control-statement":{"match":"\\s*(?i)(then|do|else|exit|exitWith|for|forEach|if|return|switch|while|from|to|step|forEachMember|forEachMemberAgent|forEachMemberTeam)\\b","name":"keyword.control.sqf"},"decl-block":{"begin":"\\{","beginCaptures":{"0":{"name":"meta.brace.curly.sqf"}},"end":"\\}","endCaptures":{"0":{"name":"meta.brace.curly.sqf"}},"name":"meta.decl.block.sqf","patterns":[{"include":"#expression"}]},"vObject-statements":{"match":"\\s*(?i)(player|cursorTarget)\\b","name":"variable.language.vobject.sqf"},"OFP":{"match":"\\s*(?i)(abs|accTime|acos|action|addMagazine|addMagazineCargo|addRating|addScore|addWeapon|addWeaponCargo|alive|allowDammage|allowFleeing|allowGetIn|ammo|and|asin|assignAsCargo|assignAsCommander|assignAsDriver|assignAsGunner|atan|atan2|atg|behaviour|benchmark|buildingPos|cadetMode|camCommand|camCommit|camCommitted|camCreate|camDestroy|cameraEffect|camSetBank|camSetDir|camSetDive|camSetFov|camSetFovRange|camSetPos|camSetRelPos|camSetTarget|canFire|canMove|canStand|captive|clearMagazineCargo|clearWeaponCargo|combatMode|commander|commandFire|commandFollow|commandMove|commandStop|commandTarget|commandWatch|cos|count|countEnemy|countFriendly|countSide|countType|countUnknown|crew|cutObj|cutRsc|cutText|daytime|debugLog|deg|direction|disableAI|disableUserInput|distance|doFire|doFollow|doMove|doStop|doTarget|doWatch|driver|enableEndDialog|enableRadio|exp|fadeMusic|fadeSound|false|fire|flag|flagOwner|fleeing|flyInHeight|forceEnd|format|formation|formLeader|fuel|getDammage|getDir|getMarkerPos|getPos|globalChat|globalRadio|goto|group|groupChat|groupRadio|gunner|handsHit|hasWeapon|hint|hintC|hintCadet|in|inflame|isNull|knowsAbout|land|leader|list|ln|local|localize|lock|locked|lockWP|log|mod|move|moveInCargo|moveInCommander|moveInDriver|moveInGunner|musicVolume|name|nearestBuilding|nearestObject|objStatus|or|orderGetIn|pi|playMove|playMusic|playSound|plus|rad|random|rating|removeAllWeapons|removeMagazine|removeMagazines|removeWeapon|reveal|saveGame|saveVar|score|select|setAccTime|setAmmoCargo|setBehaviour|setCaptive|setCombatMode|setDammage|setDir|setFace|setFaceAnimation|setFlagOwner|setFlagSide|setFlagTexture|setFog|setFormation|setFormDir|setFuel|setFuelCargo|setGroupId|setIdentity|setMarkerPos|setMarkerType|setMimic|setOvercast|setPos|setRadioMsg|setRepairCargo|setSpeedMode|setUnitPos|setViewDistance|showCinemaBorder|showCompass|showGPS|showMap|shownCompass|shownGPS|shownMap|shownPad|shownRadio|shownWarrant|shownWatch|showPad|showRadio|showWarrant|showWatch|side|sideRadio|sin|skipTime|someAmmo|soundVolume|speed|speedMode|sqrt|stop|stopped|switchCamera|switchLight|switchMove|tan|textLog|tg|time|titleCut|titleObj|titleRsc|titleText|true|unassignVehicle|unitReady|units|vehicle|vehicleRadio|addMagazinePool|addWeaponPool|animate|animationPhase|cheatsEnabled|clearMagazinePool|clearWeaponPool|deleteIdentity|deleteStatus|fillWeaponsFromPool|loadIdentity|loadStatus|magazines|object|onBriefingGear|onBriefingGroup|onBriefingNotes|onBriefingPlan|pickWeaponPool|primaryWeapon|putWeaponPool|queryMagazinePool|queryWeaponPool|resize|saveIdentity|saveStatus|say|secondaryWeapon|set|setObjectTexture|setRain|setSkill|setTerrainGrid|skill|weapons|inflamed|lightIsOn|addAction|removeAction|getMarkerColor|getMarkerSize|getMarkerType|getWPPos|requiredVersion|setMarkerColor|setMarkerSize|setWPPos|forceMap|mapAnimAdd|mapAnimClear|mapAnimCommit|mapAnimDone|selectWeapon|scudState|createUnit|createVehicle|deleteVehicle|estimatedTimeLeft|join|publicVariable|sideChat|vehicleChat|buttonAction|buttonSetAction|closeDialog|createDialog|ctrlEnable|ctrlEnabled|ctrlSetText|ctrlShow|ctrlText|ctrlVisible|damage|drop|lbAdd|lbClear|lbColor|lbCurSel|lbData|lbDelete|lbPicture|lbSetColor|lbSetCurSel|lbSetData|lbSetPicture|lbSetValue|lbSize|lbText|lbValue|markerColor|markerPos|markerSize|markerType|position|setDamage|waypointPosition|getWorld|dialog|enemy|friendly|sideEnemy|sideFriendly|missionName|missionStart|playersNumber|setVelocity|velocity|addEventHandler|comment|onMapSingleClick|preprocessFile|removeAllEventHandlers|removeEventHandler|sliderPosition|sliderRange|sliderSetPosition|sliderSetRange|sliderSetSpeed|sliderSpeed|engineOn|isEngineOn|loadFile|sideLogic|typeOf)\\b","name":"entity.name.function.sqf"},"TOH":{"match":"\\s*(?i)(batteryChargeRTD|BIS_fnc_ambientBlacklist|BIS_fnc_ambientBlacklistAdd|BIS_fnc_ambientBoats|BIS_fnc_ambientHelicopters|BIS_fnc_ambientPlanes|BIS_fnc_ambientPostprocess|BIS_fnc_animType|BIS_fnc_assignPlayerRole|BIS_fnc_camFollow|BIS_fnc_convertUnits|BIS_fnc_counter|BIS_fnc_credits|BIS_fnc_ctrlTextHeight|BIS_fnc_dbClassCheck|BIS_fnc_dbClassId|BIS_fnc_dbClassIndex|BIS_fnc_dbClassList|BIS_fnc_dbClassRemove|BIS_fnc_dbClassReturn|BIS_fnc_dbClassSet|BIS_fnc_dbConfigPath|BIS_fnc_dbImportConfig|BIS_fnc_dbImportXML|BIS_fnc_dbisClass|BIS_fnc_dbisValue|BIS_fnc_dbPrint|BIS_fnc_dbSymbolClass|BIS_fnc_dbSymbolValue|BIS_fnc_dbValueCheck|BIS_fnc_dbValueId|BIS_fnc_dbValueIndex|BIS_fnc_dbValueList|BIS_fnc_dbValueRemove|BIS_fnc_dbValueReturn|BIS_fnc_dbValueSet|BIS_fnc_diaryHints|BIS_fnc_diaryMaps|BIS_fnc_displayClouds|BIS_fnc_displayColorGet|BIS_fnc_displayColorSet|BIS_fnc_displayControls|BIS_fnc_displayLoading|BIS_fnc_displayMission|BIS_fnc_displayName|BIS_fnc_displayResize|BIS_fnc_errorMsg|BIS_fnc_functionPath|BIS_fnc_functionsDebug|BIS_fnc_GC|BIS_fnc_GCinit|BIS_fnc_genericSentence|BIS_fnc_genericSentenceInit|BIS_fnc_getIDC|BIS_fnc_getIDD|BIS_fnc_GUIbackground|BIS_fnc_GUIeditor|BIS_fnc_GUIgrid|BIS_fnc_GUIgridToProfile|BIS_fnc_GUIhint|BIS_fnc_guiMessage|BIS_fnc_GUInewsfeed|BIS_fnc_halt|BIS_fnc_helicopterCanFly|BIS_fnc_helicopterDamage|BIS_fnc_helicopterGetHitpoints|BIS_fnc_helicopterSeat|BIS_fnc_helicopterSeatMove|BIS_fnc_helicopterType|BIS_fnc_help|BIS_fnc_HUDLimits|BIS_fnc_isLocalized|BIS_fnc_kbCanSpeak|BIS_fnc_kbCreateDummy|BIS_fnc_kbIsSpeaking|BIS_fnc_kbMenu|BIS_fnc_kbPriority|BIS_fnc_kbSentence|BIS_fnc_kbSkip|BIS_fnc_kbTell|BIS_fnc_kbTellLocal|BIS_fnc_kbTopicConfig|BIS_fnc_keypointsExport|BIS_fnc_keypointsExportFromKML|BIS_fnc_KMLimport|BIS_fnc_markerCreate|BIS_fnc_markerParams|BIS_fnc_markerPath|BIS_fnc_moveIn|BIS_fnc_MP (Take On Helicopters)|BIS_fnc_MPexec|BIS_fnc_nearestHelipad|BIS_fnc_noFlyZone|BIS_fnc_noFlyZonesCreate|BIS_fnc_noFlyZonesExport|BIS_fnc_numberDigits|BIS_fnc_numberText|BIS_fnc_onEnd|BIS_fnc_onLoad|BIS_fnc_overviewAuthor|BIS_fnc_overviewDifficulty|BIS_fnc_overviewMission|BIS_fnc_overviewTerrain|BIS_fnc_overviewTimeTrial|BIS_fnc_paramIn|BIS_fnc_PIP|BIS_fnc_playerName|BIS_fnc_posDegToUTM|BIS_fnc_posDegtoUTM|BIS_fnc_posDegToWorld|BIS_fnc_position|BIS_fnc_posUTMToDeg|BIS_fnc_radioSetChannel|BIS_fnc_radioSetPlaylist|BIS_fnc_radioSetTrack|BIS_fnc_randomPos|BIS_fnc_randomPosTrigger|BIS_fnc_roundDir|BIS_fnc_saveGame|BIS_fnc_secondsToString|BIS_fnc_selectRandom|BIS_fnc_setHeight|BIS_fnc_shakeGauges|BIS_fnc_shutdown|BIS_fnc_singleMissionConfig|BIS_fnc_singleMissionKeys|BIS_fnc_singleMissionName|BIS_fnc_spawnGroup|BIS_fnc_spawnVehicle|BIS_fnc_titleText|BIS_fnc_worldArea|BIS_fnc_wpAngle|BIS_fnc_wpCheckpoint|BIS_fnc_wpFastRope|BIS_fnc_wpFormation|BIS_fnc_wpHover|BIS_fnc_wpLand|BIS_fnc_wpRestricted|BIS_fnc_wpSlingLoadAttach|BIS_fnc_wpSlingLoadDetach|BIS_fnc_wpSlingLoadDrop|BIS_fnc_wpSteady|BIS_fnc_wpTimed|BIS_fnc_wpTransport|BIS_fnc_wpWinchLoad|collectiveRTD|enableAutoStartUpRTD|enableAutoTrimRTD|enableCoPilot|getHitPointDamage|HUDMovementLevels|numberOfEnginesRTD|profileNamespace|radioChannelAdd|radioChannelCreate|radioChannelRemove|radioChannelSetCallSign|radioChannelSetLabel|ropeCreate|ropeDestroy|ropeDetach|ropeSetCargoMass|saveProfileNamespace|setActualCollectiveRTD|setAPURTD|setBatteryChargeRTD|setBatteryRTD|setBrakesRTD|setCustomWeightRTD|setEngineRPMRTD|setHitPointDamage|setPiPEffect|setRotorBrakeRTD|setStarterRTD|setThrottleRTD|setWantedRPMRTD|systemOfUnits|throttleRTD|wingsForcesRTD|assignAsCargoIndex|enableTraffic|isPiPEnabled|setTrafficDensity|setTrafficDistance|setTrafficGap|setTrafficSpeed)\\b","name":"entity.name.function.sqf"},"ARMA":{"match":"\\s*(?i)(actionKeys|actionKeysImages|actionKeysNames|activateAddons|activateKey|addSwitchableUnit|addWaypoint|animationState|assert|assignedTarget|assignTeam|attackEnabled|boundingBox|breakOut|breakTo|camCommitPrepared|cameraInterest|cameraOn|campaignConfigFile|camPreload|camPreloaded|camPrepareBank|camPrepareDir|camPrepareDive|camPrepareFocus|camPrepareFov|camPrepareFovRange|camPreparePos|camPrepareRelPos|camPrepareTarget|camSetFocus|camUseNVG|case|catch|ceil|clearRadio|closeDisplay|commandFSM|commandGetOut|compile|composeText|configFile|configName|createCenter|createDisplay|createGroup|createGuardedPoint|createMarker|createMine|createSoundSource|createTarget|createTrigger|createUnit array|createVehicleLocal|ctrlActivate|ctrlCommit|ctrlCommitted|ctrlFade|ctrlMapAnimAdd|ctrlMapAnimClear|ctrlMapAnimCommit|ctrlMapAnimDone|ctrlMapScale|ctrlParent|ctrlPosition|ctrlScale|ctrlSetActiveColor|ctrlSetBackgroundColor|ctrlSetEventHandler|ctrlSetFade|ctrlSetFocus|ctrlSetFont|ctrlSetFontH1|ctrlSetFontH1B|ctrlSetFontH2|ctrlSetFontH2B|ctrlSetFontH3|ctrlSetFontH3B|ctrlSetFontH4|ctrlSetFontH4B|ctrlSetFontH5|ctrlSetFontH5B|ctrlSetFontH6|ctrlSetFontH6B|ctrlSetFontHeight|ctrlSetFontHeightH1|ctrlSetFontHeightH2|ctrlSetFontHeightH3|ctrlSetFontHeightH4|ctrlSetFontHeightH5|ctrlSetFontHeightH6|ctrlSetFontP|ctrlSetFontPB|ctrlSetForegroundColor|ctrlSetPosition|ctrlSetScale|ctrlSetStructuredText|ctrlSetTextColor|ctrlSetTooltip|ctrlSetTooltipColorBox|ctrlSetTooltipColorShade|ctrlSetTooltipColorText|ctrlShown|ctrlType|currentCommand|date|default|deleteCenter|deleteCollection|deleteGroup|deleteMarker|deleteTarget|deleteWaypoint|displayCtrl|displaySetEventHandler|dissolveTeam|doFSM|doGetOut|drawArrow|drawEllipse|drawIcon|drawLine|drawRectangle|echo|effectiveCommander|emptyPositions|enableAI|enableAttack|enableEnvironment|enableReload|enableTeamSwitch|expectedDestination|exportLandscapeXYZ|fadeRadio|find|findCover|findDisplay|findNearestEnemy|finishMissionInit|finite|floor|fog|fogForecast|forceSpeed|formationDirection|formationLeader|formationMembers|formationPosition|formationTask|formatText|from|getArray|getHideFrom|getNumber|getPosASL|getSpeed|getText|getVariable|glanceAt|halt|hideBehindScripted|hideBody|hierarchyObjectsCount|htmlLoad|image|inGameUISetEventHandler|inheritsFrom|initAmbientLife|intersect|isArray|isClass|isFormationLeader|isHidden|isHideBehindScripted|isKeyActive|isKindOf|isMarkedForCollection|isNil|isNumber|isPlayer|isText|keyImage|keyName|lbIsSelected|lbSelection|lbSetSelected|lightAttachObject|lightDetachObject|limitSpeed|lineBreak|lookAt|max|min|missionConfigFile|modelToWorld|moveInTurret|moveTarget|moveTo|moveToCompleted|moveToFailed|nearestObjects|nearObjects|needReload|nextWeatherChange|onBriefingTeamSwitch|onPlayerConnected|onPlayerDisconnected|overcast|overcastForecast|parseNumber|parseText|playerRespawnTime|playerSide|playMission|positionCameraToWorld|posScreenToWorld|posWorldToScreen|precision|preloadCamera|preloadObject|preloadSound|preloadTitleObj|preloadTitleRsc|preprocessFileLineNumbers|processInitCommands|radioVolume|rain|rank|reload|reloadEnabled|removeSwitchableUnit|respawnVehicle|round|runInitScript|scopeName|scriptDone|selectionPosition|selectLeader|selectPlayer|sendSimpleCommand|setAperture|setAttributes|setCameraEffect|setCameraInterest|setDate|setDestination|setDropInterval|setEffectCondition|setFormationTask|setFriend|setHideBehind|setLightAmbient|setLightBrightness|setLightColor|setMarkerBrush|setMarkerDir|setMarkerShape|setMarkerText|setMousePosition|setMusicEffect|setParticleCircle|setParticleParams|setParticleRandom|setPlayable|setPosASL|setRank|setSkill|setSoundEffect|setTargetAge|setTitleEffect|setTriggerActivation|setTriggerArea|setTriggerStatements|setTriggerText|setTriggerTimeout|setTriggerType|setUnitAbility|setUnitRank|setVariable|setVectorDir|setVectorUp|setVehicleAmmo|setVehicleArmor|setVehicleId|setVehicleInit|setVehicleLock|setVehiclePosition|setVehicleVarName|setWaypointBehaviour|setWaypointCombatMode|setWaypointDescription|setWaypointFormation|setWaypointHousePosition|setWaypointPosition|setWaypointScript|setWaypointSpeed|setWaypointStatements|setWaypointTimeout|setWaypointType|showWaypoint|skill|sleep|step|str|supportInfo|surfaceIsWater|surfaceType|switchableUnits|synchronizeWaypoint|synchronizeWaypoint trigger|teamSwitch|teamSwitchEnabled|terminate|text|throw|to|triggerAttachObject|triggerAttachVehicle|try|typeName|unassignTeam|unitPos|vectorDir|vectorUp|vehicles|vehicleVarName|verifySignature|waitUntil|waypointAttachObject|waypointAttachVehicle|weaponDirection|wind|worldName|worldToModel|createMarkerLocal|deleteMarkerLocal|markerDir|markerText|setMarkerBrushLocal|setMarkerColorLocal|setMarkerDirLocal|setMarkerPosLocal|setMarkerShapeLocal|setMarkerSizeLocal|setMarkerTextLocal|setMarkerTypeLocal|setUnitPosWeak|addVehicle|assignedVehicle|assignedVehicleRole|ctrlMapScreenToWorld|ctrlMapWorldToScreen|cutFadeOut|difficultyEnabled|distributionRegion|setCurrentWaypoint|titleFadeOut|waypoints|isServer|joinSilent|nearTargets|airportSide|assignToAirport|attachedObject|attachObject|clearVehicleInit|createLocation|createMissionDisplay|deleteLocation|drawLocation|importance|landAt|lbSort|lbSortByValue|locationPosition|name|nearestLocation|nearestLocations|position location|rectangular|setAirportSide|setDirection|setImportance|setName|setPosition|setRectangular|setSide|setSize|setText|setType|size|sizeOf|text|type|addPublicVariableEventHandler|setVectorDirAndUp|toArray|toLower|toString|toUpper)\\b","name":"entity.name.function.sqf"},"ARMA2":{"match":"\\s*(?i)(addEditorObject|addGroupIcon|addLiveStats|addMenu|addMenuItem|addResources|addTeamMember|agent|agents|AISFinishHeal|allGroups|allow3DMode|allowDamage|allowFileOperations|allUnits|armoryPoints|assignedCargo|assignedCommander|assignedDriver|assignedGunner|attachTo|BIS_fnc_absSpeed|BIS_fnc_addEvidence|BIS_fnc_areEqual|BIS_fnc_arithmeticMean|BIS_fnc_arrayCompare|BIS_fnc_arrayFindDeep|BIS_fnc_arrayInsert|BIS_fnc_arrayPop|BIS_fnc_arrayPush|BIS_fnc_arrayPushStack|BIS_fnc_arrayShift|BIS_fnc_arrayUnShift|BIS_fnc_classMagazine|BIS_fnc_classWeapon|BIS_fnc_colorRGBtoHTML|BIS_fnc_commsMenuCreate|BIS_fnc_commsMenuToggleAvailability|BIS_fnc_commsMenuToggleVisibility|BIS_fnc_conditionalSelect|BIS_fnc_createmenu|BIS_fnc_crossProduct|BIS_fnc_cutDecimals|BIS_fnc_diagAnim|BIS_fnc_dirTo|BIS_fnc_distance2D|BIS_fnc_distance2Dsqr|BIS_fnc_dotProduct|BIS_fnc_findNestedElement|BIS_fnc_findSafePos|BIS_fnc_fps|BIS_fnc_geometricMean|BIS_fnc_getFactions|BIS_fnc_getLineDist|BIS_fnc_getPitchBank|BIS_fnc_greatestNum|BIS_fnc_help|BIS_fnc_inAngleSector|BIS_fnc_inTrigger|BIS_fnc_inv|BIS_fnc_invAdd|BIS_fnc_invCodeToArray|BIS_fnc_invRemove|BIS_fnc_invSlots|BIS_fnc_invSlotsEmpty|BIS_fnc_invSlotType|BIS_fnc_invString|BIS_fnc_isInFrontOf|BIS_fnc_isPosBlacklisted|BIS_fnc_listPlayers|BIS_fnc_locations|BIS_fnc_lowestNum|BIS_fnc_magnitude|BIS_fnc_magnitudeSqr|BIS_fnc_maxDiffArray|BIS_fnc_miscanim|BIS_fnc_nearestNum|BIS_fnc_nearestPosition|BIS_fnc_ObjectsGrabber|BIS_fnc_ObjectsMapper|BIS_fnc_parseNumber|BIS_fnc_PosToGrid|BIS_fnc_randomIndex|BIS_fnc_randomInt|BIS_fnc_randomNum|BIS_fnc_recompile|BIS_fnc_relativeDirTo|BIS_fnc_relPos|BIS_fnc_removeIndex|BIS_fnc_removeNestedElement|BIS_fnc_respect|BIS_fnc_returnConfigEntry|BIS_fnc_returnGroupComposition|BIS_fnc_returnNestedElement|BIS_fnc_returnParents|BIS_fnc_returnVehicleTurrets|BIS_fnc_rotateVector2D|BIS_fnc_roundNum|BIS_fnc_sceneAreaClearance|BIS_fnc_sceneCheckWeapons|BIS_fnc_sceneCreateSceneTrigger|BIS_fnc_sceneCreateSoundEntities|BIS_fnc_sceneGetObjects|BIS_fnc_sceneGetParticipants|BIS_fnc_sceneGetPositionByAngle|BIS_fnc_sceneIntruderDetector|BIS_fnc_sceneMiscStuff|BIS_fnc_sceneRotate|BIS_fnc_sceneSetAnimationsForGroup|BIS_fnc_sceneSetBehaviour|BIS_fnc_sceneSetObjects|BIS_fnc_sceneSetPosFormation|BIS_fnc_selectCrew|BIS_fnc_selectRandom|BIS_fnc_selectRandomWeighted|BIS_fnc_setNestedElement|BIS_fnc_setPitchBank|BIS_fnc_showTime|BIS_fnc_sortNum|BIS_fnc_spawnCrew|BIS_fnc_spawnGroup|BIS_fnc_spawnVehicle|BIS_fnc_subSelect|BIS_fnc_supplydrop|BIS_fnc_supplydropService|BIS_fnc_swapVars|BIS_fnc_taskAttack|BIS_fnc_taskDefend|BIS_fnc_taskHandler|BIS_fnc_taskPatrol|BIS_fnc_threat|BIS_fnc_transportService|BIS_fnc_unitVector|BIS_fnc_variableSpaceAdd|BIS_fnc_variableSpaceRemove|BIS_fnc_vectorAdd|BIS_fnc_vectorDiff|BIS_fnc_vectorFromXToY|BIS_fnc_vectorMultiply|BIS_fnc_version|BIS_fnc_zzRotate|boundingCenter|buildingExit|camConstuctionSetParams|cameraEffectEnableHUD|cameraView|camTarget|canUnloadInCombat|captiveNum|clearGroupIcons|clearOverlay|closeOverlay|collapseObjectTree|commandChat|commandingMenu|commandRadio|commitOverlay|completedFSM|copyFromClipboard|copyToClipboard|copyWaypoints|createAgent|createDiaryLink|createDiaryRecord|createDiarySubject|createGearDialog|createMenu|createSimpleTask|createTask|createTeam|ctrlAddEventHandler|ctrlAutoScrollDelay|ctrlAutoScrollRewind|ctrlAutoScrollSpeed|ctrlMapCursor|ctrlMapMouseOver|ctrlRemoveAllEventHandlers|ctrlRemoveEventHandler|ctrlSetAutoScrollDelay|ctrlSetAutoScrollRewind|ctrlSetAutoScrollSpeed|currentMagazine|currentTask|currentTasks|currentWaypoint|currentWeapon|dateToNumber|deleteEditorObject|deleteResources|deleteTeam|detach|diag_fps|diag_fpsMin|diag_frameNo|diag_log|diag_tickTime|diarySubjectExists|directSay|disableConversation|disableSerialization|displayAddEventHandler|displayRemoveAllEventHandlers|displayRemoveEventHandler|drawLink|editObject|editorSetEventHandler|enableSaving|enableSentences|enableSimulation|endLoadingScreen|endMission|estimatedEndServerTime|evalObjectArgument|execEditorScript|execFSM|faction|failMission|findEditorObject|findEmptyPosition|findEmptyPositionReady|fromEditor|gearSlotData|getEditorCamera|getEditorMode|getEditorObjectScope|getFriend|getFSMVariable|getGroupIcon|getGroupIconParams|getGroupIcons|getObjectArgument|getObjectChildren|getObjectProxy|groupIconSelectable|groupIconsVisible|groupSelectedUnits|groupSelectUnit|hcAllGroups|hcGroupParams|hcLeader|hcRemoveAllGroups|hcRemoveGroup|hcSelected|hcSelectGroup|hcSetGroup|hcShowBar|hcShownBar|hintSilent|importAllGroups|inputAction|insertEditorObject|isAgent|isDedicated|isFlatEmpty|isMultiplayer|isOnRoad|isRealTime|isShowing3DIcons|items|joinAs|joinAsSilent|kbAddDatabase|kbAddDatabaseTargets|kbAddTopic|kbHasTopic|kbReact|kbRemoveTopic|kbTell|kbWasSaid|landResult|leaveVehicle|lifeState|listObjects|lnbAddArray|lnbAddColumn|lnbAddRow|lnbClear|lnbColor|lnbCurSelRow|lnbData|lnbDeleteColumn|lnbDeleteRow|lnbGetColumnsPosition|lnbPicture|lnbSetColor|lnbSetColumnsPos|lnbSetCurSelRow|lnbSetData|lnbSetPicture|lnbSetText|lnbSetValue|lnbSize|lnbText|lnbValue|loadGame|loadOverlay|lockCargo|lockDriver|lockedCargo|lockedDriver|lockedTurret|lockTurret|lookAtPos|markerAlpha|markerBrush|markerShape|members|missionNamespace|morale|moveObjectToEnd|moveOut|moveTime|nearEntities|nearestLocationWithDubbing|nearObjectsReady|nearRoads|newOverlay|nextMenuItemIndex|nMenuItems|numberToDate|onCommandModeChanged|onDoubleClick|onGroupIconClick|onGroupIconOverEnter|onGroupIconOverLeave|onHCGroupSelectionChanged|onPreloadFinished|onPreloadStarted|onShowNewObject|onTeamSwitch|owner|parsingNamespace|playableUnits|playAction|playActionNow|playGesture|playMoveNow|playScriptedMission|ppEffectAdjust|ppEffectCommit|ppEffectCommitted|ppEffectCreate|ppEffectDestroy|ppEffectEnable|priority|processDiaryLink|progressLoadingScreen|progressPosition|progressSetPosition|rankId|registeredTasks|registerTask|remoteControl|removeAllItems|removeDrawIcon|removeDrawLinks|removeGroupIcon|removeMenuItem|removeSimpleTask|removeTeamMember|resources|restartEditorCamera|reversedMouseY|roadsConnectedTo|safeZoneH|safeZoneW|safeZoneX|safeZoneY|saveOverlay|savingEnabled|say2D|say3D|screenToWorld|scriptName|selectBestPlaces|selectDiarySubject|selectedEditorObjects|selectEditorObject|selectNoPlayer|sendTask|sendTaskResult|serverTime|setArmoryPoints|setCurrentTask|setDrawIcon|setEditorMode|setEditorObjectScope|setFromEditor|setFSMVariable|setGroupIcon|setGroupIconParams|setGroupIconsSelectable|setGroupIconsVisible|setHit|setLeader|setMarkerAlpha|setMarkerAlphaLocal|setObjectArguments|setObjectProxy|setPosASL2|setSimpleTaskDescription|setSimpleTaskDestination|setTaskResult|setTaskState|setUnconscious|setVisibleIfTreeCollapsed|setWaypointCompletionRadius|setWind|show3DIcons|showCommandingMenu|showHUD|showLegend|showNewEditorObject|showSubtitles|sideUnknown|simpleTasks|simulationEnabled|startLoadingScreen|switchAction|switchGesture|synchronizedObjects|synchronizeObjectsAdd|synchronizeObjectsRemove|synchronizeTrigger|targetsAggregate|targetsQuery|taskChildren|taskCompleted|taskDescription|taskDestination|taskHint|taskParent|taskResult|taskState|teamMember|teamName|teams|teamType|triggerActivated|triggerActivation|triggerArea|triggerAttachedVehicle|triggerStatements|triggerText|triggerTimeout|triggerType|turretUnit|uiNamespace|unlockAchievement|unregisterTask|updateDrawIcon|updateMenuItem|updateObjectTree|useAudioTimeForMoves|viewDistance|visibleMap|waypointAttachedObject|waypointAttachedVehicle|waypointBehaviour|waypointCombatMode|waypointCompletionRadius|waypointDescription|waypointFormation|waypointHousePosition|waypointScript|waypointShow|waypointSpeed|waypointStatements|waypointTimeout|waypointType|with|worldToScreen|actionKeysNamesArray|addBackpack|addCamShake|aimedAtTarget|backpackSpaceFor|BIS_fnc_AAN|BIS_fnc_boundingBoxCorner|BIS_fnc_infoText|currentMuzzle|currentVisionMode|currentWeaponMode|currentZeroing|enableCamShake|enableGunLights|enableIRLasers|fadeSpeech|fireAtTarget|forceWalk|getElevationOffset|isAutoHoverOn|isForcedWalk|isManualFire|isWalking|laserTarget|removeBackpack|resetCamShake|scoreSide|sendUDPMessage|setCamShakeDefParams|setCamShakeParams|setCamUseTi|setVehicleTiPars|setVelocityTransformation|unitBackpack|getPlayerUID|mapCenterOnCamera|getPosATL|openMap|safeZoneWAbs|safeZoneXAbs|setPosATL|mapGridPosition|unitsBelowHeight|WFSideText|checkAIFeature|debugFSM|enableAIFeature|openDSInterface|serverCommand|serverCommandAvailable|suppressFor|textLogFormat|uiSleep|hideObject|addMagazineTurret|magazinesTurret|removeMagazinesTurret|removeMagazineTurret|weaponsTurret|disableTIEquipment|enableEngineArtillery|getMagazineCargo|getWeaponCargo|addBackpackCargo|addBackpackCargoGlobal|addMagazineCargoGlobal|addMPEventHandler|addWeaponCargoGlobal|clearBackpackCargoGlobal|clearMagazineCargoGlobal|clearWeaponCargoGlobal|getBackpackCargo|getResolution|getTerrainHeightASL|hostMission|removeAllMPEventHandlers|removeMPEventHandler|setSimpleTaskTarget|setWaypointVisible|waypointVisible|BIS_fnc_3Dcredits|BIS_fnc_crows|BIS_fnc_customGPS|BIS_fnc_customGPSvideo|BIS_fnc_destroyCity|BIS_fnc_dirIndicator|BIS_fnc_flies|BIS_fnc_playVideo|BIS_fnc_sandstorm|allDead|allMissionObjects|setPlayerRespawnTime|allowCrewInImmobile|assignedTeam|callExtension|entities|loadMagazine|setWeaponReloadingTime|surfaceNormal|visiblePosition|weaponState|addMagazine|aimPos|ASLToATL|ATLToASL|deActivateKey|eyePos|libraryCredits|libraryDisclaimers|lineIntersects|lineIntersectsWith|moonIntensity|productVersion|publicVariableClient|publicVariableServer|setOwner|setToneMapping|setToneMappingParams|setUnitRecoilCoefficient|sunOrMoon|terrainIntersect|terrainIntersectASL|unitRecoilCoefficient|visiblePositionASL|diag_captureFrame|diag_captureSlowFrame|diag_logSlowFrame|getPlayerUIDOld|hasInterface|onEachFrame|systemChat)\\b","name":"entity.name.function.sqf"},"ARMA3":{"match":"\\s*(?i)(actionName|addGoggles|addHandgunItem|addHeadgear|addItem|addItemCargo|addItemCargoGlobal|addMagazines|addMissionEventHandler|addMusicEventHandler|addPrimaryWeaponItem|addSecondaryWeaponItem|addUniform|addVest|allDeadMen|allMapMarkers|allSites|animateDoor|assignAsTurret|assignedItems|assignItem|backpack|backpackCargo|backpackItems|backpackMagazines|BIS_fnc_addCommMenuItem|BIS_fnc_addRespawnPosition|BIS_fnc_call|BIS_fnc_codePerformance|BIS_fnc_endMission|BIS_fnc_error|BIS_fnc_log|BIS_fnc_MP|BIS_fnc_param|BIS_fnc_removeCommMenuItem|BIS_fnc_removeRespawnPosition|BIS_fnc_showNotification|BIS_fnc_timeToString|boundingBoxReal|buldozer_LoadNewRoads|buldozer_reloadOperMap|cancelSimpleTaskDestination|className|clearAllItemsFromBackpack|clearBackpackCargo|clearItemCargo|clearItemCargoGlobal|commandArtilleryFire|createSite|ctrlChecked|ctrlHTMLLoaded|ctrlIDC|ctrlIDD|ctrlSetChecked|ctrlTextHeight|currentMagazineDetail|customChat|customRadio|debriefingText|deleteSite|disableCollisionWith|distanceSqr|doArtilleryFire|doorPhase|drawIcon3D|drawLine3D|enableCaustics|enableCollisionWith|enableCopilot|enableFatigue|eyeDirection|firstBackpack|forceWeaponFire|freeLook|getArtilleryAmmo|getArtilleryComputerSettings|getBleedingRemaining|getBurningValue|getDescription|getFatigue|getItemCargo|getOxygenRemaining|getPosASLW|goggles|groupFromNetId|groupId|gusts|handgunItems|handgunWeapon|headgear|humidity|independent|inRangeOfArtillery|isAbleToBreathe|isBleeding|isBurning|isCopilotEnabled|isFlashlightOn|isIRLaserOn|isLocalized|isPipEnabled|isTouchingGround|isTutHintsEnabled|itemCargo|language|lightnings|linearConversion|linkItem|load|loadAbs|loadBackpack|loadUniform|loadVest|magazineCargo|magazinesDetail|mineActive|nearSupplies|netId|objectFromNetId|particlesQuality|playSound3D|ppEffectForceInNVG|primaryWeaponItems|profileName|rainbow|removeAllActions|removeAllAssignedItems|removeAllContainers|removeAllMissionEventHandlers|removeAllMusicEventHandlers|removeGoggles|removeHeadgear|removeItem|removeItems|removeMissionEventHandler|removeMusicEventHandler|removeUniform|removeVest|resetSubgroupDirection|revealMine|saveJoysticks|secondaryWeaponItems|sendAUMessage|setAmmo|setApertureNew|setBleedingRemaining|setCompassOscillation|setDebriefingText|setFatigue|setGusts|setHorizonParallaxCoef|setHUDMovementLevels|setLightAttenuation|setLightDayLight|setLightFlareMaxDistance|setLightFlareSize|setLightIntensity|setLightnings|setLightUseFlare|setLocalWindParams|setObjectMaterial|setObjectViewDistance|setOxygenRemaining|setParticleClass|setPosASLW|setRainbow|setRandomLip|setShadowDistance|setSystemOfUnits|setUserActionText|setVehicleAmmoDef|setWaves|setWaypointName|setWindDir|setWindForce|setWindStr|showChat|shownArtilleryComputer|simulSetHumidity|simulWeatherSync|soldierMagazines|stance|swimInDepth|synchronizedTriggers|synchronizedWaypoints|unassignItem|underwater|uniform|uniformItems|uniformMagazines|velocityModelSpace|vest|vestItems|vestMagazines|waves|waypointName|weaponAccessories|weaponCargo|weaponLowered|windDir|windStr|BIS_fnc_spawn|compileFinal|difficulty|getAmmoCargo|getArtilleryETA|getFuelCargo|getRepairCargo|BIS_fnc_arrayShuffle|BIS_fnc_endLoadingScreen|BIS_fnc_loadInventory|BIS_fnc_sortBy|BIS_fnc_startLoadingScreen|lbSetTooltip|canAdd|handgunMagazine|isStreamFriendlyUIEnabled|primaryWeaponMagazine|removeAllHandgunItems|removeAllPrimaryWeaponItems|removeHandgunItem|removePrimaryWeaponItem|secondaryWeaponMagazine|BIS_fnc_addRespawnInventory|BIS_fnc_removeRespawnInventory|BIS_fnc_respawnTickets|isSteamMission|markAsFinishedOnSteam|tvAdd|tvClear|tvCollapse|tvCount|tvCurSel|tvData|tvDelete|tvExpand|tvPicture|tvSetCurSel|tvSetData|tvSetPicture|tvSetPictureColor|tvSetTooltip|tvSetValue|tvSort|tvSortByValue|tvText|tvValue|addMagazineGlobal|addWeaponGlobal|allUnitsUAV|BIS_fnc_addToPairs|BIS_fnc_consolidateArray|BIS_fnc_findInPairs|BIS_fnc_groupVehicles|BIS_fnc_moduleSector|BIS_fnc_nearestRoad|BIS_fnc_removeSupportLink|BIS_fnc_taskState|connectTerminalToUAV|createVehicleCrew|getConnectedUAV|isUAVConnected|magazinesAmmo|magazinesAmmoFull|removeMagazineGlobal|removeWeaponGlobal|weaponsItems|BIS_fnc_activateAddons|BIS_fnc_addClassOO|BIS_fnc_addScore|BIS_fnc_addScriptedEventHandler|BIS_fnc_addStackedEventHandler|BIS_fnc_addSupportLink|BIS_fnc_addVirtualBackpackCargo|BIS_fnc_addVirtualItemCargo|BIS_fnc_addVirtualMagazineCargo|BIS_fnc_addVirtualWeaponCargo|BIS_fnc_addWeapon|BIS_fnc_advHint|BIS_fnc_advHintArg|BIS_fnc_advHintCall|BIS_fnc_advHintCredits|BIS_fnc_alignTabs|BIS_fnc_allSynchronizedObjects|BIS_fnc_ambientAnim|BIS_fnc_ambientAnimCombat|BIS_fnc_ambientAnimGetParams|BIS_fnc_ambientFlyby|BIS_fnc_animalBehaviour|BIS_fnc_animalSiteSpawn|BIS_fnc_animViewer|BIS_fnc_areFriendly|BIS_fnc_baseWeapon|BIS_fnc_basicBackpack|BIS_fnc_basicTask|BIS_fnc_blackIn|BIS_fnc_blackOut|BIS_fnc_bloodEffect|BIS_fnc_briefingAnimate|BIS_fnc_briefingInit|BIS_fnc_buildingPositions|BIS_fnc_callScriptedEventHandler|BIS_fnc_camera|BIS_fnc_cameraOld|BIS_fnc_changeSupportRadioChannel|BIS_fnc_cinemaBorder|BIS_fnc_colorConfigToRGBA|BIS_fnc_colorRGBAtoHTML|BIS_fnc_colorRGBAtoTexture|BIS_fnc_configPath|BIS_fnc_createLogRecord|BIS_fnc_createObjectOO|BIS_fnc_credits_movie|BIS_fnc_credits_movieConfig|BIS_fnc_credits_movieSupport|BIS_fnc_ctrlFitToTextHeight|BIS_fnc_ctrlSetScale|BIS_fnc_damageChanged|BIS_fnc_damagePulsing|BIS_fnc_deleteInventory|BIS_fnc_diagAAR|BIS_fnc_diagAARrecord|BIS_fnc_diagBulletCam|BIS_fnc_diagConfig|BIS_fnc_diagFindMissingAuthors|BIS_fnc_diagHit|BIS_fnc_diagKey|BIS_fnc_diagKeyLayout|BIS_fnc_diagKeyTest|BIS_fnc_diagKnownAsTarget|BIS_fnc_diagKnownTargets|BIS_fnc_diagLoop|BIS_fnc_diagMacros|BIS_fnc_diagMacrosAuthor|BIS_fnc_diagMacrosMapSize|BIS_fnc_diagMacrosNameSound|BIS_fnc_diagMacrosVerify|BIS_fnc_diagMissionPositions|BIS_fnc_diagMissionWeapons|BIS_fnc_diagPreview|BIS_fnc_diagPreviewCycle|BIS_fnc_diagPreviewVehicleCrew|BIS_fnc_diagRadio|BIS_fnc_diagVehicleIcons|BIS_fnc_diagWiki|BIS_fnc_dirtEffect|BIS_fnc_disableSaving|BIS_fnc_drawAO|BIS_fnc_drawMinefields|BIS_fnc_drawRespawnPositions|BIS_fnc_earthquake|BIS_fnc_effectFired|BIS_fnc_effectFiredArtillery|BIS_fnc_effectFiredFlares|BIS_fnc_effectFiredHeliRocket|BIS_fnc_effectFiredLongSmoke|BIS_fnc_effectFiredRifle|BIS_fnc_effectFiredRocket|BIS_fnc_effectFiredSmokeLauncher|BIS_fnc_effectFiredSmokeLauncher_boat|BIS_fnc_effectKilled|BIS_fnc_effectKilledAirDestruction|BIS_fnc_effectKilledAirDestructionStage2|BIS_fnc_effectKilledSecondaries|BIS_fnc_effectPlankton|BIS_fnc_enableSaving|BIS_fnc_endMissionServer|BIS_fnc_enemyDetected|BIS_fnc_enemySides|BIS_fnc_enemyTargets|BIS_fnc_establishingShot|BIS_fnc_estimatedTimeLeft|BIS_fnc_execFSM|BIS_fnc_execRemote|BIS_fnc_executeStackedEventHandler|BIS_fnc_execVM|BIS_fnc_exportCfgGroups|BIS_fnc_exportCfgHints|BIS_fnc_exportCfgMagazines|BIS_fnc_exportCfgPatches|BIS_fnc_exportCfgWeapons|BIS_fnc_exportFunctionsToWiki|BIS_fnc_exportGroupFormations|BIS_fnc_exportInventory|BIS_fnc_exportMapToBiTXT|BIS_fnc_fadeEffect|BIS_fnc_fatigueEffect|BIS_fnc_feedbackInit|BIS_fnc_feedbackMain|BIS_fnc_filterString|BIS_fnc_findOverwatch|BIS_fnc_flamesEffect|BIS_fnc_forceEnd|BIS_fnc_friendlySides|BIS_fnc_functionMeta|BIS_fnc_getCfgData|BIS_fnc_getCfgDataArray|BIS_fnc_getCfgDataBool|BIS_fnc_getCfgDataObject|BIS_fnc_getCfgDataPool|BIS_fnc_getCfgIsClass|BIS_fnc_getCfgSubClasses|BIS_fnc_getParamValue|BIS_fnc_getRespawnInventories|BIS_fnc_getRespawnMarkers|BIS_fnc_getRespawnPositions|BIS_fnc_getServerVariable|BIS_fnc_getTurrets|BIS_fnc_getUnitByUid|BIS_fnc_getVirtualBackpackCargo|BIS_fnc_getVirtualItemCargo|BIS_fnc_getVirtualMagazineCargo|BIS_fnc_getVirtualWeaponCargo|BIS_fnc_groupIndicator|BIS_fnc_guiEffectTiles|BIS_fnc_healing|BIS_fnc_healthEffects|BIS_fnc_incapacitatedEffect|BIS_fnc_indicateBleeding|BIS_fnc_initExpo|BIS_fnc_initIntelObject|BIS_fnc_initModules|BIS_fnc_initMultiplayer|BIS_fnc_initParams|BIS_fnc_initPlayable|BIS_fnc_initRespawn|BIS_fnc_initRespawnBackpack|BIS_fnc_initVirtualUnit|BIS_fnc_inString|BIS_fnc_InstructorFigure|BIS_fnc_interpolateWeather|BIS_fnc_isBuildingEnterable|BIS_fnc_isCampaign|BIS_fnc_isDemo|BIS_fnc_isInsideArea|BIS_fnc_isInZoom|BIS_fnc_isLoading|BIS_fnc_isUnitVirtual|BIS_fnc_keyCode|BIS_fnc_limitSupport|BIS_fnc_liveFeed|BIS_fnc_liveFeedEffects|BIS_fnc_liveFeedModuleEffects|BIS_fnc_liveFeedModuleInit|BIS_fnc_liveFeedModuleSetSource|BIS_fnc_liveFeedModuleSetTarget|BIS_fnc_liveFeedSetSource|BIS_fnc_liveFeedSetTarget|BIS_fnc_liveFeedTerminate|BIS_fnc_loadClass|BIS_fnc_loadEntry|BIS_fnc_loadFunctions|BIS_fnc_localize|BIS_fnc_locationDescription|BIS_fnc_locWeaponInfo|BIS_fnc_logFormat|BIS_fnc_mapSize|BIS_fnc_markerToTrigger|BIS_fnc_markWaypoints|BIS_fnc_missileLaunchPositionFix|BIS_fnc_missionConversations|BIS_fnc_missionConversationsLocal|BIS_fnc_missionFlow|BIS_fnc_missionHandlers|BIS_fnc_missionRespawnType|BIS_fnc_missionTasks|BIS_fnc_missionTasksLocal|BIS_fnc_missionTimeLeft|BIS_fnc_moduleAI|BIS_fnc_moduleAmmo|BIS_fnc_moduleAnimals|BIS_fnc_moduleArsenal|BIS_fnc_moduleBleedTickets|BIS_fnc_moduleBootcampStage|BIS_fnc_moduleCAS|BIS_fnc_moduleChat|BIS_fnc_moduleCombatGetIn|BIS_fnc_moduleCountdown|BIS_fnc_moduleCoverMap|BIS_fnc_moduleCreateDiaryRecord|BIS_fnc_moduleCreateProjectile|BIS_fnc_moduleCurator|BIS_fnc_moduleCuratorAddAddons|BIS_fnc_moduleCuratorAddCameraArea|BIS_fnc_moduleCuratorAddEditableObjects|BIS_fnc_moduleCuratorAddEditingArea|BIS_fnc_moduleCuratorAddEditingAreaPlayers|BIS_fnc_moduleCuratorAddIcon|BIS_fnc_moduleCuratorAddPoints|BIS_fnc_moduleCuratorSetAttributes|BIS_fnc_moduleCuratorSetCamera|BIS_fnc_moduleCuratorSetCoefs|BIS_fnc_moduleCuratorSetCostsDefault|BIS_fnc_moduleCuratorSetCostsSide|BIS_fnc_moduleCuratorSetCostsVehicleClass|BIS_fnc_moduleCuratorSetEditingAreaType|BIS_fnc_moduleCuratorSetObjectCost|BIS_fnc_moduleDamage|BIS_fnc_moduleDate|BIS_fnc_moduleDiary|BIS_fnc_moduleDoorOpen|BIS_fnc_moduleEffectsBubbles|BIS_fnc_moduleEffectsEmitterCreator|BIS_fnc_moduleEffectsFire|BIS_fnc_moduleEffectsPlankton|BIS_fnc_moduleEffectsShells|BIS_fnc_moduleEffectsSmoke|BIS_fnc_moduleEndMission|BIS_fnc_moduleExecute|BIS_fnc_moduleFDCPClear|BIS_fnc_moduleFDCPIn|BIS_fnc_moduleFDCPOut|BIS_fnc_moduleFDFadeMarker|BIS_fnc_moduleFDSkeetDestruction|BIS_fnc_moduleFDStatsClear|BIS_fnc_moduleFiringDrill|BIS_fnc_moduleFriendlyFire|BIS_fnc_moduleFuel|BIS_fnc_moduleGenericRadio|BIS_fnc_moduleGroupID|BIS_fnc_moduleHandle|BIS_fnc_moduleHealth|BIS_fnc_moduleHint|BIS_fnc_moduleHQ|BIS_fnc_moduleInit|BIS_fnc_moduleLightning|BIS_fnc_moduleMine|BIS_fnc_moduleMissionName|BIS_fnc_moduleMode|BIS_fnc_moduleModules|BIS_fnc_moduleMPTypeDefense|BIS_fnc_moduleMPTypeGameMaster|BIS_fnc_moduleMPTypeSectorControl|BIS_fnc_moduleMPTypeSeize|BIS_fnc_moduleObjective|BIS_fnc_moduleObjectiveFind|BIS_fnc_moduleObjectiveGetIn|BIS_fnc_moduleObjectiveMove|BIS_fnc_moduleObjectiveRaceCP|BIS_fnc_moduleObjectiveRaceFinish|BIS_fnc_moduleObjectiveRaceStart|BIS_fnc_moduleObjectiveSector|BIS_fnc_moduleObjectiveTarget|BIS_fnc_modulePositioning|BIS_fnc_modulePoster|BIS_fnc_modulePostprocess|BIS_fnc_moduleProjectile|BIS_fnc_modulePunishment|BIS_fnc_moduleRadioChannelCreate|BIS_fnc_moduleRank|BIS_fnc_moduleRating|BIS_fnc_moduleRemoteControl|BIS_fnc_moduleRespawnInventory|BIS_fnc_moduleRespawnPosition|BIS_fnc_moduleRespawnTickets|BIS_fnc_moduleRespawnVehicle|BIS_fnc_moduleSaveGame|BIS_fnc_moduleSFX|BIS_fnc_moduleShowHide|BIS_fnc_moduleSimulationManager|BIS_fnc_moduleSkill|BIS_fnc_moduleSkiptime|BIS_fnc_moduleSound|BIS_fnc_moduleStrategicMapImage|BIS_fnc_moduleStrategicMapInit|BIS_fnc_moduleStrategicMapMission|BIS_fnc_moduleStrategicMapOpen|BIS_fnc_moduleStrategicMapORBAT|BIS_fnc_moduleTaskCreate|BIS_fnc_moduleTaskSetDescription|BIS_fnc_moduleTaskSetDestination|BIS_fnc_moduleTaskSetState|BIS_fnc_moduleTimeTrial|BIS_fnc_moduleTracers|BIS_fnc_moduleTrident|BIS_fnc_moduleTriggers|BIS_fnc_moduleTTCPClear|BIS_fnc_moduleTTCPIn|BIS_fnc_moduleTTCPOut|BIS_fnc_moduleTTCPTrigger|BIS_fnc_moduleTTCPTriggerBehind|BIS_fnc_moduleTTStatsClear|BIS_fnc_moduleUnits|BIS_fnc_moduleUnlockArea|BIS_fnc_moduleUnlockObject|BIS_fnc_moduleVolume|BIS_fnc_moduleWeather|BIS_fnc_moduleZoneProtection|BIS_fnc_moduleZoneRestriction|BIS_fnc_moveAction|BIS_fnc_moveToRespawnPosition|BIS_fnc_neutralizeUnit|BIS_fnc_objectHeight|BIS_fnc_objectSide|BIS_fnc_objectVar|BIS_fnc_onDiaryChanged|BIS_fnc_onPlayerConnected|BIS_fnc_ORBATAddGroupOverlay|BIS_fnc_ORBATAnimate|BIS_fnc_ORBATConfigPreview|BIS_fnc_ORBATGetGroupParams|BIS_fnc_ORBATOpen|BIS_fnc_ORBATRemoveGroupOverlay|BIS_fnc_ORBATSetGroupFade|BIS_fnc_ORBATSetGroupParams|BIS_fnc_ORBATTooltip|BIS_fnc_ordinalNumber|BIS_fnc_packStaticWeapon|BIS_fnc_paramCountdown|BIS_fnc_paramDaytime|BIS_fnc_paramGuerFriendly|BIS_fnc_paramRespawnTickets|BIS_fnc_paramWeather|BIS_fnc_phoneticalWord|BIS_fnc_playEndMusic|BIS_fnc_playMusic|BIS_fnc_playSound|BIS_fnc_preload|BIS_fnc_prepareAO|BIS_fnc_progressLoadingScreen|BIS_fnc_quotations|BIS_fnc_radialRed|BIS_fnc_radialRedOut|BIS_fnc_randomPos|BIS_fnc_rankParams|BIS_fnc_refreshCommMenu|BIS_fnc_relPosObject|BIS_fnc_relScaledDist|BIS_fnc_removeAllScriptedEventHandlers|BIS_fnc_removeFromPairs|BIS_fnc_removeScriptedEventHandler|BIS_fnc_removeStackedEventHandler|BIS_fnc_removeVirtualBackpackCargo|BIS_fnc_removeVirtualItemCargo|BIS_fnc_removeVirtualMagazineCargo|BIS_fnc_removeVirtualWeaponCargo|BIS_fnc_respawnBase|BIS_fnc_respawnConfirm|BIS_fnc_respawnCounter|BIS_fnc_respawnEndMission|BIS_fnc_respawnGroup|BIS_fnc_respawnInstant|BIS_fnc_respawnMenuInventory|BIS_fnc_respawnMenuPosition|BIS_fnc_respawnMenuSpectator|BIS_fnc_respawnNone|BIS_fnc_respawnRounds|BIS_fnc_respawnSeagull|BIS_fnc_respawnSide|BIS_fnc_respawnSpectator|BIS_fnc_respawnTimePenalty|BIS_fnc_respawnWave|BIS_fnc_returnChildren|BIS_fnc_romanNumeral|BIS_fnc_rscLayer|BIS_fnc_saveInventory|BIS_fnc_sayMessage|BIS_fnc_scriptedWaypointType|BIS_fnc_selectDiarySubject|BIS_fnc_selectRespawnTemplate|BIS_fnc_setDate|BIS_fnc_setFog|BIS_fnc_setIDCStreamFriendly|BIS_fnc_setObjectTexture|BIS_fnc_setOvercast|BIS_fnc_setPPeffectTemplate|BIS_fnc_setRank|BIS_fnc_setRespawnDelay|BIS_fnc_setRespawnInventory|BIS_fnc_setServerVariable|BIS_fnc_setTask|BIS_fnc_setTaskLocal|BIS_fnc_setToPairs|BIS_fnc_showMarkers|BIS_fnc_showRespawnMenu|BIS_fnc_showUnitInfo|BIS_fnc_sideColor|BIS_fnc_sideID|BIS_fnc_sideName|BIS_fnc_sideType|BIS_fnc_skirmishTrigger|BIS_fnc_spawnObjects|BIS_fnc_splitString|BIS_fnc_StrategicMapAnimate|BIS_fnc_StrategicMapMouseButtonClick|BIS_fnc_StrategicMapOpen|BIS_fnc_subClasses|BIS_fnc_target|BIS_fnc_taskAlwaysVisible|BIS_fnc_taskChildren|BIS_fnc_taskCompleted|BIS_fnc_taskCreate|BIS_fnc_taskCurrent|BIS_fnc_taskDescription|BIS_fnc_taskDestination|BIS_fnc_taskExists|BIS_fnc_taskHint|BIS_fnc_taskParent|BIS_fnc_taskReal|BIS_fnc_taskSetAlwaysVisible|BIS_fnc_taskSetCurrent|BIS_fnc_taskSetDescription|BIS_fnc_taskSetDestination|BIS_fnc_taskSetState|BIS_fnc_taskSetType|BIS_fnc_tasksUnit|BIS_fnc_taskType|BIS_fnc_taskVar|BIS_fnc_teamColor|BIS_fnc_terrainGradAngle|BIS_fnc_textTiles|BIS_fnc_textureMarker|BIS_fnc_textureVehicleIcon|BIS_fnc_titlecard|BIS_fnc_toUpperDisplayTexts|BIS_fnc_traceBullets|BIS_fnc_trackMissionTime|BIS_fnc_tridentClient|BIS_fnc_tridentExecute|BIS_fnc_tridentGetRelationship|BIS_fnc_tridentHandleDamage|BIS_fnc_tridentSetRelationship|BIS_fnc_triggerToMarker|BIS_fnc_trimString|BIS_fnc_typeText|BIS_fnc_typeText2|BIS_fnc_uniqueClasses|BIS_fnc_unitAddon|BIS_fnc_unpackStaticWeapon|BIS_fnc_updatePlayerArray|BIS_fnc_validateParametersOO|BIS_fnc_vehicleRoles|BIS_fnc_VRCourseBallistics1|BIS_fnc_VRCourseBallistics2|BIS_fnc_VRCourseBallistics3|BIS_fnc_VRCourseBallistics4|BIS_fnc_VRCourseCommandingActions1|BIS_fnc_VRCourseCommandingActions2|BIS_fnc_VRCourseCommandingActions3|BIS_fnc_VRCourseCommandingBehaviour1|BIS_fnc_VRCourseCommandingBehaviour2|BIS_fnc_VRCourseCommandingBehaviour3|BIS_fnc_VRCourseCommandingMovement1|BIS_fnc_VRCourseCommandingMovement2|BIS_fnc_VRCourseCommandingVehicles1|BIS_fnc_VRCourseCommandingVehicles2|BIS_fnc_VRCourseCommandingVehicles3|BIS_fnc_VRCourseLaunchers1|BIS_fnc_VRCourseLaunchers2|BIS_fnc_VRCourseLaunchers3|BIS_fnc_VRCoursePlaceables1|BIS_fnc_VRCoursePlaceables2|BIS_fnc_VRCoursePlaceables3|BIS_fnc_VRCourseTargetDesignation1|BIS_fnc_VRCourseTargetDesignation2|BIS_fnc_VRCourseTargetDesignation3|BIS_fnc_VRDrawBorder|BIS_fnc_VRDrawGrid|BIS_fnc_VREffectKilled|BIS_fnc_VRFadeIn|BIS_fnc_VRFadeOut|BIS_fnc_VRSpawnEffect|BIS_fnc_VRSpawnSelector|BIS_fnc_VRTimer|BIS_fnc_weaponAddon|BIS_fnc_weaponComponents|BIS_fnc_wpArtillery|BIS_fnc_wpPatrol|BIS_fnc_wpRelax|BIS_fnc_wpSuppress|clearItemPool|disableDebriefingStats|enableDebriefingStats|enableSatNormalOnDetail|fogParams|getShadowDistance|incapacitatedState|isDLCAvailable|setSimulWeatherLayers|setWaypointLoiterRadius|setWaypointLoiterType|simulCloudDensity|simulCloudOcclusion|simulInClouds|UAVControl|unitAddons|unlinkItem|waypointLoiterRadius|waypointLoiterType|BIS_fnc_countdown|BIS_fnc_getFromPairs|face|nameSound|pitch|setCenterOfMass|setDetailMapBlendPars|setMass|setMusicEventHandler|setNameSound|setPitch|setSpeaker|speaker|addItemPool|addItemToBackpack|addItemToUniform|addItemToVest|backpackContainer|canAddItemToBackpack|canAddItemToUniform|canAddItemToVest|everyBackpack|forceRespawn|isInstructorFigureEnabled|itemsWithMagazines|magazinesDetailBackpack|magazinesDetailUniform|magazinesDetailVest|removeAllItemsWithMagazines|removeItemFromBackpack|removeItemFromUniform|removeItemFromVest|uniformContainer|vestContainer|BIS_fnc_deleteTask|BIS_fnc_playerSideFaction|playableSlotsNumber|setObjectTextureGlobal|BIS_fnc_crewCount|BIS_fnc_importImageLinks|BIS_fnc_itemType|BIS_fnc_jukebox|BIS_fnc_objectType|getClientState|setParticleFire|skillFinal|triggerTimeoutCurrent|waypointTimeoutCurrent|BIS_fnc_bleedTickets|BIS_fnc_fixDate|BIS_fnc_isLeapYear|BIS_fnc_monthDays|BIS_fnc_sortAlphabetically|lineIntersectsObjs|setDefaultCamera|addScoreSide|binocular|briefingName|cbChecked|cbSetChecked|currentMagazineDetailTurret|currentMagazineTurret|currentWeaponTurret|enableDiagLegend|enableSimulationGlobal|getCenterOfMass|getMass|hideObjectGlobal|hmd|queryItemsPool|selectWeaponTurret|setSpeech|activatedAddons|attachedObjects|attachedTo|addCuratorAddons|addCuratorCameraArea|addCuratorEditableObjects|addCuratorEditingArea|addCuratorPoints|allCurators|allowCuratorLogicIgnoreAreas|assignCurator|BIS_fnc_addCuratorAreaFromTrigger|BIS_fnc_addCuratorChallenge|BIS_fnc_addCuratorIcon|BIS_fnc_completedCuratorChallengesCount|BIS_fnc_curatorAttachObject|BIS_fnc_curatorAttributes|BIS_fnc_curatorAutomatic|BIS_fnc_curatorAutomaticPositions|BIS_fnc_curatorChallengeDestroyVehicle|BIS_fnc_curatorChallengeFindIntel|BIS_fnc_curatorChallengeFireWeapon|BIS_fnc_curatorChallengeGetInVehicle|BIS_fnc_curatorChallengeIlluminate|BIS_fnc_curatorChallengeSpawnLightning|BIS_fnc_curatorHint|BIS_fnc_curatorObjectEdited|BIS_fnc_curatorObjectPlaced|BIS_fnc_curatorObjectRegistered|BIS_fnc_curatorObjectRegisteredTable|BIS_fnc_curatorPinged|BIS_fnc_curatorRespawn|BIS_fnc_curatorSayMessage|BIS_fnc_curatorVisionModes|BIS_fnc_curatorWaypointPlaced|BIS_fnc_drawCuratorDeaths|BIS_fnc_drawCuratorLocations|BIS_fnc_drawCuratorRespawnMarkers|BIS_fnc_exportCfgVehicles|BIS_fnc_exportCuratorCostTable|BIS_fnc_finishCuratorChallenge|BIS_fnc_forceCuratorInterface|BIS_fnc_formatCuratorChallengeObjects|BIS_fnc_initCuratorAttribute|BIS_fnc_isCurator|BIS_fnc_isCuratorEditable|BIS_fnc_isForcedCuratorInterface|BIS_fnc_listCuratorPlayers|BIS_fnc_loop|BIS_fnc_manageCuratorAddons|BIS_fnc_manageCuratorChallenges|BIS_fnc_mirrorCuratorSettings|BIS_fnc_registerCuratorObject|BIS_fnc_removeCuratorIcon|BIS_fnc_removeDestroyedCuratorEditableObjects|BIS_fnc_runLater|BIS_fnc_setCuratorAttributes|BIS_fnc_setCuratorCamera|BIS_fnc_setCuratorVisionModes|BIS_fnc_shakeCuratorCamera|BIS_fnc_showCuratorAttributes|BIS_fnc_showCuratorFeedbackMessage|BIS_fnc_toggleCuratorVisionMode|curatorAddons|curatorCamera|curatorCameraArea|curatorCameraAreaCeiling|curatorCoef|curatorEditableObjects|curatorEditingArea|curatorEditingAreaType|curatorMouseOver|curatorPoints|curatorRegisteredObjects|curatorSelected|curatorWaypointCost|forceWeatherChange|getAssignedCuratorLogic|getAssignedCuratorUnit|getDLCs|isAutonomous|isEqualTo|objectCurators|openCuratorInterface|removeAllCuratorAddons|removeAllCuratorCameraAreas|removeAllCuratorEditingAreas|removeCuratorAddons|removeCuratorCameraArea|removeCuratorEditableObjects|removeCuratorEditingArea|setAutonomous|setCuratorCameraAreaCeiling|setCuratorCoef|setCuratorEditingAreaType|setCuratorWaypointCost|showCuratorCompass|shownCuratorCompass|shownUAVFeed|showUAVFeed|unassignCurator|logEntities|moveInAny|setStatValue|squadParams|lbSetPictureColorDisabled|lbSetPictureColorSelected|enableMimics|everyContainer|forceAddUniform|isUniformAllowed|lbSetPictureColor|magazinesAmmoCargo|openYoutubeVideo|vectorAdd|vectorCos|vectorCrossProduct|vectorDiff|vectorDistance|vectorDistanceSqr|vectorDotProduct|vectorMagnitude|vectorMagnitudeSqr|vectorMultiply|visibleCompass|visibleGPS|visibleWatch|weaponsItemsCargo|allMines|BIS_fnc_animateTaskWaypoint|BIS_fnc_arsenal|BIS_fnc_getUnitInsignia|BIS_fnc_setUnitInsignia|configClasses|detectedMines|disableUAVConnectability|enableUAVConnectability|isAutotest|isUAVConnectable|mineDetectedBy|reverse|ctrlClassName|ctrlCreate|ctrlDelete|getCargoIndex|lockCameraTo|pushBack|setTimeMultiplier|timeMultiplier|vectorFromTo|vectorNormalized|addBackpackGlobal|addMagazineAmmoCargo|addToRemainsCollector|addWeaponTurret|BIS_fnc_setMissionStatusSlot|BIS_fnc_showMissionStatus|ctrlModel|ctrlModelDirAndUp|ctrlModelScale|ctrlSetModel|ctrlSetModelDirAndUp|ctrlSetModelScale|deleteAt|deleteRange|deleteVehicleCrew|getDirVisual|getHit|getPosASLVisual|getPosATLVisual|getPosVisual|getPosWorld|isCollisionLightOn|isInRemainsCollector|isLightOn|modelToWorldVisual|removeBackpackGlobal|removeFromRemainsCollector|removeWeaponTurret|setCollisionLight|setPilotLight|setPosWorld|turretLocal|vectorDirVisual|vectorUpVisual|worldToModelVisual|airDensityRTD|allTurrets|BIS_fnc_didJIP|canSlingLoad|difficultyEnabledRTD|enablePersonTurret|enableRopeAttach|enginesIsOnRTD|enginesRpmRTD|enginesTorqueRTD|fullCrew|getSlingLoad|isObjectRTD|magazineTurretAmmo|ropeAttachedObjects|ropeAttachedTo|ropeAttachEnabled|ropeAttachTo|ropeCreate|ropeCut|ropeDestroy|ropeDetach|ropeEndPosition|ropeLength|ropes|ropeUnwind|ropeUnwound|rotorsForcesRTD|rotorsRpmRTD|serverCommandExecutable|setCustomWeightRTD|setMagazineTurretAmmo|setSlingLoad|slingLoadAssistantShown|weightRTD|wingsForcesRTD|BIS_fnc_configExtremes|BIS_fnc_openFieldManual|configProperties|getObjectDLC|getPersonUsedDLCs|setUnloadInCombat|shownChat|addWeaponItem|allControls|allDisplays|allVariables|configSourceMod|getObjectMaterials|getObjectTextures|removeSecondaryWeaponItem|turretOwner|append|configSourceModList|enableUAVWaypoints|groupOwner|setGroupOwner|waypointsEnabledUAV|BIS_fnc_dynamicGroups|BIS_fnc_garage|BIS_fnc_initVehicle|channelEnabled|controlsGroupCtrl|currentChannel|Dynamic_Groups|enableChannel|getPlayerChannel|getSuppression|isTurnedOut|isWeaponDeployed|isWeaponRested|leaderboardRequestRowsFriends|MP_End_Game|Revive|setCurrentChannel|setSuppression|BIS_fnc_dynamicGroups|BIS_fnc_garage|BIS_fnc_initVehicle|channelEnabled|controlsGroupCtrl|currentChannel|Dynamic_Groups|enableChannel|getPlayerChannel|getSuppression|isTurnedOut|isWeaponDeployed|isWeaponRested|leaderboardRequestRowsFriends|Revive|setCurrentChannel|setSuppression|diag_activeMissionFSMs|diag_activeSQFScripts|diag_activeSQSScripts|sort|lbSetSelectColor|lbSetSelectColorRight|profileNameSteam|allPlayers|arrayIntersect|BIS_fnc_unitHeadgear|configHierarchy|currentNamespace|currentThrowable|getObjectViewDistance|isObjectHidden|param|params|roleDescription|serverName|setGroupIdGlobal|worldSize|AGLToASL|ASLToAGL|CfgRemoteExec|didJIP|didJIPOwner|distance2D|getAllHitPointsDamage|getHitIndex|getModelInfo|getObjectType|joinString|lineIntersectsSurfaces|objectParent|remoteExec|remoteExecCall|setHitIndex|splitString|targetKnowledge|ctrlAngle|disableNVGEquipment|disableRemoteSensors|getRemoteSensorsDisabled|magazinesAllTurrets|shownHUD|allowSprint|enableStamina|flagSide|flagTexture|getAnimAimPrecision|getAnimSpeedCoef|getMousePosition|getStamina|inPolygon|isEqualType|isEqualTypeAll|isEqualTypeAny|isEqualTypeArray|isEqualTypeParams|isSprintAllowed|isStaminaEnabled|nearestTerrainObjects|setAnimSpeedCoef|setCustomAimCoef|setObjectMaterialGlobal|setStamina|setStaminaScheme|add3DENConnection|add3DENEventHandler|add3DENLayer|all3DENEntities|apply|BIS_fnc_sideIsEnemy|BIS_fnc_sideIsFriendly|checkVisibility|clientOwner|collect3DENHistory|create3DENComposition|create3DENEntity|current3DENOperation|cursorObject|delete3DENEntities|do3DENAction|edit3DENMissionAttributes|exportJIPMessages|get3DENActionState|get3DENAttribute|get3DENCamera|get3DENConnections|get3DENEntity|get3DENEntityID|get3DENGrid|get3DENIconsVisible|get3DENLayerEntities|get3DENLinesVisible|get3DENMissionAttribute|get3DENMouseOver|get3DENSelected|getClientStateNumber|getMissionConfig|getMissionConfigValue|getPlayerScores|getRelDir|getRelPos|is3DEN|is3DENMultiplayer|isFilePatchingEnabled|leaderboardDeInit|leaderboardGetRows|leaderboardInit|lockIdentity|logNetwork|logNetworkTerminate|missionVersion|move3DENCamera|ppEffectEnabled|pushBackUnique|remove3DENConnection|remove3DENEventHandler|remove3DENLayer|removeAll3DENEventHandlers|selectRandom|set3DENAttribute|set3DENAttributes|set3DENGrid|set3DENIconsVisible|set3DENLayer|set3DENLinesVisible|set3DENMissionAttributes|set3DENObjectType|tvSetText|animateSource|animationNames|animationSourcePhase|BIS_fnc_groupFromNetId|BIS_fnc_netId|BIS_fnc_objectFromNetId|canSuspend|createSimpleObject|ctrlParentControlsGroup|diag_codePerformance|difficultyOption|displayParent|drawPolygon|getCameraViewDirection|getUnitLoadout|getUnitTrait|hideSelection|inArea|moonPhase|roadAt|selectionNames|setSimpleTaskCustomData|setSimpleTaskType|setUnitLoadout|setUnitTrait|setWaypointForceBehaviour|sideAmbientLife|sideEmpty|taskAlwaysVisible|taskCustomData|taskType|waypointForceBehaviour|BIS_fnc_exportEditorPreviews|BIS_fnc_showRespawnMenuDisableItem|commandSuppressiveFire|doSuppressiveFire|getTerrainGrid|Pixel_Grid_System|pixelGrid|pixelH|pixelW|screenshot|shownScoretable|showScoretable|useAISteeringComponent|userInputDisabled|addOwnedMine|addPlayerScores|Arma_3_Revive|BIS_fnc_adjustSimpleObject|BIS_fnc_createSimpleObject|BIS_fnc_EXP_camp_playSubtitles|BIS_fnc_holdActionAdd|BIS_fnc_holdActionRemove|BIS_fnc_isThrowable|BIS_fnc_replaceWithSimpleObject|BIS_fnc_simpleObjectData|canVehicleCargo|createMPCampaignDisplay|ctrlSetAngle|ctrlSetFontHeightSecondary|ctrlSetFontSecondary|enableAimPrecision|enableVehicleCargo|flyInHeightASL|forcedMap|getAimingCoef|getAllOwnedMines|getCustomAimingCoef|getMissionDLCs|getShotParents|getVehicleCargo|getWeaponSway|isVehicleCargo|missionDifficulty|modParams|openDLCPage|pixelGridBase|pixelGridNoUIScale|removeAllOwnedMines|removeOwnedMine|setVehicleCargo|tvSetPictureColorDisabled|tvSetPictureColorSelected|tvSetPictureRight|tvSetPictureRightColor|tvSetPictureRightColorDisabled|tvSetPictureRightColorSelected|vehicleCargoEnabled|getPilotCameraDirection|getPilotCameraPosition|getPilotCameraRotation|getPilotCameraTarget|hasPilotCamera|setPilotCameraDirection|setPilotCameraRotation|setPilotCameraTarget|inAreaArray|selectMax|selectMin|toFixed|actionIDs|actionParams|allCutLayers|allSimpleObjects|ctAddHeader|ctAddRow|ctClear|ctCurSel|ctData|ctFindHeaderRows|ctFindRowHeader|ctHeaderControls|ctHeaderCount|ctRemoveHeaders|ctRemoveRows|ctRowControls|ctRowCount|ctSetCurSel|ctSetData|ctSetHeaderTemplate|ctSetRowTemplate|ctSetValue|ctValue|deleteGroupWhenEmpty|diag_activeScripts|diag_drawMode|diag_list|diag_mergeConfigFile|diag_recordTurretLimits|enableAudioFeature|enableWeaponDisassembly|endl|environmentEnabled|flagAnimationPhase|getAllEnvSoundControllers|getAllSoundControllers|getEnvSoundController|getSoundController|getSoundControllerResult|isGroupDeletedWhenEmpty|isMultiplayerSolo|isRemoteExecuted|isRemoteExecutedJIP|isSimpleObject|parseSimpleArray|ReportRemoteTarget|setFlagAnimationPhase|setShotParents|setVehicleRadar|setVehicleReceiveRemoteTargets|setVehicleReportOwnPosition|setVehicleReportRemoteTargets|setVelocityModelSpace|targets|terrainIntersectAtASL|unitAimPosition|unitAimPositionVisual|unitIsUAV|vehicleReceiveRemoteTargets|vehicleReportOwnPosition|vehicleReportRemoteTargets|visibleScoretable)\\b","name":"entity.name.function.sqf"},"CBA":{"match":"\\s*(?i)(CBA_fnc_(actionArgument|addBackpackCargo|addBinocularMagazine|addBISEventHandler|addClassEventHandler|addDisplayHandler|addEventHandler|addEventHandlerArgs|addItem|addItemCargo|addKeybind|addKeybindToFleximenu|addKeyHandler|addKeyHandlerFromConfig|addMagazine|addMagazineCargo|addPerFrameHandler|addPlayerAction|addPlayerEventHandler|addWaypoint|addWeapon|addWeaponCargo|benchmarkFunction|binocularMagazine|canUseWeapon|capitalize|CBA_help_fnc_setCreditsLine|CBA_help_fnc_setVersionLine|CBA_statemachine_fnc_addState|CBA_statemachine_fnc_addTransition|CBA_statemachine_fnc_clockwork|CBA_statemachine_fnc_create|CBA_statemachine_fnc_createFromConfig|CBA_statemachine_fnc_delete|CBA_statemachine_fnc_toString|CBA_statemachine_fnc_updateList|changeKeyHandler|clearWaypoints|compatibleItems|createMarker|createNamespace|createTrigger|currentMagazineIndex|currentUnit|debug|deleteEntity|deleteNamespace|directCall|dropItem|dropMagazine|dropWeapon|error|execNextFrame|filter|find|findEntity|findMax|findMin|findNil|findNull|findTypeName|findTypeOf|floatToString|formatElapsedTime|formatNumber|getAlive|getAnimType|getArg|getArrayDiff|getArrayElements|getAspectRatio|getConfigEntry|getDistance|getFirer|getFov|getGroup|getGroupIndex|getItemConfig|getKeybind|getMagazineIndex|getMarkerPersistent|getMuzzles|getNearest|getNearestBuilding|getObjectConfig|getPos|getPosFromString|getSharedGroup|getTerrainProfile|getTurret|getUISize|getUnitAnim|getUnitDeathAnim|getVolume|getWeaponModes|globalEvent|globalEventJIP|globalExecute|globalSay|globalSay3d|hashCreate|hashEachPair|hashGet|hashHasKey|hashRem|hashSet|headDir|inArea|inheritsFrom|inject|isAlive|isHash|isPerson|isRecompileEnabled|isScheduled|isTurnedOut|isUnitGetOutAnim|join|leftTrim|localEvent|log|mapDirTo|mapGridToPos|mapRelPos|modelHeadDir|moduleAttack|moduleDefend|modulePatrol|nearPlayer|northingReversed|objectRandom|ownerEvent|parseYAML|peek|players|polar2vect|publicVariable|randPos|randPosArea|readKeyFromConfig|realHeight|registerKeybind|registerKeybindModPrettyName|registerKeybindToFleximenu|reject|remoteEvent|removeBackpackCargo|removeBinocularMagazine|removeDisplayHandler|removeEventHandler|removeItem|removeItemCargo|removeKeyHandler|removeMagazine|removeMagazineCargo|removePerFrameHandler|removePlayerAction|removePlayerEventHandler|removeWeapon|removeWeaponCargo|replace|rightTrim|scaleVect|scaleVectTo|searchNearby|select|selectWeapon|serverEvent|setHeight|setMarkerPersistent|setPos|setVarNet|shuffle|simplifyAngle|simplifyAngle180|sortNestedArray|split|strLen|substr|substring|switchPlayer|targetEvent|taskAttack|taskDefend|taskPatrol|taskSearchArea|test|trim|turretDir|turretPath|turretPathWeapon|vect2Polar|vectAdd|vectCross|vectCross2D|vectDir|vectDot|vectElev|vectMagn|vectMagn2D|vectRotate2D|vectSubtract|vehicleRole|viewDir|waitAndExecute|waitUntilAndExecute|weaponComponents))\\b","name":"entity.name.function.sqf"},"ACE3":{"match":"\\s*(?i)(ace_(backpacks_fnc_isBackpack|cargo_fnc_makeLoadable|common_fnc_addMapMarkerCreatedEventHandler|common_fnc_addSyncedEventHandler|common_fnc_addToInventory|common_fnc_ambientBrightness|common_fnc_arithmeticGetResult|common_fnc_arithmeticSetSource|common_fnc_binarizeNumber|common_fnc_blurScreen|common_fnc_canInteractWith|common_fnc_checkPBOs|common_fnc_codeToString|common_fnc_createOrthonormalReference|common_fnc_currentChannel|common_fnc_debug|common_fnc_defineVariable|common_fnc_displayIcon|common_fnc_displayText|common_fnc_displayTextPicture|common_fnc_displayTextStructured|common_fnc_doAnimation|common_fnc_dropBackpack|common_fnc_getAllDefinedSetVariables|common_fnc_getChildren|common_fnc_getConfigCommander|common_fnc_getConfigGunner|common_fnc_getDefinedVariableDefault|common_fnc_getDisplayConfigName|common_fnc_getDoorTurrets|common_fnc_getFirstObjectIntersection|common_fnc_getFirstTerrainIntersection|common_fnc_getGunner|common_fnc_getInPosition|common_fnc_getItemType|common_fnc_getLightProperties|common_fnc_getLightPropertiesWeapon|common_fnc_getMapGridFromPos|common_fnc_getMapPosFromGrid|common_fnc_getName|common_fnc_getPitchBankYaw|common_fnc_getReflectorsWithSelections|common_fnc_getTargetAzimuthAndInclination|common_fnc_getTargetDistance|common_fnc_getTargetObject|common_fnc_getTurnedOnLights|common_fnc_getTurretCommander|common_fnc_getTurretConfigPath|common_fnc_getTurretCopilot|common_fnc_getTurretDirection|common_fnc_getTurretGunner|common_fnc_getTurretIndex|common_fnc_getTurretsFFV|common_fnc_getTurretsOther|common_fnc_getUavControlPosition|common_fnc_getVehicleCargo|common_fnc_getVehicleCodriver|common_fnc_getVehicleCrew|common_fnc_getVehicleUAVCrew|common_fnc_getVersion|common_fnc_getWeaponAzimuthAndInclination|common_fnc_getWeaponIndex|common_fnc_getWeaponModes|common_fnc_getWeaponMuzzles|common_fnc_getWeaponState|common_fnc_getWeaponType|common_fnc_getWindDirection|common_fnc_getZoom|common_fnc_hadamardProduct|common_fnc_hasHatch|common_fnc_hasItem|common_fnc_hasMagazine|common_fnc_headBugFix|common_fnc_hideUnit|common_fnc_interpolateFromArray|common_fnc_inTransitionAnim|common_fnc_isAwake|common_fnc_isEngineer|common_fnc_isEOD|common_fnc_isFeatureCameraActive|common_fnc_isInBuilding|common_fnc_isModLoaded|common_fnc_isPlayer|common_fnc_isUnderwater|common_fnc_lightIntensityFromObject|common_fnc_loadPerson|common_fnc_loadPersonLocal|common_fnc_monitor|common_fnc_muteUnit|common_fnc_numberToDigits|common_fnc_numberToDigitsString|common_fnc_numberToString|common_fnc_playConfigSound3D|common_fnc_player|common_fnc_playerSide|common_fnc_positionToASL|common_fnc_progressBar|common_fnc_removeMapMarkerCreatedEventHandler|common_fnc_sanitizeString|common_fnc_sendRequest|common_fnc_setDefinedVariable|common_fnc_setDisableUserInputStatus|common_fnc_setHearingCapability|common_fnc_setParameter|common_fnc_setPitchBankYaw|common_fnc_setProne|common_fnc_setVolume|common_fnc_showHud|common_fnc_statusEffect_get|common_fnc_statusEffect_set|common_fnc_stringCompare|common_fnc_stringRemoveWhiteSpace|common_fnc_stringToColoredText|common_fnc_switchToGroupSide|common_fnc_toBin|common_fnc_toBitmask|common_fnc_toHex|common_fnc_toNumber|common_fnc_unhideUnit|common_fnc_uniqueElements|common_fnc_unmuteUnit|common_fnc_useItem|common_fnc_useMagazine|common_fnc_watchVariable|dogtags_fnc_disableFactionDogtags|dragging_fnc_setCarryable|dragging_fnc_setDraggable|explosives_fnc_addClacker|explosives_fnc_addToSpeedDial|explosives_fnc_canDefuse|explosives_fnc_canDetonate|explosives_fnc_connectExplosive|explosives_fnc_defuseExplosive|explosives_fnc_detonateExplosive|explosives_fnc_dialPhone|explosives_fnc_getDetonators|explosives_fnc_getPlacedExplosives|explosives_fnc_getSpeedDialExplosive|explosives_fnc_hasExplosives|explosives_fnc_hasPlacedExplosives|explosives_fnc_interactEH|explosives_fnc_placeExplosive|explosives_fnc_removeFromSpeedDial|explosives_fnc_scriptedExplosive|explosives_fnc_setupExplosive|explosives_fnc_startDefuse|explosives_fnc_startTimer|explosives_fnc_triggerType|fastroping_fnc_deployAI|goggles_fnc_applyDirtEffect|goggles_fnc_applyDustEffect|goggles_fnc_clearGlasses|goggles_fnc_externalCamera|goggles_fnc_isDivingGoggles|goggles_fnc_isGogglesVisible|goggles_fnc_isInRotorWash|goggles_fnc_removeDirtEffect|goggles_fnc_removeDustEffect|goggles_fnc_removeGlassesEffect|goggles_fnc_removeRainEffect|interact_menu_fnc_addActionToClass|interact_menu_fnc_createAction|logistics_wirecutter_fnc_interactEH|map_gestures_fnc_addGroupColorMapping|medical_fnc_actionPlaceInBodyBag|medical_fnc_actionRemoveTourniquet|medical_fnc_addDamageToUnit|medical_fnc_addHeartRateAdjustment|medical_fnc_addToLog|medical_fnc_addToTriageCard|medical_fnc_addUnconsciousCondition|medical_fnc_addVitalLoop|medical_fnc_adjustPainLevel|medical_fnc_canAccessMedicalEquipment|medical_fnc_canTreat|medical_fnc_displayTriageCard|medical_fnc_dropDownTriageCard|medical_fnc_getTriageStatus|medical_fnc_getUnconsciousCondition|medical_fnc_hasItem|medical_fnc_hasItems|medical_fnc_hasTourniquetAppliedTo|medical_fnc_isInMedicalFacility|medical_fnc_isInMedicalVehicle|medical_fnc_isMedic|medical_fnc_isMedicalVehicle|medical_fnc_itemCheck|medical_fnc_selectionNameToNumber|medical_fnc_setCardiacArrest|medical_fnc_setDead|medical_fnc_setHitPointDamage|medical_fnc_setUnconscious|medical_fnc_showBloodEffect|medical_fnc_treatment|medical_fnc_treatmentAdvanced_bandage|medical_fnc_treatmentAdvanced_CPR|medical_fnc_treatmentAdvanced_CPRLocal|medical_fnc_treatmentAdvanced_medication|medical_fnc_treatmentAdvanced_medicationLocal|medical_fnc_treatmentIV|medical_fnc_treatmentIVLocal|medical_fnc_unconsciousPFH|medical_fnc_useItem|medical_fnc_useItems|mk6mortar_fnc_canLoadMagazine|mk6mortar_fnc_canUnloadMagazine|mk6mortar_fnc_loadMagazine|mk6mortar_fnc_loadMagazineTimer|mk6mortar_fnc_unloadMagazine|mk6mortar_fnc_unloadMagazineTimer|nametags_fnc_setFactionRankIcons|parachute_fnc_showAltimeter|rearm_fnc_disable|refuel_fnc_getFuel|refuel_fnc_makeJerryCan|refuel_fnc_reset|refuel_fnc_setFuel|repair_fnc_canRepair|repair_fnc_getClaimObjects|repair_fnc_hasItems|repair_fnc_isEngineer|repair_fnc_isInRepairFacility|repair_fnc_isNearRepairVehicle|repair_fnc_isRepairVehicle|repair_fnc_repair|repair_fnc_useItem|repair_fnc_useItems|slideshow_fnc_createSlideshow|spectator_fnc_interrupt|spectator_fnc_setCameraAttributes|spectator_fnc_setSpectator|spectator_fnc_stageSpectator|spectator_fnc_updateCameraModes|spectator_fnc_updateSpectatableSides|spectator_fnc_updateUnits|spectator_fnc_updateVisionModes|switchunits_fnc_isValidAi|switchunits_fnc_nearestPlayers|switchunits_fnc_switchBack|switchunits_fnc_switchUnit|tagging_fnc_addCustomTag|tagging_fnc_tag|ui_fnc_setElementVisibility|vehiclelock_fnc_addKeyForVehicle|vehiclelock_fnc_serverSetupCustomKeyEH|vehiclelock_fnc_setVehicleLockEH|weaponselect_fnc_putWeaponAway|weaponselect_fnc_selectNextGrenade))\\b","name":"entity.name.function.sqf"},"expression":{"name":"meta.expression.sqf","patterns":[{"include":"#string"},{"include":"#comment"},{"include":"#literal"},{"include":"#paren-expression"},{"include":"#block"},{"include":"#comparison-operator"},{"include":"#condition-operator"},{"include":"#manipulative-operator"},{"include":"#assignment-operator"},{"include":"#control-statement"},{"include":"#code-managers"},{"include":"#switch-case"},{"include":"#statements"},{"include":"#declaration"}]},"statements":{"name":"meta.expression.sqf","patterns":[{"include":"#OFP"},{"include":"#ARMA"},{"include":"#ARMA2"},{"include":"#ARMA3"}]},"declaration":{"name":"meta.declaration.sqf","patterns":[{"include":"#fnc-call"},{"include":"#fnc-declaration"},{"include":"#fnc-declaration-compile"},{"include":"#var-declaration-priv"},{"include":"#var-declaration"},{"include":"#var-call-priv"},{"include":"#var-call"}]},"var-declaration":{"begin":"([_a-zA-Z_0-9]+)(\\s*)(=+)","beginCaptures":{"1":{"name":"variable.other.sqf"},"3":{"name":"keyword.operator.assignment.sqf"}},"end":" |;|{|}|\t|=|(|)|[|]","endCaptures":{"1":{"name":"meta.brace.curly.sqf"}},"name":"meta.declaration.object.sqf"},"var-declaration-priv":{"begin":"(_+)([_a-zA-Z_0-9]+)(\\s*)(=+)","beginCaptures":{"1":{"name":"variable.other.private.sqf"},"2":{"name":"variable.other.private.sqf"},"4":{"name":"keyword.operator.assignment.sqf"}},"end":" |;|{|}|\t|=|(|)|[|]","endCaptures":{"1":{"name":"meta.brace.curly.sqf"}},"name":"meta.declaration.object.sqf"},"fnc-declaration":{"begin":"(\\s*)([_a-zA-Z_0-9]+)(\\s*)(=)(\\s*)({)","beginCaptures":{"2":{"name":"support.function.sqf"},"4":{"name":"keyword.operator.assignment.sqf"},"6":{"name":"meta.brace.curly.sqf"}},"end":" |;|{|}|\t","endCaptures":{"1":{"name":"meta.brace.curly.sqf"}},"name":"meta.declaration.object.sqf"},"fnc-declaration-compile":{"begin":"(\\s*)([_a-zA-Z_0-9]+)(\\s*)(=)(\\s*)(compileFinal|compile)","beginCaptures":{"2":{"name":"support.function.sqf"},"4":{"name":"keyword.operator.assignment.sqf"},"6":{"name":"meta.function-call.sqf"}},"end":" |;|{|}|\t","endCaptures":{"1":{"name":"meta.brace.curly.sqf"}},"name":"meta.declaration.object.sqf"},"code-managers":{"match":"(\\s*)(compile|compileFinal|exec|execFSM|execVM|callExtension)\\b","name":"meta.function-call.sqf"},"fnc-call":{"begin":"(\\s*)(call|spawn)(\\s+)([a-zA-Z_0-9]+)","beginCaptures":{"2":{"name":"meta.function-call.sqf"},"4":{"name":"support.function.sqf"}},"end":" |;|{|}|(|)","endCaptures":{"1":{"name":"keyword.operator.sqf"}},"name":"meta.declaration.object.sqf"},"var-call":{"begin":"(\\s*)([a-zA-Z_0-9]+)([^a-zA-Z_0-9]|\\s+)","beginCaptures":{"2":{"name":"variable.other.sqf"}},"end":" |;|{|}|(|)|[|]","endCaptures":{"1":{"name":"keyword.operator.sqf"}},"name":"meta.declaration.object.sqf"},"var-call-priv":{"match":"(\\s*)(_+[a-zA-Z_0-9]+)","name":"variable.other.private.sqf"},"indexer-parameter":{"captures":{"1":{"name":"variable.parameter.sqf"}},"match":"([a-zA-Z_$][\\w$]*)(?=\\:)","name":"meta.indexer.parameter.sqf"},"literal":{"name":"literal.sqf","patterns":[{"include":"#numeric-literal"},{"include":"#boolean-literal"},{"include":"#null-literal"},{"include":"#array-literal"},{"include":"#reserved-literal"}]},"manipulative-operator":{"match":"\\*|/|\\-|\\+|%|\\^|plus|\\%","name":"keyword.operator.manipulative.sqf"},"null-literal":{"match":"\\b(null|nil|controlNull|displayNull|grpNull|locationNull|netObjNull|objNull|scriptNull|taskNull|teamMemberNull|configNull)\\b","name":"constant.language.null.sqf"},"numeric-literal":{"match":"\\s*(?<=[^$])((0(x|X)[0-9a-fA-F]+)|([0-9]+(\\.[0-9]+)?))\\b","name":"constant.numeric.sqf"},"object-body":{"begin":"\\{","beginCaptures":{"0":{"name":"meta.brace.curly.sqf"}},"end":"\\}","endCaptures":{"0":{"name":"meta.brace.curly.sqf"}},"name":"meta.object.body.sqf","patterns":[{"include":"#comment"},{"include":"#type-annotation"},{"include":"#access-modifier"},{"include":"#property-accessor"}]},"":{"begin":"\\(","beginCaptures":{"0":{"name":"meta.brace.paren.sqf"}},"end":"\\)","endCaptures":{"0":{"name":"meta.brace.paren.sqf"}},"patterns":[{"include":"#expression"}]},"property-accessor":{"match":"\\b(get|set)\\b","name":"storage.type.property.sqf"},"qstring-double":{"begin":"\"","end":"\"","name":"string.double.sqf"},"qstring-single":{"begin":"'","end":"'","name":"string.single.sqf"},"string":{"name":"string.sqf","patterns":[{"include":"#qstring-single"},{"include":"#qstring-double"}]},"switch-case":{"begin":"\\b(case|default)\\b","beginCaptures":{"1":{"name":"keyword.control.sqf"}},"end":":","name":"case.expr.sqf","patterns":[{"include":"#expression"}]},"reserved-literal":{"match":"\\s*(?i)(this|_this|_x|_forEachIndex|_exception|_thisScript|_thisFSM|thisList|thisTrigger|west|east|resistance|civilian|independent|blufor|opfor)\\b","name":"variable.language.reserved.sqf"},"type":{"name":"meta.type.sqf","patterns":[{"include":"#type-object"}]},"type-annotation":{"begin":":","end":"(?=$|[,);\\}\\]]|//)|(?==[^>])|(?<=[\\}>\\]\\)]|[a-zA-Z_$])\\s*(?=\\{)","name":"meta.type.annotation.sqf","patterns":[{"include":"#type"}]},"type-object":{"begin":"\\{","beginCaptures":{"0":{"name":"meta.brace.curly.sqf"}},"end":"\\}","endCaptures":{"0":{"name":"meta.brace.curly.sqf"}},"name":"meta.object.type.sqf","patterns":[{"include":"#comment"},{"include":"#type-annotation"}]}},"scopeName":"source.sqf"} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..ba5a7bc --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "moduleResolution": "node", + "outDir": "out", + "lib": [ "es2016" ], + "sourceMap": true + }, + "exclude": [ + "node_modules", + "server" + ] +} \ No newline at end of file