Skip to content

Error when editing untitled document in R language #196

Closed

Description

@renkun-ken

The problem could be reproduced with the following steps in VSCode:

  1. Create a new untitled document
  2. Choose language R or paste any R code into the editor
  3. Errors occur as the following:
handling notification:  textDocument/didOpen

did open: {
  "uri": "untitled:untitled-1",
  "version": 2
}

internal error: Error: 'd:untitled-1' does not exist.
Stack trace:
1: stop("'", path, "' does not exist", if (!is_absolute_path(path)) paste0(" in current working directory ('", 
    getwd(), "')"), ".", call. = FALSE)
2: check_path(path)
3: standardise_path(file)
4: datasource(file, skip = skip, skip_empty_rows = skip_empty_rows)
5: readr::read_lines(path_from_uri(uri))
6: dispatch(self, params)

received:  Content-Length: 118

received payload.

handling request:  textDocument/documentColor

internal error: Error: key not found
Stack trace:
1: self$documents$get(uri)
2: stop("key not found")
3: self$documents$get(uri)
4: dispatch(self, id, params)

deliver:  ["Response", "Response", "Message", "R6"]

[Error - 11:04:15 AM] Request textDocument/colorPresentation failed.
  Message: Error: key not found
Stack trace:
1: self$documents$get(uri)
2: stop("key not found")
3: self$documents$get(uri)
4: dispatch(self, id, params)

  Code: -32603 
received:  Content-Length: 117

received payload.

handling request:  textDocument/documentLink

internal error: Error: key not found
Stack trace:
1: self$documents$get(uri)
2: stop("key not found")
3: self$documents$get(uri)
4: dispatch(self, id, params)

deliver:  ["Response", "Response", "Message", "R6"]

[Error - 11:04:15 AM] Request textDocument/documentLink failed.
  Message: Error: key not found
Stack trace:
1: self$documents$get(uri)
2: stop("key not found")
3: self$documents$get(uri)
4: dispatch(self, id, params)

  Code: -32603 
received:  Content-Length: 119

received payload.

handling request:  textDocument/documentSymbol

internal error: Error: key not found
Stack trace:
1: self$documents$get(uri)
2: stop("key not found")
3: self$documents$get(uri)
4: dispatch(self, id, params)

deliver:  ["Response", "Response", "Message", "R6"]

[Error - 11:04:15 AM] Request textDocument/documentSymbol failed.
  Message: Error: key not found
Stack trace:
1: self$documents$get(uri)
2: stop("key not found")
3: self$documents$get(uri)
4: dispatch(self, id, params)

  Code: -32603 

It seems that the untitled document will get the language from the text being pasted and the uri of the document is untitled:untitled-n.

Activity

  1. changed the title [-]Pasting R code in untitled document triggers didOpen[/-] [+]Error when editing untitled document in R language[/+] on Feb 8, 2020
  2. self-assigned this
    on Feb 8, 2020
  3. randy3k commented on Feb 9, 2020

    @randy3k
    Member

    fixed in #198

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions