@techee commented on this pull request.


> +     void (*calltips_show)(GeanyDocument *doc, gboolean force);
+
+       gboolean (*goto_provided)(GeanyDocument *doc);
+       void (*goto_perform)(GeanyDocument *doc, gint pos, gboolean definition);
+
+       gboolean (*doc_symbols_provided)(GeanyDocument *doc);
+       GPtrArray *(*doc_symbols_get)(GeanyDocument *doc);
+
+       gboolean (*symbol_highlight_provided)(GeanyDocument *doc);
+
+       gchar _dummy[1024];
+} PluginExtension;
+
+
+void plugin_extension_register(PluginExtension *extension);
+void plugin_extension_unregister(PluginExtension *extension);

OK, I may not understand this completely, but the idea is that the decision on 
whether the extension performs the particular feature is directed by the 
extension itself (so it decides whether it's "active" or not). This is 
basically what I described in 
https://github.com/geany/geany/pull/3849#discussion_r1625127493: the return 
value of the `plugin_extension_goto_provided(doc)` function decides whether the 
extension wants to perform the feature and the 
`plugin_extension_goto_perform(doc)` function performs it. The LSP plugin for 
instance takes a look at the filetype of `doc` and when there is a server 
configured for it and in addition, this particular server supports goto 
definition/declaration (this is obtained from the initial handshake with the 
server), `plugin_extension_goto_provided(doc)` returns TRUE, otherwise it 
returns FALSE. In the TRUE case, `plugin_extension_goto_perform(doc)` can be 
called.

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

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

Reply via email to