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

Command [COMMAND_NAME] is not defined inspection false positives #3318

Closed
audio-engineer opened this issue Nov 17, 2023 · 5 comments · Fixed by #3759
Closed

Command [COMMAND_NAME] is not defined inspection false positives #3318

audio-engineer opened this issue Nov 17, 2023 · 5 comments · Fixed by #3759
Labels
enhancement New feature or (non bug related) change to the program.
Milestone

Comments

@audio-engineer
Copy link

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

CLion 2023.2.2
Build #CL-232.9921.42, built on September 12, 2023
Subscription is active until August 5, 2024.
For educational use only.
Runtime version: 17.0.8+7-b1000.22 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.1.1
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 12
Metal Rendering is ON
Registry:
run.processes.with.pty=TRUE
ide.experimental.ui=true
debugger.attach.dialog.enabled=true

Non-Bundled Plugins:
org.editorconfig.editorconfigjetbrains (232.9921.30)
com.jetbrains.rust (232.20527.39)
com.intellij.kubernetes (232.9921.86)
com.intellij.grazie.pro (0.3.263)
nl.rubensten.texifyidea (0.9.1)
ru.adelf.idea.dotenv (2023.2)
mobi.hsz.idea.gitignore (4.5.2)
com.firsttimeinforever.intellij.pdf.viewer.intellij-pdf-viewer (0.15.0)

Operating System

macOS Sonoma 14.1.1

TeXiFy IDEA version

0.9.1

What I did (steps to reproduce)

Create a new LaTeX project and start writing equations or other markup that requires LaTeX commands (not just plain text rendered with LaTeX).

Minimal example to reproduce the problem

\documentclass[11pt]{article}

\usepackage{amsmath}

\begin{document}
    \begin{equation}
        \begin{aligned}
            | f(x) | & \leq C | g(x) | \\
            | 2n + 2 | & \leq Cn \\
            2n + 2 & \leq 4n
        \end{aligned}
        \label{eq:equation}
    \end{equation}
\end{document}

Expected behavior

Commands such as \leq and \\, and other commands that are either built into LaTeX or included in one of the used packages are not underlined.

Actual behavior

Command [COMMAND_NAME] is not defined is emitted 5 times on lines 8, 9 and 10.

@audio-engineer audio-engineer added bug Deficiencies in TeXiFy behaviour. untriaged Issue type still needs to be triaged or verified. labels Nov 17, 2023
@PHPirates
Copy link
Collaborator

Did you enable this inspection, which is disabled by default?

@audio-engineer
Copy link
Author

audio-engineer commented Nov 17, 2023

@PHPirates Yes, I did indeed enable it. Is it a "beta" feature, so to speak? If an inspection exists, I do expect it to work.

@PHPirates
Copy link
Collaborator

Yes, basically there were too many false positives for me to fix all at once, hence it is disabled by default.
Thanks for trying it out though, we should indeed improve it. I can reproduce the problem: somehow \le is fine but \leq raises an error, so I will have a look!
Note to self: definitions are in texmf-dist/source/latex/base/fontdef.dtx

@PHPirates PHPirates removed the untriaged Issue type still needs to be triaged or verified. label Nov 21, 2023
@PHPirates
Copy link
Collaborator

I see you also mentioned \\, however I'm having a bit of trouble finding where this is defined in source2e. If you happen to know how to find the definition, that would be really helpful.

@audio-engineer
Copy link
Author

@PHPirates I got you - no worries. It's a very useful inspection so I thought I would enable it, but yeah, it's still too buggy to be used.
I don't know where \\ is defined, but I will try to investigate it when I get time for it.

@PHPirates PHPirates added enhancement New feature or (non bug related) change to the program. and removed bug Deficiencies in TeXiFy behaviour. labels Dec 30, 2023
@PHPirates PHPirates added this to the Next milestone Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or (non bug related) change to the program.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants