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

feat(rome_diagnostics): refactor some existing diagnostics to use the new Diagnostic trait #3315

Merged
merged 3 commits into from
Oct 4, 2022

Conversation

leops
Copy link
Contributor

@leops leops commented Oct 3, 2022

Summary

This PR holds a number of miscellaneous changes related to exposing the new diagnostic system to the node.js API.
The central change to enable this is replacing the rome_diagnostics::Diagnostic type in the result of the pull_diagnostics Workspace method with the new rome_diagnostics::v2::serde::Diagnostic type, the serializable form of the new Diagnostic trait.
In order to make this work I had to fix a few bugs around the serialization and lifetime of diagnostic categories.
I also updated the logic that turns Rome diagnostics into LSP diagnostics to be generic over the Diagnostic trait, and changed the error reporting in the CLI filesystem traversal logic to use the new Error type provided by rome_diagnostics instead of declaring its own TraversalError.

Test Plan

The changes in the filesystem traversal should be covered by the CLI snapshot tests, and I've added an additional test to check how diagnostics are encoded to the LSP

@leops leops requested a review from ematipico as a code owner October 3, 2022 13:32
@leops leops requested a review from a team October 3, 2022 13:32
@netlify
Copy link

netlify bot commented Oct 3, 2022

Deploy Preview for rometools canceled.

Name Link
🔨 Latest commit fe8aa98
🔍 Latest deploy log https://app.netlify.com/sites/rometools/deploys/633afd9e270834000817c122

@leops leops temporarily deployed to netlify-playground October 3, 2022 13:32 Inactive
@github-actions
Copy link

github-actions bot commented Oct 3, 2022

crates/rome_lsp/tests/server.rs Outdated Show resolved Hide resolved
@leops leops force-pushed the refactor/diagnostics-workspace branch from 7596139 to fe8aa98 Compare October 3, 2022 15:19
@leops leops temporarily deployed to netlify-playground October 3, 2022 15:20 Inactive
@leops leops merged commit f3ade33 into main Oct 4, 2022
@leops leops deleted the refactor/diagnostics-workspace branch October 4, 2022 13:52
@ematipico ematipico added the A-Diagnostic Area: errors and diagnostics label Oct 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Diagnostic Area: errors and diagnostics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants