|
| 1 | +# GPR dependencies |
| 2 | + |
| 3 | +## Short introduction |
| 4 | + |
| 5 | +This implements the functionality 'show gpr dependencies', allowing to |
| 6 | +query all the dependencies of a given GPR file. |
| 7 | + |
| 8 | +This request returns an array of items, each one containing a URI |
| 9 | +to another GPR file and the kind of dependency that binds them together. |
| 10 | + |
| 11 | +The dependencies are listed in the `ALS_GPR_DependencyKind` enum below. |
| 12 | + |
| 13 | +You can control whether you get the GPR files that depend on the |
| 14 | +requested GPR file or the requested GPR file's own dependencies. |
| 15 | + |
| 16 | +## Capabilities |
| 17 | + |
| 18 | +The `initialize` request returns `als-gpr-dependencies` in the list of |
| 19 | +supported commands if the server supports this functionality. |
| 20 | + |
| 21 | +## Change description |
| 22 | + |
| 23 | +We introduce four new types to represent the request parameters and results: |
| 24 | + |
| 25 | +```typescript |
| 26 | +export enum ALS_GPR_DependencyKind { |
| 27 | + AGGREGATED, |
| 28 | + EXTENDED, |
| 29 | + EXTENDING, |
| 30 | + IMPORTED, |
| 31 | +} |
| 32 | + |
| 33 | +export enum ALS_GprDependencyDirection { |
| 34 | + SHOW_OUTGOING= 1 /* Get the outgoing dependencies */, |
| 35 | + SHOW_INCOMING = 2 /* Get the incoming dependencies */, |
| 36 | +} |
| 37 | + |
| 38 | +interface ALS_GPR_DependenciesParams { |
| 39 | + uri: DocumentUri /* The queried unit */; |
| 40 | + direction: ALS_GprDependencyDirection /* The direction in which to fetch the dependencies */; |
| 41 | +} |
| 42 | + |
| 43 | +export type ALS_GPR_DependencyItem = { |
| 44 | + uri: DocumentUri /* The dependency's gpr file */; |
| 45 | + kind: ALS_GPRDependencyKind /* The dependency kind */; |
| 46 | +}; |
| 47 | +``` |
| 48 | + |
| 49 | +And a new command `als-show-dependencies`: |
| 50 | + |
| 51 | +```txt |
| 52 | + method: `workspace/executeCommand` |
| 53 | + "params": { |
| 54 | + "command": "als-gpr-dependencies", |
| 55 | + "arguments": [ |
| 56 | + <ALS_GRP_DependenciesParams> |
| 57 | + ] |
| 58 | + } |
| 59 | +``` |
| 60 | + |
| 61 | +It returns list of `ALS_GPR_DependencyItem`: |
| 62 | + |
| 63 | +result: `ALS_GPR_DependencyItem[]` |
0 commit comments