Closed scoennz closed 1 week ago
Thanks for the issue. However, this is a limit of latex logging, which uses closing brace )
to denote the end of a file name when outputting file trace in log. Error messages contain the file path, so it will work. Warnings do not output file paths, so we need to infer from the file trace and breaks on closing brace in file path.
Pre-checks
Environment
The Issue
When the path or the filename of a .tex file contains an opening parenthesis [ e.g.
D:\Folder\test_(2024).tex
] , the Problems pane fails to provide the correct link to the file for Warnings. The path/filename is truncated just before the opening parenthesis, resulting in an incorrect filename to link to. Interestingly, at the same time, for the same file, Errors are correctly linked. See screen capture of example Problems pane below.Closing parentheses, by themselves, do not trigger the issue. E.g.
D:\Folder\test_2024).tex
works fine.Changing the option
latex-workshop.message.convertFilenameEncoding
(true or false) does not solve the problem.Reproduction Steps
D:\Folder_(2024)\test.tex
orD:\Folder\test_(2024).tex
[a4]
is unused (Warning) and thex=2
equation has a missing closing$
(Error)..tex
file. Clicking on the Warning fails. Displaying the Problems Pane as a List reveals that the Error points totest_(2024).tex
(correct filename) while the Warnings points totest_
(incorrect, truncated filename or path). See below for a screenshot.Expected Behavior
Filenames or paths with (opening) parentheses are valid on most OSs and are used by many. Problems pane links for Warnings and Errors should work equally well with such paths/filenames.
Logs
LaTeX Workshop Output
Note: when the log is seen in the Output pane in VS Code, the filename in the line
Latexmk: Nothing to do for 'd:/Folder/test_(2024).tex'
is underlined up to and excluding the opening parenthesis (i.e. onlyd:/Folder/test_
is underlined in my example; not the rest). However,latexmk
works fine and the documents is correctly built.Developer Tools Console
Anything Else?
The problem persists whatever type of character is after/before the opening parenthesis (letter, digit, or whitespace). Note that I haven't tested the behavior when sub-files are called (included) in a main.tex file.
Thanks for looking into this, and thanks for the great extension.