Skip to content

Commit 54a802a

Browse files
author
automatic-merge
committed
Merge remote branch 'origin/master' into edge
2 parents 8b76988 + 5fa261b commit 54a802a

36 files changed

+1712
-119
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ section below it for the last release. -->
77

88
* Fix a bug that caused the ALS to hang when trying to complete partially qualified invisible symbols
99
* Support loading a fresh checkout of an Alire crate by automatically performing the necessary Alire workspace initializations
10+
* VS Code status bar now displays an item showing the project-loading status and useful commands provided by the extension when hovering on it
1011

1112
## 26.0.202502240
1213

doc/settings.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ Settings understood by the Ada Language Server itself, independently from the LS
108108
* [rootDir](#rootdir)
109109
* [enableDiagnostics](#enableddiagnostics)
110110
* [adaFileDiagnostics](#adafilediagnostics)
111+
* [gprFileDiagnostics](#gprfilediagnostics)
111112
* [projectDiagnostics](#projectdiagnostics)
112113
* [alireDiagnostics](#alirediagnostics)
113114
* [enableIndexing](#enableindexing)
@@ -236,6 +237,17 @@ The value is a boolean.
236237
'adaFileDiagnostics': false
237238
```
238239

240+
### gprFileDiagnostics
241+
242+
You can explicitly deactivate the emission of diagnostics related to the
243+
edition of gpr Files via the `gprFileDiagnostics` key. By default,
244+
diagnostics are enabled.
245+
The value is a boolean.
246+
247+
```javascript
248+
'gprFileDiagnostics': false
249+
```
250+
239251
### projectDiagnostics
240252

241253
You can explicitly deactivate the emission of diagnostics when loading a

integration/vscode/ada/.vscode-test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ if (process.env['MOCHA_GREP']) {
3939
baseMochaOptions.grep = process.env['MOCHA_GREP'];
4040
}
4141

42-
const testsuites = ['general', 'workspace_missing_dirs', 'dot-als-json'];
42+
const testsuites = ['general', 'workspace_missing_dirs', 'dot-als-json', 'status_bar'];
4343

4444
export default defineConfig(
4545
testsuites.map((suiteName) => {

integration/vscode/ada/package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@
426426
"scope": "window",
427427
"type": "boolean",
428428
"default": null,
429-
"description": "Controls whether or not the Ada Language Server should emit project diagnostics into the VS Code Problems view."
429+
"description": "Controls whether or not the Ada Language Server should emit diagnostics related to project loading into the VS Code Problems view."
430430
},
431431
"ada.alireDiagnostics": {
432432
"scope": "window",
@@ -438,7 +438,13 @@
438438
"scope": "window",
439439
"type": "boolean",
440440
"default": null,
441-
"description": "Controls whether or not the Ada Language Server should emit diagnostics related to Ada files into the VS Code Problems view."
441+
"description": "Controls whether or not the Ada Language Server should emit diagnostics related to the edition of Ada files into the VS Code Problems view."
442+
},
443+
"ada.gprFileDiagnostics": {
444+
"scope": "window",
445+
"type": "boolean",
446+
"default": null,
447+
"description": "Controls whether or not the Ada Language Server should emit diagnostics related to the edition of GPR files into the VS Code Problems view."
442448
}
443449
}
444450
},

integration/vscode/ada/schemas/als-settings-schema.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,12 @@
8888
"adaFileDiagnostics": {
8989
"type": "boolean",
9090
"default": true,
91-
"description": "Controls whether or not the Ada Language Server should emit diagnostics related to Ada Files into the VS Code Problems view."
91+
"description": "Controls whether or not the Ada Language Server should emit diagnostics related to the edition of Ada Files into the VS Code Problems view."
92+
},
93+
"gprFileDiagnostics": {
94+
"type": "boolean",
95+
"default": true,
96+
"description": "Controls whether or not the Ada Language Server should emit diagnostics related to the edition of GPR Files into the VS Code Problems view."
9297
},
9398
"foldComments": {
9499
"type": "boolean",

integration/vscode/ada/src/ExtensionState.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ import {
2323
createSparkTaskProvider,
2424
} from './taskProviders';
2525
import { isAbsolute } from 'path';
26+
import {
27+
CMD_SHOW_EXTENSION_LOGS,
28+
CMD_SHOW_ADA_LS_OUTPUT,
29+
CMD_SHOW_GPR_LS_OUTPUT,
30+
CMD_RELOAD_PROJECT,
31+
CMD_RESTART_LANG_SERVERS,
32+
} from './commands';
2633

2734
/**
2835
* Return type of the 'als-source-dirs' LSP request.
@@ -268,18 +275,18 @@ export class ExtensionState {
268275
this.statusBar.tooltip.appendMarkdown('\n\n---\n\n');
269276
}
270277
this.statusBar.tooltip.appendMarkdown(
271-
`[$(terminal) Open Extension Logs](command:ada.showExtensionOutput
278+
`[$(terminal) Open Extension Logs](command:${CMD_SHOW_EXTENSION_LOGS}
272279
"Show Ada Extension Output")
273280
274-
[$(terminal) Open Logs for Ada & SPARK](command:ada.showAdaLSOutput
281+
[$(terminal) Open Logs for Ada & SPARK](command:${CMD_SHOW_ADA_LS_OUTPUT}
275282
"Show Ada Language Server for Ada & SPARK Output")
276283
277-
[$(terminal) Open Logs for GPR](command:ada.showGprLSOutput
284+
[$(terminal) Open Logs for GPR](command:${CMD_SHOW_GPR_LS_OUTPUT}
278285
"Show Ada Language Server for GPR Output")
279286
280-
[$(refresh) Reload Project](command:als-reload-project "Reload Project")
287+
[$(refresh) Reload Project](command:${CMD_RELOAD_PROJECT} "Reload Project")
281288
282-
[$(debug-restart) Restart Language Servers](command:ada.restartLanguageServers
289+
[$(debug-restart) Restart Language Servers](command:${CMD_RESTART_LANG_SERVERS}
283290
"Restart Ada Language Servers")`,
284291
);
285292
};

integration/vscode/ada/src/alsExecuteCommand.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import {
4040
ReplaceTypeCommandArgs,
4141
} from './refactoring/alsReplaceTypeCommand';
4242
import { adaExtState } from './extension';
43+
import { CMD_RELOAD_PROJECT } from './commands';
4344

4445
/**
4546
* Type alias for a function that intercepts a command and executes it by return a promise that
@@ -90,7 +91,7 @@ export const alsCommandExecutor = (client: LanguageClient): CommandExecutor => {
9091
args[0] as ReplaceTypeCommandArgs,
9192
);
9293
if (!proceedWithExecution) return Promise.resolve(undefined);
93-
} else if (command === 'als-reload-project') {
94+
} else if (command === CMD_RELOAD_PROJECT) {
9495
// Clear the cache and the predefined tasks when the project
9596
// has been reloaded.
9697
adaExtState.clearCacheAndTasks('project is being reloaded: clearing caches and tasks');

integration/vscode/ada/src/commands.ts

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,35 @@ export const CMD_SPARK_LIMIT_SUBP_ARG = 'ada.spark.limitSubpArg';
8686
export const CMD_SPARK_LIMIT_REGION_ARG = 'ada.spark.limitRegionArg';
8787
export const CMD_SPARK_PROVE_SUBP = 'ada.spark.proveSubprogram';
8888

89+
/**
90+
* Identifier for the command that shows the extension's output in the Output panel.
91+
*/
92+
export const CMD_SHOW_EXTENSION_LOGS = 'ada.showExtensionOutput';
93+
94+
/**
95+
* Identifier for the command that shows the output of the ALS for Ada in the Output panel.
96+
*/
97+
export const CMD_SHOW_ADA_LS_OUTPUT = 'ada.showAdaLSOutput';
98+
99+
/**
100+
* Identifier for the command that shows the output of the ALS for GPR in the Output panel.
101+
*/
102+
export const CMD_SHOW_GPR_LS_OUTPUT = 'ada.showGprLSOutput';
103+
104+
/**
105+
* Identifier for the command that reloads the currently loaded project on server-side.
106+
*/
107+
export const CMD_RELOAD_PROJECT = 'als-reload-project';
108+
109+
/**
110+
* Identifier for the command that restarts all the language servers spawned by the extension
111+
* (Ada and GPR).
112+
*/
113+
export const CMD_RESTART_LANG_SERVERS = 'ada.restartLanguageServers';
114+
89115
export function registerCommands(context: vscode.ExtensionContext, clients: ExtensionState) {
90116
context.subscriptions.push(
91-
vscode.commands.registerCommand('ada.restartLanguageServers', restartLanguageServers),
117+
vscode.commands.registerCommand(CMD_RESTART_LANG_SERVERS, restartLanguageServers),
92118
);
93119
context.subscriptions.push(
94120
vscode.commands.registerCommand('ada.createHelloWorldProject', createHelloWorldProject),
@@ -116,15 +142,15 @@ export function registerCommands(context: vscode.ExtensionContext, clients: Exte
116142
vscode.commands.registerCommand('ada.subprogramBox', addSubprogramBoxCommand),
117143
);
118144
context.subscriptions.push(
119-
vscode.commands.registerCommand('ada.showExtensionOutput', () => mainOutputChannel.show()),
145+
vscode.commands.registerCommand(CMD_SHOW_EXTENSION_LOGS, () => mainOutputChannel.show()),
120146
);
121147
context.subscriptions.push(
122-
vscode.commands.registerCommand('ada.showAdaLSOutput', () =>
148+
vscode.commands.registerCommand(CMD_SHOW_ADA_LS_OUTPUT, () =>
123149
clients.adaClient.outputChannel.show(),
124150
),
125151
);
126152
context.subscriptions.push(
127-
vscode.commands.registerCommand('ada.showGprLSOutput', () =>
153+
vscode.commands.registerCommand(CMD_SHOW_GPR_LS_OUTPUT, () =>
128154
clients.gprClient.outputChannel.show(),
129155
),
130156
);

integration/vscode/ada/test/general/extension.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { activate, assertEqualToFileContent } from '../utils';
55

66
import { readFileSync, writeFileSync } from 'fs';
77
import * as vscode from 'vscode';
8+
import { CMD_RESTART_LANG_SERVERS } from '../../src/commands';
89

910
suite('Extensions Test Suite', function () {
1011
// Make sure the extension is activated
@@ -139,7 +140,7 @@ suite('Extensions Test Suite', function () {
139140
// Restart the server and check that we still have the same project
140141
// loaded on ALS side
141142
const oldAlsUri = await adaExtState.getProjectUri();
142-
await vscode.commands.executeCommand('ada.restartLanguageServers');
143+
await vscode.commands.executeCommand(CMD_RESTART_LANG_SERVERS);
143144
const newAlsUri = await adaExtState.getProjectUri();
144145
assert.deepStrictEqual(
145146
oldAlsUri?.fsPath,

integration/vscode/ada/test/runTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ async function main() {
1010
// Passed to `--extensionDevelopmentPath`
1111
const extensionDevelopmentPath = path.resolve(__dirname, '../../');
1212

13-
const testsuites = ['general', 'gnattest', 'workspace_missing_dirs'];
13+
const testsuites = ['general', 'gnattest', 'workspace_missing_dirs', 'status_bar'];
1414

1515
let someTestsuiteFailed = false;
1616

0 commit comments

Comments
 (0)