zsh-users/zsh-syntax-highlighting

"unknown-token" is overloaded

Open

#695 创建于 2020年3月15日

在 GitHub 查看
 (3 评论) (1 反应) (0 负责人)Shell (22,617 star) (1,371 fork)batch import
FeatureIdeaImprovementTaskcomponent:testsgood first issue

描述

Highlighting all errors the same way makes sense from a UI perspective (cough #691 cough), but it makes the tests weaker: when a test checks that an alias is highlighted as unknown-token, it can't easily check whether that's due to a syntax error (as in alias x='() ]]') or due to, say, a command word not being an existing alias/function/etc. (as fixed in 9931990b92a276c6ec69cdf6af9f9f3b65603cd1).

How about adding some new styles for more specific errors — e.g., unknown-token-not-a-command-name, unknown-token-parse-error, etc — that will be highlighted the same way by default, but will make the tests more specific?

贡献者指南