emacs-ess / ESS

Emacs Speaks Statistics: ESS
https://ess.r-project.org/
GNU General Public License v3.0
614 stars 160 forks source link

completion for variable names does not work in e.g. functions from tidyverse packages #1171

Closed maxecharel closed 2 years ago

maxecharel commented 2 years ago

Discussed in https://github.com/company-mode/company-mode/discussions/1274

Hi, while company suggests variable names with df$, company_works However, for packages such as ggplot2 variables names are entered directly. In that case company does not suggest variable names from the related dataframe: company_does_not_work (NB: dist is not a variable from the df dataframe; I rather expect company to suggest the variable disp)

The output of M-x company-diag is the following:

Emacs 27.2 (x86_64-pc-linux-gnu) of 2021-11-27 on <blanked>
Company 0.9.13

company-backends: ((company-R-library company-R-args company-R-objects :separate)
 company-bbdb company-semantic company-cmake company-clang company-files
 (company-dabbrev-code company-gtags company-etags company-keywords)
 company-oddmuse company-dabbrev)

Used backend: (company-R-library company-R-args company-R-objects :separate)

Major mode: ess-r-mode
Prefix: "dis"
Completions:
  #("discoveries" 0 11 (company-backend company-R-objects))
  #("discrete_scale" 0 14 (company-backend company-R-objects))
  #("dist" 0 4 (company-backend company-R-objects))

Since all the backends from the Used backend: list come from ESS, it has been suggested to me to report this issue here.

lionel- commented 2 years ago

Duplicate of #253, but do not expect a resolution soon since there is a lack of emacs lisp developers in the community.

maxecharel commented 2 years ago

@lionel- sorry for the duplicate; I was planning to learn more about emacs list in order to be able to contribute, but obviously this will take time. BTW thank you and @vspinu for the great work with ESS