Skip to content

Some feedback on the Org parsing #159

Open
@tecosaur

Description

@tecosaur

Hello,

This is a bit of a drive-by issue as I'm not really a neovim user but I thought I'd check out the tree-sitter parsing since I think it looks cool. I've only had a little look, but a few rough spots have become apparent in the three files I checked out.

System setup

config.org

This is the first file I looked at, it's my Emacs config file, and it's massive.

Experience

File took a few seconds to open, then I got hit with

Error detected while processing CursorHold Autocommands for "*.org":
E5108: Error executing lua ...ack/packer/start/orgmode.nvim/lua/orgmode/utils/init.lua:297: too many results to unpack

The header keywords are all grey and underlined, and the rest of the document is red and underlined.

image

Thesis.org (file available on request)

This is the second Org file I tried, it's a ~60 page Thesis I wrote this year. A fair bit is going on, but it's smaller and less complicated than config.org.

Experience

Upon opening the file I immediately see the warning gutentags: ctags job failed, returned: 1.

While there's no error being blasted in my face like with config.org, unfortunately, the results don't look great here either.
All of the header keywords are underlined grey, except for the commented out subtitle which is red for some reason.
The first header, * LaTeX setup :ignore: is also red for some reason.
A few lines later we have the first source code block, and from then on the rest of the document is underlined red except for headings.

image

image

2021-04-26-Welcome.org

This is the first file that wasn't mostly underlined red text! 🎉 It's a fairly short and simple file, the first blog post I published.

Experience

Links

I notice that concel can cause some funny visual results with links

image

For reference, this is how that looks in Emacs,

image

Quite a few links also seem to be incorrectly parsed, such as

image

I tried changing the link target to see what was happening and this threw another error

Error detected while processing TextChangedI Autocommands for "*"
E5108: Error while executing lua ....e/pack/packer/start/cmp_luasnip/lua/cmp_luasnip/init.lua:65: attempted to call field 'get_snippet_filetypes' (a nil value)

image

Ignoring this and trying a few different link targets, it becomes apparent that this issue occurs when the link target spreads over multiple lines.

Inline source blocks

These don't seem to be handled well at the moment.

image

Meanwhile in Emacs,

image

It's worth noting that even if src_*{} constructs weren't special, this still shouldn't be handled as an underline. Say I replace src with hey in the Org file. This is what I then see:

image

Final comments

There are a lot of elements that aren't parsed at all, but I thought it would be best to ignore those for now while there prominent issues with the current parsing.

Lastly, apologies if this isn't as helpful as it could be. As mentioned at the start, I am not at all familiar with neovim (or vim for that matter) and so have just tried to highlight the roughest spots I've noticed. All in all I think it's fantastic to see a genuine effort being made with using tree-sitter based parsing for Org and wish you all the best going forwards. If there's anything I can do to help with a next to no neovim knowledge but a good knowledge of Org and some big/complicated files I'd be happy to assist where I can 🙂.

Metadata

Metadata

Assignees

No one assigned

    Labels

    tree-sitter-issueIssue is caused by tree-sitter parser

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions