Skip to content

Syntax error highlighting problem #3885

@jcasale

Description

@jcasale

Environment

  • TeXstudio: 4.8.5 beta 2
  • Qt: 6.8.0
  • OS: Windows 11
  • TeX distribution: miktex

Expected behavior

Projects that embed macros in files using \input statements should correctly incorporate those definitions into the error-checking semantics.

Actual behavior

The repro package contains a tcolorbox definition that is highlighted as an error when opening the project.

If I open the project and load the macros.tex file into the editor, the erroneous highlighting disappears.

I've observed a few other possibly related details:

  • The macros.tex file always highlights the color definitions at the top of the file as errors inside the tcolorbox definitions
  • I frequently encounter primitives and other latex commands that get highlighted as errors, too (e.g., nameref). When this manifests, virtually everything gets marked as an error, and I need to restart TS to solve this.

I have the following settings enabled that I assume may be related and important:

  • Automatically load included files
  • Cache documents for faster reopening

Screenshot 2024-11-21 113026

Screenshot 2024-11-21 114532

How to reproduce

The repro at jcasale/latex-repro contains the reproduction project.

  1. Open the repro.tex main project file.
  2. Open the introduction.tex file and observe the erroneous highlighting.
  3. Open the macros.tex file, then switch back to the introduction.tex file and observe the correct highlighting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions