TeXstudio: \ref and \eqref auto-completion

I've read quite a few questions and answers on this web site but none helps me to resolve my problem. I am using \ref and \eqref commands most often. After installing and re-installing the latest version of TeXstudio (2.10.0, 5.5.0), in some files the command \ref offers a list of available labels, but in some it gives an empty list although the file itself contains plenty of labels. At the same time, \eqref does not work at all. I would be grateful if somebody could help! Thanks!

• Welcome to TeX.SX! I don't use such editors, but I could imagine that TeXStudio needs an .aux file to get the labels from? – user31729 Sep 17 '15 at 8:55
• TeXstudio rolled out an update (2.10.2) yesterday, in the changelog it says - fix detection of \ref commands – Francis Sep 17 '15 at 9:26
• @Christian -- you are right, TeXstudio does need .aux files. – Alex Sobolev Sep 17 '15 at 12:26
• @Francis, thanks. Downloaded and tried. \ref or \eqref did not work until TeXstudio completely re-installed. Now \ref works, but \eqref does not. – Alex Sobolev Sep 17 '15 at 12:32
• @AlexSobolev: I am using TeXstudio 2.10.2 and have no problem with either \ref or \eqref. Have you tried completely uninstalling TeXstudio and removing all user profile (e.g. in AppData for Windows)? – Francis Sep 18 '15 at 17:13

This seems to be a known bug in TeXstudio 2.10.X that is still not fixed in the current release 2.10.8; but there is a workaround, which worked for me and does not cause problems as far as I can tell:

For now, txs generates cwl files for syntax checking.
Please make sure that those files don't contain "\ref#S" or  "\label#S".
Just delete those lines and it should work again.


When \ref offers the list of labels but \eqref does not, add \eqref{key}#r to your .cwl file. Then save it, close TeXstudio and again open TeXstudio.
I found it here and it solved the problem for me. Unfortunately, I don't have a link to an explanation of key and #r or of .cwl's in general.