✨ 未定义元数据标签在编辑器中显示警告#1608
Open
cyfung1031 wants to merge 1 commit into
Open
Conversation
@tag 若不在已知元数据提示列表中,现在会在编辑器中以警告标记显示(沿用悬浮提示的 undefinedPrompt 文案),提示用户该标签暂未被 ScriptCat 支持。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Checklist / 检查清单
@tagmetadata lines only surfaced as a hover tooltip; they now also show as an editor warning marker背景
编辑器悬浮提示已能识别不在 ScriptCat 元数据提示表中的
@tag(显示 "Undefined Prompt"),但这些标签在编辑器中没有任何可见的警告标记,用户只有主动悬浮才能发现该标签暂不受支持。本次改动
getUndefinedMetadataTagMarkers(src/pkg/utils/monaco-editor/index.ts),扫描==UserScript==元数据块内的每一行,复用悬浮提示已用的metadataHoverPattern提取标签promptByMetadataTag中,则在编辑器中生成一个MarkerSeverity.Warning标记(rule idscriptcat/undefined-metadata-tag),消息复用既有的currentEditorLang.undefinedPrompt文案(已支持所有语言),提示用户暂不受支持已知限制
undefinedPrompt文案,未新增专门的“不支持”措辞建议审查重点
name、grant、run-at等)不应被误标记为警告@noframes)也应被正确识别,不受metadataAlignmentPattern需要尾随空格+值的限制验证
pnpm run typecheck— 通过pnpm exec eslint src/pkg/utils/monaco-editor/index.ts— 无报错