macfanpl Posted April 15, 2020 Share Posted April 15, 2020 VSCode on Mac Coding in PHP file. When typing, InteliSense (or SSA) follows the cursor and display hints. Seems ok, but it displays many names that, once inserted into code, get strike-through (meaning they are deprecated. Would not be easier to remove them from IntelliSense rather than confusing others? When coding in other languages, deprecated names does not appear in IS. Its php-specific issue. Quote Link to comment Share on other sites More sharing options...
requinix Posted April 15, 2020 Share Posted April 15, 2020 Apparently the author of whatever PHP language server extension you're using decided that their list would show deprecated items and give you the choice of whether you used them. If you don't like that, see if there's a setting to hide them. Quote Link to comment Share on other sites More sharing options...
macfanpl Posted April 16, 2020 Author Share Posted April 16, 2020 @requinix yes I know, but whats rationale behind showing an deprecated entries? Quote Link to comment Share on other sites More sharing options...
kicken Posted April 16, 2020 Share Posted April 16, 2020 The rationale is that even though they are deprecated, they are technically still available to be used and someone may want/need to use them. I've used various libraries in the past that have created a new API and deprecated their old one. Usually updating to the new API isn't something that can be done right away so when I need to work on that code I'll need to continue to use those deprecated functions for a while. Not sure about VSCode but PHPStorm shows such functions with a strike-out in the autocomplete popup as well so you know right away that the function is deprecated. That lets you easily avoid them in new code but still have access to them when maintaining existing code. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.