Hannah-Sten / TeXiFy-IDEA

LaTeX support for the IntelliJ platform by JetBrains.
https://hannah-sten.github.io/TeXiFy-IDEA
MIT License
896 stars 90 forks source link

Renaming file via parameter in \includegraphics changes filename, but not parameter #1518

Closed marvk closed 4 years ago

marvk commented 4 years ago

Type of JetBrains IDE (IntelliJ, PyCharm, etc.) and version

IntelliJ IDEA 2020.1.3 (Ultimate Edition) Build #IU-201.8538.17, built on June 30, 2020 Runtime version: 11.0.7+10-b765.64 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 10 10.0 GC: ParNew, ConcurrentMarkSweep Memory: 1979M Cores: 24 Registry: search.everywhere.settings=true, ide.tooltip.initialDelay=394 Non-Bundled Plugins: Batch Scripts Support, CMD Support, Lombook Plugin, com.intellij.ideolog, com.jetbrains.CyanTheme, com.jetbrains.darkPurpleTheme, com.thvardhan.gradianto, com.tylerthrailkill.intellij.pastellicious, org.jetbrains.kotlin, MetricsReloaded, nl.rubensten.texifyidea, org.toml.lang, org.rust.lang, rasarts.espresso.light.theme, silkworm, zielu.cleansheet

Operating System

Windows 10 Pro 2004, Build ID 19041.329

TeXiFy IDEA version

0.6.10

What I did (steps to reproduce)

Renaming file (SHIFT+F6 on Windows) via parameter in \includegraphics changes filename, but not parameter

Minimal example to reproduce the problem

\documentclass[11pt]{article}

\usepackage{graphicx}

\begin{document}
    \includegraphics{foo.png}
\end{document}

Expected behavior

The parameter in the code is changed along side the file name

Actual behavior

The parameter in the code remains the same while the file name changes

PHPirates commented 4 years ago

I cannot reproduce this problem on Windows 10, IntelliJ 2020.1.3 and TeXiFy 0.6.10. I pressed shift+F6 with the cursor on foo.png.

marvk commented 4 years ago

Did you verify this yourself with the minimal example?

Yes, I noticed it on a different project, but created a new one to verify it's not my projects configuration.

Does 'Go to declaration' (Ctrl+B) work?

Yes, as does "Find Usages" (CTRL+F7) on file in the project view.

Does it work when you rename the file? i.e. press Shift+F6 with the file selected

No, both don't work. See these two videos:

From code

From project window

PHPirates commented 4 years ago

@marvk Thanks a lot for the screencast! After being confused for five minutes, I think you need to select 'Search for references', that should solve it. (It should be on by default, but IntelliJ remembers if you ever unselected it). Will make this more clear in the wiki.

marvk commented 4 years ago

Yup, that did it. Cheers! No idea why it's not selected... I'm not used to this dialog anyway, since it doesn't appear when renaming things in source references, like Java variable names and such.

Thanks again!