|
|
@ -1,6 +1,7 @@ |
|
|
|
'use strict'; |
|
|
|
import { TextEditor, TextEditorEdit, Uri, window } from 'vscode'; |
|
|
|
import { UriComparer } from '../comparers'; |
|
|
|
import { isTextEditor } from '../constants'; |
|
|
|
import { Container } from '../container'; |
|
|
|
import { Logger } from '../logger'; |
|
|
|
import { Messages } from '../messages'; |
|
|
@ -12,13 +13,13 @@ export class ClearFileAnnotationsCommand extends EditorCommand { |
|
|
|
} |
|
|
|
|
|
|
|
async execute(editor: TextEditor, edit: TextEditorEdit, uri?: Uri): Promise<any> { |
|
|
|
if (editor == null) return undefined; |
|
|
|
|
|
|
|
// Handle the case where we are focused on a non-editor editor (output, debug console)
|
|
|
|
if (uri != null && !UriComparer.equals(uri, editor.document.uri)) { |
|
|
|
const e = window.visibleTextEditors.find(e => UriComparer.equals(uri, e.document.uri)); |
|
|
|
if (e !== undefined) { |
|
|
|
editor = e; |
|
|
|
if (editor != null && !isTextEditor(editor)) { |
|
|
|
if (uri != null && !UriComparer.equals(uri, editor.document.uri)) { |
|
|
|
const e = window.visibleTextEditors.find(e => UriComparer.equals(uri, e.document.uri)); |
|
|
|
if (e !== undefined) { |
|
|
|
editor = e; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|