microsoft / microsoft/TypeScript

[Typescript] Give a visual indicator when overriding methods with the `@sealed` js/tsdoc annotation

Open
#62,076 0 comments 5 reactions 0 assignees View on GitHub
Awaiting More Feedback Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

I notice that vscode has builtin support for reading the `@deprecated` jsdoc / tsdoc annotation that can appear on methods and variables, which causes them to appear with a strikethrough.

Image

It would be useful if there was a similar visual indicator when a subclass attempts to override a method that is marked as [`@sealed`](https://tsdoc.org/pages/tags/sealed/) in its superclass, or when it tries to inherit from a `sealed` superclass. (not a strikethrough, but perhaps squiggles, or any kind of feedback).

Given that there is already machinery that looks through the class hierarchy to determine that a field defined in a parent class is marked as deprecated, I would presume it wouldn't be that difficult to also identify the `@sealed` annotation.

Contributor guide

Open the contributing guide

Research direction

Start by locating the existing handling for @deprecated annotations and the class-hierarchy lookup mentioned in the issue. Determine how @sealed is represented and where override or inheritance feedback is produced; done means a subclass overriding a sealed method or inheriting from a sealed superclass receives a visible diagnostic or indicator.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.