-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SymbolInformation.enclosing_symbol
#164
Conversation
// documentation. However, in the situation that you wish to include a local | ||
// symbol in the hierarchy, then you can use `enclosing_symbol` to locate the | ||
// "parent" or "owner" of this local symbol. | ||
string enclosing_symbol = 8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I debated using owner
or parent
, which is commonly the name of this functionality in compiler APIs that I have worked with (Java, Scala, C#, and TypeScript). However, I went with enclosing_symbol
to make it more self-descriptive and also to reflect that I don't expect this to be a high-traffic API (unlike owner
in the compiler that you use all the time).
scip.proto
Outdated
// The primary use-case for this field is to allow local symbol to be displayed | ||
// in a symbol hierarchy for API documentation. It's OK to leave this field | ||
// empty for local variables since local variables usually don't belong in API | ||
// documentation. However, in the situation that you wish to include a local | ||
// symbol in the hierarchy, then you can use `enclosing_symbol` to locate the | ||
// "parent" or "owner" of this local symbol. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading this as someone writing an indexer, it's not clear under what circumstances I would want to include a local symbol in a symbol hierarchy. Could you add an example here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I added an example.
The Haskell bindings also need to be updated. |
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.
e39f288
to
018744f
Compare
The Haskell bindings are now automatically updated \o/ |
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.Test plan
Green CI.