V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
clino

有在代码注释里加上文件和文本的链接方便跳转的 vscode 插件吗?

  •  
  •   clino ·
    zhangchunlin · Mar 23, 2022 · 3566 views
    This topic created in 1496 days ago, the information mentioned may be changed or developed.
    主要是在不同类型的文件中跳转,比如在一个 html 模板文件里写上注释:
    <!-- filelink:app1/view.py#str="test_var_name"-->
    在 python 的 views 文件里写上注释
    # filelink:app1/template/test.html#str="test_var_name"
    按着 ctrl 点击就可以跳到目标文件的某个字符串或者某行上,如果能这样感觉会方便很多,现在这种跨语言的应该是不太可能能够跳转的吧。
    4 replies    2022-03-28 13:54:04 +08:00
    ChaosesIb
        1
    ChaosesIb  
       Mar 23, 2022
    不需要扩展,直接用 file 协议就行
    ```python
    # file:///C:/Temp/test.txt
    ```
    可以用相对或者绝对路径,Ctrl+左键 打开
    clino
        2
    clino  
    OP
       Mar 23, 2022
    @ChaosesIb 但是想跳到某一个字符串上或者某个行上用 file://就没办法了吧,找文件一般来说还是比较快的,但是跳到某一行需要翻来翻去
    lmoon
        3
    lmoon  
       Mar 23, 2022 via Android
    写一个就有了 doge
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1242 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 17:40 · PVG 01:40 · LAX 10:40 · JFK 13:40
    ♥ Do have faith in what you're doing.