💡 参考文章见Ref,感谢提供思路!
🗺️当前这篇博文地址:https://myoontyee.github.io/article/18239a06.html
⚠️警告:博客文章禁止一切形式的非授权非法转载!
⚠️Attention: All forms of unauthorized illegal reposts are prohibited !

创建时间:2022年4月28日19:18:45
最新更新:2022年4月30日12:34:30


Problem Description:Visual Studio Code Comment plugin recommended configuration combination, does it enable fast code jumping within VS Code + multi-level beautiful comments?

核心思路

  • 几个插件
    • 快速跳转Comment Anchors
    • 代码注释分段Comment Divider
    • 代码Box注释Box Comment
      • Comment Box也行,就是感觉效果有待提高
  • 按位置分
    • 功能块头用Box Comment+Comment Anchors注释并设定锚点
    • 内容分段用Comment Divider

插件介绍

实现

  • 现希望实现区分功能头与内容分段的代码注释,如

    • 代码块名字是Function 1
    • 代码块的锚点是ANCHOR: Function 1
    • 代码块有3段
      • 功能段1Abi.1
      • 功能段2Abi.2
      • 功能段3Abi.3
  • 注释实现

    • 功能块头用Box Comment
    • 锚点用Comment Anchors
    • 内容分段用Comment Divider
  • 实现步骤如下几图

    • 前面代码行数是个示例,不用管
    • 按快捷键Ctrl+Shift+;
    • 功能块StartShift+Alt+X
    • 功能块EndAlt+X
    • 得到下下图
  • 实现效果如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* 

╔═════════════════════════════════════════════════════╗
║ Function 1 ║
╠═════════════════════════════════════════════════════╣
║ ANCHOR: Function 1 ║
╚═════════════════════════════════════════════════════╝

*/
/* -------------------------------------------------------------------------- */
/* Abi.1 Start */
/* -------------------------------------------------------------------------- */
G4cout << "Abi.1" << G4endl;
/* -------------------------------- Abi.1 End ------------------------------- */



/* -------------------------------------------------------------------------- */
/* Abi.2 Start */
/* -------------------------------------------------------------------------- */
G4cout << "Abi.2" << G4endl;
/* -------------------------------- Abi.2 End ------------------------------- */




/* -------------------------------------------------------------------------- */
/* Abi.3 Start */
/* -------------------------------------------------------------------------- */
G4cout << "Abi.3" << G4endl;
/* -------------------------------- Abi.3 End ------------------------------- */

  • 包含的锚点在这
    • 锚点插件Comment Anchors