R: help users pick a timezone in `tz` arguments

Open
#17,615 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript

Research direction

Start by locating Ark's existing language server completion and hover implementations; the issue names no files or tests. Check how they handle function arguments and string literals, then trace coverage for the listed base R and lubridate functions. Done means offering timezone completions for the listed arguments and a hover showing the timezone's offset and current time.

Written by the indexing model from the issue text.

Description

area: completions enhancement lang: r

@tylermorganwall built a custom Positron with a little timezone picker for as.POSIXct(): https://bsky.app/profile/tylermw.com/post/3n3m7q6jfic2f

His reason was "when I found myself googling 'timezone strings' for the umpteenth time I suddenly realized that there had to be a better way." same. 💜

There's no API for an extension to draw an arbitrary widget in the editor, so we can't ship exactly that without core work. But I think Ark could get most of the value with two LSP features it already has most of the plumbing for:

  1. Completions for tz arguments
  2. A hover on a timezone string that shows its offset and the current time there

Here's a rough mockup of what both might look like:

tz-mockup tz-mockup 2

Functions to cover: as.POSIXct(), as.POSIXlt(), ISOdatetime(), strftime(), Sys.setenv(TZ = ), lubridate's ymd_hms() and friends (tz), and lubridate's with_tz() and force_tz() (tzone).

(Inlay hints showing the offset right after the string would be another option for (2), but Ark doesn't implement inlay hints yet, so hover seems like the easier start.)

Dominant language
TypeScript
Stars
4.4k
Forks
207
Avg merge
1d 16h
Merged PRs (30d)
308

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

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.

More from posit-dev/positron

All issues in posit-dev/positron

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.