Skip to content

Commit 6b8102d

Browse files
authored
Add SymbolInformation.enclosing_symbol (#164)
* Add `SymbolInformation.enclosing_symbol` Towards #154 Previously, it was not possible to determine the enclosing symbol of a local because the syntax for local symbols has no hierarchy (unlike global symbols). This PR closes the gap by adding a field `SymbolInformation.enclosing_symbol` to allow documenting the "parent" or "owner" of a local symbol. * Add example for enclosing_symbol * Regenerate bindings, and gitignore Haskell output
1 parent 6b5114f commit 6b8102d

File tree

8 files changed

+1691
-1450
lines changed

8 files changed

+1691
-1450
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ cmd/scip
2626

2727
# Dependency directories (remove the comment below to include it)
2828
# vendor/
29+
dist-newstyle/

bindings/go/scip/scip.pb.go

Lines changed: 279 additions & 252 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindings/haskell/src/Proto/Scip.hs

Lines changed: 633 additions & 550 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindings/haskell/src/Proto/Scip_Fields.hs

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindings/rust/src/generated/scip.rs

Lines changed: 710 additions & 648 deletions
Large diffs are not rendered by default.

bindings/typescript/scip.ts

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/scip.md

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scip.proto

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,24 @@ message SymbolInformation {
327327
// while other fields such as `Documentation.occurrences` can be optionally
328328
// included to support hyperlinking referenced symbols in the signature.
329329
Document signature_documentation = 7;
330+
// (optional) The enclosing symbol if this is a local symbol. For non-local
331+
// symbols, the enclosing symbol should be parsed from the `symbol` field
332+
// using the `Descriptor` grammar.
333+
//
334+
// The primary use-case for this field is to allow local symbol to be displayed
335+
// in a symbol hierarchy for API documentation. It's OK to leave this field
336+
// empty for local variables since local variables usually don't belong in API
337+
// documentation. However, in the situation that you wish to include a local
338+
// symbol in the hierarchy, then you can use `enclosing_symbol` to locate the
339+
// "parent" or "owner" of this local symbol. For example, a Java indexer may
340+
// choose to use local symbols for private class fields while providing an
341+
// `enclosing_symbol` to reference the enclosing class to allow the field to
342+
// be part of the class documentation hierarchy. From the perspective of an
343+
// author of an indexer, the decision to use a local symbol or global symbol
344+
// should exclusively be determined whether the local symbol is accessible
345+
// outside the document, not by the capability to find the enclosing
346+
// symbol.
347+
string enclosing_symbol = 8;
330348
}
331349

332350

0 commit comments

Comments
 (0)