Skip to content

Additional information about read/write access in the Call Hierarchy Item #2207

Open

Description

@ratzdi

A call hierarchy item containing information about the access method to the referenced object would improve clarity, especially in multithreaded scenarios.

For example, in the Eclipse-CDT Plugin, this feature is represented with symbols showing read and/or write access:

Image

In the example we are looking for the call hierarchy of the field fooInt. As result we see that 3 items are tagged with symbols describing the kind of access: HasRefs::foo() writes to fooInt, HasRefs::fooSome() reads from fooint and the ctor HasRefs::HasRefs reads and writes to/from fooInt.

Information about Read/Write access is also helpful when searching for references on variables/fields and is part of this issue.

Related suggestion for the LSP specification #2226
Related clangd PR llvm/llvm-project#172462

Activity

  1. travkin79 commented on Feb 16, 2026

    @travkin79

    I'd add to this issue's description that the read / write access detail would also be helpful in the Find Reference operation, especially when used with a variable, field, or property.

  2. travkin79 commented on Feb 16, 2026

    @travkin79

    Hello Dirk Bäumer (@dbaeumer),
    How do you think about this LSP extension? Would it be sufficient, if the corresponding PR #2226 would be implemented for some language server like clangd and for an LSP client like LSP4E to get that extension into the standard, similar to #2003?

  3. dbaeumer commented on Feb 23, 2026

    @dbaeumer
    Member

    Dietrich Travkin (@travkin79) yes, an implementation a server and another client is enough.

  4. i-garrison commented on May 22, 2026

    @i-garrison

    Would it be more beneficial to fold these read/write tags into language-specific strings like described here in #2118 ? That way you will not have to list all of usable tags in advance.

  5. ratzdi commented on May 28, 2026

    @ratzdi
    Author

    Would it be more beneficial to fold these read/write tags into language-specific strings like described here in #2118 ? That way you will not have to list all of usable tags in advance.

    Hello Igor V. Kovalenko (@i-garrison), this idea undermines the core concept of the LSP protocol—namely, having a general, simple interface that covers a wide variety of languages ​​with minimal effort. This proposal results in important details remaining hidden "under the hood," undocumented at the protocol level. Could you please describe what specific information you consider useful in the context of reference lookup (textDocument.references)? I look forward to your reply!

  6. defenderfaith91-del commented on May 29, 2026

    @defenderfaith91-del
  7. i-garrison commented on May 29, 2026

    @i-garrison

    Would it be more beneficial to fold these read/write tags into language-specific strings like described here in #2118 ? That way you will not have to list all of usable tags in advance.

    Hello @i-garrison, this idea undermines the core concept of the LSP protocol—namely, having a general, simple interface that covers a wide variety of languages ​​with minimal effort. This proposal results in important details remaining hidden "under the hood," undocumented at the protocol level. Could you please describe what specific information you consider useful in the context of reference lookup (textDocument.references)? I look forward to your reply!

    Well of course you are free to standardize the set of usable tags and populate it later with more tags for new language traits, you just do not have to do that in advance. A few tags may be standardized at the time #2118 is considered, like SymbolSignature and ReadWrite, we just need to agree on the concept and propose them together with #2118 I believe.

  8. defenderfaith91-del commented on May 30, 2026

    @defenderfaith91-del
  9. ratzdi commented on Jun 8, 2026

    @ratzdi
    Author

    Would it be more beneficial to fold these read/write tags into language-specific strings like described here in #2118 ? That way you will not have to list all of usable tags in advance.

    Hello @i-garrison, this idea undermines the core concept of the LSP protocol—namely, having a general, simple interface that covers a wide variety of languages ​​with minimal effort. This proposal results in important details remaining hidden "under the hood," undocumented at the protocol level. Could you please describe what specific information you consider useful in the context of reference lookup (textDocument.references)? I look forward to your reply!

    Well of course you are free to standardize the set of usable tags and populate it later with more tags for new language traits, you just do not have to do that in advance. A few tags may be standardized at the time #2118 is considered, like SymbolSignature and ReadWrite, we just need to agree on the concept and propose them together with #2118 I believe.

    I don't think we should treat these ideas as mutually exclusive. I have a specific requirement—implementation is already underway llvm/llvm-project#172462 — to provide additional descriptions for references at the protocol level, aiming for general applicability. You have a sensible idea to provide language-specific information outside of a dedicated API function. So, we’re both good, right?

  10. i-garrison commented on Jun 8, 2026

    @i-garrison

    I don't think we should treat these ideas as mutually exclusive. I have a specific requirement—implementation is already underway llvm/llvm-project#172462 — to provide additional descriptions for references at the protocol level, aiming for general applicability. You have a sensible idea to provide language-specific information outside of a dedicated API function. So, we’re both good, right?

    Correct, both approaches are not mutually exclusive of course.

    Back at the time I looked at how various language-specific attributes were added and it appeared that adding a field with value at a time iteratively for next language feature takes too much time to propagate to specification, and also likely each language has a few traits which will never be shared with other languages. Single attribute with extensible and trivially structured format for all of those features looked rather attractive and would probably speed up prototyping more language-specific features without changing language server specification a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions