Skip to content

Outline uses quarto style labels, #| label: <name> - #11192

Merged
romainfrancois merged 5 commits into
rstudio:mainfrom
romainfrancois:feature/outline_chunk_yaml_label_10473
May 13, 2022
Merged

romainfrancois merged 5 commits into
rstudio:mainfrom
romainfrancois:feature/outline_chunk_yaml_label_10473

Conversation

@romainfrancois

@romainfrancois romainfrancois commented May 12, 2022 •

Copy link
Copy Markdown
Contributor

Intent

addresses #10473

Approach

Improve getChunkLabel() so that it looks for #| label: after the opening of the scope.

Automated Tests

Indicate whether this change includes unit tests or integration tests, or link a work item or pull request to add those tests to another repo. If the change cannot or will not be covered by a test, indicate why.

QA Notes

Open this quarto document:

---
title: Test Quarto
---

# Test

## heading 2

```{r}
#| label: foo
1 + 1
```

```{r}
#| label: bar
2 + 3
```

The chunk labels should be displayed in the source and visual editors:

image

image

Checklist

  • If this PR adds a new feature, or fixes a bug in a previously released version, it includes an entry in NEWS.md
  • If this PR adds or changes UI, the updated UI meets accessibility standards
  • A reviewer is assigned to this PR (if unsure who to assign, check Area Owners list)
  • This PR passes all local unit tests

@romainfrancois

Copy link
Copy Markdown
Contributor Author

This works only for source mode:

image

It seems visual mode goes a different code path for outline:

image

@romainfrancois

This comment was marked as outdated.

@romainfrancois
romainfrancois force-pushed the feature/outline_chunk_yaml_label_10473 branch from 9910acc to fbeb6d6 Compare May 13, 2022 06:26
@romainfrancois

Copy link
Copy Markdown
Contributor Author

Now also in visual mode:

image

@romainfrancois

romainfrancois commented May 13, 2022 •

Copy link
Copy Markdown
Contributor Author

Just a thought, perhaps for a follow up pr: what about styling the chunks in the outline to clue, e.g.

image

Also, when collapsed we get more information. Should that be in the outline as well ?

image

@jgutman
jgutman self-requested a review May 13, 2022 15:13

@jgutman jgutman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks!
nice regexing

};
}

// Finally, look for magic label comments:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

huh, magic label, is that we're calling these new chunk options style?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤔 yeah maybe not, I think I've seen it though

@romainfrancois
romainfrancois merged commit 7fbd9e9 into rstudio:main May 13, 2022
@romainfrancois
romainfrancois deleted the feature/outline_chunk_yaml_label_10473 branch May 13, 2022 15:47
matheustavaresdev added a commit that referenced this pull request May 17, 2022
…on-auto-select

* 'main' of github.com:rstudio/rstudio: (40 commits)
  update to Electron 18.2.3
  ensure new instance is created when opening remote session file
  Update NEWS.md
  Fix flags not being passed through constructor in R version selectors
  remove unnecessary package
  install gpg1 for signing
  skip adding compiler definitions
  find jdk on my Intel Mac
  produce builds for fedora36
  use ucrtbase.dll with R 4.2.0 or newer (#11207)
  Outline uses quarto style labels, `#| label: <name>` (#11192)
  Allow fallback unknown text file types to open in Desktop same as in server
  update embedded libclang to 13.0.1 (#11186)
  Addresses handling of native pipe args with no placeholder (#11194)
  New project fails earlier when directory already exist (#11191)
  remove unused gwt class replacements (#11193)
  update Electron NEWS
  make message box API aware of this option
  whitespace tweak
  naming tweaks from PR feedback
  ...
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