-
Notifications
You must be signed in to change notification settings - Fork 34.6k
feat(Diagnostics): Add proposed DiagnosticTag.Deprecated enum member #77760
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
feat(Diagnostics): Add proposed DiagnosticTag.Deprecated enum member #77760
Conversation
@sandy081 @jrieken I'm still trying to understand the different aspects of this. I added Am I understanding that correctly? If so, I can revert those two changes. Plus, limiting to just adding the new proposed enum member will be closer to the exact purpose of #56694 |
@kamranayub both requests, #56694 and #50972, are independent and need separate solutions. Having |
Thanks for clarifying. I will revert the two Marker changes. |
Not sure why you did that. Your change is now exposing a new enum member but it's not being used anywhere, e.g. it's not being translated into our "internal" API which is |
Ah, I assumed |
@jrieken Brought those changes back. Is the next step to try and perform some rendering using this new API or just add a test case for mapping the |
👍 the whole thing |
Making progress. Rendering Rendering Both examples above are NOT actually implemented with the language provider, they are just hardcoded to include deprecated tag or set diff --git a/extensions/typescript-language-features/src/features/completions.ts b/extensions/typescript-language-features/src/features/completions.ts
index fdfabd4365..89e80b8319 100644
--- a/extensions/typescript-language-features/src/features/completions.ts
+++ b/extensions/typescript-language-features/src/features/completions.ts
@@ -50,6 +50,9 @@ class MyCompletionItem extends vscode.CompletionItem {
) {
super(tsEntry.name, MyCompletionItem.convertKind(tsEntry.kind));
+ // TODO: Remove
+ this.deprecated = true;
+
if (tsEntry.source) {
// De-prioritze auto-imports
// https://github.com/Microsoft/vscode/issues/40311
diff --git a/extensions/typescript-language-features/src/typeScriptServiceClientHost.ts b/extensions/typescript-language-features/src/typeScriptServiceClientHost.ts
index 2571d395a5..7a88de73fe 100644
--- a/extensions/typescript-language-features/src/typeScriptServiceClientHost.ts
+++ b/extensions/typescript-language-features/src/typeScriptServiceClientHost.ts
@@ -261,6 +261,7 @@ export default class TypeScriptServiceClientHost extends Disposable {
if (diagnostic.reportsUnnecessary) {
converted.tags = [vscode.DiagnosticTag.Unnecessary];
}
+ converted.tags = [vscode.DiagnosticTag.Deprecated];
(converted as vscode.Diagnostic & { reportUnnecessary: any }).reportUnnecessary = diagnostic.reportsUnnecessary;
return converted as vscode.Diagnostic & { reportUnnecessary: any };
} |
Please do not mix both features into one PR, please extract the changes for the completion item into a separate PR. Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one PR, one feature request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The diagnostics tag changes look good to me
@kamranayub fyi - I have moved the completion related commits into https://github.com/microsoft/vscode/tree/joh/completionsDeprecated. There is some little work left there and I would appreciate another PR off that |
This works like a charm. Thanks @kamranayub |
Merged despite an open question regarding the use of both tags, today deprecated will overrule unnecessary. Let's wait for the bug |
Closes #56694
Relates to #50972
Changes
DiagnosticTag.Deprecated
memberMarkerTag.Deprecated
TODO