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

Treat diagnostics as separate entity from stdout/stderr #127

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

benjreinhart
Copy link
Contributor

This PR sends tsserver diagnostics over a separate websocket event as a rich diagnostic object rather than a string message. This paves the way to do things like add squiggly lines under sections with errors, or highlight lines with errors.

I made one other change in this PR which has bugged me for a while: When you clear output, you should only be clearing the output of the current tab, not all tabs, which is confusing and annoying if you didn't mean to do that.

@benjreinhart benjreinhart requested a review from nichochar July 11, 2024 21:27
@@ -66,9 +69,9 @@ export function CellStdio({ cell, show, setShow }: PropsType) {
'border-transparent data-[state=active]:border-transparent data-[state=active]:text-tertiary-foreground mb-0',
)}
>
{tscOutput.length > 0 ? (
{diagnostics.length > 0 ? (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We call this "problems" but right now we're sending all diagnostics to this tab. That includes warnings and suggestions. So... TODO: rework "Problems" tab to be something like "Diagnostics" which has different categories of diagnostics (error, warning, suggestion)

@benjreinhart benjreinhart merged commit 00b7afa into main Jul 11, 2024
1 check passed
@benjreinhart benjreinhart deleted the diagnostic-cell-output branch July 11, 2024 21:31
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