Skip to content

fix(editor): re-add tester and prevent empty inverted diagnostics #9991

Merged
graphite-app[bot] merged 1 commit intomainfrom
fix-empty-diagnostics
Mar 24, 2025
Merged

fix(editor): re-add tester and prevent empty inverted diagnostics #9991
graphite-app[bot] merged 1 commit intomainfrom
fix-empty-diagnostics

Conversation

@camchenry
Copy link
Member

@camchenry camchenry commented Mar 23, 2025

This PR fixes an issue where the "inverted diagnostics" (i.e., the hint spans converted into diagnostic reports) cause issues in VS Code because the spans are not labeled. This happens to be the case in no-non-null-asserted-optional-chain: there are two diagnostic spans, but neither is labeled. This ends up creating "empty" diagnostics which cause problems. So, the fix is to simply skip creating the full diagnostic report when the message content is empty. The better fix for the future is to ensure we always label spans, as this also results in more helpful error messages.

This also re-adds the testing code which was reverted previously. I've hopefully reduced the flakiness of these tests by replacing more of the file path content to a static value.

@github-actions github-actions bot added A-editor Area - Editor and Language Server C-test Category - Testing. Code is missing test cases, or a PR is adding them labels Mar 23, 2025
Copy link
Member Author

camchenry commented Mar 23, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@camchenry camchenry changed the title test(editor): add tests for offset_to_position fix(editor): re-add tester and prevent empty inverted diagnostics Mar 23, 2025
@github-actions github-actions bot added the C-bug Category - Bug label Mar 23, 2025
@camchenry camchenry requested a review from Sysix March 23, 2025 18:38
@camchenry camchenry force-pushed the fix-empty-diagnostics branch from f83ea0e to 56f6a0f Compare March 23, 2025 18:39
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 23, 2025

CodSpeed Instrumentation Performance Report

Merging #9991 will not alter performance

Comparing fix-empty-diagnostics (2d7b0cf) with main (1b41cb3)

Summary

✅ 33 untouched benchmarks

@camchenry camchenry force-pushed the fix-empty-diagnostics branch from 56f6a0f to b48e8cc Compare March 24, 2025 02:15
@camchenry camchenry added the 0-merge Merge with Graphite Merge Queue label Mar 24, 2025
Copy link
Member Author

camchenry commented Mar 24, 2025

Merge activity

  • Mar 23, 10:16 PM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 23, 10:24 PM EDT: A user added this pull request to the Graphite merge queue.
  • Mar 23, 10:35 PM EDT: A user merged this pull request with the Graphite merge queue.

graphite-app bot pushed a commit that referenced this pull request Mar 24, 2025
)

- fixes #9958
- reverts + fixes #9982

This PR fixes an issue where the "inverted diagnostics" (i.e., the hint spans converted into diagnostic reports) cause issues in VS Code because the spans are not labeled. This happens to be the case in `no-non-null-asserted-optional-chain`: there are two diagnostic spans, but neither is labeled. This ends up creating "empty" diagnostics which cause problems. So, the fix is to simply skip creating the full diagnostic report when the message content is empty. The better fix for the future is to ensure we always label spans, as this also results in more helpful error messages.

This also re-adds the testing code which was reverted previously. I've hopefully reduced the flakiness of these tests by replacing more of the file path content to a static value.
@graphite-app graphite-app bot force-pushed the fix-empty-diagnostics branch from b48e8cc to 552aa58 Compare March 24, 2025 02:25
)

- fixes #9958
- reverts + fixes #9982

This PR fixes an issue where the "inverted diagnostics" (i.e., the hint spans converted into diagnostic reports) cause issues in VS Code because the spans are not labeled. This happens to be the case in `no-non-null-asserted-optional-chain`: there are two diagnostic spans, but neither is labeled. This ends up creating "empty" diagnostics which cause problems. So, the fix is to simply skip creating the full diagnostic report when the message content is empty. The better fix for the future is to ensure we always label spans, as this also results in more helpful error messages.

This also re-adds the testing code which was reverted previously. I've hopefully reduced the flakiness of these tests by replacing more of the file path content to a static value.
@graphite-app graphite-app bot force-pushed the fix-empty-diagnostics branch from 552aa58 to 2d7b0cf Compare March 24, 2025 02:27
@graphite-app graphite-app bot merged commit 2d7b0cf into main Mar 24, 2025
30 checks passed
@graphite-app graphite-app bot deleted the fix-empty-diagnostics branch March 24, 2025 02:35
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-editor Area - Editor and Language Server C-bug Category - Bug C-test Category - Testing. Code is missing test cases, or a PR is adding them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

editor: Presence of typescript-eslint(no-non-null-asserted-optional-chain) error causes errors not to be shown

2 participants