我目前正在检查LaTeX's TikZ/PGF code的lua文件,除其他外,我想纠正拼写错误,因为这些lua文件的一部分也用于manual。
为此,我使用Notepad ++,但是看起来[[" ... "]]
中包含的内容并未经过拼写检查。在这里,文件DistanceMatrix.lua中的一个示例是我引入了拼写错误。
declare {
key = "distance matrix verticess",
type = "string",
summary = [["
A list of verticess that are used in the parsing of the
|distance matrix| key. If this key is not used at all, all
vertices of the graph will be used for the computation of a
distance matrix.
"]],
在下图的左侧,当Lua
是有效语言时,看到的结果;在右边的TeX
是有效语言时,看到的结果。
可以看出,当Lua是活动语言时,summary
部分中的“ verticess”一词没有加下划线。
是否可以在Notepad ++中扩展/修改Lua语言,从而对[[" ... "]]
中包含的部分进行拼写检查? (也许对[[ ... ]]
中的内容进行拼写检查也就足够了,因此不用引号?不幸的是,我对Lua语言不熟悉。)当然,如果可能的话,怎么办?
答案 0 :(得分:2)
我认为问题在于,当选择了突出显示语言样式时,用于Notepad ++的DSpellCheck插件不会检查字符串文字。这不仅适用于Lua,而且适用于其他语言(例如C#及其@"multiline string literal";
)。可能没有简单的方法来解决此问题。我建议和他们一起开票。
一些指针:
在Scintilla.h中被定义
#define SCE_LUA_LITERALSTRING 8
和DsSpellCheck的SpellChecker.cpp
if (category != SciUtils::StyleCategory::text && !((category == SciUtils::StyleCategory::comment && m_settings.check_comments) ||
(category == SciUtils::StyleCategory::string && m_settings.check_strings) ||
(category == SciUtils::StyleCategory::identifier && m_settings.check_variable_functions))) {
但是,Scintilla可能无法正确公开Lua字符串文字的string属性。
答案 1 :(得分:1)