VHDL标签不有效的vim与标签+标签列表



我使用Vim与标签和标签列表插件。当编辑。vhd文件时,标签非常差(只显示实体)。

我不知道标签对VHDL的支持是否弱,或者Taglist是否有效地读取由标签创建的文件。

我怎样才能解决这个问题?是否有另一个解决方案来创建更好的标签与标签/标签列表vhdl ?

如果您发现标签对某些东西的支持不够,您可以通过向主目录中的.ctags文件添加一系列声明来扩展它。例如,对于VHDL,您可以使用下面的代码:

--langdef=vhdl
--langmap=vhdl:.vhd
--regex-vhdl=/^[ t]*package[ t]+([^ ]+) is/1/d,package declarations/i
--regex-vhdl=/^[ t]*package[ t]+body[ t]+([^ ]+) is/1/b,package bodies/i
--regex-vhdl=/^[ t]*architecture[ t]+([^ ]+) of/1/a,architecture specifications/i
--regex-vhdl=/^[ t]*entity[ t]+([^ ]+) is/1/e,entities/i
--regex-vhdl=/^[ t]*([^ t:]+)[ t]*:[ t]*process[ t]*(/1/p,processes/i
--regex-vhdl=/^[ t]*function[ t]+([a-z0-9_]+)/1/f,functions/i
--regex-vhdl=/^[ t]*procedure[ t]+([a-z0-9_]+)/1/r,procedures/i
--regex-vhdl=/^[ t]*type[ t]+([^ ]+) is/1/t,type declarations/i

我已经添加了'变量','信号'和:(in|out)端口定义基于您建议的原始. tags文件。我发现匹配这些也更方便

--langdef=vhdl
--langmap=vhdl:.vhd;.VHD
--regex-vhdl=/^[ t]*signal[ t]*([^ ]+)/1/s,signals/i
--regex-vhdl=/^[ t]*([^ ]+)[ t]*:[ t]*(in|out)/1/p,ports/i
--regex-vhdl=/^[ t]*variable[ t]*([^ ]+)/1/v,variable/i
--regex-vhdl=/^[ t]*package[ t]+([^ ]+) is/1/d,package declarations/i
--regex-vhdl=/^[ t]*package[ t]+body[ t]+([^ ]+) is/1/b,package bodies/i        
--regex-vhdl=/^[ t]*architecture[ t]+([^ ]+) of/1/a,architecture specifications/i
--regex-vhdl=/^[ t]*entity[ t]+([^ ]+) is/1/e,entities/i                 
--regex-vhdl=/^[ t]*([^ t:]+)[ t]*:[ t]*process[ t]*(/1/p,processes/i
--regex-vhdl=/^[ t]*function[ t]+([a-z0-9_]+)/1/f,functions/i  
--regex-vhdl=/^[ t]*procedure[ t]+([a-z0-9_]+)/1/r,procedures/i
--regex-vhdl=/^[ t]*type[ t]+([^ ]+) is/1/t,type declarations/i

Ctags从根本上被打破了,因为它没有考虑到VHDL中名称的作用域和重载。只是不要用它。

您可以在这篇博客文章中找到更多信息

最新更新