Comments (12)
As a Vim user who doesn't use Nvim-R (there are dozens of us!), I can't tell you how much I appreciate your work on this. Having the LSP is an order of magnitude improvement over life before.
A long-term goal could also be supporting Rmarkdown documents. Even the smaller subset of features currently provided by the package would be really handy there too.
Thanks!
from languageserver.
Good question. The fact is there were no plans. It lets me think of the following road map. Some of the items below may lead to developments of new packages.
Short term and easy tasks
- Linting/Diagnostics (basically done)
- Basic auto completion:
- Signature help (hints for function arguments)
- References for objects in default packges
- References for objects in form of
foo::bar
orxyz:::abc
Medium term
- Formatting:
styler
seems to be a better alternative toformatR
which is what I had in mind. - Auto completion of attached functions via
library
andrequire
, it requires an inspection the use oflibrary()
if it is a script or an inspection ofNAMESPACE
file if it is a package - References of attached functions (similar to auto completion)
- Code Lens
- Go to definition
Long term and/or difficult tasks
- Robust refactoring (code action)
- Hook into an active R session and do object completions (something nvimcon of Nvim-R).
from languageserver.
You must take care of supporting go to definition.
from languageserver.
We appreciate any contributions. If you want to contribute, I am happy to give some guidance.
from languageserver.
I think you really need to query the R session to do anything like detecting attached packages. R code can attach packages implicitly if they are in Depends
in another package, explicitly in R code with attach()
and other ways. Doing so with lexical analysis alone is going to be brittle.
Probably you need something like nvimcom that provides bi-directional communication between the R process and the language server process, this will also let you do object completions easily.
For completions it would also be nice if the package supported custom completions defined using R's rc.options("custom.completer")
see ?rc.options
for more details. I have a new completeme package that will make it much easier for package authors to define custom completions and have them work in tandem, so while there are few examples today there will likely be more in the near future.
from languageserver.
@randy3k What's the benefit in using the language server instead of Hydrogen, which uses the R Jupyter Kernel. In my experience, Hydrogen has auto-completion based on attached packages.
from languageserver.
They are different concepts. Language server would be useful in any R files to provide language support. For example, if you are developing an R package, I am quite sure that you don't run Hydrogen on top of the R files. Hydrogen is mainly useful if one is doing data analysis.
from languageserver.
I'll read more about the language server protocol, and might be interested in contributing in the future.
from languageserver.
@jimhester
It is hard to fully support what RStudio offers via lexical analysis without querying a R session. Inspecting the use of library
, the NAMESPACE
file and scanning "Depends" iteratively should be sufficient in most cases. The Language server is just a helper anyway, we don't expect it to work under all circumstances.
Discussing something like nvimcom is also too early for now. I also envision such implementation and have put into in the long term target.
Didn't know that there is an option to specify custom completer. Thank for letting me know.
from languageserver.
Do you know if there is any package for providing go to definition? Or you can do manually that by searching the workspace and choosing the one that matches the definition in the syntax.
from languageserver.
We will need to manually search for the definitions and apply the match. That's one of the reasons why I still haven't implemented it.
from languageserver.
Something else I want to ask you about.
Have you implemented yet symbol outlining??
from languageserver.
Related Issues (20)
- Support for old R version HOT 3
- Support for path completions
- Availability of `formatOnType` in quarto
- Roxygen comments soft linebreaks aren't ignored in languageserver hover hints
- Reference support for S4 methods
- No documentSymbol response for Rmarkdown file with helix editor HOT 1
- Variable duplication, one from workspace, another from session
- Autocompletion Bugs in vscode rmd-files
- "glue" function semantic for the expressions inside {}
- spawn: bash failed with exit code 127 and signal 0. HOT 1
- callback error in Neovim: “attempt to compare string with number” HOT 1
- Completion dataframe variable/columns HOT 3
- Neovim lspinstall r-languageserver installation not using .Rprofile CRAN mirror address?
- languageserver crashes with regex in file
- VSCode outline fails in Rmarkdown document if there is pseudo chunk text inside the chunks
- VSCode Perl::LanguageServer causes a process that consumes CPU HOT 2
- Section collapsing issues HOT 1
- Error with renv: Header must provide a Content-Length property
- Hover and Outline do not appear to function
- languageserver and help page viewer not working in windows10 and miniforge environment
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from languageserver.