Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completion on user-defined functions doesn't work. #27

Closed
hifall opened this issue Aug 27, 2018 · 15 comments
Closed

Completion on user-defined functions doesn't work. #27

hifall opened this issue Aug 27, 2018 · 15 comments

Comments

@hifall
Copy link

hifall commented Aug 27, 2018

While completion on built-in functions like paste seems to work, completion on user-defined functions doesn't seem so.

For example, if I define a function like addcustom, and later I enter 'addcu' expecting addcustom to be in the completion candidate list, it's not.

@randy3k
Copy link
Member

randy3k commented Aug 27, 2018

Ya, it is supported in v0.2.4.

@randy3k
Copy link
Member

randy3k commented Aug 27, 2018

Ai, there are actually a few bugs in v0.2.4. Please install the current master and try again.
I will publish another release in a week.

@hifall
Copy link
Author

hifall commented Aug 27, 2018

So glad to see that this feature will be improved soon.

Awesome stuff! 👍

@randy3k
Copy link
Member

randy3k commented Aug 27, 2018

Actually, I just picked up the development today, langauageserver has not been updated for a while.

@hifall
Copy link
Author

hifall commented Aug 27, 2018

I see.

I think this project definitely brings much value to many members of the R community. It certainly does to me.

@hifall
Copy link
Author

hifall commented Sep 10, 2018

Now that 0.2.5 is released, is this supposed to be fixed?

@randy3k
Copy link
Member

randy3k commented Sep 10, 2018

It has not yet submitted to CRAN because CRAN was off. You need to install it via GitHub for now.

@hifall
Copy link
Author

hifall commented Sep 10, 2018

Okay. I will wait until it's on CRAN then.

@randy3k
Copy link
Member

randy3k commented Sep 11, 2018

V0.2.5 is out

@hifall
Copy link
Author

hifall commented Sep 11, 2018

Doesn't seem working for me -- still unable to see a user-defined function appear in the completion list.

@randy3k
Copy link
Member

randy3k commented Sep 11, 2018

It works for me. Note that the server only caches user functions when a file is opened or saved.

screen shot 2018-09-11 at 10 07 23 am

@hifall
Copy link
Author

hifall commented Sep 12, 2018

I see.

But why this limitation (the server only caches user functions when a file is opened or saved)? Other language servers I have worked on don't require this.

Is it possible/does it make sense to make it in-memory as well?

@randy3k
Copy link
Member

randy3k commented Sep 12, 2018

It is partly because R is unfortunately too slow. And a more economical reason is to save cpu power. Caching functions on the fly requires a lot of cpu power (related to R being slow). It is particularly important for laptop users.

With that said, it is totally possible to make a setting to allow online caching. I am not a big fan of it and I would still recommend users turning it off, even if it exists, to save battery life.

@renkun-ken
Copy link
Member

renkun-ken commented Sep 10, 2019

It would be expensive at the moment to cache workspace symbols on every key stroke. I'm wondering if it makes sense and if it's possible to cache every N seconds, something like cache interval option?

@renkun-ken
Copy link
Member

1e1c74d should fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants