Declare some latex related language ids as internal only
The two grammars markdown_latex_combined and cpp_embedded_latex are designed to be used only for embedded blocks in LaTeX files. To warn users against manually using these languages, their names are now prefixed with internal_only_.
This PR is required to make sure further calls to latex/build/update-grammars.js will not break the latex syntax.
Related to https://github.com/jlelong/vscode-latex-basics/pull/101 and https://github.com/James-Yu/LaTeX-Workshop/issues/4533.
@alexr00 This PR is required to ensure that the LaTeX grammar updated in #242296 works properly.
Actually, the languages cpp_embedded_latex and markdown_latex_combined are available from VS Code language picker. Some users have reported issues because they tried to use them directly. We hope that added the internal_only prefix will make clearer that these languages must not be used directly.
I'm still not seeing them in the language picker. Can you share a screen shot?
You are right, the languages cpp_embedded_latex and markdown_latex_combined are only visible in the language picker when the LaTeX-Worskhop extension is activated or I launch the vscode-latex-basics extension. This is probably because these languages are listed in the contributes entry of the package.json file.
This makes me come to the real question. Is there a way for an extension to define a language internally and to not contribute it outside of the extension?
Thanks for your help.
@jlelong, I think it's as simple as not specifying any aliases in the package.json. See here, where we do specify aliases for BibTeX but don't specify any for cpp_embedded_latex.
https://github.com/microsoft/vscode/blob/3c911af4406aec42fab81a502feb8e12d483dbbe/extensions/latex/package.json#L44-L58
Specifying "aliases": [] does prevent the corresponding language to show up in the language picker but not specifying any aliases entry does not.
Then, I will reconsider https://github.com/jlelong/vscode-latex-basics/pull/101. I think this PR can be safely closed. @alexr00 Thanks for your help.