/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer.ProcessHost.UnitTests/Utilities/LspServerLaunchOptions.cs
54 строки
3 KB
David Barbet
Implement LSP daemon mode (#84199)
25 июл 2026, 00:26
Не верифицирован
25 июл 2026, 00:26
490f516
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. namespace Microsoft.CodeAnalysis.LanguageServer.ProcessHost.UnitTests; internal sealed record LspServerLaunchOptions { public static LspServerLaunchOptions Default { get; } = new(); public bool AutoLoadProjects { get; init; } public bool IncludeDevKitComponents { get; init; } public bool DebugLsp { get; init; } /// <summary> /// Whether the editor transport is a named pipe (the default) or stdio. In single-server mode the thin client /// forwards this choice to the dedicated server it launches. /// </summary> public bool UseNamedPipe { get; init; } = true; /// <summary> /// The process id forwarded as the editor (<c>--clientProcessId</c>) that the thin client and server monitor. /// Defaults to the current test process when not specified. /// </summary> public int? ClientProcessId { get; init; } /// <summary> /// Whether the thin client should run in daemon mode (<c>--daemon-mode</c>), connecting the editor transport to /// a shared daemon instead of launching a dedicated per-session server. /// </summary> public bool DaemonMode { get; init; } /// <summary> /// Overrides the daemon pipe name (and therefore which daemon a thin client discovers/launches). Clients that /// share a value share a daemon; distinct values use distinct daemons. Tests set this so each test scopes its /// own isolated daemon; it is ignored unless <see cref="DaemonMode"/> is set. /// </summary> public string? DaemonPipeName { get; init; } /// <summary> /// The keepalive value, in seconds, the launched daemon uses after its last client disconnects. This uses the /// same format as <c>--daemonKeepAlive</c>: zero exits immediately and -1 stays alive indefinitely. Forwarded /// through the keepalive environment variable and ignored unless <see cref="DaemonMode"/> is set. When unset, /// the daemon uses its default. /// </summary> public int? DaemonKeepAlive { get; init; } /// <summary> /// The process id sent in the LSP <c>initialize</c> request's <c>processId</c> field. In daemon mode the /// per-client server monitors this process and tears that client's server down (only) when it exits. Defaults /// to unset (no process monitored for that client). /// </summary> public int? InitializeProcessId { get; init; } }