Skip to content

Commit af8b78e

Browse files
author
automatic-merge
committed
Merge remote branch 'origin/master' into edge
2 parents f2781a5 + 2eb761e commit af8b78e

File tree

17 files changed

+1758
-452
lines changed

17 files changed

+1758
-452
lines changed

.vscode/tasks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"script": "compile",
2525
"path": "integration/vscode/ada",
2626
"group": "build",
27-
"problemMatcher": [],
27+
"problemMatcher": ["$tsc"],
2828
"label": "npm: compile",
2929
"detail": "node ./node_modules/typescript/bin/tsc",
3030
"presentation": {

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ TESTER=$(ROOTDIR)/.obj/tester/tester-run$(EXE)
3535
MOCHA_ALS_UPDATE=
3636

3737
GPRBUILD_EXTRA=
38-
GPRBUILD_FLAGS=-j0 $(GPRBUILD_EXTRA)
38+
GPRBUILD_FLAGS=-m -j0 $(GPRBUILD_EXTRA)
3939
GPRBUILD=gprbuild $(GPRBUILD_FLAGS) -XSUPERPROJECT=
4040
GPRCLEAN_EXTRA=
4141
GPRCLEAN=gprclean -XSUPERPROJECT= $(GPRCLEAN_EXTRA)

integration/vscode/ada/package-lock.json

Lines changed: 431 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integration/vscode/ada/package.json

Lines changed: 149 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,142 @@
445445
}
446446
],
447447
"taskDefinitions": [
448+
{
449+
"type": "ada",
450+
"required": [
451+
"configuration"
452+
],
453+
"properties": {
454+
"configuration": {
455+
"type": "object",
456+
"required": [
457+
"kind",
458+
"projectFile"
459+
],
460+
"properties": {
461+
"kind": {
462+
"type": "string",
463+
"description": "Kind of Ada task",
464+
"enum": [
465+
"buildProject",
466+
"checkFile",
467+
"cleanProject",
468+
"buildMain",
469+
"buildAndRunMain"
470+
]
471+
},
472+
"projectFile": {
473+
"type": "string",
474+
"description": "Path to GPR project file",
475+
"default": "${config:ada.projectFile}"
476+
},
477+
"args": {
478+
"type": "array",
479+
"description": "Extra command line arguments"
480+
}
481+
},
482+
"oneOf": [
483+
{
484+
"$comment": "Each oneOf is evaluated regardless of the parent schema. That's why valid properties of the parent must be repeated here in order to be allowed.",
485+
"properties": {
486+
"kind": {
487+
"enum": [
488+
"buildProject",
489+
"checkFile",
490+
"cleanProject"
491+
]
492+
},
493+
"projectFile": true,
494+
"args": true
495+
},
496+
"additionalProperties": false
497+
},
498+
{
499+
"required": [
500+
"main"
501+
],
502+
"$comment": "Each oneOf is evaluated regardless of the parent schema. That's why valid properties of the parent must be repeated here in order to be allowed.",
503+
"properties": {
504+
"kind": {
505+
"enum": [
506+
"buildMain"
507+
]
508+
},
509+
"projectFile": true,
510+
"args": true,
511+
"main": {
512+
"type": "string",
513+
"description": "Path to main source file"
514+
}
515+
},
516+
"additionalProperties": false
517+
},
518+
{
519+
"required": [
520+
"main"
521+
],
522+
"$comment": "Each oneOf is evaluated regardless of the parent schema. That's why valid properties of the parent must be repeated here in order to be allowed.",
523+
"properties": {
524+
"kind": {
525+
"enum": [
526+
"buildAndRunMain"
527+
]
528+
},
529+
"projectFile": true,
530+
"args": true,
531+
"main": {
532+
"type": "string",
533+
"description": "Path to main source file"
534+
},
535+
"executable": {
536+
"type": "string",
537+
"description": "Path to main executable file (if it cannot be computed automatically)"
538+
}
539+
},
540+
"additionalProperties": false
541+
}
542+
]
543+
}
544+
}
545+
},
546+
{
547+
"type": "spark",
548+
"properties": {
549+
"configuration": {
550+
"type": "object",
551+
"required": [
552+
"kind",
553+
"projectFile"
554+
],
555+
"properties": {
556+
"kind": {
557+
"description": "Kind of SPARK task",
558+
"enum": [
559+
"cleanProjectForProof",
560+
"examineProject",
561+
"examineFile",
562+
"examineSubprogram",
563+
"proveProject",
564+
"proveFile",
565+
"proveSubprogram",
566+
"proveRegion",
567+
"proveLine"
568+
]
569+
},
570+
"projectFile": {
571+
"type": "string",
572+
"description": "Path to GPR project file",
573+
"default": "${config:ada.projectFile}"
574+
},
575+
"args": {
576+
"type": "array",
577+
"description": "Extra command line arguments"
578+
}
579+
},
580+
"additionalProperties": false
581+
}
582+
}
583+
},
448584
{
449585
"type": "gnat",
450586
"required": [
@@ -453,11 +589,13 @@
453589
"properties": {
454590
"taskKind": {
455591
"type": "string",
456-
"description": "Tool and action kind"
592+
"description": "Tool and action kind",
593+
"deprecationMessage": "The task type \"gnat\" is deprecated. Use task type \"ada\" or \"spark\" instead."
457594
},
458595
"args": {
459596
"type": "array",
460-
"description": "Extra command arguments"
597+
"description": "Extra command line arguments",
598+
"deprecationMessage": "The task type \"gnat\" is deprecated. Use task type \"ada\" or \"spark\" instead."
461599
}
462600
}
463601
},
@@ -469,15 +607,18 @@
469607
"properties": {
470608
"projectFile": {
471609
"type": "string",
472-
"description": "The project file"
610+
"description": "The project file",
611+
"deprecationMessage": "The task type \"gpr\" is deprecated. Use task type \"ada\" instead."
473612
},
474613
"main": {
475614
"type": "string",
476-
"description": "The main file targeted"
615+
"description": "The main file targeted",
616+
"deprecationMessage": "The task type \"gpr\" is deprecated. Use task type \"ada\" instead."
477617
},
478618
"executable": {
479619
"type": "string",
480-
"description": "The related executable"
620+
"description": "The related executable",
621+
"deprecationMessage": "The task type \"gpr\" is deprecated. Use task type \"ada\" instead."
481622
}
482623
}
483624
}
@@ -649,10 +790,11 @@
649790
"dependencies": {
650791
"@types/command-exists": "1.2.0",
651792
"command-exists": "1.2.9",
793+
"fast-xml-parser": "4.2.5",
652794
"fp-ts": "2.12.0",
653795
"process": "0.11.10",
654796
"vscode-languageclient": "7.0.0",
655-
"ws": "8.13.0",
656-
"fast-xml-parser": "4.2.5"
797+
"winston": "3.10.0",
798+
"ws": "8.13.0"
657799
}
658800
}

integration/vscode/ada/src/clients.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ import {
77
LanguageClientOptions,
88
ServerOptions,
99
} from 'vscode-languageclient/node';
10-
import { mainLogChannel } from './extension';
10+
import { logger } from './extension';
1111
import GnatTaskProvider from './gnatTaskProvider';
1212
import GprTaskProvider from './gprTaskProvider';
1313
import { logErrorAndThrow } from './helpers';
14+
import { registerTaskProviders } from './taskProviders';
1415

1516
export class ContextClients {
1617
public readonly gprClient: LanguageClient;
@@ -57,7 +58,7 @@ export class ContextClients {
5758
GprTaskProvider.gprTaskType,
5859
new GprTaskProvider(this.adaClient)
5960
),
60-
];
61+
].concat(registerTaskProviders());
6162
};
6263

6364
public unregisterTaskProviders = (): void => {
@@ -127,7 +128,7 @@ function createClient(
127128
logErrorAndThrow(
128129
`The Ada language server given in the ALS environment ` +
129130
`variable does not exist: ${serverExecPath}`,
130-
mainLogChannel
131+
logger
131132
);
132133
}
133134
} else {
@@ -137,11 +138,13 @@ function createClient(
137138
`language server for your architecture (${process.arch}) ` +
138139
`and platform (${process.platform}) ` +
139140
`at the expected location: ${serverExecPath}`,
140-
mainLogChannel
141+
logger
141142
);
142143
}
143144
}
144145

146+
logger.debug(`Using ALS at: ${serverExecPath}`);
147+
145148
// The debug options for the server
146149
// let debugOptions = { execArgv: [] };
147150
// If the extension is launched in debug mode then the debug server options are used

integration/vscode/ada/src/commands.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import * as vscode from 'vscode';
22
import { SymbolKind } from 'vscode';
33
import { ContextClients } from './clients';
44
import { getOrAskForProgram } from './debugConfigProvider';
5-
import { mainLogChannel } from './extension';
6-
import { getEnclosingSymbol } from './gnatTaskProvider';
5+
import { mainOutputChannel } from './extension';
6+
import { getEnclosingSymbol } from './taskProviders';
77

88
export function registerCommands(context: vscode.ExtensionContext, clients: ContextClients) {
99
context.subscriptions.push(
@@ -13,7 +13,7 @@ export function registerCommands(context: vscode.ExtensionContext, clients: Cont
1313
vscode.commands.registerCommand('ada.subprogramBox', addSupbrogramBoxCommand)
1414
);
1515
context.subscriptions.push(
16-
vscode.commands.registerCommand('ada.showExtensionOutput', () => mainLogChannel.show())
16+
vscode.commands.registerCommand('ada.showExtensionOutput', () => mainOutputChannel.show())
1717
);
1818
context.subscriptions.push(
1919
vscode.commands.registerCommand('ada.showAdaLSOutput', () =>

integration/vscode/ada/src/debugConfigProvider.ts

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'assert';
22
import * as vscode from 'vscode';
33
import { contextClients } from './extension';
4-
import { getExecutables, getMains, getProjectFile } from './helpers';
4+
import { AdaMain, getAdaMains, getProjectFile } from './helpers';
55

66
/**
77
* Ada Configuration for a debug session
@@ -244,54 +244,6 @@ const setupCmd = [
244244
},
245245
];
246246

247-
/**
248-
* A class that represents an Ada main entry point. It encapsulate both the
249-
* source file path and the executable file path.
250-
*/
251-
class AdaMain {
252-
mainFullPath: string;
253-
execFullPath: string;
254-
constructor(mainFullPath: string, execFullPath: string) {
255-
this.mainFullPath = mainFullPath;
256-
this.execFullPath = execFullPath;
257-
}
258-
259-
/**
260-
* @returns path of the main source file relative to the workspace
261-
*/
262-
mainRelPath(): string {
263-
return vscode.workspace.asRelativePath(this.mainFullPath);
264-
}
265-
266-
/**
267-
* @returns path of the executable file relative to the workspace
268-
*/
269-
execRelPath(): string {
270-
return vscode.workspace.asRelativePath(this.execFullPath);
271-
}
272-
}
273-
274-
/**
275-
* @returns The list of Mains defined for the current project as an array of AdaMains.
276-
*/
277-
async function getAdaMains(): Promise<AdaMain[]> {
278-
const mains = await getMains(contextClients.adaClient);
279-
const execs = await getExecutables(contextClients.adaClient);
280-
assert(
281-
execs.length == mains.length,
282-
`The ALS returned mains.length = ${mains.length} and ` +
283-
`execs.length = ${execs.length}` +
284-
`when they should be equal`
285-
);
286-
287-
const result: AdaMain[] = [];
288-
for (let i = 0; i < mains.length; i++) {
289-
result.push(new AdaMain(mains[i], execs[i]));
290-
}
291-
292-
return result;
293-
}
294-
295247
type QuickPickAdaMain = {
296248
label: string;
297249
description: string;

0 commit comments

Comments
 (0)