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

Add support for org-mode files #277

Closed
sirno opened this issue Mar 16, 2021 · 8 comments
Closed

Add support for org-mode files #277

sirno opened this issue Mar 16, 2021 · 8 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

@sirno
Copy link

sirno commented Mar 16, 2021

Describe the bug
Ltex will not start with org files although enabled.

Steps to reproduce

  1. install vscode-org-mode extension
  2. Add setting:
{
"ltex.enabled": [
    "bibtex",
    "latex",
    "markdown",
    "rsweave",
    "org"
  ]
}
  1. Open a file with *.org

Expected behavior
Ltex starts and checks document

Sample document
Any org document.

LTeX configuration

{
"ltex.enabled": [
    "bibtex",
    "latex",
    "markdown",
    "rsweave",
    "org"
  ]
}
@sirno sirno 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 Mar 16, 2021
@neoscaler
Copy link

Can confirm this, seems like a general problem. I am trying to check Asciidoc (identifier 'asciidoc') files with Ltex. Same as described above. Checking MD works.

Settings:

    "ltex.enabled": [
        "bibtex",
        "latex",
        "markdown",
        "rsweave",
        "asciidoc"
    ],

@valentjn
Copy link
Owner

valentjn commented Apr 3, 2021

Maybe the docs of ltex.enabled are a bit misleading/incomplete here. Of course that setting only works for languages that are actually supported by LTEX. You can't just supply an arbitrary language and expect LTEX to be able to parse it out-of-the-box. All currently supported languages are already given in the default of ltex.enabled: bibtex, latex, markdown, and rsweave. See also the feature list in the README: “Checks LATEX and Markdown documents.” So, this issue is mostly a feature request, and partly a documentation bug.

To be able to work with org-mode files, we need an org-mode parser written in Java; the parser needs to preserve source code positions. I'll look into this. @neoscaler Please open a separate feature request for Asciidoc.

@valentjn valentjn added 1-feature-request ✨ Issue type: Request for a desirable, nice-to-have feature and removed 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 Apr 3, 2021
@valentjn valentjn changed the title Ltex will not start with orgmode files Add support for org-mode files Apr 3, 2021
valentjn added a commit that referenced this issue Apr 5, 2021
@valentjn
Copy link
Owner

valentjn commented Apr 6, 2021

The available options of org-mode parsers written in Java and in active development seem to be orgzly/org-java and 200ok-ch/org-parser. The former is licensed under GPLv3 and the latter under AGPLv3, both without linking exceptions (such as the Classpath exception). Unfortunately, these licenses are incompatible with the MPL-2.0 LTEX is using. I'm not sure how you can possibly license a library (it's a whole different story for standalone programs) under the GPL and not under the LGPL, as that essentially means that only GPL libraries/programs can use that library.

So, until somebody comes up with a different parser we can use (and which preserves source code positions), this feature is going to be out-of-scope.

Mentioning #91 as fixing that would help here as well.

@valentjn valentjn closed this as completed Apr 6, 2021
@valentjn valentjn added the 3-out-of-scope Issue resolution: Issue is out of LTeX's feature scope, or fixing this would be too complicated label Apr 6, 2021
@valentjn
Copy link
Owner

valentjn commented Apr 6, 2021

FWIW, it's possible to check arbitrary files as plain text by adding the code language ID such as "org" to ltex.enabled and activating the extension by running LTeX: Activate Extension. However, without a parser, this will yield some false positives regarding org-mode syntax.

@sirno
Copy link
Author

sirno commented Apr 6, 2021

Thanks @valentjn for the effort!

@valentjn valentjn reopened this Apr 10, 2021
@valentjn
Copy link
Owner

If the result doesn't have to be 100% accurate (regarding false positives), I'll try writing a parser myself. It doesn't have to be an actual parser; it suffices to strip all the markup away. If the syntax of org-mode is reasonable (which I don't know), this might be within my reach.

@valentjn valentjn removed the 3-out-of-scope Issue resolution: Issue is out of LTeX's feature scope, or fixing this would be too complicated label Apr 10, 2021
@sirno
Copy link
Author

sirno commented Apr 12, 2021

Since it is very similar to markdown, it may even be possible to adjust a md parser to make it work. For me, being able to activate the extension to quickly check text in all sorts of places is already great.

@valentjn valentjn self-assigned this Apr 18, 2021
@valentjn valentjn added this to the 10.1.0 milestone Apr 18, 2021
valentjn added a commit to valentjn/ltex-ls that referenced this issue Apr 18, 2021
valentjn added a commit that referenced this issue Apr 18, 2021
@valentjn valentjn added the 3-fixed Issue resolution: Issue has been fixed on the develop branch label Apr 18, 2021
@valentjn
Copy link
Owner

I finished the Org parser. Now I know enough Org to be able to say that Org isn't sufficiently similar to Markdown. Reusing the Markdown parser was not an option, unfortunately.

This is fixed in 10.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-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

3 participants