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

Known Command Does Not Show Up in Completion #1088

Closed
CakeUser321 opened this issue May 13, 2020 · 14 comments
Closed

Known Command Does Not Show Up in Completion #1088

CakeUser321 opened this issue May 13, 2020 · 14 comments

Comments

@CakeUser321
Copy link

When using the package xfrac, the command \sfracdoes not show up in the auto completion list. However it is not marked red, so the command must be known.

Environment

  • TeXstudio: TeXstudio 2.12.6 (hg 6631:16db084dae24)
  • Qt: 5.9.5, compiled with Qt 5.9.3 R
  • OS: Linux 5.3.0-46-generic LanguageTool errors not underlined #38~18.04.1-Ubuntu SMP Tue Mar 31 04:17:56 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • TeX distribution: TexLive 2020

Expected behavior

\sfrac is available in the auto completion.

Actual behavior

\sfrac is not available in the auto completion.

How to reproduce

\documentclass[english]{book}
\usepackage{xfrac}

\begin{document}
	\sfrac{1}{2}
\end{document}
@muzimuzhi
Copy link
Contributor

Currently texstudio does not contain the cwl file for xfrac package. And autogenerated cwl files are used for syntax highlighting (not marked red) only, not for autocompletion. See #336 (comment).

@CakeUser321
Copy link
Author

Hello muzimuzhi, thank you for your prompt response! According to #336 (comment) the auto completion only works for a package if the corresponding cwl file is stored in ~/.config/texstudio/completion/user. However on my machine, this directory is empty. Nontheless, auto completion works quite well for most packages (e.g. FloatBarrier from placeins, although ~/.config/texstudio/completion/user/placeins.cwl does not exist).

@muzimuzhi
Copy link
Contributor

I have opened #1089 to add xfrac.cwl to texstudio. As a quick solution, you can save the contents of file xfrac.cwl in ~/.config/texstudio/completion/user/xfrac.cwl.

@CakeUser321
Copy link
Author

I have opened #1089 to add xfrac.cwl to texstudio. As a quick solution, you can save the contents of file xfrac.cwl in ~/.config/texstudio/completion/user/xfrac.cwl.

This fix does unfortunately not work for me.

@muzimuzhi
Copy link
Contributor

According to #336 (comment) the auto completion only works for a package if the corresponding cwl file is stored in ~/.config/texstudio/completion/user.

The autocompletion works if there is a corresponding cwl file

  • installed with texstudio (this is the case for placeins.cwl), or
  • in path ~/.config/texstudio/completion/user.

@muzimuzhi
Copy link
Contributor

I have opened #1089 to add xfrac.cwl to texstudio. As a quick solution, you can save the contents of file xfrac.cwl in ~/.config/texstudio/completion/user/xfrac.cwl.

This fix does unfortunately not work for me.

You need to reopen texstudio.

@CakeUser321
Copy link
Author

CakeUser321 commented May 13, 2020

You need to reopen texstudio.

I already tried that. Furthermore, I tried to enable xfrac.cwl manually in the options.
Neither

  1. xfrac.cwl not manually imported + restart
    nor
  2. xfrac.cwl manually imported + restart
    did work...

Edit: Maybe this was a bit ambiguous. I copied xfrac.cwl from ~/.config/texstudio/completion/autogenerated/xfrac.cwl to ~/.config/texstudio/completion/user/xfrac.cwl.

@CakeUser321
Copy link
Author

The autocompletion works if there is a corresponding cwl file

* installed with texstudio (this is the case for `placeins.cwl`), or

* in path `~/.config/texstudio/completion/user`.

That makes sense, thank you. So what you are saying is, basically I have to wait until a .cwl file for the xfrac package has been manually created?

@muzimuzhi
Copy link
Contributor

This is strange. On my side, after copying the xfrac.cwl to ~/.config/texstudio/user, I get command \sfrac shown in autocompletion.
image

Notice that you use a somewhat old release of texstudio (2.12.6), would you test the latest stable release (2.12.22)?

@CakeUser321
Copy link
Author

Notice that you use a somewhat old release of texstudio (2.12.6), would you test the latest stable release (2.12.22)?

Sure, I can do that. Did you copy the xfrac.cwl file from the autogenerated directory or did you get this file from somewhere else?

@muzimuzhi
Copy link
Contributor

muzimuzhi commented May 13, 2020

You can get the contents of (tidy and reliable) xfrac.cwl here: https://github.com/texstudio-org/texstudio/pull/1089/files#diff-419ebdee302edda6b9a6de72fd25c326.

@CakeUser321
Copy link
Author

Thanks, with the new xfrac.xwl is does work! Even with the old version. The problem was, that I copied the autogenerated file and not your new file.

@CakeUser321
Copy link
Author

CakeUser321 commented May 13, 2020

Maybe it would make sense to update the section Why does a command not show up in the completion? in the FAQ https://sourceforge.net/p/texstudio/wiki/Frequently%20Asked%20Questions/#why-does-a-command-not-show-up-in-the-completion. Your point is not included in it directly, one might think that the autogenerated files are sufficient

@muzimuzhi
Copy link
Contributor

The problem was, that I copied the autogenerated file and not your new file.

I have opened #1089 to add xfrac.cwl to texstudio. As a quick solution, you can save the contents of file xfrac.cwl in ~/.config/texstudio/completion/user/xfrac.cwl.
quoted from #1088 (comment)

Ok, that might be my fault to not explicitly mention "save the contents of file xfrac.cwl provided in my pr."

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

No branches or pull requests

2 participants