提交 6832ada7 编写于 作者: J Johannes Rieken

Only filter snippets by user-facing languages, #19954

上级 c07bf9de
......@@ -92,6 +92,14 @@ class InsertSnippetAction extends EditorAction {
languageId = modeService.getLanguageIdentifier(langId).id;
} else {
languageId = editor.getModel().getLanguageIdAtPosition(lineNumber, column);
// validate the `languageId` to ensure this is a user
// facing language with a name and the chance to have
// snippets, else fall back to the outer language
const {language} = modeService.getLanguageIdentifier(languageId);
if (!modeService.getLanguageName(language)) {
languageId = editor.getModel().getLanguageIdentifier().id;
}
}
if (name) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册