Skip to content

fix: #165 disable completion in comments - #227

Open
liuxy0551 wants to merge 2 commits into
DTStack:nextfrom
liuxy0551:fix_165
Open

fix: #165 disable completion in comments#227
liuxy0551 wants to merge 2 commits into
DTStack:nextfrom
liuxy0551:fix_165

Conversation

@liuxy0551

Copy link
Copy Markdown
Collaborator

改动内容

#165

  • 光标位于 SQL 注释内时,不再触发代码补全
  • 通过当前语言的 Monarch tokenizer 判断注释状态,并在调用 worker/C3 前结束补全流程
  • 正确区分块注释内部和 */ 之后的位置
  • 新增单行注释、MySQL # 注释、块注释及非注释边界场景单测

预览地址

https://liuxy0551.github.io/monaco-sql-languages/

2026-07-29 15 09 38

@liuxy0551
liuxy0551 requested a review from Cythia828 July 29, 2026 08:20
@Cythia828

Copy link
Copy Markdown
Collaborator
image 看看是否存在这个问题

Comment thread src/languageFeatures.ts Outdated
@liuxy0551

liuxy0551 commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

image 看看是否存在这个问题

这里确实是依赖各方言 Monaco tokenizer 的注释识别结果来决定是否关闭补全。

当前实现的目标是:一旦光标已经处于该方言 tokenizer 识别出的注释区域内,就在 Monaco 层直接短路,不再触发 worker、C3 和 completionService。

因此像 MySQL 这类方言,如果其现有 tokenizer 会把某些输入识别为注释,这次补全逻辑会沿用同一套方言语义,不会再单独引入另一套注释判定规则。本次 PR 只收敛在共享 CompletionAdapter,不调整各方言 tokenizer 或 dt-sql-parser 的注释定义。

目前 MySQL 中 --a 也会识别为注释,非本次修改影响。
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants