Skip to content

Commit a25d857

Browse files
Merge branch 'topic/project-view-doc' into 'master'
Add documentation for the Project View See merge request eng/ide/ada_language_server!2297
2 parents 195d84d + c8e9ffa commit a25d857

3 files changed

Lines changed: 52 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ section below it for the last release. -->
1111
* The project name is now displayed in the Ada & SPARK extension status bar
1212
* VS Code now displays a custom file icon for Ada files
1313
* Add support for loading Cobertura XML coverage reports in addition to GNATcoverage XML reports, via the unified command `ada: GNATcoverage - Load an existing coverage report`
14+
* New [Project View](./doc/vscode-ug.md#project-view) panel in the Explorer sidebar showing the GPR project structure as a tree, grouping source files by project and source directory
1415

1516
## 2026.2.202604091
1617

doc/media/project-view.png

263 KB
Loading

doc/vscode-ug.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,57 @@ A status bar item displaying the project-loading status and various useful comma
209209

210210
![Ada & SPARK Status Bar](media/status_bar.gif)
211211

212+
## Project View
213+
214+
The Ada & SPARK extension contributes a **Project View** panel in the VS Code Explorer sidebar. It shows the structure of the loaded GPR project as a tree, grouping source files by their project and source directory.
215+
216+
![Project View](media/project-view.png)
217+
218+
### Tree Structure
219+
220+
The tree reflects the GPR project hierarchy:
221+
222+
* **Root project** — the top-level `.gpr` project file.
223+
* **Sub-projects** — projects imported, aggregated, or extended by the root project, shown as children.
224+
* **Source directories** — each project's source directories are shown as folder nodes. Directories declared in the project file are always shown, even when empty.
225+
* **Source files** — source files are listed under their containing directory. Clicking a file opens it in the editor.
226+
* **Object directory** — optionally displayed under each project (see [View Options](#view-options) below).
227+
* **Runtime project** — optionally shown at the bottom of the tree, listing the GNAT runtime source files (see [View Options](#view-options) below).
228+
229+
### Navigation
230+
231+
* **Reveal Active File** (`Ada: Reveal in Project View`) — locates and selects the currently open editor file in the Project View tree. This command is also available as an editor context menu.
232+
* **Reveal in Explorer** — available via right-click on a source file or a project file node; opens the VS Code Explorer and selects the item there.
233+
234+
### File Management
235+
236+
Source files can be **moved between source directories** by dragging them from one directory node and dropping them onto another. A confirmation dialog is shown before any move is performed, and name collisions are detected and reported.
237+
238+
### Filtering
239+
240+
The Project View toolbar provides a filter button (funnel icon). When active, only projects, directories, and files whose names contain the filter string are shown. Clear the filter by clicking the filled funnel icon that replaces it.
241+
242+
### View Options
243+
244+
Click the **View Options** button (`···`) in the Project View toolbar to toggle the following display settings:
245+
246+
| Option | Setting | Description |
247+
|--------|---------|-------------|
248+
| Flat Mode | `ada.projectView.flatMode` | Show all projects as a flat list rather than a hierarchy |
249+
| Show Object directories | `ada.projectView.showObjectDirectories` | Show each project's object directory |
250+
| Show Runtime files | `ada.projectView.showRuntimeFiles` | Show GNAT runtime source files |
251+
252+
These options can also be set permanently via the corresponding [VS Code settings](./settings.md).
253+
254+
### Context Menu Commands
255+
256+
Right-clicking a node in the Project View exposes additional commands:
257+
258+
* **Show File Dependencies Graph** — opens an interactive graph of Ada file dependencies for the selected file. Only available for source files.
259+
* **Show GPR Dependencies Graph** — opens an interactive graph of GPR project dependencies. Only available for GPR project files.
260+
261+
Project file items also have a context menu with commands to build, analyze, and clean the project, among others.
262+
212263
## Alire Support
213264

214265
When the workspace is an Alire crate (i.e. it contains an `alire.toml` file), the extension uses Alire to determine the GPR project that should be loaded and to obtain an environment where the crate's dependencies have been provisioned.

0 commit comments

Comments
 (0)