forked from PowerShell/PowerShellEditorServices
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStart-EditorServices.ps1
More file actions
111 lines (87 loc) · 2.85 KB
/
Start-EditorServices.ps1
File metadata and controls
111 lines (87 loc) · 2.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
.SYNOPSIS
Starts the language and debug services from the PowerShellEditorServices module.
.DESCRIPTION
PowerShell Editor Services Bootstrapper Script
----------------------------------------------
This script contains startup logic for the PowerShell Editor Services
module when launched by an editor. It handles the following tasks:
- Verifying the existence of dependencies like PowerShellGet
- Verifying that the expected version of the PowerShellEditorServices module is installed
- Installing the PowerShellEditorServices module if confirmed by the user
- Creating named pipes for the language and debug services to use (if using named pipes)
- Starting the language and debug services from the PowerShellEditorServices module
.INPUTS
None
.OUTPUTS
None
.NOTES
If editor integration authors make modifications to this script, please
consider contributing changes back to the canonical version of this script
at the PowerShell Editor Services GitHub repository:
https://github.com/PowerShell/PowerShellEditorServices/blob/main/module/PowerShellEditorServices/Start-EditorServices.ps1'
#>
[CmdletBinding(DefaultParameterSetName="NamedPipe")]
param(
[ValidateNotNullOrEmpty()]
[string]
$HostName,
[ValidateNotNullOrEmpty()]
[string]
$HostProfileId,
[ValidateNotNullOrEmpty()]
[string]
$HostVersion,
[ValidateNotNullOrEmpty()]
[string]
$BundledModulesPath,
[ValidateNotNullOrEmpty()]
$LogPath,
[ValidateSet(("Diagnostic", "Verbose", "Normal") + ("Trace", "Debug", "Information", "Warning", "Error", "Critical", "None"))]
$LogLevel,
[ValidateNotNullOrEmpty()]
[string]
$SessionDetailsPath,
[switch]
$EnableConsoleRepl,
[switch]
$UseLegacyReadLine,
[switch]
$DebugServiceOnly,
[switch]
$LanguageServiceOnly,
[string[]]
$AdditionalModules,
[string[]]
$FeatureFlags,
[switch]
$WaitForDebugger,
[Parameter(ParameterSetName="Stdio", Mandatory)]
[switch]
$Stdio,
[Parameter(ParameterSetName="NamedPipe")]
[string]
$LanguageServicePipeName,
[Parameter(ParameterSetName="NamedPipe")]
[string]
$DebugServicePipeName,
[Parameter(ParameterSetName="NamedPipeSimplex")]
[switch]
$SplitInOutPipes,
[Parameter(ParameterSetName="NamedPipeSimplex")]
[string]
$LanguageServiceInPipeName,
[Parameter(ParameterSetName="NamedPipeSimplex")]
[string]
$LanguageServiceOutPipeName,
[Parameter(ParameterSetName="NamedPipeSimplex")]
[string]
$DebugServiceInPipeName,
[Parameter(ParameterSetName="NamedPipeSimplex")]
[string]
$DebugServiceOutPipeName
)
Import-Module -Name "$PSScriptRoot/PowerShellEditorServices.psd1"
Start-EditorServices @PSBoundParameters