Skip to content
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

Add expl3-commands.cwl with arg specs #3915

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

mbertucci47
Copy link
Contributor

This adds a cwl for expl3 commands as mentioned in #3896. Several things don't work when commands have _ and : in the name. For example, I couldn't get keyval completion to work, and something like

\my_command:Nn{cmd}{def}#d

does not cause \my_command:Nn \foo {bar} to add \foo to the completion list.

Suggestions welcome (@muzimuzhi). Could probably be mentioned in the documentation. Ideally this cwl would be automatically activated inside \ExplSyntaxOn...\ExplSyntaxOff and not active elsewhere, but for right now the only way to activate it is manually in the TXS configuration. Note we do not want it automatically activated by \usepackage{expl3} since that is a legacy package and expl3 is now always loaded by the format.

Comment on lines +6 to +7
\bitset_clear:N %<⟨bitset var⟩%>
\bitset_clear:c {%<⟨bitset var name⟩%>}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we want a consistent use (or dropping) of ⟨...⟩ brackets. Not a blocker.

Stats of uses of ⟨...⟩

$ rg -F '⟨' --count
metre.cwl:17
exerquiz.cwl:3
physics2.cwl:12
pdfextra.cwl:1
eqexam.cwl:9
textopo.cwl:9
semantex.cwl:1
ajmacros.cwl:4
tikzlibrarybraids.cwl:2
plaintex.cwl:133
hiero.cwl:2
wargame.cwl:10
plext.cwl:1
expkv-cs.cwl:10
china2e.cwl:1
luatexja-ajmacros.cwl:4
qcircuit.cwl:1
babel.cwl:10
tikzlibraryext.shapes.circlearrow.cwl:1
texmate.cwl:4
ptex.cwl:45
nath.cwl:6
class-elteikthesis.cwl:5
longnamefilelist.cwl:2
tikzlibraryceltic.cwl:1
tikzlibraryext.transformations.mirror.cwl:2
tex.cwl:12
abspos.cwl:2
xskak.cwl:6
namedef.cwl:2
yathesis.cwl:109
mdwtab.cwl:7
class-iopart.cwl:2
prettytok.cwl:3
algxpar.cwl:4
doafter.cwl:1
easybase.cwl:8
optex.cwl:86

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a fan of using the angle brackets with "undelimited" arguments. To me ⟨bitset var⟩ signifies "insert something here" that a merely greyed out bitset var does not. Since most document commands have delimited arguments, they are not necessary, but I agree consistency would be better. Not sure how easy a mass change would be since I think the brackets need to be inside %<...%> which would break a lot of cwl argument types.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree the unbraced arguments need angle brackets more than braced ones. So, I'm OK to just keep them as is.

@sunderme sunderme merged commit d172470 into texstudio-org:master Dec 17, 2024
7 checks passed
@sunderme
Copy link
Member

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants