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

IntelliSense: Support @deprecated tag #9255

Closed
Zlatkovsky opened this issue Jun 19, 2016 · 3 comments
Closed

IntelliSense: Support @deprecated tag #9255

Zlatkovsky opened this issue Jun 19, 2016 · 3 comments
Labels
Duplicate An existing issue was already created

Comments

@Zlatkovsky
Copy link
Member

Suppose that I am a library author, and in V1.0 of my APIs I have the following method signature:

namespace MyLibrary {
    export class SomeObject {
        foo(text: string): void { 
            alert(text); 
        }
    }   
}

After my V1.0 API is released, I receive feedback that foo wasn't that descriptive of a name (should have used bar!)... or perhaps that I should instead have made it a static method off of MyLibrary, such as MyLibrary.performFoo(new SomeObject());.

Based on that feedback, I wish I would have named the method differently, so that new users of my V1.1+ API and above never see foo, but see my new and improved API signature instead. On the other hand, I certainly don't want to break the compilation of existing projects that use foo.

Suggestion: In the ideal world, I wish I could add a @deprecated tag to foo that would be recognized by the TypeScript compiler / language service, and where the behavior would be:

  • foo is not visible by default in the SomeObject's IntelliSense, but continues to be usable by the compiler.
  • [As icing on the cake]: foo's declaration does show up if the developer has already typed the complete method's name (i.e., new MyLibrary.SomeObject().foo), so that -- in pressing ctrl+space -- he/she can still see foo's parameters, if they're already using the deprecated version of the function (and that way, too, they can see the @deprecated tag, along with a library-author-supplied description of what new method to use instead).
@aluanhaddad
Copy link
Contributor

@Zlatkovsky you may be interested in #2900

@DickvdBrink
Copy link
Contributor

Refs #390

@mhegazy
Copy link
Contributor

mhegazy commented Jun 22, 2016

closing in favor of #390

@mhegazy mhegazy closed this as completed Jun 22, 2016
@mhegazy mhegazy added the Duplicate An existing issue was already created label Jun 22, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

4 participants