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

Ignore rule for just one line #3404

Closed
fsparv opened this issue Jan 20, 2024 · 1 comment · Fixed by #3779
Closed

Ignore rule for just one line #3404

fsparv opened this issue Jan 20, 2024 · 1 comment · Fixed by #3779
Labels
enhancement New feature or (non bug related) change to the program.
Milestone

Comments

@fsparv
Copy link

fsparv commented Jan 20, 2024

Most syntax checking plugins have an option to ignore a rule for just one line. I'm writing a novel and a character has a speech pattern where they swallow 'h' sounds. This is to be indicated to the user like this:

image

This gets flagged as a close quote without an open quote, which is usually correct but not correct for this case. I was originally going to file an issue to try to get you to handle this, but I realized that that is probably very difficult, and the larger problem is that there is no way to say "I meant it" quickly and easily without turning off the validation for the entire file

image

Since LaTeX supports comments it should be very easy to insert something like

% noinspection umatchedCloseQuote 

This quote insertion to toggle a syntax rule for a single line is a common practice in many syntax checkers for programming languages. Java example:

private Configuration doGetEmbedConfiguration() {
  //noinspection UnstableApiUsage
  return getEmbedConfiguration()
      .orElse(unoJarExtension.getEmbedConfiguration())
      .getOrElse(getProject().getConfigurations().getByName("runtimeClasspath"));
}

I'm aware of https://hannah-sten.github.io/TeXiFy-IDEA/editing-a-latex-file.html#switching-parser-off-and-on but this request is for a quick action that applies a single line syntax for suspending the checking of just one rule, rather than suspending the whole parser for a block. (block suspend a single rule would also be interesting in some cases)

I also want to point out that without resolving this warning, the f2 key will not move on to lower priority warnings like misspellings.

@fsparv fsparv added enhancement New feature or (non bug related) change to the program. untriaged Issue type still needs to be triaged or verified. labels Jan 20, 2024
@PHPirates
Copy link
Collaborator

In your screenshot one of the menu options is 'suppress for environment' or for the whole file, which is probably what you want in this case. Documentation: https://hannah-sten.github.io/TeXiFy-IDEA/inspections.html#suppress-inspections
(Personally I would just disable the inspection for the whole project, I mean if you're writing a whole novel in LaTeX you probably know how LaTeX quotes work!)

However, there is indeed no option yet to suppress it for one line of text only, but I think this should be possible to implement.

@PHPirates PHPirates removed the untriaged Issue type still needs to be triaged or verified. label Jan 20, 2024
@PHPirates PHPirates added this to the Next milestone Nov 28, 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