-
Notifications
You must be signed in to change notification settings - Fork 351
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
autocompletion of expl3 commands #3896
Comments
It even uses |
it is not strictly necessary that txs restricts the completion wintin |
@sunderme Ah yes! Why I didn't realize it earlier? Tried with cwl entries
and they do work (currently not necessarily in between |
so, we can close this for now ? |
I think having automatic activation inside expl3 environments is important to this issue as outside such environments, they just pollute the autocompleter. So I’d vote not to close |
Just a note for the future, the completion file should be called |
Also useful would be a way of marking commands as expl3-only, so only show in the autocompleter in an expl3 environment. Something like
That way packages that provide an expl3 programming layer like fontspec or l3draw could have proper autocompletion in addition to the kernel expl3 commands. |
@mbertucci47 With 19f3aea (generalize start/stop env per command, 2024-12-18) and cd2d61d (avoid potential naming collision, 2024-12-18), maybe it's possible to use something like
But I didn't test it. |
Something like /%expl3 will probably be the solution. But currently the completer does not filter for valid commands. |
this is basically implemented (completer list with expl3 commands and limited completion based on context). |
Wondering if texstudio wants to also recognize deprecated (but not removed) l3kernel functions and variables. They are not documented in |
@muzimuzhi As far as I can tell there is no syntax checking done in expl3 environments, only command completion. So wouldn't it be better to not show the obsolete commands in the completer? |
@mbertucci47 If so then yes, current support is enough. |
Describe the feature and the current behavior/state
Correct highlighting for expl3 code was somewhat recently added to TXS, but there is currently no autocompletion for expl3 commands. Generating an appropriate cwl would be easy since LaTeX Workshop has a script for making a json file of expl3 commands: https://github.com/James-Yu/LaTeX-Workshop/blob/master/data/packages/expl3.json
A quick test shows that commands in cwls can contain underscores and colons, so that part is fine. The only thing that would need extra code is making the autocompletion active only inside
\ExplSyntaxOn...\ExplSyntaxOff
or in a file that declares\ProvidesExplPackage
, etc.Who will benefit with this feature?
Anyone who writes expl3 code in TXS.
The text was updated successfully, but these errors were encountered: