VS Code Tips - Fix Multiline Comments in CSS/HTML

Pubblicato il: 26 marzo 2024
sul canale di: CSS Weekly
1,407
91

Visual Studio Code tip showing you how to fix broken block comments behavior in CSS/HTML when toggling a comment adds a new comment instead of uncommenting the focused comment.

EDIT: Jayden Pearse noted in the comments that you can use "resourceLangId" instead of "resourceExtname," which will also work on files without an extension, as long as the correct language (CSS or HTML) is detected or set manually.

BETTER When Expression: editorTextFocus && !editorReadonly && (resourceLangId == 'html' || resourceLangId == 'css')

When Expression shown in the video: editorTextFocus && !editorReadonly && (resourceExtname == '.css' || resourceExtname == '.html')

Subscribe to CSS Weekly Newsletter:
💌 https://css-weekly.com/

Help support my channel
👨‍🎓 Get a course: https://masteringlinting.com/
🪧 Buy a CSS sticker pack: https://stickers.css-weekly.com
💖 Support me on Patreon:   / cssweekly  

📖 Chapters
00:00 Problem with block comments in VS Code
01:39 Use Emmet to toggle block comments in CSS/HTML
02:23 Add Keyboard Shortcut to “Emmet: Toggle Comment” command
03:33 Restrict Keyboard Shortcut to CSS & HTML files
06:49 Why you should use Emmet Toggle Comments command in VS Code

Keep up-to-date with CSS Weekly:
🐦 Twitter:   / @cssweekly  
🎶 TikTok:   / cssweekly  
🎇 Instagram:   / cssweekly  
📘 Facebook:   / cssweekly  

Keep up to date with what I'm up to:
👨‍💼 Blog: https://zoranjambor.com
💼 LinkedIn:   / zoranjambor  

Zoran Jambor
#css #vscode


In questa pagina del sito puoi guardare il video online VS Code Tips - Fix Multiline Comments in CSS/HTML della durata di ore minuti seconda in buona qualità , che l'utente ha caricato CSS Weekly 26 marzo 2024, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 1,407 volte e gli è piaciuto 91 spettatori. Buona visione!