OK, let's keep the `priority` then (for the single plugin that will use this 
API for a long time :-P)

I also noticed one tiny problem in
```C
+#define CALL_PROVIDED(f, doc, ext)                                             
                                                \
+       G_STMT_START {                                                          
                                                                \
+               for (GList *node = all_extensions; node; node = node->next)     
                        \
+               {                                                               
                                                                                
\
+                       PluginExtensionEntry *entry = node->data;               
                                        \
+                                                                               
                                                                                
\
+                       if (entry->extension->f && entry->extension->f(doc, 
entry->data))       \
+                               return (ext) ? entry->extension == (ext) : 
TRUE;                                \
+               }                                                               
                                                                                
\
+               return FALSE;                                                   
                                                                \
+       } G_STMT_END
```

I would also add
```C
if ((ext) && entry->extension == (ext))
    return FALSE;
```
at the end of the loop because without it the loop will continue unnecessarily. 
This doesn't seem like a big problem but the call  `entry->extension->f(doc, 
entry->data)` has the potential to start the LSP server process which would be 
started unnecessarily if some extension earlier in the chain were the target.

Again future-proofing our single-plugin use case ;-).

I'll try to prepare the patch tomorrow.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3849#issuecomment-2153450917
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/pull/3849/[email protected]>

Reply via email to