Пример #1
0
        internal static async Task <IWorkspaceService> CreateWorkspaceServiceAsync(
            LanguageDescription languageDescription,
            WorkspaceConfiguration configuration,
            CancellationToken cancellationToken)
        {
            if (!activators.TryGetValue(languageDescription.Name, out var activator))
            {
                throw new Exception(
                          $"Unable to resolve a workspace service activator " +
                          $"for language '{languageDescription.Name}'");
            }

            return(await activator.CreateNew(
                       languageDescription,
                       configuration,
                       cancellationToken).ConfigureAwait(false));
        }
Пример #2
0
 public TestWorkspaceService(WorkspaceConfiguration configuration)
 => Configuration = configuration;
Пример #3
0
 public Task <IWorkspaceService> CreateNew(
     LanguageDescription languageDescription,
     WorkspaceConfiguration configuration,
     CancellationToken cancellationToken)
 => Task.FromResult <IWorkspaceService> (new TestWorkspaceService(configuration));