I am trying to use the Plugin API this.registerEditorSuggest.
It works, but as I am developing the plugin, I am using the ‘hot-reload’ plugin.
Changes to everything else seem to work (and immediately become effective).
But the EditorSuggest that I register stops working at all. The constructor is called, but it is not actually registered (and the old one is also no longer registered).
I’m not sure what’s happening, and because obsidian isn’t open source, I can’t easily navigate to find out where the issue is happening. I’m guessing there’s some lifecycle assumptions baked in that don’t work when using hot-reload.
Actually, by debuggin on the console, I discovered another suggester is placed ahead of the suggester I register with the hot reload plugin. I can’t seem to figure out which suggester it is, but it provides no suggestions and when it runs mine can’t run.
I confirmed this by simply (on the console) reversing the order of the two suggesters, and then mine wouldn’t work.
When I again reversed the order, mine worked again.
That’s an interesting situation. If you can prepare steps to reproduce of the issue, I would debug to find what is this magical another suggester you found.
Because, Hot-Reload just unloads and loads your plugin back, so it’s essentially the same as doing this manually. Can you confirm if you observe broken EditorSuggester when you reload your plugin manually?