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

Optional parameter of sectioning commands triggers UNPAIRED_BRACKETS rule #123

Closed
MoeRT09 opened this issue Sep 18, 2020 · 2 comments
Closed
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

@MoeRT09
Copy link

MoeRT09 commented Sep 18, 2020

Describe the bug
When the optional parameter for the short title of the sectioning commands is used, the closing bracket will be marked by LTeX saying Unpaired symbol: '[' seems to be missingLTeX - EN_UNPAIRED_BRACKETS.

The reason for this is, that somehow the closing square bracket of the optional parameter gets not stripped out before language tool checks the string:
INFORMATION: Checking the following text in language 'en-GB' via LanguageTool: '\n\nISO standards]ISO standards. '

Steps to reproduce
Steps to reproduce the behavior:

  1. Create a new LaTeX document
  2. Create boilerplate
  3. use a sectioning command with optional parameter
  4. See error

Expected behavior
The closing bracket will not get handed to language tool.

Sample document
If the bug occurs for a specific document (e.g. LaTeX), please paste it here. If your document is very long or confidential, please create and attach a smaller example for which the bug still occurs so that we can reproduce it.

Ignore the fact, that the optional parameter in this example is redundant. In the real document, an acronym command is used in the full title.

\documentclass{scrreprt}

\begin{document}
\section[ISO standards]{ISO standards}
\end{document}

LTeX configuration
Please paste all configuration settings starting with ltex. from your settings.json. You can help us by temporarily removing some irrelevant settings from your settings.json and see if the bug still occurs.

{
  "enabled": true,
  "language": "en-GB",
  "dictionary": {
    "en-GB": [
      "Cellsim",
      "depacketisation",
      "downlink",
      "packetisation",
      "Saturatr",
      "testbed"
    ]
  },
  "workspaceDictionary": {},
  "workspaceFolderDictionary": {},
  "disabledRules": {},
  "workspaceDisabledRules": {},
  "workspaceFolderDisabledRules": {},
  "enabledRules": {},
  "workspaceEnabledRules": {},
  "workspaceFolderEnabledRules": {},
  "ltex-ls": {
    "path": "",
    "languageToolHttpServerUri": ""
  },
  "java": {
    "path": "",
    "initialHeapSize": 64,
    "maximumHeapSize": 512
  },
  "commands": {
    "ignore": [],
    "dummy": [
      "\\glsentrylong{}",
      "\\Ac{}",
      "\\acp{}",
      "\\newacronym{}{}",
      "\\acrshort{}",
      "\\acl{}",
      "\\glsentryshort{}",
      "\\ac{}",
      "\\acs{}",
      "\\mintinline{}{}"
    ]
  },
  "environments": {
    "ignore": [
      "minted"
    ]
  },
  "markdown": {
    "ignore": [
      "CodeBlock",
      "FencedCodeBlock",
      "IndentedCodeBlock"
    ],
    "dummy": [
      "AutoLink",
      "Code"
    ]
  },
  "ignoreRuleInSentence": [],
  "configurationTarget": {
    "addToDictionary": "workspaceFolder",
    "disableRule": "workspaceFolder",
    "ignoreRuleInSentence": "workspaceFolder"
  },
  "additionalRules": {
    "motherTongue": "",
    "languageModel": "",
    "neuralNetworkModel": "",
    "word2VecModel": ""
  },
  "sentenceCacheSize": 2000,
  "diagnosticSeverity": "information",
  "clearDiagnosticsWhenClosingFile": true,
  "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:

[Info  - 12:21:35] Starte ltex-ls ...
Sep. 18, 2020 12:21:38 NACHM. org.bsplines.ltexls.LtexLanguageServer initialize
INFORMATION: Setting locale to 'en'
Sep. 18, 2020 12:21:39 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Checking the following text in language 'en-GB' via LanguageTool: '\n\nDummy0 '
Sep. 18, 2020 12:21:42 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Obtained 0 rule matches
Sep. 18, 2020 12:21:45 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Checking the following text in language 'en-GB' via LanguageTool: '\n\n\n\n'
Sep. 18, 2020 12:21:45 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Obtained 0 rule matches
Sep. 18, 2020 12:21:46 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Checking the following text in language 'en-GB' via LanguageTool: '\n\nISO standards]Dummy0 standards. '
Sep. 18, 2020 12:21:46 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Obtained 1 rule match
Sep. 18, 2020 12:21:49 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Checking the following text in language 'en-GB' via LanguageTool: '\n\nISO standards]Dummy0 standards. '
Sep. 18, 2020 12:21:49 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Obtained 1 rule match
Sep. 18, 2020 12:22:38 NACHM. org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint notify
INFORMATION: Unsupported notification method: $/setTraceNotification
Sep. 18, 2020 12:22:38 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Checking the following text in language 'en-GB' via LanguageTool: '\n\nISO standards]iso. standards. '
Sep. 18, 2020 12:22:38 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Obtained 3 rule matches
Sep. 18, 2020 12:22:41 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Checking the following text in language 'en-GB' via LanguageTool: '\n\nISO standards]iso. standards. '
Sep. 18, 2020 12:22:41 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Obtained 3 rule matches
Sep. 18, 2020 12:22:43 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Checking the following text in language 'en-GB' via LanguageTool: '\n\nISO standards]iso. standards. '
Sep. 18, 2020 12:22:43 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Obtained 3 rule matches
Sep. 18, 2020 12:22:46 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Checking the following text in language 'en-GB' via LanguageTool: '\n\nISO standards]iso. standards. '
Sep. 18, 2020 12:22:46 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Obtained 3 rule matches
Sep. 18, 2020 12:22:51 NACHM. org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint notify
INFORMATION: Unsupported notification method: $/setTraceNotification
Sep. 18, 2020 12:22:51 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Checking the following text in language 'en-GB' via LanguageTool: '\n\nISO standards]Dummy0 standards. '
Sep. 18, 2020 12:22:51 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Obtained 1 rule match
Sep. 18, 2020 12:23:18 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Checking the following text in language 'en-GB' via LanguageTool: '\n\n[ISO standards]Dummy0 standards '
Sep. 18, 2020 12:23:18 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Obtained 0 rule matches
Sep. 18, 2020 12:23:18 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Checking the following text in language 'en-GB' via LanguageTool: '\n\n[ISO standards]Dummy0 standards '
Sep. 18, 2020 12:23:18 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Obtained 0 rule matches
Sep. 18, 2020 12:23:19 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Checking the following text in language 'en-GB' via LanguageTool: '\n\nISO standards]Dummy0 standards. '
Sep. 18, 2020 12:23:19 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Obtained 1 rule match
Sep. 18, 2020 12:28:06 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Checking the following text in language 'en-GB' via LanguageTool: '\n\nISO standards]I standards. '
Sep. 18, 2020 12:28:06 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Obtained 2 rule matches
Sep. 18, 2020 12:28:06 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Checking the following text in language 'en-GB' via LanguageTool: '\n\nISO standards]IS standards. '
Sep. 18, 2020 12:28:06 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Obtained 1 rule match
Sep. 18, 2020 12:28:06 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Checking the following text in language 'en-GB' via LanguageTool: '\n\nISO standards]ISO standards. '
Sep. 18, 2020 12:28:06 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Obtained 1 rule match
Sep. 18, 2020 12:28:09 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Checking the following text in language 'en-GB' via LanguageTool: '\n\nISO standards]ISO standards. '
Sep. 18, 2020 12:28:09 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Obtained 1 rule match
Sep. 18, 2020 12:28:19 NACHM. org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint notify
INFORMATION: Unsupported notification method: $/setTraceNotification
Sep. 18, 2020 12:28:19 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: Checking the following text in language 'en-GB' via LanguageTool: '\n\nISO standards]ISO standards. '
Sep. 18, 2020 12:28:19 NACHM. org.bsplines.ltexls.DocumentChecker checkAnnotatedTextFragment
INFORMATION: 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):

2020-09-18T10:21:31.130Z Info: Setting LTeX UI language to 'de'.
2020-09-18T10:21:31.130Z Info: Loading i18n messages...
2020-09-18T10:21:31.131Z Info: Loading default i18n messages...
2020-09-18T10:21:31.132Z Info: 
2020-09-18T10:21:31.132Z Info: ltex.ltex-ls.path not set.
2020-09-18T10:21:31.132Z Info: Searching for ltex-ls in 'c:\Users\moert\.vscode\extensions\valentjn.vscode-ltex-7.0.0\lib'...
2020-09-18T10:21:31.133Z Info: ltex-ls found in 'c:\Users\moert\.vscode\extensions\valentjn.vscode-ltex-7.0.0\lib\ltex-ls-7.0.0'.
2020-09-18T10:21:31.133Z Info: 
2020-09-18T10:21:31.133Z Info: ltex.java.path not set.
2020-09-18T10:21:31.133Z Info: Using ltex-ls from 'c:\Users\moert\.vscode\extensions\valentjn.vscode-ltex-7.0.0\lib\ltex-ls-7.0.0'.
2020-09-18T10:21:31.133Z Info: Using Java from PATH or JAVA_HOME (may fail if not installed).
2020-09-18T10:21:31.136Z Info: Testing ltex-ls...
2020-09-18T10:21:31.137Z Info:   Command: "c:\\Users\\moert\\.vscode\\extensions\\valentjn.vscode-ltex-7.0.0\\lib\\ltex-ls-7.0.0\\bin\\ltex-ls.bat"
2020-09-18T10:21:31.137Z Info:   Arguments: ["--version"]
2020-09-18T10:21:31.137Z Info:   env['JAVA_HOME']: "C:\\Program Files\\Java\\jdk1.8.0_211"
2020-09-18T10:21:31.137Z Info:   env['JAVA_OPTS']: "-Xms64m -Xmx512m"
2020-09-18T10:21:31.857Z Info: Test failed due to too old Java. You have Java 8 (version 1.8.0_211). Please upgrade to Java 11 or newer.
2020-09-18T10:21:31.916Z Info: 
2020-09-18T10:21:31.916Z Info: Searching for Java in 'c:\Users\moert\.vscode\extensions\valentjn.vscode-ltex-7.0.0\lib'...
2020-09-18T10:21:31.916Z Info: Java found in 'c:\Users\moert\.vscode\extensions\valentjn.vscode-ltex-7.0.0\lib\jdk-11.0.8+10-jre'.
2020-09-18T10:21:31.916Z Info: Using ltex-ls from 'c:\Users\moert\.vscode\extensions\valentjn.vscode-ltex-7.0.0\lib\ltex-ls-7.0.0'.
2020-09-18T10:21:31.916Z Info: Using Java from 'c:\Users\moert\.vscode\extensions\valentjn.vscode-ltex-7.0.0\lib\jdk-11.0.8+10-jre'.
2020-09-18T10:21:31.917Z Info: Testing ltex-ls...
2020-09-18T10:21:31.917Z Info:   Command: "c:\\Users\\moert\\.vscode\\extensions\\valentjn.vscode-ltex-7.0.0\\lib\\ltex-ls-7.0.0\\bin\\ltex-ls.bat"
2020-09-18T10:21:31.917Z Info:   Arguments: ["--version"]
2020-09-18T10:21:31.917Z Info:   env['JAVA_HOME']: "c:\\Users\\moert\\.vscode\\extensions\\valentjn.vscode-ltex-7.0.0\\lib\\jdk-11.0.8+10-jre"
2020-09-18T10:21:31.917Z Info:   env['JAVA_OPTS']: "-Xms64m -Xmx512m"
2020-09-18T10:21:35.036Z Info: Test successful!
2020-09-18T10:21:35.036Z Info: 
2020-09-18T10:21:35.041Z Info: Starte ltex-ls ...
2020-09-18T10:21:35.041Z Info:   Command: "c:\\Users\\moert\\.vscode\\extensions\\valentjn.vscode-ltex-7.0.0\\lib\\ltex-ls-7.0.0\\bin\\ltex-ls.bat"
2020-09-18T10:21:35.041Z Info:   Arguments: []
2020-09-18T10:21:35.041Z Info:   env['JAVA_HOME']: "c:\\Users\\moert\\.vscode\\extensions\\valentjn.vscode-ltex-7.0.0\\lib\\jdk-11.0.8+10-jre"
2020-09-18T10:21:35.041Z Info:   env['JAVA_OPTS']: "-Xms64m -Xmx512m"
2020-09-18T10:21:35.041Z Info: 
[Trace - 12:28:19] Sending notification '$/setTraceNotification'.
Params: {
    "value": "verbose"
}


[Trace - 12:28:19] Sending notification 'workspace/didChangeConfiguration'.
Params: {
    "settings": {
        "ltex": {
            "enabled": true,
            "language": "en-GB",
            "dictionary": {
                "en-GB": [
                    "Cellsim",
                    "depacketisation",
                    "downlink",
                    "packetisation",
                    "Saturatr",
                    "testbed"
                ]
            },
            "workspaceDictionary": {},
            "workspaceFolderDictionary": {},
            "disabledRules": {},
            "workspaceDisabledRules": {},
            "workspaceFolderDisabledRules": {},
            "enabledRules": {},
            "workspaceEnabledRules": {},
            "workspaceFolderEnabledRules": {},
            "ltex-ls": {
                "path": "",
                "languageToolHttpServerUri": ""
            },
            "java": {
                "path": "",
                "initialHeapSize": 64,
                "maximumHeapSize": 512
            },
            "commands": {
                "ignore": [],
                "dummy": [
                    "\\glsentrylong{}",
                    "\\Ac{}",
                    "\\acp{}",
                    "\\newacronym{}{}",
                    "\\acrshort{}",
                    "\\acl{}",
                    "\\glsentryshort{}",
                    "\\ac{}",
                    "\\acs{}",
                    "\\mintinline{}{}"
                ]
            },
            "environments": {
                "ignore": [
                    "minted"
                ]
            },
            "markdown": {
                "ignore": [
                    "CodeBlock",
                    "FencedCodeBlock",
                    "IndentedCodeBlock"
                ],
                "dummy": [
                    "AutoLink",
                    "Code"
                ]
            },
            "ignoreRuleInSentence": [],
            "configurationTarget": {
                "addToDictionary": "workspaceFolder",
                "disableRule": "workspaceFolder",
                "ignoreRuleInSentence": "workspaceFolder"
            },
            "additionalRules": {
                "motherTongue": "",
                "languageModel": "",
                "neuralNetworkModel": "",
                "word2VecModel": ""
            },
            "sentenceCacheSize": 2000,
            "diagnosticSeverity": "information",
            "clearDiagnosticsWhenClosingFile": true,
            "trace": {
                "server": "verbose"
            }
        }
    }
}


[Trace - 12:28:19] Received request 'workspace/configuration - (17)'.
Params: {
    "items": [
        {
            "scopeUri": "file:///d%3A/Users/moert/Downloads/latextest/test.tex",
            "section": "ltex"
        }
    ]
}


[Trace - 12:28:19] Sending response 'workspace/configuration - (17)'. Processing request took 7ms
Result: [
    {
        "enabled": true,
        "language": "en-GB",
        "dictionary": {
            "en-GB": [
                "Cellsim",
                "depacketisation",
                "downlink",
                "packetisation",
                "Saturatr",
                "testbed"
            ]
        },
        "workspaceDictionary": {},
        "workspaceFolderDictionary": {},
        "disabledRules": {},
        "workspaceDisabledRules": {},
        "workspaceFolderDisabledRules": {},
        "enabledRules": {},
        "workspaceEnabledRules": {},
        "workspaceFolderEnabledRules": {},
        "ltex-ls": {
            "path": "",
            "languageToolHttpServerUri": ""
        },
        "java": {
            "path": "",
            "initialHeapSize": 64,
            "maximumHeapSize": 512
        },
        "commands": {
            "ignore": [],
            "dummy": [
                "\\glsentrylong{}",
                "\\Ac{}",
                "\\acp{}",
                "\\newacronym{}{}",
                "\\acrshort{}",
                "\\acl{}",
                "\\glsentryshort{}",
                "\\ac{}",
                "\\acs{}",
                "\\mintinline{}{}"
            ]
        },
        "environments": {
            "ignore": [
                "minted"
            ]
        },
        "markdown": {
            "ignore": [
                "CodeBlock",
                "FencedCodeBlock",
                "IndentedCodeBlock"
            ],
            "dummy": [
                "AutoLink",
                "Code"
            ]
        },
        "ignoreRuleInSentence": [],
        "configurationTarget": {
            "addToDictionary": "workspaceFolder",
            "disableRule": "workspaceFolder",
            "ignoreRuleInSentence": "workspaceFolder"
        },
        "additionalRules": {
            "motherTongue": "",
            "languageModel": "",
            "neuralNetworkModel": "",
            "word2VecModel": ""
        },
        "sentenceCacheSize": 2000,
        "diagnosticSeverity": "information",
        "clearDiagnosticsWhenClosingFile": true,
        "trace": {
            "server": "verbose"
        }
    }
]


[Trace - 12:28:19] Received notification 'telemetry/event'.
Params: {
    "type": "progress",
    "uri": "file:///d%3A/Users/moert/Downloads/latextest/test.tex",
    "operation": "checkDocument",
    "progress": 0
}


[Trace - 12:28:19] Received notification 'telemetry/event'.
Params: {
    "type": "progress",
    "uri": "file:///d%3A/Users/moert/Downloads/latextest/test.tex",
    "operation": "checkDocument",
    "progress": 1
}


[Trace - 12:28:19] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "uri": "file:///d%3A/Users/moert/Downloads/latextest/test.tex",
    "diagnostics": [
        {
            "range": {
                "start": {
                    "line": 3,
                    "character": 22
                },
                "end": {
                    "line": 3,
                    "character": 23
                }
            },
            "severity": 3,
            "source": "LTeX - EN_UNPAIRED_BRACKETS",
            "message": "Unpaired symbol: '[' seems to be missing"
        }
    ]
}


[Trace - 12:28:20] Sending request 'textDocument/codeAction - (23)'.
Params: {
    "textDocument": {
        "uri": "file:///d%3A/Users/moert/Downloads/latextest/test.tex"
    },
    "range": {
        "start": {
            "line": 0,
            "character": 0
        },
        "end": {
            "line": 0,
            "character": 0
        }
    },
    "context": {
        "diagnostics": []
    }
}


[Trace - 12:28:20] Received response 'textDocument/codeAction - (23)' in 38ms.
Result: []


2020-09-18T10:29:43.117Z Info: Creating bug report...

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

  • Operating system: Windows_NT (win32), x64, 10.0.19042
  • VS Code: 1.49.0
  • vscode-ltex: 7.0.0
  • ltex-ls: 7.0.0
  • Java: 11.0.8

Additional context/information
You can add any other context or information about the problem here.

@valentjn valentjn 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) 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 Sep 18, 2020
@valentjn valentjn self-assigned this Sep 18, 2020
@valentjn valentjn added this to the 7.1.0 milestone Sep 18, 2020
@valentjn
Copy link
Owner

Thank you @MoeRT09 for the detailed bug report. This is now fixed on develop, and the fix will be in the next release of LTEX. Thanks again!

@valentjn valentjn added the 3-fixed Issue resolution: Issue has been fixed on the develop branch label Sep 18, 2020
@valentjn
Copy link
Owner

Fix released in 7.1.0.

me-johnomar added a commit to me-johnomar/ltex-ls that referenced this issue Jan 31, 2024
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