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

Spell checker in markdown table concats cells #903

Open
Flamefire opened this issue Feb 5, 2025 · 0 comments
Open

Spell checker in markdown table concats cells #903

Flamefire opened this issue Feb 5, 2025 · 0 comments
Labels
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)

Comments

@Flamefire
Copy link

Flamefire commented Feb 5, 2025

Describe the bug

When using a markdown table the spell checker considers the last word of the last cell in a row adjacent to the first word of the first cell in the next row and reports a wrong spelling error.

Steps to reproduce
Steps to reproduce the behavior:

  1. Create new markdown document with below content
  2. Let spell checker run
  3. "transfer\nsbatch" (and only that) is highlighted as an error

Expected behavior

No error should be reported

Sample document

# XX

|term|meaning|
|----------|----------|
|**home**  | transfer |
|**sbatch**| xx sbatch|

LTeX configuration

"ltex.trace.server": "verbose"

"LTeX Language Server" log file

Feb. 05, 2025 4:19:19 NACHM. org.bsplines.ltexls.server.DocumentChecker logTextToBeChecked
FEIN: Checking the following text in language 'en-US' via LanguageTool: "XX\n\nterm meaning\n\nhome transfer\nsbatch xx sbatch\n"
Feb. 05, 2025 4:19:19 NACHM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment
FEIN: Obtained 1 rule match

"LTeX Language Client" log file

[Trace - 16:23:17] Sending request 'textDocument/codeAction - (2915)'.
Params: {
    "textDocument": {
        "uri": "file:///dev/shm/foo.md"
    },
    "range": {
        "start": {
            "line": 0,
            "character": 0
        },
        "end": {
            "line": 0,
            "character": 0
        }
    },
    "context": {
        "diagnostics": []
    }
}


[Trace - 16:23:17] Received response 'textDocument/codeAction - (2915)' in 14ms.
Result: []


[Trace - 16:23:18] Sending request 'textDocument/codeAction - (2916)'.
Params: {
    "textDocument": {
        "uri": "file:///dev/shm/foo.md"
    },
    "range": {
        "start": {
            "line": 0,
            "character": 0
        },
        "end": {
            "line": 6,
            "character": 0
        }
    },
    "context": {
        "diagnostics": [
            {
                "range": {
                    "start": {
                        "line": 4,
                        "character": 13
                    },
                    "end": {
                        "line": 5,
                        "character": 9
                    }
                },
                "message": "'transfer\nsbatch': Possible spelling mistake found.",
                "code": "MORFOLOGIK_RULE_EN_US",
                "codeDescription": {
                    "href": "https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang%3Den-US"
                },
                "severity": 3,
                "source": "LTeX"
            }
        ]
    }
}


[Trace - 16:23:18] Received response 'textDocument/codeAction - (2916)' in 8ms.
Result: [
    {
        "title": "'transfers batch' verwenden",
        "kind": "quickfix.ltex.acceptSuggestions",
        "diagnostics": [
            {
                "range": {
                    "start": {
                        "line": 4,
                        "character": 13
                    },
                    "end": {
                        "line": 5,
                        "character": 9
                    }
                },
                "severity": 3,
                "code": "MORFOLOGIK_RULE_EN_US",
                "codeDescription": {
                    "href": "https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US"
                },
                "source": "LTeX",
                "message": "'transfer\nsbatch': Possible spelling mistake found."
            }
        ],
        "edit": {
            "documentChanges": [
                {
                    "textDocument": {
                        "version": 40,
                        "uri": "file:///dev/shm/foo.md"
                    },
                    "edits": [
                        {
                            "range": {
                                "start": {
                                    "line": 4,
                                    "character": 13
                                },
                                "end": {
                                    "line": 5,
                                    "character": 9
                                }
                            },
                            "newText": "transfers batch"
                        }
                    ]
                }
            ]
        }
    },
    {
        "title": "'transfer batch' verwenden",
        "kind": "quickfix.ltex.acceptSuggestions",
        "diagnostics": [
            {
                "range": {
                    "start": {
                        "line": 4,
                        "character": 13
                    },
                    "end": {
                        "line": 5,
                        "character": 9
                    }
                },
                "severity": 3,
                "code": "MORFOLOGIK_RULE_EN_US",
                "codeDescription": {
                    "href": "https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US"
                },
                "source": "LTeX",
                "message": "'transfer\nsbatch': Possible spelling mistake found."
            }
        ],
        "edit": {
            "documentChanges": [
                {
                    "textDocument": {
                        "version": 40,
                        "uri": "file:///dev/shm/foo.md"
                    },
                    "edits": [
                        {
                            "range": {
                                "start": {
                                    "line": 4,
                                    "character": 13
                                },
                                "end": {
                                    "line": 5,
                                    "character": 9
                                }
                            },
                            "newText": "transfer batch"
                        }
                    ]
                }
            ]
        }
    },
    {
        "title": "'transfer snatch' verwenden",
        "kind": "quickfix.ltex.acceptSuggestions",
        "diagnostics": [
            {
                "range": {
                    "start": {
                        "line": 4,
                        "character": 13
                    },
                    "end": {
                        "line": 5,
                        "character": 9
                    }
                },
                "severity": 3,
                "code": "MORFOLOGIK_RULE_EN_US",
                "codeDescription": {
                    "href": "https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US"
                },
                "source": "LTeX",
                "message": "'transfer\nsbatch': Possible spelling mistake found."
            }
        ],
        "edit": {
            "documentChanges": [
                {
                    "textDocument": {
                        "version": 40,
                        "uri": "file:///dev/shm/foo.md"
                    },
                    "edits": [
                        {
                            "range": {
                                "start": {
                                    "line": 4,
                                    "character": 13
                                },
                                "end": {
                                    "line": 5,
                                    "character": 9
                                }
                            },
                            "newText": "transfer snatch"
                        }
                    ]
                }
            ]
        }
    },
    {
        "title": "'transfer swatch' verwenden",
        "kind": "quickfix.ltex.acceptSuggestions",
        "diagnostics": [
            {
                "range": {
                    "start": {
                        "line": 4,
                        "character": 13
                    },
                    "end": {
                        "line": 5,
                        "character": 9
                    }
                },
                "severity": 3,
                "code": "MORFOLOGIK_RULE_EN_US",
                "codeDescription": {
                    "href": "https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US"
                },
                "source": "LTeX",
                "message": "'transfer\nsbatch': Possible spelling mistake found."
            }
        ],
        "edit": {
            "documentChanges": [
                {
                    "textDocument": {
                        "version": 40,
                        "uri": "file:///dev/shm/foo.md"
                    },
                    "edits": [
                        {
                            "range": {
                                "start": {
                                    "line": 4,
                                    "character": 13
                                },
                                "end": {
                                    "line": 5,
                                    "character": 9
                                }
                            },
                            "newText": "transfer swatch"
                        }
                    ]
                }
            ]
        }
    },
    {
        "title": "'transfer s batch' verwenden",
        "kind": "quickfix.ltex.acceptSuggestions",
        "diagnostics": [
            {
                "range": {
                    "start": {
                        "line": 4,
                        "character": 13
                    },
                    "end": {
                        "line": 5,
                        "character": 9
                    }
                },
                "severity": 3,
                "code": "MORFOLOGIK_RULE_EN_US",
                "codeDescription": {
                    "href": "https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US"
                },
                "source": "LTeX",
                "message": "'transfer\nsbatch': Possible spelling mistake found."
            }
        ],
        "edit": {
            "documentChanges": [
                {
                    "textDocument": {
                        "version": 40,
                        "uri": "file:///dev/shm/foo.md"
                    },
                    "edits": [
                        {
                            "range": {
                                "start": {
                                    "line": 4,
                                    "character": 13
                                },
                                "end": {
                                    "line": 5,
                                    "character": 9
                                }
                            },
                            "newText": "transfer s batch"
                        }
                    ]
                }
            ]
        }
    },
    {
        "title": "'transfer\nsbatch' zum Wörterbuch hinzufügen",
        "kind": "quickfix.ltex.addToDictionary",
        "diagnostics": [
            {
                "range": {
                    "start": {
                        "line": 4,
                        "character": 13
                    },
                    "end": {
                        "line": 5,
                        "character": 9
                    }
                },
                "severity": 3,
                "code": "MORFOLOGIK_RULE_EN_US",
                "codeDescription": {
                    "href": "https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US"
                },
                "source": "LTeX",
                "message": "'transfer\nsbatch': Possible spelling mistake found."
            }
        ],
        "command": {
            "title": "'transfer\nsbatch' zum Wörterbuch hinzufügen",
            "command": "_ltex.addToDictionary",
            "arguments": [
                {
                    "uri": "file:///dev/shm/foo.md",
                    "words": {
                        "en-US": [
                            "transfer\nsbatch"
                        ]
                    }
                }
            ]
        }
    },
    {
        "title": "Falschen Fehler verbergen",
        "kind": "quickfix.ltex.hideFalsePositives",
        "diagnostics": [
            {
                "range": {
                    "start": {
                        "line": 4,
                        "character": 13
                    },
                    "end": {
                        "line": 5,
                        "character": 9
                    }
                },
                "severity": 3,
                "code": "MORFOLOGIK_RULE_EN_US",
                "codeDescription": {
                    "href": "https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US"
                },
                "source": "LTeX",
                "message": "'transfer\nsbatch': Possible spelling mistake found."
            }
        ],
        "command": {
            "title": "Falschen Fehler verbergen",
            "command": "_ltex.hideFalsePositives",
            "arguments": [
                {
                    "uri": "file:///dev/shm/foo.md",
                    "falsePositives": {
                        "en-US": [
                            "{\"rule\":\"MORFOLOGIK_RULE_EN_US\",\"sentence\":\"^\\\\Qhome transfer\\nsbatch xx sbatch\\\\E$\"}"
                        ]
                    }
                }
            ]
        }
    },
    {
        "title": "Regel deaktivieren",
        "kind": "quickfix.ltex.disableRules",
        "diagnostics": [
            {
                "range": {
                    "start": {
                        "line": 4,
                        "character": 13
                    },
                    "end": {
                        "line": 5,
                        "character": 9
                    }
                },
                "severity": 3,
                "code": "MORFOLOGIK_RULE_EN_US",
                "codeDescription": {
                    "href": "https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US"
                },
                "source": "LTeX",
                "message": "'transfer\nsbatch': Possible spelling mistake found."
            }
        ],
        "command": {
            "title": "Regel deaktivieren",
            "command": "_ltex.disableRules",
            "arguments": [
                {
                    "uri": "file:///dev/shm/foo.md",
                    "ruleIds": {
                        "en-US": [
                            "MORFOLOGIK_RULE_EN_US"
                        ]
                    }
                }
            ]
        }
    }
]

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

  • Operating system: Linux Mint 21.3
  • VS Code: 1.96.4
  • vscode-ltex: 13.1.0

Additional context/information

Judging from the log output and tested it also applies when the 2 words really are separated by any kind of whitespace. In the following example it highlights both the transfer\nsbatch and transfer srun but not any word in the last line (after adding sbatch/srun to local dictionary)

# XX

transfer
sbatch

transfer srun

transfer x sbatch y srun

So additionally to the table related bug there seems to be an issue when the 2nd word starts with an s for certain 1st words, like "transfer" or "run".

@Flamefire Flamefire 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 Feb 5, 2025
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-unconfirmed Issue status: Bug that needs to be reproduced (all new bugs have this label)
Projects
None yet
Development

No branches or pull requests

1 participant