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

language server should be able to fufill requests even without textdocument/didOpen Notifications #15

Open
ggilmore opened this issue Apr 26, 2018 · 6 comments

Comments

@ggilmore
Copy link

The LSP Spec says the following:

... Note that a server’s ability to fulfill requests is independent of whether a text document is open or closed.

For example, I see no hover when I hover over length in this file: https://github.com/gluc/data.tree/blob/HEAD/R/node_methods_traversal.R#L93, unless I manually send this didOpen notification with the file contents. The spec says that language servers should still be able to hovers, etc. even without this notification.

@randy3k
Copy link
Member

randy3k commented Apr 26, 2018

It can be considered as a bug. The hover reply is not sent back because the server fails to load the document content. The document content is only loaded when upon didOpen, didChange and didSave.

@andycraig
Copy link
Contributor

Can we add a feature to automatically load all R files in the workspace on initialisation (and on workspace change)?

I think the throttling already implemented in process_sync_in would avoid overwhelming the computer even in workspaces with many R files.

I am happy to work on this.

@randy3k
Copy link
Member

randy3k commented Oct 3, 2019

When you say all R files, what are those R files? We are already loading the R files if the root folder is a R package.

@andycraig
Copy link
Contributor

The case where the root folder (and possibly subfolders) contain R files, but the root directory not itself a package.

For example, in this structure I would like all of a.R, b.R and c.R to be loaded on startup:

root/
- a.R
- b.R
- package1/
  - R/
    - c.R

@renkun-ken
Copy link
Member

In my case, each of my research projects often contain 500+ R scripts, 70k+ lines of code, which is almost surely a disaster if all files are loaded on startup.

For me, a way to provide language service that makes more sense is to provide LS to a file and referenced files (#20). And completion should be independently provided for eah file for its content (#58). Or otherwise, as the project grows, the burden of LSP gets heavier; or as I open more and more files, LSP provides more and more info mixed with every file I opened.

@andycraig
Copy link
Contributor

Okay, at present it sounds like keeping the current system (automatically loading files only if the root folder is a package) is better than loading all files within the workspace.

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

4 participants