Skip to content

Commit f82a2ce

Browse files
committed
Open editor containing query location in non-preview mode
1 parent ad3cd7e commit f82a2ce

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

extensions/ql-vscode/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## [UNRELEASED]
44

5+
- Editors opened by navigating from the results view are no longer opened in _preview mode_. Now they are opened as a persistent editor. [#630](https://github.com/github/vscode-codeql/pull/630)
6+
57
## 1.3.6 - 4 November 2020
68

79
- Fix URI encoding for databases that were created with special characters in their paths. [#648](https://github.com/github/vscode-codeql/pull/648)

extensions/ql-vscode/src/interface-utils.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,13 @@ export async function showLocation(location?: Location) {
167167
const editor =
168168
editorsWithDoc.length > 0
169169
? editorsWithDoc[0]
170-
: await Window.showTextDocument(doc, ViewColumn.One);
170+
: await Window.showTextDocument(
171+
doc, {
172+
// avoid preview mode so editor is sticky and will be added to navigation and search histories.
173+
preview: false,
174+
viewColumn: ViewColumn.One,
175+
});
176+
171177
const range = location.range;
172178
// When highlighting the range, vscode's occurrence-match and bracket-match highlighting will
173179
// trigger based on where we place the cursor/selection, and will compete for the user's attention.

0 commit comments

Comments
 (0)