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

Use safe delete in deletion quick fixes #1787

Merged
merged 7 commits into from
Mar 9, 2021
Merged

Use safe delete in deletion quick fixes #1787

merged 7 commits into from
Mar 9, 2021

Conversation

slideclimb
Copy link
Collaborator

@slideclimb slideclimb commented Feb 27, 2021

Fix TEX-16

Summary of additions and changes

  • LaTeX inspection that detects if labeled figure is not referenced now includes a safe delete quick fix to delete the figure environment.
  • BibTeX inspection that detects if bib item is not used now uses safe deletion instead of regular deletion.

Known bug The text in the safe delete dialog is a bit weird and there doesn't seem to be a way to customise it.

How to test this pull request

\usepackage{biblatex}

\addbibresource{references.bib}

\begin{document}
%    Hallo~\cite{goossens1993}

%    test~\ref{fig:hj}
    hallo
    \begin{figure}
        \centering
        \includegraphics{}
        \caption{}
        \label{fig:hj}
    \end{figure}
    doei
\end{document}
@string{mytext = "This is a note."}

@Article{greenwade1993,
    author  = "George D. Greenwade",
    title   = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",
    year    = "1993",
    journal = "TUGBoat",
    volume  = "14",
    number  = "3",
    pages   = "342--351",
    note    = mytext,
}

@Book{goossens1993,
    author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
    title     = "The LaTeX Companion",
    year      = "1993",
    publisher = "Addison-Wesley",
    address   = "Reading, Massachusetts"
}

Example of safe delete finding a usage in a comment:
safe-delete-bib-ref

Wiki

Copy link
Collaborator

@PHPirates PHPirates left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I've had this before, where a UI element takes the psi element class name instead of human readable name, will try to find how to change that.

Copy link
Collaborator

@PHPirates PHPirates left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@HannahSchellekens HannahSchellekens added the enhancement New feature or (non bug related) change to the program. label Mar 2, 2021
@PHPirates PHPirates added this to the b0.7.5 milestone Mar 5, 2021
@PHPirates PHPirates self-assigned this Mar 5, 2021
# Conflicts:
#	build.gradle.kts
#	gen/nl/hannahsten/texifyidea/parser/LatexParser.java
#	src/nl/hannahsten/texifyidea/inspections/bibtex/BibtexUnusedEntryInspection.kt
#	src/nl/hannahsten/texifyidea/inspections/latex/LatexFigureNotReferencedInspection.kt
@PHPirates PHPirates merged commit 722b49c into master Mar 9, 2021
@PHPirates PHPirates deleted the safe-delete branch March 9, 2021 19:25
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 this pull request may close these issues.

3 participants