samleong019

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

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

    可以实现和 webstorm 一样的效果
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4430 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 01:18 · PVG 09:18 · LAX 17:18 · JFK 20:18
    ♥ Do have faith in what you're doing.