Skip to content

Conversation

@Kingwl
Copy link
Contributor

@KingwlKingwl commented May 13, 2020

Fixes#390
Fixes#33092
Fixes#33093

After read the codebase, I found below things need todo:

  • completions with symbol tag

  • workspace symbol with symbol tag

  • document symbol with symbol tag

  • call hierarchy with symbol tag

  • DiagnosticTags

current state:
222

TIM截图20200514183407
TIM截图20200514183420
TIM截图20200514184807
TIM截图20200518150229

image

Others need to do:

  • protocol
  • reports deprecated diag
  • confirm where's the line
  • confirm the place where report suggestion is correct
  • tests

@typescript-bot
Copy link
Collaborator

Thanks for the PR! It looks like you've changed the TSServer protocol in some way. Please ensure that any changes here don't break consumers of the current TSServer API. For some extra review, we'll ping @sheetalkamat, @amcasey, @mjbvz, @minestarks for you. Feel free to loop in other consumers/maintainers if necessary

@Kingwl
Copy link
ContributorAuthor

@typescript-bot pack this.

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 13, 2020

Heya @Kingwl, I've started to run the tarball bundle task on this PR at 9185734. You can monitor the build here.

@KingwlKingwl changed the title Add deprecated related feature[Expirement] [WIP] Add deprecated related featureMay 13, 2020
@KingwlKingwl mentioned this pull request May 13, 2020
@Kingwl
Copy link
ContributorAuthor

@typescript-bot pack this.

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 13, 2020

Heya @Kingwl, I've started to run the tarball bundle task on this PR at 726b933. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 13, 2020

Hey @Kingwl, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{"devDependencies":{"typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/73795/artifacts?artifactName=tgz&fileId=744B1D71C0DD25EAC199979B809F997229EB4AB80010D5B25D42E3374ABD21EE02&fileName=/typescript-4.0.0-insiders.20200513.tgz" } } 

and then running npm install.


There is also a playground for this build.

@Kingwl
Copy link
ContributorAuthor

Kingwl commented May 14, 2020

Ping, need some help. Please take a look
@sheetalkamat, @amcasey, @mjbvz, @minestarks, @DanielRosenwasser

@Kingwl
Copy link
ContributorAuthor

Another problem is, where's the line:

a.b.c.d// c is deprecated

What is the expected behavior?

  1. [a.b.c].d
  2. a.b.[c].d
  3. a.b.[c.d]

And if:

a.b.c.d// c and d is deprecated

What is the expected behavior

  1. [a.b.c.d]
  2. a.b.[c].[d]
  3. a.b.[c.d]

@amcasey
Copy link
Member

@Kingwl, sorry, I'm not sure I understand your question. Are you asking about the design of the features? If so, you probably want @sandersn.

@sandersnsandersn self-assigned this May 14, 2020
@Kingwl
Copy link
ContributorAuthor

Does the protocol looks good?I'm not sure🤷‍♂️

@spahnke
Copy link

I believe this would also fix #33093

@Kingwl
Copy link
ContributorAuthor

Finally, It passed tests. I'll add more tests soon.
@typescript-bot pack this.

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 18, 2020

Heya @Kingwl, I've started to run the tarball bundle task on this PR at ceeaead. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 18, 2020

Hey @Kingwl, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{"devDependencies":{"typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/74212/artifacts?artifactName=tgz&fileId=2056AC579024F64F4D733979778E0700E6D317EE140EA5F9D238E4B88C38090F02&fileName=/typescript-4.0.0-insiders.20200518.tgz" } } 

and then running npm install.


There is also a playground for this build.

}
}

symbol.isDeprecated = symbol.isDeprecated || isDeprecated;
Copy link
Member

Choose a reason for hiding this comment

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

SHould this be SymbolFlags instead?

Copy link
Member

Choose a reason for hiding this comment

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

I agree -- if there's space there. I think the limit is 29 so there's 1 left.

Copy link
Member

Choose a reason for hiding this comment

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

Alternatively, making this a ModifierFlag would go well with public/@public et al. It would also go better with getNodeModifiers in services.

@typescript-bot
Copy link
Collaborator

@Kingwl
The results of the perf run you requested are in!

Here they are:

Comparison Report - master..38523

Metricmaster38523DeltaBestWorst
Angular - node (v10.16.3, x64)
Memory used340,211k (± 0.02%)339,838k (± 0.02%)-373k (- 0.11%)339,673k339,959k
Parse Time1.98s (± 0.59%)1.98s (± 0.70%)+0.00s (+ 0.00%)1.94s2.01s
Bind Time0.81s (± 1.32%)0.80s (± 0.59%)-0.00s (- 0.37%)0.79s0.81s
Check Time4.68s (± 0.56%)4.71s (± 0.57%)+0.02s (+ 0.51%)4.65s4.79s
Emit Time5.21s (± 0.79%)5.18s (± 0.41%)-0.03s (- 0.52%)5.13s5.22s
Total Time12.67s (± 0.48%)12.66s (± 0.38%)-0.01s (- 0.05%)12.57s12.79s
Monaco - node (v10.16.3, x64)
Memory used338,724k (± 0.01%)338,774k (± 0.02%)+50k (+ 0.01%)338,667k338,949k
Parse Time1.55s (± 0.69%)1.55s (± 0.62%)-0.00s (- 0.19%)1.52s1.57s
Bind Time0.69s (± 0.58%)0.69s (± 0.69%)-0.00s (- 0.29%)0.68s0.70s
Check Time4.85s (± 0.56%)4.84s (± 0.49%)-0.01s (- 0.12%)4.78s4.88s
Emit Time2.75s (± 0.49%)2.73s (± 0.55%)-0.01s (- 0.55%)2.70s2.76s
Total Time9.83s (± 0.38%)9.80s (± 0.23%)-0.03s (- 0.25%)9.73s9.85s
TFS - node (v10.16.3, x64)
Memory used301,536k (± 0.02%)301,848k (± 0.03%)+312k (+ 0.10%)301,663k302,032k
Parse Time1.21s (± 1.09%)1.21s (± 0.91%)-0.00s (- 0.08%)1.18s1.22s
Bind Time0.64s (± 1.47%)0.65s (± 1.39%)+0.01s (+ 0.78%)0.62s0.66s
Check Time4.35s (± 0.66%)4.35s (± 0.44%)+0.00s (+ 0.07%)4.32s4.40s
Emit Time2.85s (± 0.97%)2.87s (± 1.34%)+0.02s (+ 0.56%)2.77s2.94s
Total Time9.04s (± 0.58%)9.07s (± 0.53%)+0.03s (+ 0.29%)8.95s9.21s
material-ui - node (v10.16.3, x64)
Memory used459,155k (± 0.02%)459,128k (± 0.01%)-26k (- 0.01%)459,009k459,276k
Parse Time2.02s (± 0.52%)2.03s (± 0.52%)+0.00s (+ 0.15%)2.01s2.05s
Bind Time0.64s (± 1.32%)0.65s (± 1.35%)+0.01s (+ 2.19%)0.64s0.67s
Check Time12.80s (± 0.71%)12.85s (± 0.57%)+0.05s (+ 0.43%)12.69s13.00s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time15.46s (± 0.63%)15.53s (± 0.54%)+0.07s (+ 0.47%)15.38s15.72s
Angular - node (v12.1.0, x64)
Memory used317,588k (± 0.03%)317,116k (± 0.09%)-472k (- 0.15%)316,034k317,351k
Parse Time1.95s (± 0.39%)1.93s (± 0.75%)-0.02s (- 1.28%)1.90s1.96s
Bind Time0.78s (± 0.57%)0.78s (± 0.67%)-0.00s (- 0.13%)0.77s0.79s
Check Time4.57s (± 0.58%)4.59s (± 0.63%)+0.02s (+ 0.35%)4.53s4.65s
Emit Time5.32s (± 0.53%)5.31s (± 1.00%)-0.01s (- 0.23%)5.21s5.46s
Total Time12.63s (± 0.37%)12.61s (± 0.68%)-0.03s (- 0.20%)12.45s12.84s
Monaco - node (v12.1.0, x64)
Memory used321,236k (± 0.02%)321,314k (± 0.02%)+79k (+ 0.02%)321,184k321,497k
Parse Time1.52s (± 0.60%)1.51s (± 1.00%)-0.01s (- 0.66%)1.48s1.54s
Bind Time0.67s (± 0.60%)0.68s (± 1.01%)+0.00s (+ 0.60%)0.66s0.69s
Check Time4.65s (± 0.44%)4.63s (± 0.37%)-0.02s (- 0.37%)4.60s4.66s
Emit Time2.81s (± 0.44%)2.80s (± 0.58%)-0.02s (- 0.53%)2.76s2.83s
Total Time9.65s (± 0.28%)9.61s (± 0.18%)-0.04s (- 0.38%)9.57s9.65s
TFS - node (v12.1.0, x64)
Memory used285,983k (± 0.02%)286,294k (± 0.02%)+311k (+ 0.11%)286,197k286,394k
Parse Time1.22s (± 0.79%)1.23s (± 1.02%)+0.00s (+ 0.33%)1.20s1.26s
Bind Time0.61s (± 0.97%)0.62s (± 1.33%)+0.01s (+ 1.63%)0.60s0.64s
Check Time4.25s (± 0.54%)4.25s (± 0.39%)+0.00s (+ 0.12%)4.22s4.30s
Emit Time2.90s (± 0.69%)2.91s (± 1.02%)+0.00s (+ 0.07%)2.83s2.97s
Total Time8.99s (± 0.43%)9.00s (± 0.44%)+0.02s (+ 0.20%)8.90s9.09s
material-ui - node (v12.1.0, x64)
Memory used437,736k (± 0.02%)437,626k (± 0.01%)-110k (- 0.03%)437,520k437,782k
Parse Time1.99s (± 0.58%)2.01s (± 0.76%)+0.02s (+ 0.95%)1.99s2.05s
Bind Time0.63s (± 0.98%)0.63s (± 1.05%)-0.00s (- 0.16%)0.61s0.64s
Check Time11.45s (± 0.52%)11.45s (± 0.56%)+0.00s (+ 0.04%)11.34s11.66s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time14.07s (± 0.41%)14.09s (± 0.42%)+0.02s (+ 0.16%)14.01s14.28s
Angular - node (v8.9.0, x64)
Memory used336,631k (± 0.02%)336,369k (± 0.02%)-262k (- 0.08%)336,259k336,489k
Parse Time2.49s (± 0.57%)2.49s (± 0.73%)+0.00s (+ 0.12%)2.46s2.54s
Bind Time0.83s (± 0.60%)0.83s (± 0.70%)+0.01s (+ 0.97%)0.82s0.84s
Check Time5.31s (± 0.50%)5.36s (± 0.60%)+0.05s (+ 0.88%)5.27s5.44s
Emit Time5.90s (± 1.04%)5.97s (± 1.06%)+0.07s (+ 1.20%)5.83s6.10s
Total Time14.53s (± 0.46%)14.65s (± 0.62%)+0.13s (+ 0.87%)14.49s14.85s
Monaco - node (v8.9.0, x64)
Memory used340,066k (± 0.01%)340,145k (± 0.01%)+79k (+ 0.02%)340,063k340,233k
Parse Time1.85s (± 0.57%)1.85s (± 0.48%)+0.00s (+ 0.22%)1.84s1.88s
Bind Time0.86s (± 0.46%)0.86s (± 0.52%)+0.00s (+ 0.12%)0.85s0.87s
Check Time5.33s (± 0.38%)5.33s (± 0.53%)+0.00s (+ 0.08%)5.29s5.39s
Emit Time3.21s (± 0.53%)3.20s (± 0.54%)-0.01s (- 0.19%)3.17s3.24s
Total Time11.25s (± 0.24%)11.25s (± 0.42%)+0.00s (+ 0.03%)11.15s11.36s
TFS - node (v8.9.0, x64)
Memory used303,226k (± 0.01%)303,498k (± 0.01%)+272k (+ 0.09%)303,431k303,576k
Parse Time1.54s (± 0.26%)1.54s (± 0.50%)+0.00s (+ 0.00%)1.53s1.56s
Bind Time0.65s (± 0.76%)0.65s (± 0.53%)+0.00s (+ 0.15%)0.64s0.65s
Check Time4.96s (± 1.74%)4.93s (± 1.80%)-0.03s (- 0.54%)4.81s5.13s
Emit Time3.05s (± 3.38%)3.06s (± 3.18%)+0.01s (+ 0.46%)2.81s3.24s
Total Time10.19s (± 0.61%)10.19s (± 0.53%)-0.01s (- 0.06%)10.09s10.33s
material-ui - node (v8.9.0, x64)
Memory used463,424k (± 0.01%)463,232k (± 0.01%)-191k (- 0.04%)463,123k463,335k
Parse Time2.35s (± 0.51%)2.37s (± 0.49%)+0.01s (+ 0.55%)2.34s2.39s
Bind Time0.76s (± 0.81%)0.77s (± 0.87%)+0.01s (+ 0.79%)0.76s0.78s
Check Time16.97s (± 0.50%)16.94s (± 0.88%)-0.03s (- 0.17%)16.61s17.28s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time20.08s (± 0.42%)20.07s (± 0.71%)-0.01s (- 0.05%)19.77s20.40s
Angular - node (v8.9.0, x86)
Memory used193,160k (± 0.01%)193,040k (± 0.02%)-120k (- 0.06%)192,942k193,128k
Parse Time2.42s (± 0.70%)2.41s (± 0.65%)-0.01s (- 0.37%)2.38s2.45s
Bind Time0.97s (± 0.57%)0.97s (± 0.85%)+0.00s (+ 0.21%)0.95s0.99s
Check Time4.78s (± 0.54%)4.78s (± 0.55%)+0.00s (+ 0.02%)4.73s4.84s
Emit Time5.98s (± 1.03%)5.88s (± 1.07%)-0.10s (- 1.70%)5.71s5.98s
Total Time14.15s (± 0.57%)14.04s (± 0.43%)-0.11s (- 0.76%)13.85s14.17s
Monaco - node (v8.9.0, x86)
Memory used193,139k (± 0.02%)193,179k (± 0.01%)+40k (+ 0.02%)193,126k193,241k
Parse Time1.89s (± 1.30%)1.89s (± 0.68%)-0.01s (- 0.37%)1.85s1.91s
Bind Time0.68s (± 0.59%)0.68s (± 0.70%)-0.00s (- 0.29%)0.67s0.69s
Check Time5.40s (± 1.97%)5.45s (± 0.37%)+0.05s (+ 0.96%)5.41s5.50s
Emit Time2.76s (± 3.52%)2.67s (± 0.82%)🟩-0.09s (- 3.23%)2.62s2.73s
Total Time10.72s (± 0.53%)10.68s (± 0.24%)-0.04s (- 0.40%)10.63s10.73s
TFS - node (v8.9.0, x86)
Memory used173,321k (± 0.02%)173,512k (± 0.02%)+191k (+ 0.11%)173,448k173,642k
Parse Time1.58s (± 1.03%)1.58s (± 0.73%)-0.01s (- 0.38%)1.55s1.60s
Bind Time0.62s (± 1.08%)0.61s (± 0.73%)-0.00s (- 0.81%)0.60s0.62s
Check Time4.61s (± 0.44%)4.61s (± 0.68%)0.00s ( 0.00%)4.56s4.70s
Emit Time2.78s (± 1.33%)2.78s (± 1.18%)+0.00s (+ 0.14%)2.70s2.88s
Total Time9.59s (± 0.43%)9.59s (± 0.54%)-0.01s (- 0.08%)9.49s9.70s
material-ui - node (v8.9.0, x86)
Memory used262,246k (± 0.02%)262,174k (± 0.02%)-72k (- 0.03%)262,061k262,249k
Parse Time2.42s (± 0.62%)2.43s (± 0.52%)+0.00s (+ 0.21%)2.39s2.45s
Bind Time0.66s (± 1.34%)0.66s (± 0.89%)+0.01s (+ 1.07%)0.65s0.68s
Check Time15.48s (± 0.68%)15.46s (± 0.91%)-0.02s (- 0.13%)15.22s15.95s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time18.56s (± 0.64%)18.56s (± 0.74%)-0.01s (- 0.03%)18.32s19.02s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-166-generic
Architecturex64
Available Memory16 GB
Available Memory1 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v8.9.0, x64)
  • node (v8.9.0, x86)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v8.9.0, x64)
  • Angular - node (v8.9.0, x86)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v8.9.0, x64)
  • Monaco - node (v8.9.0, x86)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v8.9.0, x64)
  • TFS - node (v8.9.0, x86)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • material-ui - node (v8.9.0, x64)
  • material-ui - node (v8.9.0, x86)
BenchmarkNameIterations
Current3852310
Baselinemaster10

Copy link
Member

@sandersnsandersn left a comment

Choose a reason for hiding this comment

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

So to recap: we now have NodeFlags.Deprecated, SymbolFlags.Deprecated and ModifierFlags.Deprecated.

I would say we are well-positioned to deprecate things now. =)

@sandersnsandersn merged commit 59ad375 into microsoft:masterJun 19, 2020
@sandersn
Copy link
Member

It's in! Thanks so much for your persistence @Kingwl!

@G-Rath
Copy link

G-Rath commented Jun 19, 2020

I've not followed this feature much, so while I've done a quick read over the discussions, linked tickets & searched the issue tracker I still could have missed something or misunderstood entirely, but just in case:

Has anyone raised the behaviour of removeComments in regards to this feature? I know a few libraries that use that flag, and so this feature is a bit moot if it removes @deprecated comments.

Happy to open a new issue for discussion.


Just found #14619, which would resolve this problem.

@KingwlKingwl deleted the deprecated_support branch June 19, 2020 02:57
@Kingwl
Copy link
ContributorAuthor

@typescript-bot pack this.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 19, 2020

Heya @Kingwl, I've started to run the tarball bundle task on this PR at 6434447. You can monitor the build here.

@brabenetz
Copy link

brabenetz commented Aug 31, 2020

Does it works with a comment which explain why something is deprecated?
I saw not a singe example with a comment!?
Like:

/** @deprecated replaced by new method .... */ public myOldMethod(){... 

VSCode should than show that message.
And tslint should enforce a comment.

lukmccall pushed a commit to expo/expo that referenced this pull request Sep 1, 2020
# Why _This follows the TS 4.0 update PR: #9960_ Typescript 4.0 comes with support for `@deprecated` annotations, which gives nice VS Code (and probably other IDE) messages informing users about API deprecation. It also marks deprecated methods/properties with ~~Strikethrough~~. See [this](https://devblogs.microsoft.com/typescript/announcing-typescript-4-0/#deprecated-support) and microsoft/TypeScript#38523 # How - Added appropriate annotations to every possible deprecated Expo API that I found. - Updated existing comments to play nice with VS Code messages Also, added note about dead code in Notifications, which is related to #9563 (I forgot to add it then) > Not sure what to do with changelogs ❓ # Test Plan Tested messages in VS Code with _TS 4.0.2_ enabled.
@Kingwl
Copy link
ContributorAuthor

image

Seems work for me

Jamedjo pushed a commit to Jamedjo/expo that referenced this pull request Feb 4, 2021
# Why _This follows the TS 4.0 update PR: #9960_ Typescript 4.0 comes with support for `@deprecated` annotations, which gives nice VS Code (and probably other IDE) messages informing users about API deprecation. It also marks deprecated methods/properties with ~~Strikethrough~~. See [this](https://devblogs.microsoft.com/typescript/announcing-typescript-4-0/#deprecated-support) and microsoft/TypeScript#38523 # How - Added appropriate annotations to every possible deprecated Expo API that I found. - Updated existing comments to play nice with VS Code messages Also, added note about dead code in Notifications, which is related to expo#9563 (I forgot to add it then) > Not sure what to do with changelogs ❓ # Test Plan Tested messages in VS Code with _TS 4.0.2_ enabled.
@paulyoung
Copy link

Is there a way to suppress this warning using // eslint-disable-next-line or similar?

Eric-Tyrrell22 pushed a commit to Eric-Tyrrell22/expo that referenced this pull request Aug 14, 2025
# Why _This follows the TS 4.0 update PR: #9960_ Typescript 4.0 comes with support for `@deprecated` annotations, which gives nice VS Code (and probably other IDE) messages informing users about API deprecation. It also marks deprecated methods/properties with ~~Strikethrough~~. See [this](https://devblogs.microsoft.com/typescript/announcing-typescript-4-0/#deprecated-support) and microsoft/TypeScript#38523 # How - Added appropriate annotations to every possible deprecated Expo API that I found. - Updated existing comments to play nice with VS Code messages Also, added note about dead code in Notifications, which is related to expo#9563 (I forgot to add it then) > Not sure what to do with changelogs ❓ # Test Plan Tested messages in VS Code with _TS 4.0.2_ enabled.
kosmydel pushed a commit to kosmydel/expo-quest that referenced this pull request Sep 15, 2025
# Why _This follows the TS 4.0 update PR: #9960_ Typescript 4.0 comes with support for `@deprecated` annotations, which gives nice VS Code (and probably other IDE) messages informing users about API deprecation. It also marks deprecated methods/properties with ~~Strikethrough~~. See [this](https://devblogs.microsoft.com/typescript/announcing-typescript-4-0/#deprecated-support) and microsoft/TypeScript#38523 # How - Added appropriate annotations to every possible deprecated Expo API that I found. - Updated existing comments to play nice with VS Code messages Also, added note about dead code in Notifications, which is related to #9563 (I forgot to add it then) > Not sure what to do with changelogs ❓ # Test Plan Tested messages in VS Code with _TS 4.0.2_ enabled.
@microsoftmicrosoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

ExperimentA fork with an experimental idea which might not make it into masterFor Backlog BugPRs that fix a backlog bug

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Render uses of deprecated symbols Mark deprecated suggestion @‌deprecated JSDoc tag

11 participants

@Kingwl@typescript-bot@amcasey@spahnke@sandersn@RyanCavanaugh@G-Rath@brabenetz@paulyoung@DanielRosenwasser@sheetalkamat