Skip to content

Commit 5a3142a

Browse files
committed
Open editor containing query location in non-preview mode
1 parent 2ac7881 commit 5a3142a

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

extensions/ql-vscode/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
- Add a `View DIL` command on query history items. This opens a text editor containing the Datalog Intermediary Language representation of the compiled query.
2222
- Remove feature flag for the AST Viewer. For more information on how to use the AST Viewer, [see the documentation](https://help.semmle.com/codeql/codeql-for-vscode/procedures/exploring-the-structure-of-your-source-code.html).
2323
- The `codeQL.runningTests.numberOfThreads` setting is now used correctly when running tests.
24+
- Add the `codeQL.ui.openInPreviewEditor` config option. This option allows users to open query results in non-preview editors (by un-checking this option). Doing so will make navigation between results files easier, but may also contribute to a proliferation of open editors.
2425

2526
## 1.3.3 - 16 September 2020
2627

extensions/ql-vscode/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@
110110
"type": "object",
111111
"title": "CodeQL",
112112
"properties": {
113+
"codeQL.ui.openInPreviewEditor": {
114+
"type": "boolean",
115+
"default": true,
116+
"markdownDescription": "When enabled (default), query results will in a _preview_ editor. Disabling will make navigation between results easier, but will also result in a proliferation of open editors."
117+
},
113118
"codeQL.cli.executablePath": {
114119
"scope": "machine",
115120
"type": "string",

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,12 @@ export async function showLocation(location?: Location) {
162162
const editor =
163163
editorsWithDoc.length > 0
164164
? editorsWithDoc[0]
165-
: await Window.showTextDocument(doc, ViewColumn.One);
165+
: await Window.showTextDocument(
166+
doc, {
167+
preview: true,
168+
viewColumn: ViewColumn.One,
169+
});
170+
166171
const range = location.range;
167172
// When highlighting the range, vscode's occurrence-match and bracket-match highlighting will
168173
// trigger based on where we place the cursor/selection, and will compete for the user's attention.

0 commit comments

Comments
 (0)