Skip to content

Commit 262aab7

Browse files
Add -LanguageServiceOnly switch to disable debug service (#1640)
This is used by third party consumers. Co-authored-by: Andy Schwartzmeyer <[email protected]>
1 parent 0717bd0 commit 262aab7

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

module/PowerShellEditorServices/Start-EditorServices.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ param(
6666
[switch]
6767
$DebugServiceOnly,
6868

69+
[switch]
70+
$LanguageServiceOnly,
71+
6972
[string[]]
7073
$AdditionalModules,
7174

src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,12 @@ public StartEditorServicesCommand()
182182
[Parameter]
183183
public SwitchParameter DebugServiceOnly { get; set; }
184184

185+
/// <summary>
186+
/// When set, do not enable debug adapter, only the language service.
187+
/// </summary>
188+
[Parameter]
189+
public SwitchParameter LanguageServiceOnly { get; set; }
190+
185191
/// <summary>
186192
/// When set with a debug build, startup will wait for a debugger to attach.
187193
/// </summary>
@@ -465,6 +471,12 @@ private ITransportConfig GetDebugServiceTransport()
465471
{
466472
_logger.Log(PsesLogLevel.Diagnostic, "Configuring debug transport");
467473

474+
if (LanguageServiceOnly)
475+
{
476+
_logger.Log(PsesLogLevel.Diagnostic, "No Debug transport: PSES is language service only");
477+
return null;
478+
}
479+
468480
if (Stdio)
469481
{
470482
if (DebugServiceOnly)

0 commit comments

Comments
 (0)