-
Notifications
You must be signed in to change notification settings - Fork 236
Delete projects we wont be keeping around and get pses.vscode working again #1046
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
Delete projects we wont be keeping around and get pses.vscode working again #1046
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome stuff man :) Here's my first pass
Also:
They cant add anything to the provider, but at least they can get all the goodness if they want to dive really deep.
How feasible is that to add? Not suggesting it be done in this PR or maybe even before release, just curious what kind of a lift it is.
src/PowerShellEditorServices.Engine/Services/PowerShellContext/Extensions/EditorObject.cs
Outdated
Show resolved
Hide resolved
src/PowerShellEditorServices.VSCode/Cmdlets/VSCodeHtmlContentViewCommands.cs
Show resolved
Hide resolved
src/PowerShellEditorServices.VSCode/Cmdlets/VSCodeHtmlContentViewCommands.cs
Outdated
Show resolved
Hide resolved
public ViewColumn? ShowInColumn { get; set; } | ||
|
||
/// | ||
protected override void BeginProcessing() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove empty override
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed all of these.
src/PowerShellEditorServices.VSCode/Cmdlets/VSCodeHtmlContentViewCommands.cs
Outdated
Show resolved
Hide resolved
...owerShellEditorServices.VSCode/en-US/Microsoft.PowerShell.EditorServices.VSCode.dll-Help.xml
Outdated
Show resolved
Hide resolved
{ | ||
public const string BuildVersion = "<development-build>"; | ||
public const string BuildOrigin = "<development>"; | ||
public static readonly System.DateTime? BuildTime = System.DateTime.Parse("2019-09-29T23:13:58"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why nullable? If Parse
fails it'll throw during type initialization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rjmholt do you wanna speak to this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually don't think I was suppose to checkin this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to go back and fix the way we handle that file in general, but I think it's nullable so it can be built with null.
I'm not very attached to this idea; it was supposed to be a way to stamp a build to be self-documenting, but I don't think it's ever quite worked, possibly because of git checkin issues.
We can ignore it for now and I'll try and look into it in the coming weeks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah looks like we should just delete this
src/PowerShellEditorServices.VSCode/Cmdlets/VSCodeHtmlContentViewCommands.cs
Outdated
Show resolved
Hide resolved
@SeeminglyScience this is the review that was needed long long ago lol |
Co-Authored-By: Patrick Meinecke <SeeminglyScience@users.noreply.github.com>
I mean, I guess it's feasible to bring back the ComponentRegistry and then selectively put services inside of it to expose to users... But I kinda like this model of "here's what PSES gives you, maintain your own state if you need to." |
Oh I took that to mean "you can't register any new things like code lens or symbol providers". All I'm worried about is if you can extend, and if other users can invoke your extensions. e.g. with symbol providers, you can register a symbol provider, and a consumer of the PSES API can get your symbols through without referencing your project. And just to clarify, it's not a show stopper if it's not currently possible (since practically no one has used the existing system). I'd just like it to be kept in mind so that it could be re-added in the future (assuming it isn't already possible to do what I'm describing). |
Yes I'm pretty sure that's still possible because those providers are within some service that can be accessed via the IServiceRegistry. I'll double check but I'm pretty sure what you're asking is still possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the point at which Engine
should drop out of the namespace?
{ | ||
public const string BuildVersion = "<development-build>"; | ||
public const string BuildOrigin = "<development>"; | ||
public static readonly System.DateTime? BuildTime = System.DateTime.Parse("2019-09-29T23:13:58"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah looks like we should just delete this
@@ -53,25 +54,27 @@ protected override void ProcessRecord() | |||
} | |||
else | |||
{ | |||
throw new Exception("unable to fetch psEditor value"); | |||
WriteError( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently this is a non-terminating error.
Would it be better as a terminating error, since not being able to find the PSEditor object we won't be able to proceed meaningfully?
Terminating here wouldn't kill a script, just a pipeline, so it would operate with the desired effect I think.
ThrowTerminatingError(
new ErrorRecord(
new ItemNotFoundException("Cannot find the '$psEditor' variable"),
"PSEditorNotFound",
ErrorCategory.ObjectNotFound,
targetObject: null));
return;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that makes sense. Updated!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't kill the script, but in general I prefer non-terminating because that lets the user easily handle errors with the -ErrorAction
common parameter. With a terminating error, you have to try
/catch
, so I try to leave that for rare catastrophic errors.
I don't feel particularly strongly about not using terminating in this particular case though, just adding some more information.
ErrorCategory.CloseError, | ||
targetObject: null)); | ||
|
||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return
here looks like it might be unneeded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep!
ErrorCategory.OpenError, | ||
targetObject: null)); | ||
|
||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unneeded return
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep!
ErrorCategory.WriteError, | ||
targetObject: null)); | ||
|
||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unneeded return
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep!
Next PR |
Ok I've addressed all of @SeeminglyScience and @rjmholt's feedback! |
@rjmholt RE: removing "Engine" everywhere... you're gonna want this in another PR lol |
I figured. Just wanted to make sure :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
… again (PowerShell#1046) * delete other folders and tweak build script for BuildInfo * working PowerShellEditorServices.VSCode now a binary module! * some typo * Apply suggestions from code review Co-Authored-By: Patrick Meinecke <SeeminglyScience@users.noreply.github.com> * address additional comments * don't checkin maml * add error handling * deleted buildinfo and address rob's comments
* Add starting point * x * More work * Make integration tests pass for omnisharp * Changes * add dummy workspace symbols handler * use LoggerFactory * A working WorkspaceSymbolsHandler * working text document syncer * needed document selector and getVersion handler to work with vscode * Added Diagnostics * didChangeConfiguration message and general settings support * Add diagnostics (#18) * initial folding support * added test for folding * Add setting support (#19) * Added Diagnostics * didChangeConfiguration message and general settings support * Apply suggestions from code review Co-Authored-By: Robert Holt <rjmholt@gmail.com> * Folding support (#20) * Added Diagnostics * didChangeConfiguration message and general settings support * initial folding support * log level trace * folding works with latest omnisharp version * comment typo * added test for folding * formatting support * remove merge conflict * add formatting tests * DocumentSymbols and References support (#997) * working formatting * add tests * delete commented out code * [Omnisharp-LSP] textDocument/documentHighlight support (#999) * Add handler scaffold * More stuff * Make handler work * Add copyright * Add tests, fix bugs * Fix small issues * codelens support (#1001) * codelens support * address rob's feedback * powerShell/getPSHostProcesses and powerShell/getRunspace (#1002) * Test only pester for now (#1003) * Implement textDocument/codeAction (#1004) * Add initial handler * Add working codeAction implementation * Crash * Make tests work * Fix issues * Make tests work in WinPS * Add powershellcontext (#1005) * Add powershellcontext * using file sink now instead * all the newlines * support $psEditor (#1006) * support $psEditor * deleted commented out code * fix initial build failures due to lack of certain assemblies * use different RootPath * wait an extra 5 seconds just in case * refactor initialize script * Re-add Stdio option and replace Pester tests with xunit tests. (#1008) * Completion Support (#1007) * completion support * misc codacy fixes * use BUILD_ARTIFACTSTAGINGDIRECTORY so logs can be uploaded * publish artifacts even if build fails * handle log messages * give PSES a chance to run what it needs to run * switch to using xUnit output helper * treat DynamicKeywords as Keyword * completionresolve support (#1009) * handle log messages * switch to using xUnit output helper * Add completionItem/resolve request * feedback * update build to run update-help for signature help test * removing scope hoping it works in CI * setting to EA silentlycontinue * change to language=powershell * hover support (#1010) * handle log messages * switch to using xUnit output helper * add hover handler * move to language=powershell * refactoring for feedback * codacy * Omni signaturehelp (#1011) * handle log messages * switch to using xUnit output helper * Support SignatureHelp * concurrentdict * Add definition handler (#1013) * add definition handler * codacy * sneak in powerShell/executionStatusChanged * codacy * Add Plaster messages (#1014) * Comment Help and Evaluate (#1015) * Support for Comment Help generator * add evaluate handler * Last LSP messages (#1016) * support CommandExporer commands and powerShell/runspaceChanged * expand alias * refactor server setup (#1018) * rename namespaces (#1019) * The entire Debug Adapter moved over... (#1043) * initial non-working dap * working launch but not attach * working attach handler * update namespaces * Disconnect support and handling of JsonRpcServer teardown * Add foundation for debug tests - stdio and fixures * all handlers * remote file manager working * rest of debug adapter * use actual release * Apply suggestions from code review Co-Authored-By: Robert Holt <rjmholt@gmail.com> * Delete projects we wont be keeping around and get pses.vscode working again (#1046) * delete other folders and tweak build script for BuildInfo * working PowerShellEditorServices.VSCode now a binary module! * some typo * Apply suggestions from code review Co-Authored-By: Patrick Meinecke <SeeminglyScience@users.noreply.github.com> * address additional comments * don't checkin maml * add error handling * deleted buildinfo and address rob's comments * Remove engine from files and namespaces (#1048) * apply apt state for PS7 (#1051) * delete buildinfo * implement powerShell/startDebugger (#1049) * implement powerShell/startDebugger * add line Co-Authored-By: Patrick Meinecke <SeeminglyScience@users.noreply.github.com> * Enable alias corrections (#1053) * Codacy comments
wowie
ok. so.
THE DELETIONS (aka commit 1)
This deletes:
PowerShellEditorServices
PowerShellEditorServices.Protocol
PowerShellEditorServices.Host
(deletion of test projects will happen after the tests are moved over)
PSES.VSCODE IS A BINARY MODULE (aka commit 2)
I had to refactor some stuff to get PSES.VSCode working. The biggest problem was that I deleted the concept of a "ComponentRegistry" which allowed modules to add "components" to
$psEditor.Components
. Instead of going that route, I now give modules direct access to theIServiceProvider
that contains all the services and even things like theLangageServer
type so they can send messages back to the client. They cant add anything to the provider, but at least they can get all the goodness if they want to dive really deep.In this refactor I also thought... hmmm... let's go binary module this time since it probably should have been all along. So the markdown docs and maml are included.
FEEDBACK (aka commit 3+)