'use strict' ; import { EventEmitter as NodeEventEmitter } from 'events' ; import * as vscode from 'vscode' ; export * from './extHostedTypes' ; export * from './uri' ; export namespace vscMock { export class Disposable { constructor ( private callOnDispose ) { } public dispose ( ) { if ( this . callOnDispose ) { this . callOnDispose ( ) ; } } } export class EventEmitter < T > implements vscode . EventEmitter < T > { public event : vscode . Event < T > ; public emitter : NodeEventEmitter ; constructor ( ) { this . event = this . add . bind ( this ) ; this . emitter = new NodeEventEmitter ( ) ; } public fire ( data ? ) { this . emitter . emit ( 'evt' , data ) ; } public dispose ( ) { this . emitter . removeAllListeners ( ) ; } protected add = ( listener , _thisArgs ? , _disposables ? ) : Disposable => { const bound = _thisArgs ? listener . bind ( _thisArgs ) : listener ; this . emitter . addListener ( 'evt' , bound ) ; return ( { dispose : ( ) => { this . emitter . removeListener ( 'evt' , bound ) ; } } as any ) as Disposable ; } ; } export class CancellationToken extends EventEmitter < any > implements vscode . CancellationToken { public isCancellationRequested ! : boolean ; public onCancellationRequested : vscode . Event < any > ; constructor ( ) { super ( ) ; this . onCancellationRequested = this . add . bind ( this ) ; } public cancel ( ) { this . isCancellationRequested = true ; this . fire ( ) ; } } export class CancellationTokenSource { public token : CancellationToken ; constructor ( ) { this . token = new CancellationToken ( ) ; } public cancel ( ) { this . token . cancel ( ) ; } public dispose ( ) { this . token . dispose ( ) ; } } export class CodeAction { public title : string ; public edit ? : vscode . WorkspaceEdit ; public diagnostics ? : vscode . Diagnostic [ ] ; public command ? : vscode . Command ; public kind ? : CodeActionKind ; public isPreferred ? : boolean ; constructor ( _title , _kind ? ) { this . title = _title ; this . kind = _kind ; } } 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 , Reference = 17 , File = 16 , Folder = 18 , EnumMember = 19 , Constant = 20 , Struct = 21 , Event = 22 , Operator = 23 , TypeParameter = 24 } 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 , EnumMember = 21 , Struct = 22 , Event = 23 , Operator = 24 , TypeParameter = 25 } export enum IndentAction { None = 0 , Indent = 1 , IndentOutdent = 2 , Outdent = 3 } export class CodeActionKind { public static readonly Empty : CodeActionKind = new CodeActionKind ( 'empty' ) ; public static readonly QuickFix : CodeActionKind = new CodeActionKind ( 'quick.fix' ) ; public static readonly Refactor : CodeActionKind = new CodeActionKind ( 'refactor' ) ; public static readonly RefactorExtract : CodeActionKind = new CodeActionKind ( 'refactor.extract' ) ; public static readonly RefactorInline : CodeActionKind = new CodeActionKind ( 'refactor.inline' ) ; public static readonly RefactorRewrite : CodeActionKind = new CodeActionKind ( 'refactor.rewrite' ) ; public static readonly Source : CodeActionKind = new CodeActionKind ( 'source' ) ; public static readonly SourceOrganizeImports : CodeActionKind = new CodeActionKind ( 'source.organize.imports' ) ; public static readonly SourceFixAll : CodeActionKind = new CodeActionKind ( 'source.fix.all' ) ; private constructor ( private _value ) { } public append ( parts ) { return new CodeActionKind ( `${ this . _value }.${ parts }` ) ; } public intersects ( other ) { return this . _value . includes ( other . _value ) || other . _value . includes ( this . _value ) ; } public contains ( other ) { return this . _value . startsWith ( other . _value ) ; } public get value ( ) : string { return this . _value ; } } export interface DebugAdapterExecutableOptions { env ? : { [ key ] : string ; } ; cwd ? : string ; } export class DebugAdapterServer { constructor ( public readonly port , public readonly host ? ) { } } export class DebugAdapterExecutable { constructor ( public readonly command , public readonly args = [ ] , public readonly options ? ) { } } export enum FileType { Unknown = 0 , File = 1 , Directory = 2 , SymbolicLink = 64 } }