Skip to content

Commit b0f01df

Browse files
Merge branch 'topic/#1167' into 'master'
Provide a template in 'Help/Report Issue' See merge request eng/ide/ada_language_server!2043
2 parents c76a551 + d6a2e54 commit b0f01df

File tree

3 files changed

+51
-2
lines changed

3 files changed

+51
-2
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Bug Summary and Reproducer
2+
3+
Please describe the feature (for example, completion) that is not working as expected.
4+
Include information about the actual workspace project (for example, is the project an aggregate project, does it target native platforms or cross platforms etc.).
5+
6+
## Bug Summary
7+
8+
## Steps to reproduce
9+
10+
1.
11+
12+
## Expected Behavior
13+
14+
## Configuration and Logs
15+
16+
Please provide your VS Code workspace-specific configuration files and logs. Logs are in particular very useful to investigate bugs such as unexpected exceptions.
17+
18+
- `tasks.json` file (for VS Code task-related issues) or `launch.json` (for VS Code debug-related issues)
19+
- Logs from running `Ada: Show extension output` from the VS Code command palette
20+
- Logs from the Ada Language Server in the `$HOME/.als directory` (`%USERPROFILE%/.als` on Windows). More info about ALS logging can be found [here](https://github.com/AdaCore/ada_language_server/blob/master/doc/traces.md)
21+

integration/vscode/ada/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,6 +1140,10 @@
11401140
{
11411141
"command": "ada.loadGnatCovXMLReport",
11421142
"title": "ada: GNATcoverage - Load an existing XML coverage report"
1143+
},
1144+
{
1145+
"command": "ada.issueReporter",
1146+
"title": "Ada: Report Issue"
11431147
}
11441148
],
11451149
"keybindings": [
@@ -1185,6 +1189,11 @@
11851189
"when": "editorLangId == ada"
11861190
}
11871191
],
1192+
"issue/reporter": [
1193+
{
1194+
"command": "ada.issueReporter"
1195+
}
1196+
],
11881197
"editor/context": [
11891198
{
11901199
"command": "ada.otherFile",

integration/vscode/ada/src/commands.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import assert from 'assert';
2-
import { existsSync } from 'fs';
3-
import { basename } from 'path';
2+
import { existsSync, readFileSync } from 'fs';
3+
import path, { basename } from 'path';
44
import * as vscode from 'vscode';
55
import { SymbolKind, commands } from 'vscode';
66
import { Disposable } from 'vscode-jsonrpc';
@@ -228,6 +228,10 @@ export function registerCommands(context: vscode.ExtensionContext, clients: Exte
228228
commands.registerCommand('ada.loadGnatCovXMLReport', loadGnatCovXMLReport),
229229
);
230230

231+
context.subscriptions.push(
232+
vscode.commands.registerCommand('ada.issueReporter', openReportIssue),
233+
);
234+
231235
registerTaskWrappers(context);
232236
}
233237

@@ -361,6 +365,21 @@ interface TaskQuickPickItem extends vscode.QuickPickItem {
361365
task: vscode.Task;
362366
}
363367

368+
/**
369+
* Display the VS Code Issue Reporter, providing a default template
370+
* for reporing issues on the Ada & SPARK VS Code extension.
371+
*/
372+
async function openReportIssue() {
373+
const EXTENSION_ROOT_DIR = adaExtState.context.extensionPath;
374+
const templatePath = path.join(EXTENSION_ROOT_DIR, 'media', 'report_issue_template.md');
375+
const template = readFileSync(templatePath, 'utf8');
376+
377+
await vscode.commands.executeCommand('workbench.action.openIssueReporter', {
378+
extensionId: 'adacore.ada',
379+
issueBody: template,
380+
});
381+
}
382+
364383
/**
365384
* Propose to the User a list of build and run tasks, one for each main defined
366385
* in the project.

0 commit comments

Comments
 (0)