Skip to content

Add more logging and internal documentation #1474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 19, 2021
Merged

Conversation

andyleejordan
Copy link
Member

@andyleejordan andyleejordan commented May 11, 2021

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.

/// </summary>
/// <remarks>
/// The logical stack of the program is:
Copy link
Member Author

Choose a reason for hiding this comment

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

@rjmholt Did I get this right?

Copy link
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
Member Author

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.

/// </summary>
/// <remarks>
/// The logical stack of the program is:
Copy link
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
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.

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
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
Member Author

Choose a reason for hiding this comment

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

Helpful!

@andyleejordan andyleejordan force-pushed the andschwa/comments branch 2 times, most recently from eb3769c to dab4e3c Compare May 13, 2021 19:34
Also change handled exceptions to warning instead of error.
@andyleejordan andyleejordan enabled auto-merge May 19, 2021 01:31
@andyleejordan 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 andyleejordan merged commit 88e3d5d into master May 19, 2021
@andyleejordan andyleejordan deleted the andschwa/comments branch May 19, 2021 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Logging Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants