V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
wyc9296
V2EX  ›  Visual Studio Code

实现像 html li*3 这样自动展开的插件

  •  
  •   wyc9296 · 51 天前 · 917 次点击
    这是一个创建于 51 天前的主题,其中的信息可能已经有所发展或是发生改变。

    html 的 Emmet abbreviation expansion 的功能很酷! 比如说输入ul>li*3,会自动展开成

    <ul>
    	<li> </li>
    	<li> </li>
    	<li> </li>
    </ul>
    

    最新正在给新语言写一个代码提示插件,想引入这个功能,但是不想要 html 的标记符号,只需要类似于将abc*3展开成abcabcabc就行了,貌似 code snippet 不支持(如果支持操作符或者内嵌 js 就好了)吧?兄弟们有没有办法,求!

    2 条回复    2024-03-07 09:44:52 +08:00
    fyq
        1
    fyq  
       51 天前
    可以去 emmet 的源码那里改改:

    https://github.com/emmetio/emmet

    Platform for new tools
    Dig into Emmet source code and re-use its modules to create your very own and unique actions.
    wyc9296
        2
    wyc9296  
    OP
       51 天前
    @fyq 感谢大佬,只是有点难啊😂
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1900 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 21ms · UTC 16:15 · PVG 00:15 · LAX 09:15 · JFK 12:15
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.