Просмотр исходного кода

Fixes openEditor with GitUris

main
Eric Amodio 7 лет назад
Родитель
Сommit
5cd30ab268
2 измененных файлов: 7 добавлений и 1 удалений
  1. +2
    -0
      CHANGELOG.md
  2. +5
    -1
      src/commands/common.ts

+ 2
- 0
CHANGELOG.md Просмотреть файл

@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
### Fixed
- Fixes issue where `Open File` command failed for in many instances (for GitUri resources)
## [5.6.1] - 2017-10-11
### Fixed

+ 5
- 1
src/commands/common.ts Просмотреть файл

@ -1,7 +1,7 @@
'use strict';
import { commands, Disposable, SourceControlResourceGroup, SourceControlResourceState, TextDocumentShowOptions, TextEditor, TextEditorEdit, Uri, window, workspace } from 'vscode';
import { ExplorerNode } from '../views/explorerNodes';
import { GitBranch, GitCommit, GitRemote } from '../gitService';
import { GitBranch, GitCommit, GitRemote, GitUri } from '../gitService';
import { Logger } from '../logger';
import { Telemetry } from '../telemetry';
@ -277,6 +277,10 @@ export async function openEditor(uri: Uri, options?: TextDocumentShowOptions): P
viewColumn: (window.activeTextEditor && window.activeTextEditor.viewColumn) || 1
};
if (uri instanceof GitUri) {
uri = Uri.file(uri.fsPath);
}
const document = await workspace.openTextDocument(uri);
return window.showTextDocument(document, { ...defaults, ...(options || {}) });
}

Загрузка…
Отмена
Сохранить