Skip to content

Conversation

@lionel-
Copy link
Member

@lionel- lionel- commented Jan 13, 2026

No description provided.

uri <- paste0("file://", file)

lines <- ark_annotate_source(uri, paste_line(lines)) %||% lines
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm somewhat inclined to want this whole thing to be in a tryCatch(), is it just me?

Like, what if normalizePath() fails?

What if we want to change ark_annotate_source() in some breaking way?

Since this feature is just about debugging, I'd hate for some kind of issue there to mean I can't load my package. That would be extremely frustrating as a devtools::load_all() user.

Copy link
Member Author

@lionel- lionel- Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and silently ignore errors? Or warn? hmm I don't know about either.

Basically we've exported ark_annotate_source from Ark and treat it like any other dependency.

If there is a problem and you can't debug anymore, it's frustrating for users too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A warning feels like the most useful compromise:

  • you get to learn something has gone very wrong with annotations
  • you still get to use your package, because nothing is actually wrong with it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this function is called once per source file, this throws a ton of warnings when the annotation fails systematically, but this doesn't prevent pkgload from loading the package:

Screenshot 2026-01-22 at 14 15 25

@lionel- lionel- merged commit 47007e1 into r-lib:main Jan 22, 2026
11 checks passed
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

Successfully merging this pull request may close these issues.

2 participants