chipsenkbeil / org-roam.nvim

Port of org-roam to neovim using orgmode
MIT License
107 stars 9 forks source link

[TRACKER] Refactor parser to use nvim-orgmode/orgmode's file parsing #7

Closed chipsenkbeil closed 6 months ago

chipsenkbeil commented 6 months ago

Today, we have a custom parser that uses treesitter queries to look up information about headlines, property drawers, directives, and links. There is a lot of excess, custom work that is duplicative of what the nvim-orgmode/orgmode plugin offers.

  1. Remove the bulk of the parser and leverage OrgFile parsing to get the data.
  2. Provide a way to translate an OrgLink with an OrgRange into our OrgRoamRange because we need offset data, which isn't available from the orgmode plugin.
  3. Update scanner to return OrgFile, OrgRoamNode[], and potentially OrgRoamLink[] because we use the link data to check for links under cursor.

Note that we do not use OrgFiles to load the entire directory, although we could use the top-level OrgFiles to do the loading of individual files. The reason is that I want to get updates as we scan and parse each file. Some files could be VERY big, or we may be parsing 10k+ files and need to see progress.

Additionally, this will hopefully resolve a bug where I'm off by one with previewing lines (maybe). Not sure on this one.