Exemplo n.º 1
0
        public async Task InitializedAsync()
        {
            // Initialized request, this occurs once the server and client have agreed on what sort of features they both support. It only happens once.

            var workspaceDirectoryPath = _workspaceDirectoryPathResolver.Resolve();

            foreach (var fileChangeDetector in _fileChangeDetectors)
            {
                // We create a dummy cancellation token for now. Have an issue to pass through the cancellation token in the O# lib: https://github.com/OmniSharp/csharp-language-server-protocol/issues/200
                var cancellationToken = CancellationToken.None;
                await fileChangeDetector.StartAsync(workspaceDirectoryPath, cancellationToken);
            }

            lock (_disposeLock)
            {
                if (_disposed)
                {
                    // Got disposed while starting our file change detectors. We need to re-stop our change detectors.
                    Stop();
                }
            }
        }