Ejemplo n.º 1
0
 public LanguageClientWorkDoneManager(IWindowLanguageClient router, ISerializer serializer, IProgressManager progressManager)
 {
     _router          = router;
     _serializer      = serializer;
     _progressManager = progressManager;
     _pendingWork     = new ConcurrentDictionary <ProgressToken, IProgressObservable <WorkDoneProgress> >();
 }
Ejemplo n.º 2
0
        internal LanguageClient(
            Connection connection,
            IOptions <LanguageClientOptions> options,
            IEnumerable <ICapability> capabilities,
            ClientInfo clientInfo,
            ClientCapabilities clientCapabilities,
            ILspClientReceiver lspClientReceiver,
            TextDocumentIdentifiers textDocumentIdentifiers,
            IServiceProvider serviceProvider,
            IEnumerable <OnLanguageClientStartedDelegate> startedDelegates,
            IEnumerable <IOnLanguageClientStarted> startedHandlers,
            ITextDocumentLanguageClient textDocumentLanguageClient,
            IClientLanguageClient clientLanguageClient,
            IGeneralLanguageClient generalLanguageClient,
            IWindowLanguageClient windowLanguageClient,
            IWorkspaceLanguageClient workspaceLanguageClient,
            LanguageProtocolSettingsBag languageProtocolSettingsBag,
            SharedHandlerCollection handlerCollection,
            IResponseRouter responseRouter,
            IProgressManager progressManager,
            IClientWorkDoneManager clientWorkDoneManager,
            IRegistrationManager registrationManager,
            ILanguageClientWorkspaceFoldersManager languageClientWorkspaceFoldersManager, IEnumerable <OnLanguageClientInitializeDelegate> initializeDelegates,
            IEnumerable <IOnLanguageClientInitialize> initializeHandlers, IEnumerable <OnLanguageClientInitializedDelegate> initializedDelegates,
            IEnumerable <IOnLanguageClientInitialized> initializedHandlers
            ) : base(handlerCollection, responseRouter)
        {
            _connection              = connection;
            _capabilities            = capabilities;
            _clientCapabilities      = clientCapabilities;
            _clientInfo              = clientInfo;
            _receiver                = lspClientReceiver;
            _textDocumentIdentifiers = textDocumentIdentifiers;
            _startedDelegates        = startedDelegates;
            _startedHandlers         = startedHandlers;
            _rootUri = options.Value.RootUri;
            _trace   = options.Value.Trace;
            _initializationOptions = options.Value.InitializationOptions;
            _settingsBag           = languageProtocolSettingsBag;
            _collection            = handlerCollection;
            Services = serviceProvider;

            _responseRouter         = responseRouter;
            ProgressManager         = progressManager;
            WorkDoneManager         = clientWorkDoneManager;
            RegistrationManager     = registrationManager;
            WorkspaceFoldersManager = languageClientWorkspaceFoldersManager;
            _initializeDelegates    = initializeDelegates;
            _initializeHandlers     = initializeHandlers;
            _initializedDelegates   = initializedDelegates;
            _initializedHandlers    = initializedHandlers;
            _concurrency            = options.Value.Concurrency;

            // We need to at least create Window here in case any handler does loggin in their constructor
            TextDocument = textDocumentLanguageClient;
            Client       = clientLanguageClient;
            General      = generalLanguageClient;
            Window       = windowLanguageClient;
            Workspace    = workspaceLanguageClient;
        }
 public static void SendWorkDoneProgressCancel(this IWindowLanguageClient mediator, ProgressToken token)
 {
     mediator.SendNotification(WindowNames.WorkDoneProgressCancel, new WorkDoneProgressCancelParams()
     {
         Token = token
     });
 }
Ejemplo n.º 4
0
 public static TResult ObserveWorkDone <T, TResult>(
     this IWindowLanguageClient proxy, T @params, Func <IWindowLanguageClient, T, TResult> func, IWorkDoneProgressObserver observer
     )
     where T : IWorkDoneProgressParams
 {
     DoObserveWorkDone(proxy, @params, observer);
     return(func(proxy, @params));
 }
Ejemplo n.º 5
0
 public static void SendWorkDoneProgressCancel(this IWindowLanguageClient mediator, IWorkDoneProgressParams @params) =>
 mediator.SendNotification(
     WindowNames.WorkDoneProgressCancel, new WorkDoneProgressCancelParams {
     Token = @params.WorkDoneToken
 }
     );