samleong019

vscode 怎么实现类似 webstorm 上 console.log 的 autocomplete 呢

  •  
  •   samleong019 · Oct 10, 2018 · 5519 views
    This topic created in 2799 days ago, the information mentioned may be changed or developed.

    在 webstorm 上,输入 a.log 按 tab 后会扩展为 console.log(a) 输出多个变量的时候,可以 a, b, c.log 也会转为 console.log(a, b, c) 这个功能习惯后是非常顺手的,在 vscode 上,用 snippets 怎么实现这个功能呢

    6 replies    2021-12-15 21:00:08 +08:00
    cyberpoint
        1
    cyberpoint  
       Oct 10, 2018
    兄弟,你可能要改变一下调试习惯,尽量减少使用 console 调试。
    TabGre
        2
    TabGre  
       Oct 11, 2018 via iPhone
    @cyberpoint 那应该怎么调试呀?真心请教,输入 debugger 吗?
    ZxBing0066
        3
    ZxBing0066  
       Oct 11, 2018
    ...直接 log snippet console.log($1) 就行了吧
    Ethan92
        4
    Ethan92  
       Jan 15, 2019
    我也遇到这个问题,解决办法是用会 webstorm🤨
    Ethan92
        5
    Ethan92  
       Jan 15, 2019
    vscode 自己设置 snippet 最多只能输入.log 按 tab 出来 console.log(),没法把.log 前的内容自动放到括号里
    jaluik
        6
    jaluik  
       Dec 15, 2021
    我也遇到了这个问题,然后写了一个很轻量的 vscode 插件:Dot Log

    可以实现和 webstorm 一样的效果
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5837 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 02:00 · PVG 10:00 · LAX 19:00 · JFK 22:00
    ♥ Do have faith in what you're doing.