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

Non-server command-line interface (CLI) #71

Closed
hdorgeval opened this issue May 22, 2021 · 7 comments
Closed

Non-server command-line interface (CLI) #71

hdorgeval opened this issue May 22, 2021 · 7 comments
Assignees
Labels
1-feature-request ✨ Issue type: Request for a desirable, nice-to-have feature 3-fixed Issue resolution: Issue has been fixed on the develop branch
Milestone

Comments

@hdorgeval
Copy link

hdorgeval commented May 22, 2021

Hi, I am using your extension to manually correct markdown files and it works great!

I would like to know if there is a way to write a script inside my visual studio project (nodejs + typescript), that could tell for any given markdown filepath if there is an error or not in the file.

Thanks for your response.


Note: Originally posted as issue 317 “How to use this extension programmatically?” at valentjn/vscode-ltex.

@valentjn
Copy link
Owner

LTEX uses the Language Server Protocol (LSP) architecture, which separates the display of diagnostics (“language client”) from the actual checking of documents (“language server”). Therefore, LTEX is split into the language client vscode-ltex and the language server ltex-ls. You should use ltex-ls instead and communicate with it via LSP messages. You can do so via standard input and output or via TCP sockets. Maybe we can add a non-server, file checker mode to ltex-ls.

@hdorgeval
Copy link
Author

@valentjn : thanks for your answer.

It would be great if you could provide a non-server, file checker mode to ltex-ls.

@valentjn
Copy link
Owner

It's not straightforward, and I'm currently pretty busy, so this will take a while. Learning to use the LSP might be faster for you. The file checker will probably print the results in the LSP response format, anyway.

@valentjn valentjn transferred this issue from valentjn/vscode-ltex May 24, 2021
@valentjn valentjn added the 1-feature-request ✨ Issue type: Request for a desirable, nice-to-have feature label May 24, 2021
@valentjn valentjn changed the title How to use this extension programmatically? Non-server command-line interface (CLI) May 24, 2021
@valentjn valentjn self-assigned this Jul 17, 2021
@valentjn valentjn added this to the 12.4.0 milestone Jul 17, 2021
@valentjn valentjn added the 3-fixed Issue resolution: Issue has been fixed on the develop branch label Jul 17, 2021
@valentjn
Copy link
Owner

This is now implemented via --input-documents. I opted for a human-readable output, which may be processed by scripts at the same time. The exit code indicates whether no grammar/spelling errors were found (exit code 0), or at least one error (exit code 3).

@hdorgeval
Copy link
Author

Hi @valentjn , thank you so much for integrating this new feature 👍 .

I will test it and I will give you some feedback as soon as it is published.

Regards

@valentjn
Copy link
Owner

FWIW, develop, which includes this feature, is already published as pre-release on a nightly basis. The same holds for vscode-ltex, which should be irrelevant in this case.

@valentjn
Copy link
Owner

Feature released in 13.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-feature-request ✨ Issue type: Request for a desirable, nice-to-have feature 3-fixed Issue resolution: Issue has been fixed on the develop branch
Projects
None yet
Development

No branches or pull requests

2 participants