Files
ada_language_server/doc/reference_kinds.md
Adrien Boulanger 6187ef2e32 SB14-037: Add new reference kind "access".
Add a reference kind for the following write reference:
Foo'Access
Foo'Unrestricted_Access
Foo'Address
Foo'Unchecked_Access

It allows to filter them from more common write reference like
"assignment" ("Foo :=").

Adapt tests. (using sed)
Add a test.
2020-06-03 11:48:15 +02:00

41 lines
1.2 KiB
Markdown

# Reference kinds
## Short introduction
This feature allows the LSP server to provide reference kinds in
results for the `textDocument/references` request. A reference can
be 'write', 'parent', 'dispatching call', etc.
## Change description
We extend the result of `textDocument/references` by adding an
extra field to the `Location` type:
```typescript
export type AlsReferenceKind = 'write' | 'access' | 'call' | 'dispatching call' | 'parent' | 'child';
export namespace AlsReferenceKind {
export const Write : AlsReferenceKind = 'write';
export const Access : AlsReferenceKind = 'access';
export const Static_Call : AlsReferenceKind = 'call';
export const Dispatching_Call : AlsReferenceKind = 'dispatching call';
export const Parent : AlsReferenceKind = 'parent';
export const Child : AlsReferenceKind = 'child';
}
interface Location {
uri: DocumentUri;
range: Range;
alsKind?: AlsReferenceKind[];
}
```
### See also
[documentHighlight] request also provides `Read` and `Write` markers to highlight
the code on the fly.
[documentHighlight]: https://microsoft.github.io/language-server-protocol/specification#textDocument_documentHighlight