Skip to content

Add more logging and internal documentation - #1474

Merged
Andy Jordan (andyleejordan) merged 5 commits into
masterfrom
andschwa/comments
May 19, 2021
Merged

Add more logging and internal documentation#1474
Andy Jordan (andyleejordan) merged 5 commits into
masterfrom
andschwa/comments

Conversation

@andyleejordan

@andyleejordanAndy Jordan (andyleejordan) commented May 11, 2021

Copy link
Copy Markdown
Member

Just writing up what I've learned and odd stuff I've spotted while reading through the code. Also added at least a bit more logging to help debug PowerShell/vscode-powershell#3306.

Comment threadsrc/PowerShellEditorServices.Hosting/EditorServicesLoader.cs
Comment threadsrc/PowerShellEditorServices.Hosting/Internal/EditorServicesRunner.cs Outdated
Comment threadsrc/PowerShellEditorServices/Server/PsesServiceCollectionExtensions.cs Outdated
/// cref="HostStartupInfo"/>.
/// </summary>
/// <remarks>
/// The logical stack of the program is:

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rob Holt (@rjmholt) Did I get this right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think that looks right

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This was super useful (to me) to work through and document.

/// cref="HostStartupInfo"/>.
/// </summary>
/// <remarks>
/// The logical stack of the program is:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think that looks right

Comment on lines +170 to +171
/// This is a strange class that is generally <c>null</c> or otherwise just has a single path
/// set. It is eventually parsed one-by-one when setting up the PowerShell runspace.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class is used for configuring profile path values, which are set by the client. Different clients conceptually implement different hosts (so VSCode implements a different host to vim or IntelliJ), so they need different profile paths. This is how they configure that.

Comment threadsrc/PowerShellEditorServices/Server/PsesLanguageServer.cs
provider.GetService<OmniSharp.Extensions.LanguageServer.Protocol.Server.ILanguageServerFacade>(),
hostStartupInfo))
.AddSingleton<TemplateService>()
.AddSingleton<TemplateService>() // TODO: What's the difference between this and the TemplateHandler?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handlers handle requests from the LSP client, like ASP.NET controllers.

Services internally manage some conceptual area, and generally implement the business logic behind handlers.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Helpful!

@andyleejordan
Andy Jordan (andyleejordan)force-pushed the andschwa/comments branch 2 times, most recently from eb3769c to dab4e3cCompareMay 13, 2021 19:34
Also change handled exceptions to warning instead of error.
@andyleejordanAndy Jordan (andyleejordan) added Ignore Exclude from the changelog. Area-Logging Issue-Enhancement A feature request (enhancement). and removed Ignore Exclude from the changelog. labels May 19, 2021
@andyleejordan
Andy Jordan (andyleejordan) deleted the andschwa/comments branch May 19, 2021 17:02
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-LoggingIssue-EnhancementA feature request (enhancement).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@andyleejordan@rjmholt