REditorSupport / REditorSupport/vscode-R

View() fails to handle lubridate Period objects within a data structure

Open
#1,408 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
1.2k
Forks
139
Avg merge
2h 46m
Merged PRs (30d)
5

Description

Describe the bug
In VS Code, View() displays only the seconds of Period objects when in some sort of larger data structure, like a tibble, data frame or a list. Haven't tested with other data structures.

View(tibble(x=lubridate::period(num = 20, unit="hours")))

Behaviour in VS Code with the R extension:
image

To Reproduce
Steps to reproduce the behavior:

  1. Use VS Code with the R Extension
  2. Try to View a Period object within some data structure like so: View(tibble(x=period(num=20, unit="hours")))
  3. See View() output

Can you fix this issue by yourself? (We appreciate the help)

No :(

Expected behavior
Normal Rstudio behaviour:
image

Environment (please complete the following information):

  • OS: Ubuntu 22.04.3 LTS
  • VSCode Version: 1.81
  • R Version: 4.3.0
  • vscode-R version: 2.8.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

First reproduce View(tibble(x=lubridate::period(num=20, unit="hours"))) in the VS Code R extension and compare the displayed Period with the expected RStudio behavior. Trace the View() data-display path to find where Period values inside structures are converted, then verify that hours are preserved in the output.

Written by the indexing model from the issue text.

Assessment

Tech stack
r, vscode
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.