Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0539406

Browse files
committedMay 31, 2017
Send document Uri instead of path for extension command execution
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 #810. Resolves PowerShell/PowerShellEditorServices #434.
1 parent b5c0abe commit 0539406

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/features/ExtensionCommands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ export class ExtensionCommandsFeature implements IFeature {
313313

314314
private getEditorContext(): EditorContext {
315315
return {
316-
currentFilePath: vscode.window.activeTextEditor.document.fileName,
316+
currentFilePath: vscode.window.activeTextEditor.document.uri.toString(),
317317
cursorPosition: asPosition(vscode.window.activeTextEditor.selection.active),
318318
selectionRange:
319319
asRange(

0 commit comments

Comments
 (0)
Please sign in to comment.