Skip to content

feat: ability to ignore diagnostics by code #272

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

Merged
merged 2 commits into from
Nov 13, 2021
Merged

Conversation

rchl
Copy link
Member

@rchl rchl commented Oct 18, 2021

Fixes #166

@predragnikolic
Copy link
Contributor

predragnikolic commented Oct 19, 2021

IMO, I think that this logic should be implemented on the client side.

In the LSP spec, a diagnostic can have a code property:

export interface Diagnostic {
	/**
	 * The diagnostic's code, which might appear in the user interface.
	 */
	code?: integer | string;
} 

Why?

It makes more sense to filtering diagnostics by the code on the client,
because than all servers do not have to implement their own way of filtering diagnostics by code. (keep in mind that there are less clients, than servers)

@rchl
Copy link
Member Author

rchl commented Oct 20, 2021

Valid point. I guess I will drop it unless someone else some good arguments for having it.

@rchl rchl closed this Nov 8, 2021
@rchl rchl reopened this Nov 13, 2021
@rchl
Copy link
Member Author

rchl commented Nov 13, 2021

I'll go with that after all.

Asking all clients to support that takes quite some effort and convincing and it's not even clear if client authors would want to implement that.

And fixing will close a bunch of issues. :)

@predragnikolic
Copy link
Contributor

It's not even clear if client authors would want to implement that.

Yes, it is true that it is not specified in the spec.

Clients already implemented the ability to filter out diagnostics by severity to only show errors and warnings, and hide info, and hints.
That is also not defined in the spec, but yet it made sense for the client to do it.

I do not have anything again this PR,
if this fixes a lot of issues now, why not merge it? :)

@rchl
Copy link
Member Author

rchl commented Nov 13, 2021

Yes, it is true that it is not specified in the spec.

I did not make such argument. :)

if this fixes a lot of issues now, why not merge it? :)

Well, I guess only this one #142 :P

But still, it's low effort, hopefully no maintenance feature so I don't mind.

@rchl rchl merged commit 3c00910 into master Nov 13, 2021
@rchl rchl deleted the feat/ignore-diagnostics branch November 13, 2021 20:32
@drahnieR
Copy link

drahnieR commented Nov 25, 2021

Quite a lot people are suffering from microsoft/vscode#47299 I think

Since that thread is locked, can I link it here to give some hits for folks over there?
Seems that what locked is locked :(

@jacobchrismarsh
Copy link

n00b question @rchl: where exactly can I add this setting? I've tried my projects tsconfig.json, but that wasn't it. I use coc-tsserver, but I didn't see the option there either.

@predragnikolic
Copy link
Contributor

@jacobchrismarsh coc-tsserver doesn't use this package.
Instead it has ots own implementation for communicating with the tsserver.

@jacobchrismarsh
Copy link

@jacobchrismarsh coc-tsserver doesn't use this package. Instead it has ots own implementation for communicating with the tsserver.

Ah, that makes sense. Alright then! Thanks, for the info @predragnikolic

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.

how to disable this may be converted to async function error
4 participants