languageserver icon indicating copy to clipboard operation
languageserver copied to clipboard

Provide completion for list-like objects in package

Open renkun-ken opened this issue 5 years ago • 5 comments

We may provide completion for list-like objects in package such as .Machine, .Platform, and objects defined in packages such as R6 classes since their elements are known.

In contrast with https://github.com/Ikuyadeu/vscode-R/pull/165 which provides completion for elements in list-like objects in a live R session, languageserver may do similar for list-like objects in packages.

renkun-ken avatar Jan 01 '20 15:01 renkun-ken

With typescript style type definition file will help simplify the work, aka typedef for R object.

R6 classes are already typed. They will be easier to process.

qinwf avatar May 28 '20 14:05 qinwf

Sounds interesting, would you like to elaborate?

renkun-ken avatar May 29 '20 02:05 renkun-ken

https://devblogs.microsoft.com/python/announcing-pylance-fast-feature-rich-language-support-for-python-in-visual-studio-code/

Python introduced https://docs.python.org/3/library/typing.html

and pylance is using https://github.com/microsoft/pyright for the information, which is similar to typescript and javascript.

qinwf avatar Jul 04 '20 05:07 qinwf

@qinwf Just noticed Pylance yesterday. Looks quite promising. Do you have any idea how we could benefit from its design or implementation?

renkun-ken avatar Jul 04 '20 13:07 renkun-ken

Pylance is based on type hints feature built into Python 3.5+.

There is no typing library for R now. A gradual type system is required to enable features like it.

To build a gradual type system, there will be a frontend to do type checking for R code without running the code.

qinwf avatar Jul 05 '20 08:07 qinwf