Skip to content

Accessing/suggesting completion and doc for functions 'called' via namespace and the namespace access operators (double/triple colon) #730

Description

@maxecharel

Hi,

TL;DR

When packages are declared to be attached via library, languageserver suggests their functions as completions and gives access to their documentation. However, when a function is accessed via namespace + access operator (e.g. typing purrr::wal for purrr::walk) without a library declaration, it does not work.
Is there something I miss, or do you think you could implement such functionality?

Extended description

I mainly use R via Emacs (ess-r-mode, from the pkg Emacs Speaks Statistics, and r-ts-mode, from ESR pkg). ESS, in the same vein I think as RStudio, provides a completion system that allows to have e.g. purrr::walk suggested when typing purrr::wal, and gives access to its documentation. The drawback is that this completion system requires to have an associated R process running.

On the other hand, r-ts-mode leverages tree-sitter and, coupled with e.g. Eglot (Emacs-native LSP client), provides a pretty interesting IDE solution. However, the LSP features it gives access to is determined by languageserver, and since typing e.g. purrr::wal does not suggest purrr::walk , I guess the functionality is missing from languageserver itself.

While it is possible that there is something I am missing in my current Eglot + languageserver config, I am rather confident that the 'issue' comes from languageserver. Do you think implementing the previously described functionality would be feasible?

Finally, many thanks for your work with languageserver.

Edit: languageserver 0.3.18 and R 4.6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions