首页 > 解决方案 > 在引号内禁用 completionItemProvider

问题描述

我已经成功地用来monaco.languages.registerCompletionItemProvider填充完成列表。摩纳哥有什么办法可以检测光标何时在单引号或双引号之间并暂时停用完成提供程序?

标签: typeaheadmonaco-editor

解决方案


Yes, you can embed any kind of logic into your CompletionItemProvider. You can use the provdied Position and parse the file to figure out if you are inside single or double quotes and then return a [] accordingly.


推荐阅读