internal VisualStudioInProcLanguageServer(
            AbstractRequestDispatcherFactory requestDispatcherFactory,
            JsonRpc jsonRpc,
            ICapabilitiesProvider capabilitiesProvider,
            LspWorkspaceRegistrationService workspaceRegistrationService,
            IGlobalOptionService globalOptions,
            IAsynchronousOperationListenerProvider listenerProvider,
            ILspLogger logger,
            IDiagnosticService?diagnosticService,
            ImmutableArray <string> supportedLanguages,
            string?clientName,
            string userVisibleServerName,
            string telemetryServerTypeName)
            : base(requestDispatcherFactory, jsonRpc, capabilitiesProvider, workspaceRegistrationService, lspMiscellaneousFilesWorkspace: null, globalOptions, listenerProvider, logger, supportedLanguages, clientName, userVisibleServerName, telemetryServerTypeName)
        {
            _supportedLanguages = supportedLanguages;
            _diagnosticService  = diagnosticService;

            // Dedupe on DocumentId.  If we hear about the same document multiple times, we only need to process that id once.
            _diagnosticsWorkQueue = new AsyncBatchingWorkQueue <DocumentId>(
                TimeSpan.FromMilliseconds(250),
                (ids, ct) => ProcessDiagnosticUpdatedBatchAsync(_diagnosticService, ids, ct),
                EqualityComparer <DocumentId> .Default,
                Listener,
                Queue.CancellationToken);

            if (_diagnosticService != null)
            {
                _diagnosticService.DiagnosticsUpdated += DiagnosticService_DiagnosticsUpdated;
            }
        }
Beispiel #2
0
 internal VisualStudioInProcLanguageServer(
     AbstractRequestDispatcherFactory requestDispatcherFactory,
     JsonRpc jsonRpc,
     ICapabilitiesProvider capabilitiesProvider,
     LspWorkspaceRegistrationService workspaceRegistrationService,
     IGlobalOptionService globalOptions,
     IAsynchronousOperationListenerProvider listenerProvider,
     ILspLogger logger,
     ImmutableArray <string> supportedLanguages,
     string?clientName,
     WellKnownLspServerKinds serverKind)
     : base(requestDispatcherFactory, jsonRpc, capabilitiesProvider, workspaceRegistrationService, lspMiscellaneousFilesWorkspace: null, globalOptions, listenerProvider, logger, supportedLanguages, clientName, serverKind)
 {
     _supportedLanguages = supportedLanguages;
 }
Beispiel #3
0
 public AbstractInProcLanguageClient(
     AbstractRequestDispatcherFactory requestDispatcherFactory,
     VisualStudioWorkspace workspace,
     IDiagnosticService?diagnosticService,
     IAsynchronousOperationListenerProvider listenerProvider,
     ILspWorkspaceRegistrationService lspWorkspaceRegistrationService,
     string?diagnosticsClientName)
 {
     _requestDispatcherFactory = requestDispatcherFactory;
     Workspace          = workspace;
     _diagnosticService = diagnosticService;
     _listenerProvider  = listenerProvider;
     _lspWorkspaceRegistrationService = lspWorkspaceRegistrationService;
     _diagnosticsClientName           = diagnosticsClientName;
 }
 public AbstractInProcLanguageClient(
     AbstractRequestDispatcherFactory requestDispatcherFactory,
     IGlobalOptionService globalOptions,
     IAsynchronousOperationListenerProvider listenerProvider,
     LspWorkspaceRegistrationService lspWorkspaceRegistrationService,
     ILspLoggerFactory lspLoggerFactory,
     IThreadingContext threadingContext)
 {
     _requestDispatcherFactory        = requestDispatcherFactory;
     GlobalOptions                    = globalOptions;
     _listenerProvider                = listenerProvider;
     _lspWorkspaceRegistrationService = lspWorkspaceRegistrationService;
     _lspLoggerFactory                = lspLoggerFactory;
     _threadingContext                = threadingContext;
 }