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

\todo can't be ignored #63

Closed
joker234 opened this issue Jun 23, 2020 · 3 comments
Closed

\todo can't be ignored #63

joker234 opened this issue Jun 23, 2020 · 3 comments
Assignees
Labels
1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-confirmed Issue status: Confirmed, reproducible bug in LTeX 3-fixed Issue resolution: Issue has been fixed on the develop branch
Milestone

Comments

@joker234
Copy link

Describe the bug
The content of "ltex.commands.ignore" is not recognized.

Steps to reproduce
Steps to reproduce the behavior:

  1. Create LaTeX file using package todonotes and a todo note.
  2. Ignore \todo in your settings.
  3. Run LTeX and see what is recognized.

Expected behavior
The content of \todo{…} or \todo[…]{…} should be ignored. But I get this issue:

{
	"resource": "/tmp/test-ltex/foo.tex",
	"owner": "_generated_diagnostic_collection_name_#0",
	"severity": 2,
	"message": "This sentence does not start with an uppercase letter",
	"source": "LTeX - UPPERCASE_SENTENCE_START",
	"startLineNumber": 7,
	"startColumn": 11,
	"endLineNumber": 7,
	"endColumn": 14
}

Sample document
This is my minimal example. I expect LTeX to only mention an issue with foo, not with \todo{bar is more foo}.

\documentclass{scrreprt}

\usepackage{todonotes}

\begin{document}
    foo
    \todo{bar is more foo}
\end{document}

LTeX configuration
This is the whole settings.json of my example project.

{   
    "ltex.language": "en-GB",
    "ltex.commands.ignore": [
        "\\todo{}",
        "\\todo[]{}"
    ],
    "ltex.trace.server": "verbose"
}

"LTeX Language Server" log file
First, reproduce the bug. Then, go to ViewOutput and select LTeX Language Server in the drop-down list. Paste this log here:

Jun 23, 2020 2:14:28 PM org.bsplines.ltex_ls.DocumentChecker checkAnnotatedTextFragment
INFO: Checking the following text in language en-GB via LanguageTool: "bar is more foo"
Jun 23, 2020 2:14:28 PM org.bsplines.ltex_ls.DocumentChecker checkAnnotatedTextFragment
INFO: Obtained 1 rule match
Jun 23, 2020 2:14:28 PM org.bsplines.ltex_ls.DocumentChecker checkAnnotatedTextFragment
INFO: Checking the following text in language en-GB via LanguageTool: "\n\n\n\nfoo "
Jun 23, 2020 2:14:28 PM org.bsplines.ltex_ls.DocumentChecker checkAnnotatedTextFragment
INFO: Obtained 1 rule match

"LTeX Language Client" log file
First, set the ltex.trace.server setting in your settings.json to "verbose". Then, reload the VS Code window and reproduce the bug. Go to ViewOutput and select LTeX Language Client in the drop-down list. Paste this log here (note: it will contain your checked document):

[Trace - 14:14:28] Sending request 'textDocument/codeAction - (79)'.
Params: {
    "textDocument": {
        "uri": "file:///tmp/test-ltex/foo.tex"
    },
    "range": {
        "start": {
            "line": 7,
            "character": 13
        },
        "end": {
            "line": 7,
            "character": 13
        }
    },
    "context": {
        "diagnostics": [
            {
                "range": {
                    "start": {
                        "line": null,
                        "character": 0
                    },
                    "end": {
                        "line": null,
                        "character": 65535
                    }
                },
                "message": "Marginpar on page 1 moved.\n",
                "severity": 2,
                "source": "LaTeX"
            }
        ]
    }
}


[Trace - 14:14:28] Received request 'workspace/configuration - (107)'.
Params: {
    "items": [
        {
            "scopeUri": "file:///tmp/test-ltex/foo.tex",
            "section": "ltex"
        }
    ]
}


[Trace - 14:14:28] Sending response 'workspace/configuration - (107)'. Processing request took 10ms
Result: [
    {
        "enabled": true,
        "language": "en-GB",
        "dictionary": {},
        "disabledRules": {},
        "enabledRules": {},
        "ltex-ls": {
            "path": "",
            "languageToolHttpServerUri": ""
        },
        "java": {
            "path": "",
            "initialHeapSize": 64,
            "maximumHeapSize": 512
        },
        "commands": {
            "ignore": [
                "\\todo{}",
                "\\todo[]{}"
            ],
            "dummy": []
        },
        "environments": {
            "ignore": []
        },
        "markdown": {
            "ignore": [
                "CodeBlock",
                "FencedCodeBlock",
                "IndentedCodeBlock"
            ],
            "dummy": [
                "AutoLink",
                "Code"
            ]
        },
        "ignoreRuleInSentence": [],
        "configurationTarget": {
            "addToDictionary": "global",
            "disableRule": "workspaceFolder",
            "ignoreRuleInSentence": "workspaceFolder"
        },
        "additionalRules": {
            "motherTongue": "",
            "languageModel": "",
            "neuralNetworkModel": "",
            "word2VecModel": ""
        },
        "sentenceCacheSize": 2000,
        "diagnosticSeverity": "information",
        "trace": {
            "server": "verbose"
        },
        "javaHome": null,
        "performance": {
            "initialJavaHeapSize": null,
            "maximumHeapSize": null,
            "sentenceCacheSize": null
        },
        "ar": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "ar-DZ": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "ast-ES": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "be-BY": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "br-FR": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "ca-ES": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "ca-ES-valencia": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "da-DK": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "de": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "de-AT": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "de-CH": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "de-DE": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "de-DE-x-simple-language": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "el-GR": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "en": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "en-AU": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "en-CA": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "en-GB": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "en-NZ": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "en-US": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "en-ZA": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "eo": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "es": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "fa": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "fr": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "ga-IE": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "gl-ES": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "it": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "ja-JP": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "km-KH": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "nl": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "pl-PL": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "pt": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "pt-AO": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "pt-BR": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "pt-MZ": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "pt-PT": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "ro-RO": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "ru-RU": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "sk-SK": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "sl-SI": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "sv": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "ta-IN": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "tl-PH": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "uk-UA": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        },
        "zh-CN": {
            "dictionary": [],
            "enabledRules": [],
            "disabledRules": []
        }
    }
]


[Trace - 14:14:28] Received notification 'telemetry/event'.
Params: {
    "type": "progress",
    "uri": "file:///tmp/test-ltex/foo.tex",
    "operation": "checkDocument",
    "progress": 0
}


[Trace - 14:14:28] Received notification 'telemetry/event'.
Params: {
    "type": "progress",
    "uri": "file:///tmp/test-ltex/foo.tex",
    "operation": "checkDocument",
    "progress": 1
}


[Trace - 14:14:28] Received response 'textDocument/codeAction - (79)' in 23ms.
Result: []

Version information
List here the version information of the relevant software.

  • Operating system: Linux Debian bullseye/sid 5.6.0-2-amd64
  • VS Code: 1.46.1
  • vscode-ltex: 5.0.2
  • ltex-ls: x.xx (automatically downloaded by LTeX)
  • Java: 11.0.7-ea (system java, not sure if LTeX downloaded its own version)

Additional context/information
Didn't check any other commands apart from \todo, but tried different escape possiblities, and dummy or environment settings. Nothing worked so far for \todo.

@joker234 joker234 added 1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-unconfirmed Issue status: Bug that needs to be reproduced (all new bugs have this label) labels Jun 23, 2020
@valentjn valentjn changed the title "ltex.commands.ignore" commands not ignored \todo can't be ignored Jun 23, 2020
@valentjn valentjn added 2-confirmed Issue status: Confirmed, reproducible bug in LTeX and removed 2-unconfirmed Issue status: Bug that needs to be reproduced (all new bugs have this label) labels Jun 23, 2020
@valentjn valentjn self-assigned this Jun 23, 2020
@joker234
Copy link
Author

joker234 commented Jun 23, 2020

Update: I needed other commands. They worked in the dummy settings.

    "ltex.commands.dummy": [
        "\\acrshort{}",
        "\\acrshortpl{}",
        "\\acrfull{}",
        "\\acrfullpl{}",
        "\\citeauthor{}",
        "\\citetitle{}",
        "\\citeyear{}",
        "\\nameref{}"
    ],
    "ltex.commands.ignore": [
        "\\todo{}",
        "\\todo[]{}",
        "\\fnurl{}"
    ]

@valentjn valentjn added this to the 6.0.0 milestone Jun 23, 2020
@valentjn valentjn added the 3-fixed Issue resolution: Issue has been fixed on the develop branch label Jun 23, 2020
@valentjn
Copy link
Owner

Thanks for the report. This is a regression from #42, where users wanted to have contents of \footnote and \todo checked separately from the main text. The implementation of that feature request made it impossible to ignore these two commands. \todo used to be ignored altogether before fixing #42.

@valentjn
Copy link
Owner

Fix released in 6.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-confirmed Issue status: Confirmed, reproducible bug in LTeX 3-fixed Issue resolution: Issue has been fixed on the develop branch
Projects
None yet
Development

No branches or pull requests

2 participants