Check the CancellationToken in the DeclarePublicAPI analyzer
Related to issue #610. The DeclarePublicAPI analyzer loops over the set of AdditionalFiles looking for one named "PublicAPI.txt", and later loops through all the lines in that file. If there are a large number of AdditionalFiles, or the file contains a large number of lines (which is certainly the case for some of our projects) we may end up doing a lot of work even after analysis has been cancelled. This can happen during typing, where we may repeatedly cancel analysis and start again as the user is typing. We can potentially end up with a bunch of Tasks doing long-running but unnecessary work, consuming system resources and making VS less responsive. The fix here is to be aggressive about checking the CancellationToken while in these loops.
Showing
想要评论请 注册 或 登录