public static LanguageServerOptions WithConfigurationSection(this LanguageServerOptions options, string sectionName) { options.Services.AddSingleton(new ConfigurationItem { Section = sectionName }); return(options); }
/// <summary> /// Create the server without connecting to the client /// /// Mainly used for unit testing /// </summary> /// <param name="options"></param> /// <returns></returns> public static ILanguageServer PreInit(LanguageServerOptions options) { var server = new LanguageServer( options.Input, options.Output, options.Reciever, options.RequestProcessIdentifier, options.LoggerFactory, options.Serializer, options.Services, options.HandlerTypes.Select(x => x.Assembly) .Distinct().Concat(options.HandlerAssemblies), options.Handlers, options.HandlerTypes, options.NamedHandlers, options.NamedServiceHandlers, options.TextDocumentIdentifiers, options.TextDocumentIdentifierTypes, options.InitializeDelegates, options.InitializedDelegates ); if (options.AddDefaultLoggingProvider) { options.LoggerFactory.AddProvider(new LanguageServerLoggerProvider(server)); } return(server); }
public static async Task <ILanguageServer> From(LanguageServerOptions options) { var server = new LanguageServer( options.Input, options.Output, options.Reciever, options.RequestProcessIdentifier, options.LoggerFactory, options.Serializer, options.Services, options.HandlerTypes.Select(x => x.Assembly) .Distinct().Concat(options.HandlerAssemblies), options.InitializeDelegates, options.InitializedDelegates ); if (options.AddDefaultLoggingProvider) { options.LoggerFactory.AddProvider(new LanguageServerLoggerProvider(server)); } await server.Initialize(); return(server); }
public static Task <LanguageServer> From(Action <LanguageServerOptions> optionsAction, IServiceProvider outerServiceProvider, CancellationToken cancellationToken) { var options = new LanguageServerOptions(); optionsAction(options); return(From(options, outerServiceProvider, cancellationToken)); }
public static LanguageServer Create(Action <LanguageServerOptions> optionsAction, IServiceProvider outerServiceProvider) { var options = new LanguageServerOptions(); optionsAction(options); return(Create(options, outerServiceProvider)); }
public static Task <ILanguageServer> From(Action <LanguageServerOptions> optionsAction, CancellationToken token) { var options = new LanguageServerOptions(); optionsAction(options); return(From(options, token)); }
public static async Task <LanguageServer> From(LanguageServerOptions options, IServiceProvider outerServiceProvider, CancellationToken cancellationToken) { var server = Create(options, outerServiceProvider); await server.Initialize(cancellationToken); return(server); }
public static ILanguageServer PreInit(Action <LanguageServerOptions> optionsAction) { var options = new LanguageServerOptions(); optionsAction(options); return(PreInit(options)); }
public static async Task <ILanguageServer> From(LanguageServerOptions options, CancellationToken token) { var server = (LanguageServer)PreInit(options); await server.Initialize(token); return(server); }
public static Task <ILanguageServer> From(Action <LanguageServerOptions> optionsAction) { var options = new LanguageServerOptions(); optionsAction(options); return(From(options)); }
/// <summary> /// Create the server without connecting to the client /// /// Mainly used for unit testing /// </summary> /// <param name="options"></param> /// <returns></returns> public static ILanguageServer PreInit(LanguageServerOptions options) { return(new LanguageServer( options.Input, options.Output, options.Receiver, options.RequestProcessIdentifier, options.Serializer, options.Services, options.HandlerTypes.Select(x => x.Assembly) .Distinct().Concat(options.HandlerAssemblies), options.Handlers, options.HandlerTypes, options.NamedHandlers, options.NamedServiceHandlers, options.TextDocumentIdentifiers, options.TextDocumentIdentifierTypes, options.InitializeDelegates, options.InitializedDelegates, options.StartedDelegates, options.LoggingBuilderAction, options.AddDefaultLoggingProvider, options.ProgressManager, options.ServerInfo, options.ConfigurationBuilderAction, options.Concurrency )); }
public static LanguageServerOptions WithReceiver( this LanguageServerOptions options, ILspServerReceiver serverReceiver ) { options.Services.AddSingleton(serverReceiver); return(options); }
/// <summary> /// Create the server without connecting to the client /// /// Mainly used for unit testing /// </summary> /// <param name="options"></param> /// <returns></returns> public static ILanguageServer PreInit(LanguageServerOptions options) { return(new LanguageServer( options.Input, options.Output, options.Reciever, options.RequestProcessIdentifier, options.Serializer, options.Services, options.HandlerTypes.Select(x => x.Assembly) .Distinct().Concat(options.HandlerAssemblies), options.Handlers, options.HandlerTypes, options.NamedHandlers, options.NamedServiceHandlers, options.TextDocumentIdentifiers, options.TextDocumentIdentifierTypes, options.InitializeDelegates, options.InitializedDelegates, options.LoggingBuilderAction )); }
public static LanguageServerOptions WithServerInfo(this LanguageServerOptions options, ServerInfo serverInfo) { options.ServerInfo = serverInfo; return(options); }
public static LanguageServerOptions WithSerializer(this LanguageServerOptions options, LspSerializer serializer) { options.Serializer = serializer; return(options); }
public static LanguageServerOptions OnInitialize(this LanguageServerOptions options, OnLanguageServerInitializeDelegate @delegate) { options.Services.AddSingleton(@delegate); return(options); }
public static Task <ILanguageServer> From(LanguageServerOptions options) { return(From(options, CancellationToken.None)); }
public static Task <LanguageServer> From(LanguageServerOptions options, IServiceProvider outerServiceProvider) => From(options, outerServiceProvider, CancellationToken.None);
public static LanguageServerOptions OnStarted(this LanguageServerOptions options, OnLanguageServerStartedDelegate @delegate) { options.Services.AddSingleton(@delegate); return(options); }
public static Task <LanguageServer> From(LanguageServerOptions options) => From(options, null, CancellationToken.None);
public static LanguageServerOptions ConfigureConfiguration(this LanguageServerOptions options, Action <IConfigurationBuilder> builderAction) { options.ConfigurationBuilderAction = builderAction; return(options); }
public static LanguageServerOptions ConfigureLogging(this LanguageServerOptions options, Action <ILoggingBuilder> builderAction) { options.LoggingBuilderAction = builderAction; return(options); }
public static LanguageServer Create(LanguageServerOptions options, IServiceProvider outerServiceProvider) => CreateContainer(options, outerServiceProvider).Resolve <LanguageServer>();
public static LanguageServer Create(LanguageServerOptions options) => Create(options, null);
internal static IContainer CreateContainer(LanguageServerOptions options, IServiceProvider outerServiceProvider) => JsonRpcServerContainer.Create(outerServiceProvider) .AddLanguageServerInternals(options, outerServiceProvider);
public static LanguageServerOptions AddDefaultLoggingProvider(this LanguageServerOptions options) { options.AddDefaultLoggingProvider = true; return(options); }
public static LanguageServerOptions WithRequestProcessIdentifier(this LanguageServerOptions options, IRequestProcessIdentifier requestProcessIdentifier) { options.RequestProcessIdentifier = requestProcessIdentifier; return(options); }
public static Task <LanguageServer> From(LanguageServerOptions options, CancellationToken cancellationToken) => From(options, null, cancellationToken);
/// <summary> /// Create the server without connecting to the client /// /// Mainly used for unit testing /// </summary> /// <param name="options"></param> /// <returns></returns> public static LanguageServer PreInit(LanguageServerOptions options) => Create(options);
public static LanguageServerOptions WithConfigurationItem(this LanguageServerOptions options, ConfigurationItem configurationItem) { options.Services.AddSingleton(configurationItem); return(options); }