TeXstudio – Where Does TeXstudio Store .cwl Files for Hyperref and Xspace?

auto-completionhyperrefmacrostexstudioxspace

TeXstudio uses .cwl files for storing information about which macros are defined by which packages, one file per package. This information is used for autocompletion suggestions and highlighting of unrecognized macros. Most of these files I can find in C:\Users\doncherry\AppData\Roaming\texstudio.

For some packages, e.g. hyperref and xspace, however, I can’t find them in that directory and neither in the program’s directory C:\Program Files (x86)\TeXstudio. Where are they hiding? Are they hard-coded into the executables?

Best Answer

Qrrbrbirlbel is exactly right:

They probably are stored in the .exe. Proposal: Copy both xspace.cwl and hyperref.cwl to the %APPDATA%\texstudio\ folder and add the missing macros.

Entries in %APPDATA%\texstudio\ override the ones integrated in TeXstudio.

As of TeXstudio 2.10.8 the mechanism for searching cwl files has been refined.

TXS searches for cwl files in three different locations:

  1. [settings-directory]/completion/user
  2. builtin cwls
  3. [settings-directory]/completion/autogenerated

See also FAQ: Where are cwl files stored?

Also, I encourage you to share your updated cwl files, so we can integrate them for the next release. To do so, just create an entry in the feature request tracker and attach the files.