Auctex autocomplete and physics.sty

I have autocomplete successfully working in auctex. It also works for included packages, so if I, for example, have \usepackage{url} in my preamble, I will get autocompletion while typing \url.

However, this is not the case for the physics package in latex.

One possible problem I can think of is that this package makes use of xparse, so there is no \def or \newcommand in physics.sty but instead commands like \DeclareDocumentCommand.

Is there a way to get autocomplete for physics.sty?

• I'm not completely sure, but I think Auctex might not actually parse package .sty files (for reasons I don't know). If you check TeX-style-path, you'll find a path that contains Auctex style files like url.el, which has a comment that says "This file adds support for url.sty'." So it seems like packages need an Auctex style file to work properly. – gsingh2011 Dec 31 '19 at 7:33

Auctex uses elisp style files to know what symbols exist. For your own code, it auto generates these style files and stores them in the "auto" directory. For some libraries, it ships with style files (see the TeX-style-path variable to find where these are stored). But for other libraries it doesn't auto generate the style file.
You can manually generate the style file by running TeX-auto-generate on the physics.sty` file that shipped with your TeX distribution. However, the parsing is very naive, so while you'll probably get all of the commands, they won't have the right arguments. You can modify the generated file yourself to set the number of arguments (and if you get a fully working style file feel free to commit it upstream).