Skip to content

Commit 490b6ef

Browse files
committed
Merge branch 'topic/bump_from_edge' into 'master'
Bump edge to master Closes #1132, #1128, and #1129 See merge request eng/ide/ada_language_server!1218
2 parents 3a09218 + da0167c commit 490b6ef

File tree

93 files changed

+3398
-859
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+3398
-859
lines changed

.github/workflows/pack-binaries.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ pushd integration/vscode/ada
2424
sed -i -e "/version/s/[0-9][0-9.]*/$TAG/" package.json
2525
[ -z "$DEBUG" ] || sed -i -e '/^ "name"/s/ada/ada-debug/' \
2626
-e '/displayName/s/Ada/Ada (with debug info)/' package.json
27+
28+
npm -v; node -v; which node
2729
npm install
28-
sudo npm install -g vsce --unsafe-perm
30+
sudo npm install -g @vscode/vsce --unsafe-perm
2931
sudo npm install -g esbuild --unsafe-perm
3032
make_change_log > CHANGELOG.md
3133
if [[ ${GITHUB_REF##*/} = 2*.[0-9]*.[0-9]* ]] ; then

.gitlab-ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ build_and_test:
138138
export GPR_PROJECT_PATH=/it/wave/x86_64-linux/als/src/subprojects/gnatdoc/gnat:$GPR_PROJECT_PATH;
139139
export GPR_PROJECT_PATH=/it/wave/x86_64-linux/als/src/subprojects/VSS/gnat:$GPR_PROJECT_PATH;
140140
cd /it/wave/x86_64-linux/als/src;
141-
lsif-ada gnat/lsp_server.gpr > $CI_PROJECT_DIR/dump.lsif 2>/dev/null )
141+
lsif-ada gnat/lsp_server.gpr > $CI_PROJECT_DIR/dump.lsif 2>/dev/null ||
142+
touch $CI_PROJECT_DIR/dump.lsif )
142143

143144
- if [ ! -z ${FAILED+x} ]; then echo "There was at least one testcase failure" && exit 1; fi
144145

README.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ for Ada/SPARK.
1313
Current features:
1414

1515
* [GNAT project files](https://docs.adacore.com/gprbuild-docs/html/gprbuild_ug/gnat_project_manager.html) support.
16+
* Basic [Alire](https://alire.ada.dev/) support.
1617
* Code completion for names, keywords, aggregates, etc.
1718
* Code navigation, such as Go to Definition/Declaration, Find All References, Call Hierarchies, etc.
1819
* [Code refactoring](#refactoring-tools) like insert named associations, auto-add `with`-clauses, etc.
@@ -32,10 +33,6 @@ extension at
3233
- [Dependencies](#dependencies)
3334
- [Usage](#usage)
3435
- [Supported LSP Server Requests](#supported-lsp-server-requests)
35-
- [General Requests](#general-requests)
36-
- [Workspace Requests](#workspace-requests)
37-
- [Synchronization Requests](#synchronization-requests)
38-
- [Text Document Requests](#text-document-requests)
3936
- [Protocol extensions](#protocol-extensions)
4037
- [How to use the VScode extension](#how-to-use-the-vscode-extension)
4138
- [Getting started](#getting-started)
@@ -44,12 +41,13 @@ extension at
4441
- [Commands and shortcuts](#commands-and-shortcuts)
4542
- [Launch the extension to debug it](#launch-the-extension-to-debug-it)
4643
- [Configuration](#configuration)
47-
- [Integration with Coc.NVim](#integration-with-cocnvim)
48-
- [Integration with vim-lsp](#integration-with-vim-lsp)
49-
- [Integration with LanguageClient-Neovim](#integration-with-languageclient-neovim)
50-
- [Integration with Neovim's built-in LSP client](#integration-with-neovims-built-in-lsp-client)
44+
- [Integration with other editors and IDEs](#integration-with-other-editors-and-ides)
45+
- [Integration with Coc.NVim](#integration-with-cocnvim)
46+
- [Integration with vim-lsp](#integration-with-vim-lsp)
47+
- [Integration with LanguageClient-Neovim](#integration-with-languageclient-neovim)
48+
- [Integration with Neovim's built-in LSP client](#integration-with-neovims-built-in-lsp-client)
5149
- [Integration with emacs lsp-mode](#integration-with-emacs-lsp-mode)
52-
- [Integration with QtCreator](#integration-with-qtcreator)
50+
- [Integration with QtCreator](#integration-with-qtcreator)
5351
- [Refactoring Tools](#refactoring-tools)
5452
- [Authors & Contributors](#authors--contributors)
5553
- [Contribute](#contribute)
@@ -78,7 +76,6 @@ To build the language server you need:
7876
* The [gnatdoc](https://github.com/AdaCore/gnatdoc) library
7977
* The [gpr](https://github.com/AdaCore/gpr) library
8078
* The process [spawn](https://github.com/AdaCore/spawn) library
81-
* The [templates-parser](https://github.com/AdaCore/templates-parser) library
8279

8380
Project files of the libraries must be available via the `GPR_PROJECT_PATH`
8481
environment variable.
@@ -127,7 +124,12 @@ formatting might no succeed on incomplete/illegal code.
127124

128125
* **Toooling support**: we currently provide minimal support for *SPARK* (see *Prove/Examine* tasks in the [Auto-detected tasks](#auto-detected-tasks) section), but there is no support for tools such as *CodePeer*, *GNATcheck*, *GNATtest* or *GNATcoverage*.
129126

130-
* **Project support**: there is no `Scenario` view: users should configure scenarios via the *ada.scenarioVariables* setting (see the settings list available [here](doc/refactoring_tools.md)). You can execute the *Developper: Reload Window* command to reload your project after saving the new scenario values (use the *Ctrl+P* shortcut to invoke the **Command Palette**, allowing you to execute commands).
127+
* **Alire support**: if the root folder contains an `alire.toml` file and
128+
there is `alr` executable in the `PATH`, then the language server fetches
129+
the project's search path, environment variables and the project's file
130+
name from the crate description.
131+
132+
* **Project support**: there is no `Scenario` view: users should configure scenarios via the *ada.scenarioVariables* setting (see the settings list available [here](doc/refactoring_tools.md)). You can execute the *Ada: Reload project* command to reload your project after saving the new scenario values (use the *Ctrl+P* shortcut to invoke the **Command Palette**, allowing you to execute commands).
131133

132134
Source directories from imported projects should be added in a [workspace file](https://code.visualstudio.com/docs/editor/workspaces#_multiroot-workspaces). If you already have a workspace file, the extension will propose you to automatically add all the source directories coming from imported projects to your workspace automatically at startup.
133135

@@ -248,7 +250,9 @@ Here is an example config file from the gnatcov project:
248250
}
249251
```
250252

251-
## Integration with Coc.NVim
253+
## Integration with other editors and IDEs
254+
255+
### Integration with Coc.NVim
252256

253257
If you want to use the Ada Language Server with Vim/Neovim, you can use the
254258
[Coc.NVim](https://github.com/neoclide/coc.nvim). You'll have to
@@ -276,7 +280,7 @@ configure the Ada Language Server with `:CocConfig`:
276280
}
277281
```
278282

279-
## Integration with vim-lsp
283+
### Integration with vim-lsp
280284

281285
If you want to integrate the Ada Language Server into vim, you can use the
282286
[vim-lsp](https://github.com/prabirshrestha/vim-lsp).
@@ -297,7 +301,7 @@ if executable('ada_language_server')
297301
endif
298302
```
299303

300-
## Integration with LanguageClient-Neovim
304+
### Integration with LanguageClient-Neovim
301305

302306
If you want to integrate the Ada Language Server into Neovim, you can use the
303307
[LanguageClient-neovim](https://github.com/autozimu/LanguageClient-neovim).
@@ -341,7 +345,7 @@ the language server *even for files which might have nothing to do with that
341345
specific project*, so this needs to be taken into account. Ultimately what this
342346
means is that the configuration is determined by where you open vim.
343347

344-
## Integration with Neovim's built-in LSP client
348+
### Integration with Neovim's built-in LSP client
345349

346350
Neovim 0.5.0 and later have a built-in LSP client which can be used with the
347351
Ada Language Server. In order to use it with minimal effort, follow these steps:
@@ -415,7 +419,7 @@ for the `ada_language_server` and defines default customizable configuration
415419
values in the `lsp-ada` group that can be edited similarly to
416420
`lsp-ada-project-file` in the example above.
417421

418-
## Integration with QtCreator
422+
### Integration with QtCreator
419423

420424
Starting with version `4.9`, QtCreator supports a LSP plugin. Follow
421425
[the official documentation](https://doc.qt.io/qtcreator/creator-language-servers.html)

doc/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ related resources.
4545
* [Reference kinds](reference_kinds.md)
4646
* [Show Dependencies](show_dependencies.md)
4747
* [Check Syntax](check_syntax.md)
48+
* [Executables](executables.md)

doc/executables.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Executables
2+
3+
## Short introduction
4+
5+
This implements a functionality to query the mains and the executables for a multi targets project.
6+
7+
## Capabilities
8+
9+
We provide the Build and Run tasks for specific targets in a GPR Projects.
10+
11+
To check these tasks :
12+
- click : `Ctrl + Shift + P `.
13+
- Select `Run Tasks` , then Select `GPR Tasks`.
14+
15+
## Change description
16+
17+
We introduce two requests, the first one:
18+
19+
method: `glsMains`
20+
21+
Which provides the mains for the project, with a response type:
22+
23+
```typesript
24+
type GlsMainResult = {
25+
mains: string[];
26+
};
27+
```
28+
29+
The second one is:
30+
31+
method: `glsExecutables`
32+
33+
Which provides the executables for the project, with a response type:
34+
35+
```typesript
36+
type GlsExecutableResult = {
37+
executables: string[];
38+
};
39+
```

gnat/lsp_server.gpr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
------------------------------------------------------------------------------
22
-- Language Server Protocol --
33
-- --
4-
-- Copyright (C) 2018-2022, AdaCore --
4+
-- Copyright (C) 2018-2023, AdaCore --
55
-- --
66
-- This is free software; you can redistribute it and/or modify it under --
77
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -20,6 +20,7 @@ with "libadalang";
2020
with "lal_tools.gpr";
2121
with "ada_libfswatch.gpr";
2222
with "libgnatdoc.gpr";
23+
with "spawn.gpr";
2324

2425
with "lsp";
2526

integration/vscode/ada/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ node_modules
22
.vsix
33
out
44
.vscode-test
5+
**/obj

integration/vscode/ada/.vscode/launch.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@
1818
"runtimeExecutable": "${execPath}",
1919
"args": [
2020
"--extensionDevelopmentPath=${workspaceFolder}",
21-
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
22-
],
23-
"outFiles": [
24-
"${workspaceFolder}/out/test/**/*.js"
21+
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index",
22+
"${workspaceFolder}/test/SampleProject"
2523
],
2624
"preLaunchTask": "npm: pretest"
2725
}

integration/vscode/ada/package.json

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,14 @@
1818
"activationEvents": [
1919
"onLanguage:ada",
2020
"onLanguage:gpr",
21+
"workspaceContains:*.gpr",
22+
"workspaceContains:*/*.gpr",
23+
"workspaceContains:*.ad[bs]",
24+
"workspaceContains:*/*.ad[bs]",
25+
"workspaceContains:alire.toml",
2126
"onCommand:workbench.action.tasks.runTask"
2227
],
23-
"main": "./out/extension",
28+
"main": "./out/src/extension",
2429
"icon": "icons/ada.png",
2530
"bugs": "https://github.com/AdaCore/ada_language_server/issues",
2631
"repository": {
@@ -437,6 +442,23 @@
437442
"description": "Extra command arguments"
438443
}
439444
}
445+
},
446+
{
447+
"type": "GPR Tasks",
448+
"required": [
449+
"projectFile",
450+
"mainFile"
451+
],
452+
"properties": {
453+
"projectFile": {
454+
"type": "string",
455+
"description": "The project file"
456+
},
457+
"executable": {
458+
"type": "string",
459+
"description": "The main file"
460+
}
461+
}
440462
}
441463
],
442464
"commands": [
@@ -547,7 +569,7 @@
547569
},
548570
"scripts": {
549571
"vscode:prepublish": "npm run esbuild-base -- --minify",
550-
"esbuild-base": "esbuild ./src/extension.ts --bundle --outfile=out/extension.js --external:vscode --format=cjs --platform=node",
572+
"esbuild-base": "esbuild ./src/extension.ts --bundle --outfile=out/src/extension.js --external:vscode --format=cjs --platform=node",
551573
"compile": "node ./node_modules/typescript/bin/tsc",
552574
"watch": "node ./node_modules/typescript/bin/tsc -watch",
553575
"pretest": "npm run compile",

0 commit comments

Comments
 (0)