Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn deprecated dollar prefix in global directives #70

Merged
merged 17 commits into from
Sep 16, 2019

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Sep 13, 2019

Updates in the upstream package will break existing Markdown slides that has used $ prefix for global directive. (marp-team/marpit#182)

Marp CLI had a time to see warnings for 3 weeks so user could deal with this deprecation. We have already outputted warnings in the developer console of VS Code too, but almost users would have not any chance to notice that.

In Marp for VS Code, we will keep supporting $ prefix against upstream packages, and output warnings through VS Code's Diagnostic API.

warn

Added diagnostic support might help migration from the old Marp app too. (marp-team/marp-cli#85)

ToDo

  • Restore the removed dollar prefix support in upstream packages (dollarPrefixForGlobalDirectives: Add dollarPrefixForGlobalDirectives option marp-core#104)
    • Marpit
      • $theme
      • $style
      • $headingDivider
    • Marp Core
      • $size (>= v0.13.1)
    • Marp CLI (Pass dollarPrefixForGlobalDirectives option to engine: Require update)
  • Warn deprecated dollar prefix in global directives
    • Front-matter
    • HTML comment
      • Don't warn to the string within the code block and fence
    • Warn only in Markdown document that has marp directive as true
  • Support quick-fix to remove $
  • Add tests

@yhatt yhatt marked this pull request as ready for review September 16, 2019 14:10
Copy link
Member Author

@yhatt yhatt left a comment

Choose a reason for hiding this comment

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

Checks are passed ✅

doc.uri,
new Range(diag.range.start, diag.range.start.translate(0, 1))
)
// act.isPreferred = true // TODO: Require VS Code >= v1.32
Copy link
Member Author

Choose a reason for hiding this comment

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

isPreferred is marked as proposal in VS Code v1.31, the least version Marp supported.
https://code.visualstudio.com/updates/v1_31#_auto-fix-and-codeactionispreferred

We should consider bump the least version in another PR.

@yhatt yhatt merged commit 0a079f0 into master Sep 16, 2019
@yhatt yhatt deleted the diagnostic-deprecation-warning branch September 16, 2019 14:47
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.

1 participant