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

Suggestion to replace /def with /newcommand does not replace line with working code #3576

Open
efrancis opened this issue Jun 3, 2024 · 0 comments · May be fixed by #3583
Open

Suggestion to replace /def with /newcommand does not replace line with working code #3576

efrancis opened this issue Jun 3, 2024 · 0 comments · May be fixed by #3583
Assignees
Labels
bug Deficiencies in TeXiFy behaviour.

Comments

@efrancis
Copy link

efrancis commented Jun 3, 2024

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

PhpStorm 2024.1.2

Operating System

MacOS Sonoma 14.5

TeXiFy IDEA version

0.9.6

What I did (steps to reproduce)

  • Write the following commands before the document part begins:
\def\shortyearhelper#1#2#3#4{#3#4}
\def\shortyear#1{\expandafter\shortyearhelper#1}
  • When the \def commands get highlighted, click on one of them to see the suggestions lightbulb
  • Click on lightbulb and choose solution "convert to \newcommand"
  • Repeat with the other command.

Minimal example to reproduce the problem

\documentclass[12pt]{article}

\def\shortyearhelper#1#2#3#4{#3#4}
\def\shortyear#1{\expandafter\shortyearhelper#1}

\begin{document}
\shortyear{\the\year}
\end{document}

Expected behavior

Commands to be properly modified into \newcommand such that it can be typeset without errors and the same result as before. The result of transforming is this:

\newcommand{\shortyearhelper}{#1#2#3#4}{#3#4}
\newcommand{\shortyear}{#1}{\expandafter\shortyearhelper#1}

Actual behavior

Document no longer typesets, as command were wrongly transformed. Commands as they should be (according to ChatGPT and tested to work properly):

\newcommand{\shortyearhelper}[4]{#3#4}
\newcommand{\shortyear}[1]{\expandafter\shortyearhelper#1}
@efrancis efrancis added bug Deficiencies in TeXiFy behaviour. untriaged Issue type still needs to be triaged or verified. labels Jun 3, 2024
@slideclimb slideclimb self-assigned this Jun 16, 2024
@slideclimb slideclimb removed the untriaged Issue type still needs to be triaged or verified. label Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Deficiencies in TeXiFy behaviour.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants