You still see this issue?: Yes
You visited the wiki?: Yes
You can compile a TeX document manually?: Not applicable
When trying to autocomplete an \includegraphics call the first level of directories inside the root directory is ignored. For example if the root rirectory tree is
rootdir -> root.tex
-> dir1
-> dir11
fig1.pdf
fig2.pdf
-> dir12
the autocompletion only shows dir11/ as first proposal.
Note that \input autocompletion works fine with the same directory tree.
I tried changing the setting of latex-workshop.intellisense.file.base which should not make a difference in my case and that doesn't change the behavior.
In my actual directory the subdirectories are called Images and Logos so no fancy names here.
Steps to reproduce the behavior:
Except testing on an own document, not sure what could be a relevant way to reproduce this
An \includegraphics auto completion that does not ignore the first sub-directory level.
Please paste the whole log messages here, not parts of ones. It is very important to identify problems.
To access the log, click the 'TeX' icon on the Activity Bar on the left side, select 'View Log Messages', then select 'View LaTeX Workshop extension log'.
[17:53:17] Found root file from active editor: d:\BambOoxX\test\test.tex
[17:53:17] Root file remains unchanged from: d:\BambOoxX\test\test.tex.
[17:53:23] BUILD command invoked.
[17:53:23] Found root file from active editor: d:\BambOoxX\test\test.tex
[17:53:23] Root file remains unchanged from: d:\BambOoxX\test\test.tex.
[17:53:23] Building root file: d:\BambOoxX\test\test.tex
[17:53:23] Build root file d:\BambOoxX\test\test.tex
[17:53:23] Recipe step 1: arara, --verbose,d:\BambOoxX/test/test
[17:53:23] cwd: d:\BambOoxX\test
[17:53:23] LaTeX build process spawned. PID: 13508.
[17:53:23] File watcher: responding to change in d:\BambOoxX\test\test.tex
[17:53:23] Parsing d:\BambOoxX\test\test.tex
[17:53:23] Parse fls file.
[17:53:23] Cannot find fls file.
[17:53:31] Recipe of length 1 finished. PID: 13508.
[17:53:31] Successfully built d:\BambOoxX\test\test.tex.
[17:53:31] No PDF viewer connected for d:\BambOoxX\test\test.pdf
[17:53:31] Parse fls file.
[17:53:31] Cannot find fls file.
[17:53:31] SyncTex after build invoked.
[17:53:31] Open external viewer for syncTeX from d:\BambOoxX\test\test.pdf
To access the log, click 'help' -> 'Toggle Developer Tools. Paste anything suspicious.
[Paste the log here]
If applicable, add screenshots to help explain your problem.
No
Add any other context about the problem here.
It should show all directories containing image files. To debug your issue, we need a minimal working example to reproduce it. In particular, post the file structure under dir1.
Well, don't ask me why, but after changing the root directory name to something dummy and then changing it back to its original name, it works fine. Sorry for disturbing your sunday.
Sorry to bother you again, but the problem resurfaced. This time, I cannot solve it by switching the root tex name or the root directory name.
I tried to reproduce it with the same directory structure but located in my desktop directory and that works fine. The only things I can think of are :
I know you asked me for a minimal working example to reproduce, but since I am myself unable to show the problem on such an example on my system, would you have any suggestions to help corner the issue ?
This sounds a bit strange.
Could any information from https://github.com/James-Yu/LaTeX-Workshop/wiki/Intellisense#files be helpful?
I do not think that the location of the file system is problematic. On the contrary, I remember at some point that the was a limit on the number of characters for intellisense (hard coded in vscode) microsoft/vscode/issues/74133, microsoft/vscode/issues/77391
Hmm, that's interesting. Unfortunatly I already checked for the extension specific intellisense settings, but it doesn't change the behavior.
It might be related to this 128 character limit, which is probably reached when searching for a subfile in my root directory.
Do you know if there is a way with the console to see the raw Intellisense output ?
Do you know if there is a way with the console to see the raw Intellisense output ?
Unfortunately, I do not think so. The easiest way would be to use run the extension within VSCode debugger, see https://github.com/James-Yu/LaTeX-Workshop/blob/master/CONTRIBUTING.md
Then you need to look into https://github.com/James-Yu/LaTeX-Workshop/blob/master/src/providers/completer/input.ts
A possibly related question, I saw somewhere that the extension parses a graphicspath call. Does it make any inclusions to this by itself ?
I'm asking this because I jsut found out that my document compiles fine even when missing the firs picture directory level, while I do not use any \graphicspath.
My bad, found, an old one.
Ok, so this seems to be the reason. When commenting the graphicspath call, everythin goes back to normal. Is this the expectec behavior of the \graphicspath parsing by the extension ?
@jlelong Any ideas on the source of this behavior (pure curiosity)
When some graphics paths are defined, only the files under those directories are listed for completion. Is this your question? If not, what behaviour are you referring to?
Ok, then the behavior I had was the expected one. Surprinsingly, I saw nothing about this in the FAQ. Can you confirm ? If there is no information about this at the moment, it could help other users to add an item about this detail in the FAQ, don't you think ?
I agree that this is not as crystal clear as it should be https://github.com/James-Yu/LaTeX-Workshop/wiki/Intellisense#files
I will fix it.
I believe, you omitted a not In your previous comment ^^
New FAQ entry: https://github.com/James-Yu/LaTeX-Workshop/wiki/FAQ#autocompletion-for-includegraphics-seems-incomplete