-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Basic LaTeX built-in extension #138395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic LaTeX built-in extension #138395
Conversation
|
Looking closely at the files
Cases 4, 5 and 6 only are of interest for (very?) advanced users and may remain in LaTeX-Workshop. The files {
"id": "cpp_embedded_latex",
"configuration": "latex-cpp-embedded-language-configuration.json"
}Could we just refer to the C++ language configuration file here? |
|
Consider extension "languages": [
{
"id": "langA",
"configuration": "./langA-language-configuration.json"
}
],
"grammars": [
{
"language": "langA",
"scopeName": "source.A",
"path": "./syntaxes/A.tmLanguage.json"
}
]
All these questions are related to your question about merging languages? Thanks a lot for your help. |
No, you can only reference a file located in your own extension. There's no mechanism to have one JSON file extension from another one, or languages extending each other. -> You'll have to duplicate some configurations Two languages can point to the same language config file (or grammar). That's fine What could be done, but I don't recommend it, is to define the language configurations in code (see the |
|
If you feel that the duplications are error prone, we could look into a build script that creates the files. Or a script that we call on |
|
Thanks for making all this clearer. Before asking I had already considered relying on some scripts to create the language configuration files with a common base. I just wanted to make that there is no simpler approach. Therefore, I will go on with the scripts. |
|
On the number of languages. Sorry for only realizing that now. It would be great if we could focus on the most popular ones. |
|
OK, let us decide that For sure the languages |
ce21007 to
c9913f3
Compare
The support for these languages will still be provided by LaTeX-Workshop. Related to microsoft/vscode#138395
|
I have removed the support for LaTeX3, BibTeX-style and DocTeX from vscode-latex-basics and therefore from this PR to only focus and LaTeX (include |
|
Thanks a lot, @jlelong ! I'd prefer that we move |
In the grammars declaration, only keep the embedded languages provided as a built-in extension
Well, so be it even though the built-in extension will then not entirely solve James-Yu/LaTeX-Workshop#2983 but that is an other story. FYI, |
249741f to
1a51707
Compare
|
Cool, thanks a lot! |
|
@alexr00 Ok to merge? |
|
Great. I will have a look at the |
alexr00
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thank you! Just a couple questions about the licenses.
| "suitability for any purpose.", | ||
| "", | ||
| "The file syntaxes/markdown-latex-combined.tmLanguage.json is generated from the Markdown grammar", | ||
| "included in VSCode and falls under the license described in markdown-latex-combined-license.txt.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is markdown-latex-combined-license.txt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And also cpp-bailout-license.txt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I have been a little aggressive when removing the extra languages.
I have just added them back.
alexr00
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you!
|
@aeschli @alexr00 |
|
@jlelong How would you use the utility? |
|
@aeschli Thanks for your interest in this! See for instance markdown-latex-combined.extension.language-configuration.json, which defines The expanded file can be obtained by running const vel = require('vscode-extend-language')
vel.expandConfigurationFile('./languages/data/markdown-latex-combined.extension.language-configuration.json', './languages/markdown-latex-combined-language-configuration.json')Even if this utility has to be run after every update on the base file, it makes propagating changes far easier. The ultimate solution would be that VS Code does the expansion itself when loading a Note that the base file can be remote, for instance defined in an other extension. For the time being, we rely on this utility in |
|
Is the idea to run the utility as a build step and then write out the result to an |
|
Exactly. It is designed to be run as a build step. |
|
BTW, vscode/extensions/latex/package.json Line 44 in 25553c8
|
|
Yes, |
This PR adds a basic LaTeX support built-in and closes James-Yu/LaTeX-Workshop#2731.
Once this PR is merged, you might consider merging microsoft/vscode-markdown-tm-grammar#99 too.