Skip to content

Commit

Permalink
Add basic support for reStructuredText
Browse files Browse the repository at this point in the history
  • Loading branch information
me-johnomar authored and valentjn committed Apr 10, 2021
1 parent 7f176d2 commit 6a2063a
Show file tree
Hide file tree
Showing 11 changed files with 944 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- `ltex.hideFalsePositives``_ltex.hideFalsePositives`
- `ltex.checkDocument``_ltex.checkDocument`
- `ltex.getServerStatus``_ltex.getServerStatus`
- Add basic support for reStructuredText; use the code language ID `restructuredtext` (fixes [vscode-ltex#32](https://github.com/valentjn/vscode-ltex/issues/32))
- Add `--server-type=tcpSocket` option to communicate over a TCP socket
- Add `--host` and `--port` options to control host and port of the TCP socket
- Add `--[no-]endless` option to keep the server alive when the client terminates the connection
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[![stars](https://badgen.net/github/stars/valentjn/ltex-ls)](https://github.com/valentjn/ltex-ls) 
[![open issues](https://badgen.net/github/open-issues/valentjn/ltex-ls?label=open/closed%20issues&color=blue)](https://github.com/valentjn/ltex-ls/issues) [![closed issues](https://badgen.net/github/closed-issues/valentjn/ltex-ls?label=)](https://github.com/valentjn/ltex-ls/issues)

LT<sub>E</sub>X LS (LT<sub>E</sub>X Language Server) implements a language server according to the [Language Server Protocol (LSP)](https://microsoft.github.io/language-server-protocol/) and provides grammar and spelling errors in L<sup>A</sup>T<sub>E</sub>X and Markdown documents. The documents are checked with [LanguageTool](https://languagetool.org/).
LT<sub>E</sub>X LS (LT<sub>E</sub>X Language Server) implements a language server according to the [Language Server Protocol (LSP)](https://microsoft.github.io/language-server-protocol/) and provides grammar and spelling errors in markup documents (L<sup>A</sup>T<sub>E</sub>X, Markdown, etc.). The documents are checked with [LanguageTool](https://languagetool.org/).

Simply put, you start the language server (either locally or remotely), you send the language server your L<sup>A</sup>T<sub>E</sub>X or Markdown document, and it will respond with a list of the grammar and spelling errors in it. To use LT<sub>E</sub>X LS, you have to use a language client (usually an editor or an extension of the editor) that communicates with LT<sub>E</sub>X LS according to the LSP.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.bsplines.ltexls.parsing.latex.LatexAnnotatedTextBuilder;
import org.bsplines.ltexls.parsing.markdown.MarkdownAnnotatedTextBuilder;
import org.bsplines.ltexls.parsing.plaintext.PlaintextAnnotatedTextBuilder;
import org.bsplines.ltexls.parsing.restructuredtext.RestructuredtextAnnotatedTextBuilder;
import org.bsplines.ltexls.settings.Settings;
import org.bsplines.ltexls.tools.Tools;
import org.checkerframework.checker.nullness.qual.Nullable;
Expand All @@ -31,6 +32,8 @@ public abstract class CodeAnnotatedTextBuilder extends AnnotatedTextBuilder {
new MarkdownAnnotatedTextBuilder());
constructorMap.put("plaintext", (String codeLanguageId) ->
new PlaintextAnnotatedTextBuilder());
constructorMap.put("restructuredtext", (String codeLanguageId) ->
new RestructuredtextAnnotatedTextBuilder(codeLanguageId));
constructorMap.put("rsweave", (String codeLanguageId) ->
new LatexAnnotatedTextBuilder(codeLanguageId));
constructorMap.put("tex", (String codeLanguageId) ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.bsplines.ltexls.parsing.latex.LatexFragmentizer;
import org.bsplines.ltexls.parsing.markdown.MarkdownFragmentizer;
import org.bsplines.ltexls.parsing.plaintext.PlaintextFragmentizer;
import org.bsplines.ltexls.parsing.restructuredtext.RestructuredtextFragmentizer;
import org.bsplines.ltexls.settings.Settings;
import org.bsplines.ltexls.tools.Tools;
import org.checkerframework.checker.nullness.qual.Nullable;
Expand All @@ -35,6 +36,8 @@ public abstract class CodeFragmentizer {
new MarkdownFragmentizer(codeLanguageId));
constructorMap.put("plaintext", (String codeLanguageId) ->
new PlaintextFragmentizer(codeLanguageId));
constructorMap.put("restructuredtext", (String codeLanguageId) ->
new RestructuredtextFragmentizer(codeLanguageId));
constructorMap.put("rsweave", (String codeLanguageId) ->
new LatexFragmentizer(codeLanguageId));
constructorMap.put("tex", (String codeLanguageId) ->
Expand Down
Loading

0 comments on commit 6a2063a

Please sign in to comment.