ihdavids / orgextended

Sublime Text OrgMode Extension
MIT License
209 stars 15 forks source link

Org Todo View command shows an empty file, despite TODOs existing in tracked files #80

Closed dyaso closed 1 month ago

dyaso commented 9 months ago

In a .org file in a tracked directory, a heading like "* TODO thing" is highlighted correctly, but issuing the "Org Todo View" command opens an empty file.

Adding a tag and using "Org Filtered Todo View" also shows an empty file.

I'm on Manjaro linux. The only error in Sublime's ctrl+~ log thing is "Error loading embed in syntax file "Packages/OrgExtended/OrgExtended.sublime-syntax": Unable to find syntax file for scope "source.powershell"", in case that's relevant, but OrgExtended seems to be running as the manual describes it, other than not creating todo views.

ihdavids commented 9 months ago

It's been a bit but it probably has to do with the setup of that command. 3/4 of the way down this page: https://github.com/ihdavids/orgextended_docs/blob/master/learning_todos.org

It talks a bit about the todo view setup. It's pretty complicated. But the definition of task can be a project based task vs a loose todo. I suspect you are running into that. The item is probably expecting to be part of a project to be defined as a todo.

dyaso commented 9 months ago

Thanks for the reply!

I've been trying various things -- adding individual files, setting agendaIncludeFilesOutsideOrgDir (which I think should also search any open Org file, not just ones in orgDirs), clearing Sublime's cache, making hierarchies with parents and their children headlines all marked TODO, adding :PROJECT: tags to headlines, to no avail.

Just overrode the package's orgdb.py file, to check that it is actually indexing orgDirs files (it is). Will investigate orgagenda.py next.

Might just try writing my own external Agenda generator using ripgrep, I can still use OrgExtended's capture and structure editing features.

(Btw my Sublime build is "Stable Channel, Build 4169", forgot to mention.)

Will report back if I find what was wrong, thanks again.

Edited to add: class TodoView function RenderView is generating appropriate calls to RenderEntry, which contain the info I would expect to be output, it's just not being shown. The class/function OrgTodoViewCommand :: run is not being called, is that weird? no wait it is, sorry i'm not familiar with python and am print-debugging :(

ihdavids commented 9 months ago

Yeah, that might be a bug. I was playing around with it and I think I may have broken it in a previous release. I will see about patching it. I usually use the choose todo view now, not the default command as I have quite a few filters that I use for my todos.

The default search filter for that command is supposed to be: def FilterEntry(self, n, filename): return IsTodo(n) and not IsProject(n) and not IsArchived(n)

But it seems to be comming up empty for some reason for me as well. Give me a bit and I will sort it out and patch it once I figure out why it is not doing the right thing here.

I tried all the definitions of a project supported (tag, property, and nested todo and none of it seems to be making it into the todo)

ihdavids commented 9 months ago

Huh, for me it may be this: I am sadly working on a mac at the moment (which is an anomaly for me) and seem to be having some problems with regex. That is definetly part of the reason this is failing for me.

Traceback (most recent call last): File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 308, in reload_plugin m = importlib.import_module(modulename) File "./python3.3/importlib/init.py", line 90, in import_module File "", line 1584, in _gcd_import File "", line 1565, in _find_and_load File "", line 1532, in _find_and_load_unlocked File "", line 584, in _check_name_wrapper File "", line 1022, in load_module File "", line 1003, in load_module File "", line 560, in module_for_loader_wrapper File "", line 868, in _load_module File "", line 313, in _call_with_frames_removed File "/Users/idavids/Library/Application Support/Sublime Text/Packages/OrgExtended/orgrevealjs.py", line 5, in import regex File "/Users/idavids/Library/Application Support/Sublime Text/Lib/python33/regex.py", line 398, in import _regex_core File "/Users/idavids/Library/Application Support/Sublime Text/Lib/python33/_regex_core.py", line 21, in import _regex ImportError: dlopen(/Users/idavids/Library/Application Support/Sublime Text/Lib/python33/_regex.so, 0x0002): tried: '/Users/idavids/Library/Application Support/Sublime Text/Lib/python33/_regex.so' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/idavids/Library/Application Support/Sublime Text/Lib/python33/_regex.so' (no such file), '/Users/idavids/Library/Application Support/Sublime Text/Lib/python33/_regex.so' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64'))

ihdavids commented 9 months ago

Sorry you are struggling here. Looks like I am going to have to wait a bit till I am somewhere I can use a PC or sort out this arm fun with sublime. I suspect because my plugin is still operating on the older 3.3 framework I am running into some issues that aren't fully supported on M* mac hardware. :(

ihdavids commented 9 months ago

This function: def FilterEntry(self, n, filename): return IsTodo(n) and not IsProject(n) and not IsArchived(n)

Should be called for each todo found. If it passes the todo should be shown in the list. Once I wrote that method, I then extended it to make it configurable in your config file and Choose Todo View was born from that command that lets you choose a config you define in your config file.

That flow was working for me on my PC last week. Sadly I have been forced into VSCode land due to the need for various work plugins. As a result I have been working on a similar plugin for VSCode and have kind of been ignoring the sublime version a bit of late.

Mostly because the task of upgrading my plugin to the python 3.8 runtime was a bit overwhelming given the volume of dependencies I used and up till recently the lack of available dependency system for 3.8 based plugins on packagecontrol. That said, this is a good chance for me to dust this plugin off again and try to get it ported. I like sublime better than VSCode but generally have found the plugin api to be frustrating in how limited it is.

dyaso commented 9 months ago

Yeah, I've been contemplating moving to VS Code too for the plugins, but strongly prefer Sublime's default experience as a user :/

In the meantime, what sort of custom agenda config / commands are you using which are successfully making todo list views -- should I modify my settings?

Am looking up the "Choose" command in the release notes, seems to be in 1.2.49

ETA: just to be clear, TodoView::FilterEntry is returning true for all my TODOs, they're just not being shown (unless i set agendaTodoFilterByDefault to true) -- the tab which should be showing them is completely blank, no column headings or anything.

dyaso commented 9 months ago

Success!

For some reason, adding "agendaTodoFilterByDefault": true to my settings fixes the Org Todo View command, and Org Agenda Choose View now lets me see Notes as well.

Ronaldoh1 commented 8 months ago

@dyaso that worked for me ! thank you!

ihdavids commented 1 month ago

I have made some improvements that may help in 1.2.54