Skip to content

Fix source marker formatting - #10491

Merged
timtmok merged 1 commit into
mainfrom
bugfix/source-marker-bugs
Feb 7, 2022
Merged

timtmok merged 1 commit into
mainfrom
bugfix/source-marker-bugs

Conversation

@timtmok

@timtmok timtmok commented Feb 2, 2022

Copy link
Copy Markdown
Contributor

Intent

Fixes #10430 and #10062

The gutter would show duplicate issues and the duplicate would be incorrectly formatted. RMarkdown files in visual mode literally rendered the HTML in the tooltip. The issues would manifest after code diagnostics had run and the R session was restarted.

Approach

For duplicate gutter issues, this came from adding the custom source markers to the gutter. Code diagnostics already had the issues and they would be added a second time to the lint result. Adding a flag to the marker set that it is a diagnostic issue allows a check to prevent adding it to lint items returned.

For the formatting issues with tooltips, a flag was added to VirtualConsole to render the text as HTML. This allowed the HTML entities to show up properly in the tooltips. If the source editor was in visual mode then it would not apply any formatting since the tooltip sets the text using a title attribute.

The session restart wrote the source markers to file so they could be reloaded. The file now writes the marker set flag that indicates the markers are diagnostic issues. Upon read, it sets the flag again so the linter can only retrieve the custom source markers.

Automated Tests

An existing test covers the visual mode tooltip.

QA Notes

See #10430 for reproduction steps.

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

Code diagnostics correctly renders
Fix duplicate gutter markers
Fix RMarkdown visual mode marker tooltips
@timtmok
timtmok requested a review from kevinushey February 2, 2022 14:49
@timtmok timtmok mentioned this pull request Feb 4, 2022
4 tasks done
@timtmok
timtmok merged commit e6c03de into main Feb 7, 2022
@timtmok
timtmok deleted the bugfix/source-marker-bugs branch February 7, 2022 13:42
@timtmok

timtmok commented Feb 7, 2022

Copy link
Copy Markdown
Contributor Author

Merging to fix the automated test

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

Labels

None yet

Projects

None yet

1 participant