Skip to content

Commit

Permalink
Add reStructuredText to ltex.enabled, support .rst
Browse files Browse the repository at this point in the history
See #32.
  • Loading branch information
valentjn committed Apr 10, 2021
1 parent 95f9005 commit 304ba0a
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

## 10.1.0 (upcoming)

- Add basic support for reStructuredText (fixes [#32](https://github.com/valentjn/vscode-ltex/issues/32))
- Add [`LTeX: Reset and Restart`](https://valentjn.github.io/vscode-ltex/docs/commands.html#ltex-reset-and-restart) command to reset the extension and restart LT<sub>E</sub>X LS (equivalent to reloading the VS Code window)
- Fix inconsistent titles of German commands
- Hide internal commands in table of keyboard shortcuts to prevent confusion (see [#282](https://github.com/valentjn/vscode-ltex/issues/282))
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- file, You can obtain one at https://mozilla.org/MPL/2.0/.
-->

# LT<sub>E</sub>X Extension for VS Code: Grammar/Spell Checker with LanguageTool and L<sup>A</sup>T<sub>E</sub>X/Markdown Support
# LT<sub>E</sub>X Extension for VS Code: Grammar/Spell Checker Using LanguageTool with Support for L<sup>A</sup>T<sub>E</sub>X, Markdown, and Others

[![latest release](https://badgen.net/badge/-/release/585858?label=)![version number](https://badgen.net/vs-marketplace/v/valentjn.vscode-ltex?label=)![release date](https://badgen.net/github/last-commit/valentjn/vscode-ltex/release?label=)][website]&nbsp;
[![installs](https://badgen.net/vs-marketplace/i/valentjn.vscode-ltex)][website]&nbsp;
Expand Down Expand Up @@ -41,9 +41,10 @@ LT<sub>E</sub>X is a successor (since it's a fork) of the abandoned [LanguageToo

![Grammar/Spell Checker for VS Code with LanguageTool and LaTeX Support](https://github.com/valentjn/vscode-ltex/raw/release/img/banner-ltex.png)

- Checks **L<sup>A</sup>T<sub>E</sub>X** and **Markdown** documents
- **Supported markup languages:** L<sup>A</sup>T<sub>E</sub>X, Markdown, reStructuredText, R Sweave
- Comes with **everything included,** no need to install Java or LanguageTool
- Supports **over 20 languages**
- **Offline checking:** Does not upload anything to the internet
- Supports **over 20 languages:** English, French, German, Dutch, Chinese, Russian, etc.
- **Issue highlighting** with hover description
- **Replacement suggestions** via quick fixes
- **User dictionaries**
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-ltex",
"displayName": "LTeX",
"version": "10.0.0",
"description": "Grammar/spell checker with LanguageTool and LaTeX/Markdown support",
"description": "Grammar/spell checker using LanguageTool with support for LaTeX, Markdown, and others",
"icon": "img/logo-ltex.png",
"author": "Julian Valentin",
"publisher": "valentjn",
Expand Down Expand Up @@ -52,6 +52,7 @@
"onLanguage:bibtex",
"onLanguage:latex",
"onLanguage:markdown",
"onLanguage:restructuredtext",
"onLanguage:rsweave"
],
"extensionKind": [
Expand Down Expand Up @@ -79,6 +80,7 @@
"bibtex",
"latex",
"markdown",
"restructuredtext",
"rsweave"
],
"markdownDescription": "%ltex.i18n.configuration.ltex.enabled.markdownDescription%"
Expand Down
2 changes: 1 addition & 1 deletion package.nls.de.json
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@
"ltex.i18n.commands.ltex.checkCurrentDocument.title": "Aktuelles Dokument prüfen",
"ltex.i18n.commands.ltex.checkCurrentDocument.fullMarkdownDescription": "Löst eine Prüfung des aktiven Dokuments aus.\n\nDas aktive Dokument ist dasjenige, dessen Editor momentan den Fokus besitzt, oder, falls kein Editor den Fokus besitzt, welches als letztes geändert wurde.\n\nEs ist normalerweise nicht nötig, diesen Befehl auszuführen, da LTeX alle unterstützten Dokumente prüft, wenn sie geöffnet oder geändert werden.",
"ltex.i18n.commands.ltex.checkAllDocumentsInWorkspace.title": "Alle Dokumente im Arbeitsbereich prüfen",
"ltex.i18n.commands.ltex.checkAllDocumentsInWorkspace.fullMarkdownDescription": "Löst eine Prüfung aller Markdown- und LaTeX-Dokumente im Arbeitsbereich aus.\n\nDies führt eine Dateisuche nach `*.bib`-, `*.tex`- und `*.md`-Dateien in allen Ordnern des Arbeitsbereiches durch, je nachdem, für welche Dateitypen LTeX aktiviert wurde (siehe `ltex.enabled`). Unbenannte und ungespeicherte Dokumente werden nicht überprüft. Die Dokumenttypen werden anhand der Dateinamen-Erweiterungen erkannt.\n\nDie Dokumente müssen in der UTF-8-Kodierung vorliegen. Dies funktioniert nicht, falls keine Ordner im Arbeitsbereich geöffnet sind.",
"ltex.i18n.commands.ltex.checkAllDocumentsInWorkspace.fullMarkdownDescription": "Löst eine Prüfung aller Markdown- und LaTeX-Dokumente im Arbeitsbereich aus.\n\nDies führt eine Dateisuche nach `*.bib`-, `*.md`-, `*.rst`- und `*.tex`-Dateien in allen Ordnern des Arbeitsbereiches durch, je nachdem, für welche Dateitypen LTeX aktiviert wurde (siehe `ltex.enabled`). Unbenannte und ungespeicherte Dokumente werden nicht überprüft. Die Dokumenttypen werden anhand der Dateinamen-Erweiterungen erkannt.\n\nDie Dokumente müssen in der UTF-8-Kodierung vorliegen. Dies funktioniert nicht, falls keine Ordner im Arbeitsbereich geöffnet sind.",
"ltex.i18n.commands.ltex.clearDiagnosticsInCurrentDocument.title": "Schreibfehler in aktuellem Dokument löschen",
"ltex.i18n.commands.ltex.clearDiagnosticsInCurrentDocument.fullMarkdownDescription": "Löscht alle durch LTeX gemeldeten Schreibfehler im aktiven Dokument.\n\nDas aktive Dokument ist dasjenige, dessen Editor momentan den Fokus besitzt, oder, falls kein Editor den Fokus besitzt, welches als letztes geändert wurde.",
"ltex.i18n.commands.ltex.clearAllDiagnostics.title": "Alle Schreibfehler löschen",
Expand Down
2 changes: 1 addition & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@
"ltex.i18n.commands.ltex.checkCurrentDocument.title": "Check Current Document",
"ltex.i18n.commands.ltex.checkCurrentDocument.fullMarkdownDescription": "Triggers a check of the active document.\n\nThe active document is the one whose editor currently has focus, or, if none has focus, the one which was changed most recently.\n\nIt is usually not necessary to run this command as LTeX automatically checks supported documents when being opened or changed.",
"ltex.i18n.commands.ltex.checkAllDocumentsInWorkspace.title": "Check All Documents in Workspace",
"ltex.i18n.commands.ltex.checkAllDocumentsInWorkspace.fullMarkdownDescription": "Triggers a check of all Markdown and LaTeX documents in the workspace.\n\nThis does a file search for `*.bib`, `*.tex`, and `*.md` files in all folders of the workspace, depending on for which file types LTeX has been enabled (see `ltex.enabled`). Untitled and unsaved documents are not checked. The types of the documents are recognized by their file extensions.\n\nThe documents must be in UTF-8 encoding. This does not work if no folders are opened in the workspace.",
"ltex.i18n.commands.ltex.checkAllDocumentsInWorkspace.fullMarkdownDescription": "Triggers a check of all Markdown and LaTeX documents in the workspace.\n\nThis does a file search for `*.bib`, `*.md`, `*.rst`, and `*.tex` files in all folders of the workspace, depending on for which file types LTeX has been enabled (see `ltex.enabled`). Untitled and unsaved documents are not checked. The types of the documents are recognized by their file extensions.\n\nThe documents must be in UTF-8 encoding. This does not work if no folders are opened in the workspace.",
"ltex.i18n.commands.ltex.clearDiagnosticsInCurrentDocument.title": "Clear Diagnostics in Current Document",
"ltex.i18n.commands.ltex.clearDiagnosticsInCurrentDocument.fullMarkdownDescription": "Clears all LTeX diagnostics in the active document.\n\nThe active document is the one whose editor currently has focus, or, if none has focus, the one which was changed most recently.",
"ltex.i18n.commands.ltex.clearAllDiagnostics.title": "Clear All Diagnostics",
Expand Down
7 changes: 6 additions & 1 deletion src/CommandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ export default class CommandHandler {
let enabledCodeLanguageIds: string[];

if ((enabled === true) || (enabled === false)) {
enabledCodeLanguageIds = (enabled ? ['bibtex', 'latex', 'markdown', 'rsweave'] : []);
enabledCodeLanguageIds = (enabled
? ['bibtex', 'latex', 'markdown', 'restructuredtext', 'rsweave'] : []);
} else {
enabledCodeLanguageIds = enabled;
}
Expand All @@ -245,6 +246,10 @@ export default class CommandHandler {
enabledFileExtensions.add('md');
break;
}
case 'restructuredtext': {
enabledFileExtensions.add('rst');
break;
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ async function startLanguageClient(context: Code.ExtensionContext,
let enabledCodeLanguageIds: string[];

if ((enabled === true) || (enabled === false)) {
enabledCodeLanguageIds = (enabled ? ['bibtex', 'latex', 'markdown', 'rsweave'] : []);
enabledCodeLanguageIds = (enabled
? ['bibtex', 'latex', 'markdown', 'restructuredtext', 'rsweave'] : []);
} else {
enabledCodeLanguageIds = enabled;
}
Expand Down

0 comments on commit 304ba0a

Please sign in to comment.