+
Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

feat(rome_diagnostics): add with_severity API #3823

Merged
merged 3 commits into from
Nov 25, 2022
Merged

Conversation

ematipico
Copy link
Contributor

Summary

This PR adds a new API to DiagnosticExt called with_severity, which allows changing the severity of a diagnostic in a "native" way.

This change allows removing an API I had to create in the AnalyzerDiagnostic, which is not needed anymore.

Test Plan

This is a "under the hoods" change, which means that the existing tests should pass.

@ematipico ematipico requested a review from a team November 22, 2022 09:54
@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for docs-rometools ready!

Name Link
🔨 Latest commit 64c2be7
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/6380a60c98c3a000081c8465
😎 Deploy Preview https://deploy-preview-3823--docs-rometools.netlify.app/playground
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

Parser conformance results on ubuntu-latest

js/262

Test result main count This PR count Difference
Total 45879 45879 0
Passed 44936 44936 0
Failed 943 943 0
Panics 0 0 0
Coverage 97.94% 97.94% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 39 39 0
Passed 36 36 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.31% 92.31% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 5946 5946 0
Passed 1757 1757 0
Failed 4189 4189 0
Panics 0 0 0
Coverage 29.55% 29.55% 0.00%

ts/babel

Test result main count This PR count Difference
Total 588 588 0
Passed 519 519 0
Failed 69 69 0
Panics 0 0 0
Coverage 88.27% 88.27% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 16257 16257 0
Passed 12397 12397 0
Failed 3860 3860 0
Panics 0 0 0
Coverage 76.26% 76.26% 0.00%

@ematipico ematipico force-pushed the feature/with-category branch from d2567a4 to 2a2e39e Compare November 22, 2022 10:05
@@ -42,6 +42,11 @@ pub trait DiagnosticExt: internal::Sealed + Sized {
fn with_tags(self, tags: DiagnosticTags) -> Error
where
Error: From<internal::TagsDiagnostic<Self>>;

/// Returns a new diagnostic with additional `severity`
fn with_severity(self, severity: Severity) -> Error
Copy link
Contributor

Choose a reason for hiding this comment

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

For feature parity, can we add this new method to the Context trait too ? (It looks like I forgot to add a few methods from DiagnosticExt in that trait already already, but in theory they should be kept in sync)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also added with_tags

@ematipico ematipico force-pushed the feature/with-category branch 2 times, most recently from bb51ac8 to 0adaebe Compare November 24, 2022 10:21
@ematipico ematipico added A-Diagnostic Area: errors and diagnostics A-Core Area: core labels Nov 24, 2022
@ematipico ematipico requested a review from leops November 24, 2022 18:12
@ematipico ematipico force-pushed the feature/with-category branch from 0adaebe to 64c2be7 Compare November 25, 2022 11:24
@ematipico ematipico requested a review from a team as a code owner November 25, 2022 11:24
@ematipico ematipico merged commit f9a3db6 into main Nov 25, 2022
@ematipico ematipico deleted the feature/with-category branch November 25, 2022 12:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Core Area: core A-Diagnostic Area: errors and diagnostics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载