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

\includegraphics filename autocomplete does not work with optional arguments (emacs) #573

Closed
WannabeSmith opened this issue Mar 2, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@WannabeSmith
Copy link

First, thanks for this awesome project!

OS/editor details:

OS: macOS Monterey
Editor: Emacs 27.2
LaTeX: TeX Live 2021 (installed mactex via homebrew)

Description of the issue:

When using the \includegraphics macro, if I write

\includegraphics{}

and begin typing a filename (e.g. an image) within the curly brackets, I successfully see an autocompleted list of filenames through which I can scroll, select, and so on. This is the desired behaviour.

However, if I add optional arguments, such as

\includegraphics[width=\textwidth]{}

and begin typing the same filename, no such autocompleted list appears. It would be great if the list of filenames were available regardless of whether optional arguments have been added or not.

@pfoerster
Copy link
Member

It would be great if the list of filenames were available regardless of whether optional arguments have been added or not.

This should normally work so it appears to be a bug. On my machine, I cannot reproduce the issue with the example you provided:

image

Is there something around the statement, which could mess with the parser like unbalanced braces? In this case, a full example file could help.
Also, what texlab version are you using?

@pfoerster pfoerster added the needs more info Issue requires more information from poster label Mar 2, 2022
@WannabeSmith
Copy link
Author

I am using texlab version 3.3.2.

You're absolutely right, the example I provided works fine. My apologies. It fails when I use the option [width=0.5\textwidth] (note the 0.5).

Here's an example. Note that the first two autocompletes work fine, while the third does not.

Screen.Recording.2022-03-02.at.3.37.11.PM.mov

@pfoerster pfoerster added bug Something isn't working and removed needs more info Issue requires more information from poster labels Mar 3, 2022
pfoerster added a commit that referenced this issue Mar 3, 2022
@pfoerster
Copy link
Member

Thanks, I am able to reproduce the issue, now. 0edafcf fixes the error in the parser.

@pfoerster
Copy link
Member

Released with texlab 4.0.0.

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue May 29, 2022
## [4.0.0] - 25.05.2022

### Added

- Add `--version` command line flag
- Provide pre-built binaries for `aarch64-apple-darwin` architecture ([#591](latex-lsp/texlab#591))
- Autocomplete files based on `\graphicspath` ([#590](latex-lsp/texlab#590))
- Release `texlab` on `crates.io` ([#399](latex-lsp/texlab#399))

### Changed

- _BREAKING_: Use client-side file watching instead of server-side notifications (`workspace/didChangeWatchedFiles`)
- _BREAKING_: Bump minimum supported Rust version to 1.58.1
- _BREAKING_: Do not use `citeproc-rs` to render citations. Instead, use a custom approach that tries to resemble the `BibLaTeX` output ([#629](latex-lsp/texlab#629))

### Fixed

- Parse `\subinputfrom` command correctly ([#610](latex-lsp/texlab#610))
- Parse verbatim environments correctly ([#490](latex-lsp/texlab#490))
- Stop capturing stdout when build exits ([#588](latex-lsp/texlab#588))
- Fix parsing of key-value pairs ([#573](latex-lsp/texlab#573))
- Normalize `texlab.rootDirectory` when resolving includes ([#571](latex-lsp/texlab#571))
- Allow optional arguments in environment definitions ([#570](latex-lsp/texlab#570))
- Allow `=` in include paths ([#568](latex-lsp/texlab#568))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants