@@ -7,6 +7,22 @@ import { Disposable } from 'vscode-jsonrpc';
77import { ExecuteCommandRequest } from 'vscode-languageclient' ;
88import { ALSSourceDirDescription , ExtensionState } from './ExtensionState' ;
99import { startVisualize } from './alsVisualizer' ;
10+ import {
11+ CMD_BUILD_AND_DEBUG_GNATEMULATOR ,
12+ CMD_BUILD_AND_DEBUG_MAIN ,
13+ CMD_BUILD_AND_RUN_GNATEMULATOR ,
14+ CMD_BUILD_AND_RUN_MAIN ,
15+ CMD_GET_PROJECT_FILE ,
16+ CMD_GPR_PROJECT_ARGS ,
17+ CMD_RESTART_LANG_SERVERS ,
18+ CMD_SHOW_ADA_LS_OUTPUT ,
19+ CMD_SHOW_EXTENSION_LOGS ,
20+ CMD_SHOW_GPR_LS_OUTPUT ,
21+ CMD_SPARK_ASK_OPTIONS ,
22+ CMD_SPARK_LIMIT_REGION_ARG ,
23+ CMD_SPARK_LIMIT_SUBP_ARG ,
24+ CMD_SPARK_PROVE_SUBP ,
25+ } from './constants' ;
1026import { AdaConfig , getOrAskForProgram , initializeConfig } from './debugConfigProvider' ;
1127import { adaExtState , logger , mainOutputChannel } from './extension' ;
1228import { loadGnatCoverageReport } from './gnattest' ;
@@ -33,89 +49,6 @@ import {
3349import { Hierarchy } from './visualizerTypes' ;
3450import { createHelloWorldProject , walkthroughStartDebugging } from './walkthrough' ;
3551
36- /**
37- * Identifier for a hidden command used for building and running a project main.
38- * The command accepts a parameter which is the URI of the main source file.
39- * It is triggered by CodeLenses provided by the extension.
40- *
41- * @see {@link buildAndRunSpecifiedMain }
42- */
43- export const CMD_BUILD_AND_RUN_MAIN = 'ada.buildAndRunMain' ;
44-
45- /**
46- * Identifier for a hidden command used for building and debugging a project main.
47- * The command accepts a parameter which is the URI of the main source file.
48- * It is triggered by CodeLenses provided by the extension.
49- *
50- * @see {@link buildAndDebugSpecifiedMain }
51- */
52- export const CMD_BUILD_AND_DEBUG_MAIN = 'ada.buildAndDebugMain' ;
53-
54- /**
55- * Identifier for a hidden command used for building and running a project main,
56- * using GNATemulator.
57- * The command accepts a parameter which is the URI of the main source file.
58- * It is triggered by CodeLenses provided by the extension.
59- *
60- * @see {@link buildAndRunMainWithGNATemulator }
61- */
62- export const CMD_BUILD_AND_RUN_GNATEMULATOR = 'ada.buildAndRunGNATemulator' ;
63-
64- /**
65- * Identifier for a hidden command used for building and debugging a project main,
66- * using GNATemulator.
67- * The command accepts a parameter which is the URI of the main source file.
68- * It is triggered by CodeLenses provided by the extension.
69- *
70- * @see {@link buildAndDebugSpecifiedMain }
71- */
72- export const CMD_BUILD_AND_DEBUG_GNATEMULATOR = 'ada.buildAndDebugGNATemulator' ;
73-
74- /**
75- * Identifier for a hidden command that returns an array of strings constituting
76- * the -P and -X project and scenario arguments.
77- */
78- export const CMD_GPR_PROJECT_ARGS = 'ada.gprProjectArgs' ;
79-
80- /**
81- * Identifier for a hidden command that returns a string referencing the current
82- * project. That string is either `"$\{config:ada.projectFile\}"` if that
83- * setting is configured, or otherwise the full path to the project file
84- * returned from a query to the
85- */
86- export const CMD_GET_PROJECT_FILE = 'ada.getProjectFile' ;
87-
88- export const CMD_SPARK_LIMIT_SUBP_ARG = 'ada.spark.limitSubpArg' ;
89- export const CMD_SPARK_LIMIT_REGION_ARG = 'ada.spark.limitRegionArg' ;
90- export const CMD_SPARK_PROVE_SUBP = 'ada.spark.proveSubprogram' ;
91- const CMD_SPARK_ASK_OPTIONS = 'ada.spark.askGNATproveOptions' ;
92-
93- /**
94- * Identifier for the command that shows the extension's output in the Output panel.
95- */
96- export const CMD_SHOW_EXTENSION_LOGS = 'ada.showExtensionOutput' ;
97-
98- /**
99- * Identifier for the command that shows the output of the ALS for Ada in the Output panel.
100- */
101- export const CMD_SHOW_ADA_LS_OUTPUT = 'ada.showAdaLSOutput' ;
102-
103- /**
104- * Identifier for the command that shows the output of the ALS for GPR in the Output panel.
105- */
106- export const CMD_SHOW_GPR_LS_OUTPUT = 'ada.showGprLSOutput' ;
107-
108- /**
109- * Identifier for the command that reloads the currently loaded project on server-side.
110- */
111- export const CMD_RELOAD_PROJECT = 'als-reload-project' ;
112-
113- /**
114- * Identifier for the command that restarts all the language servers spawned by the extension
115- * (Ada and GPR).
116- */
117- export const CMD_RESTART_LANG_SERVERS = 'ada.restartLanguageServers' ;
118-
11952export function registerCommands ( context : vscode . ExtensionContext , clients : ExtensionState ) {
12053 context . subscriptions . push (
12154 vscode . commands . registerCommand ( CMD_RESTART_LANG_SERVERS , restartLanguageServers ) ,
0 commit comments