Start-EditorServices.cs:
HostName:
- Only significant use: hostInfo.name = HostName
hostInfo:
CreateConfigObject():
EditorServicesLoader psesLoader:
EditorServicesLoader.Create():
psesLoader.LoadAndRunEditorServicesAsync(): - NOTE: psesLoader should call on an EditorServicesRunner object
- declaration
- calls in order:
- LogHostInformation
- declaration
- just dumps host info to logger
- CheckNetFxVersion
- declaration
- Checks .NETFramework version against .NET 4.6.2. Doesn't throw error, but dumps a warning to console
- UpdatePSModulePath
- declaration
- adds BundledModulePath to $env:PSModulePath
- ValidateConfiguration
- declaration
- ensures that Debug and Language Service Transport are not both set to STDIO
- Ensures there is "PSHost" object (this is the MonadShell/PowerShell (MSH) Runspace)
- LoadEditorService
- declaration
- Wrapper for EditorServicesLoading.LoadEditorServicesForHost()
- Which is a "no-op" that just ensures that Microsoft.PowerShell.EditorServices.Hosting assembly is loaded
- This triggers an AssemblyResolve event
- Which is a "no-op" that just ensures that Microsoft.PowerShell.EditorServices.Hosting assembly is loaded
- _editorServicesRunner = new EditorServicesRunner(_logger, _hostConfig, _sessionFileWriter, _loggersToUnsubscribe);
- declaration
- EditorServicesRunner.RunUntilShutdown()
- Wraps CreateEditorServicesAndRunUntilShutdown()
- declaration
- Wraps a Try...Final() block
- calls CreateHostStartupInfo();
- if debug, sets debug server to RunTempDebugSessionAsync(hostStartupInfo).ConfigureAwait(false);
- unsubscribes from host logger (I assume from bloating it? I don't remember this bloating the host logger??)
- calls WriteStartupBanner();
- which is no-oped due to not having an entry in for the startup banner argument PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs
- sets languages server to PsesLanguageServer languageServer = await CreateLanguageServerAsync(hostStartupInfo).ConfigureAwait(false);
- declaration (PsesLanguageServer)
- hostdetails gets processed in StartAsync() as an argument to AddPsesLanguageServices()
- declaration for AddPsesLanguageServices()
- this is done in a callback passed to options.WithServices
- options is a parameter for a callback passed to LanguageServer.From()
- this call has the this signature
- the definition assoc'd with that sig is a wrapper for From(Action<LanguageServerOptions> optionsAction,outerServiceProvider,CancellationToken) where optionsAction is the callback
- the def
- this function is also a wrapper for From(LanguageServerOptions options, ...)
- The LanguageServerOptions type is an implementation of LanguageProtocolRpcOptionsBase<LanguageServerOptions>
- which is an implementation of JsonRpcServerOptionsBase<T>
- which has a method called WithServices(Action<IServiceCollection> servicesAction)
- declaration
- servicesAction is a callback with the signature: servicesAction(
- which has a method called WithServices(Action<IServiceCollection> servicesAction)
- which is an implementation of JsonRpcServerOptionsBase<T>
- The LanguageServerOptions type is an implementation of LanguageProtocolRpcOptionsBase<LanguageServerOptions>
- options is a parameter for a callback passed to LanguageServer.From()
- calls languageServer.StartAsync();
- starts debug server
- calls languageServer.WaitForShutdown()
- then final() resubs the host logger
- Writes Starting State to Session File
- Wraps CreateEditorServicesAndRunUntilShutdown()
- return Task.Run(_editorServicesRunner.RunUntilShutdown);
- and a whole bunch of calls to _logger
- LogHostInformation
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
psesinternalhost also gets wrapped by EditorOperationsService
Are you sure? yes | no
an alias for psesinternalhost is IInternalPowerShellExecutionService executionService
Are you sure? yes | no
RunspaceFactory is an SMA class! Which means we finally found what it hostname is used for lol
Are you sure? yes | no
gets passed:
Runspace runspace = RunspaceFactory.CreateRunspace(PublicHost, initialSessionState);
Are you sure? yes | no
EditorServicesConsolePSHost also uses hostname as EditorServicesConsolePSHost.name (which is grabbed from PsesInternalHost.name)
Are you sure? yes | no
gets passed to CreateInitialPowerShell, but it doesn't use hostinfo.name
Are you sure? yes | no
also gets refactored into PsesInternalHost
as PsesInternalHost.hostinfo and PsesInternalHost.name (hostinfo.name)
Are you sure? yes | no
HostStartupInfo:
Gets passed to omnisharp as part of PsesLanguageServer creation
AddPsesLanguageServices() can be used to do this
Are you sure? yes | no
EditorServicesConfig:
Passed to:
<EditorServicesLoader>psesLoader.<EditorServicesRunner>_editorServicesRunner.<EditorServicesConfig>config.<HostInfo>HostInfo.name
<EditorServicesLoader>psesLoader.<EditorServicesConfig>_hostConfig.<HostInfo>HostInfo.name
<EditorServicesRunner>
Dumped by:
EditorServicesLoader.LogHostInformation()
Injected by:
EditorServicesLoader.LoadAndRunEditorServicesAsync() to EditorServicesRunner
Are you sure? yes | no