Skip to content

Commit 5cd30ab

Browse files
committed
Fixes openEditor with GitUris
1 parent 0e8720a commit 5cd30ab

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
66

77
## [Unreleased]
8+
### Fixed
9+
- Fixes issue where `Open File` command failed for in many instances (for GitUri resources)
810

911
## [5.6.1] - 2017-10-11
1012
### Fixed

src/commands/common.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
import { commands, Disposable, SourceControlResourceGroup, SourceControlResourceState, TextDocumentShowOptions, TextEditor, TextEditorEdit, Uri, window, workspace } from 'vscode';
33
import { ExplorerNode } from '../views/explorerNodes';
4-
import { GitBranch, GitCommit, GitRemote } from '../gitService';
4+
import { GitBranch, GitCommit, GitRemote, GitUri } from '../gitService';
55
import { Logger } from '../logger';
66
import { Telemetry } from '../telemetry';
77

@@ -277,6 +277,10 @@ export async function openEditor(uri: Uri, options?: TextDocumentShowOptions): P
277277
viewColumn: (window.activeTextEditor && window.activeTextEditor.viewColumn) || 1
278278
};
279279

280+
if (uri instanceof GitUri) {
281+
uri = Uri.file(uri.fsPath);
282+
}
283+
280284
const document = await workspace.openTextDocument(uri);
281285
return window.showTextDocument(document, { ...defaults, ...(options || {}) });
282286
}

0 commit comments

Comments
 (0)