vscode-R icon indicating copy to clipboard operation
vscode-R copied to clipboard

Use virtual documents for function definitions

Open ElianHugh opened this issue 2 years ago • 2 comments

At present, function definitions are files stored on disk. The current liveshare implementation avoids this through virtual documents, which has the added benefit of marking documents as read only.

I realise that definitions are created and provided by the LSP, but I don't believe virtual documents are part of the spec. Please feel free to redirect @renkun-ken if you think this fits better in the LSP repo.

Describe the solution you'd like

I think it would be a lot cleaner if function definitions were virtual documents and not files in their own right

ElianHugh avatar Jun 08 '22 01:06 ElianHugh

I agree. It is definitely much cleaner to view definitions in virtual docs. LSP uses document selector to provide features to editor documents. It would be nice if we could still use lsp features in the virtual docs but I'm not sure if it is the case?

Do you have any examples in mind such as other languages which opens a virtual doc but lsp is still functioning in it?

renkun-ken avatar Jun 08 '22 08:06 renkun-ken

RIght, I see what you mean re: LSP. I don't think I've come across this before, but I'll have a look through some extensions and get back to you.

Also, I think this would be useful for the View() function with non-list or dataframe values (e.g. View(5), View(mean))

ElianHugh avatar Jun 09 '22 02:06 ElianHugh

This issue is stale because it has been open for 365 days with no activity.

github-actions[bot] avatar Jun 10 '23 01:06 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Jun 24 '23 02:06 github-actions[bot]