Skip to content

$psEditor.GetEditorContext() doesn't work with untitled-1 unsaved file #434

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

Closed
dfinke opened this issue Apr 8, 2017 · 2 comments · Fixed by #774
Closed

$psEditor.GetEditorContext() doesn't work with untitled-1 unsaved file #434

dfinke opened this issue Apr 8, 2017 · 2 comments · Fixed by #774
Labels
Issue-Bug A bug to squash.

Comments

@dfinke
Copy link
Contributor

dfinke commented Apr 8, 2017

Exception calling "GetEditorContext" with "0" argument(s): "One or more errors occurred."
At line:1 char:1

@daviwil
Copy link
Contributor

daviwil commented Apr 8, 2017

Thanks for catching that one!

@daviwil daviwil added the Issue-Bug A bug to squash. label Apr 8, 2017
@daviwil daviwil added this to the April 2017 milestone Apr 8, 2017
@daviwil daviwil removed this from the June 2017 milestone May 31, 2017
@daviwil
Copy link
Contributor

daviwil commented May 31, 2017

I screwed up the issue tag for this, but this has been fixed now as of PowerShell/vscode-powershell#811, will be in 1.2.1.

@daviwil daviwil closed this as completed May 31, 2017
@rjmholt rjmholt reopened this Oct 24, 2018
TylerLeonhardt pushed a commit to TylerLeonhardt/PowerShellEditorServices that referenced this issue Feb 26, 2019
Three of them started to fail when I added another psd1 file to the folder (for the PSSA settings).
TylerLeonhardt pushed a commit to TylerLeonhardt/PowerShellEditorServices that referenced this issue Feb 26, 2019
This change fixes an issue which causes the language server to crash
when running a registered $psEditor command from within an untitled
file.  This happens because the workspace code in the language server
expects to receive Uri paths instead of local file paths when referring
to an editor buffer.  The fix is to send the untitled file's Uri instead
of its non-existent file path.

Resolves PowerShell#810.
Resolves PowerShell/PowerShellEditorServices PowerShell#434.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants