si就不用介绍了吧,左手vi右手si,你都得有,想用啥用啥:)

话说在看erofs-utils时,偶尔发现一个问题,就是struct erofs_inode解析不到,找不到这个定义:

si-sym-not-found-for-erofs_inode.png

好吧,先问了问手上能用的鸡皮踢:

openai-answer-si-cannot-parse-struct.png

感觉没啥用,或许是prompt不对?不聊了,次数受限,直接bing搜了:

search-si-cannot-parse-struct-using-bing.png

第一栏就看到了Fixing “Parse-Too-Complex”又是官方doc,感觉很香啊,打开看看:

If Source Insight encounters too many problems trying to parse a file, the symbol window at the left side of the source window will say “Parse Too Complex” instead of listing the symbols in the file.

我是没碰到这个情况。

The Parse-too-complex can often be handled by using the Edit Condition dialog, or defining Source Insight preprocessor macros (token macros).

有两个修复方法,一个是Edit Condition,是给#ifdef用的,我这儿应该不是,另一个是添加定义token macros:

defining a token macro in the c.tom file located in your Documents\Source Insight 4.0

这是for 4.0,我是3.5:

si-version.png

直接site根目录浏览了一把没找到对应入口,好吧,先看看怎么用:

Token Macro Syntax
A token macro file consists of token macros, one per line. The format of a token macro is:

macroname    <no text here means macro is a no-op>
macroname substituted text here
macroname(parameter list) substituted text with parameter names
macroname(parameter) text##parameter // concatenates text
; comments begin with a semicolon

Some examples of token macros:

MyStructure(sname)    struct sname
NoOperation
BuildName(name1, name2) name1##name2

再来看internal.h,留意si符号窗口按行排序时是这样的:

si-parse-erofs-internal-h.png

啊,貌似宏EROFS_FEATURE_FUNCS有嫌疑,红框处也就是它后面的EROFS_I_EA_INITED/EROFS_I_Z_INITED也找不到定义。

那就照样子改句子,我的文档下也有个C.tom文件哈:

C:\Users\tj\Documents\Source Insight\C.tom

直接打开看看,里面还有内容,尾巴添加:

; erofs-utils
EROFS_FEATURE_FUNCS

重新打开si,进入Project->Synchronize Files,勾选Force all files to be re-parsed,点击OK,哇,I’m back, 符号窗口和颜色都有了,哈皮:)

si-parsed-struct-erofs-inode.png

Done。

[参考文档]