[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-08-03 Thread Jiří Techet via Github-comments
Merged #3849 into master. -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/3849#event-13750265059 You are receiving this because you are subscribed to this thread. Message ID:

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-08-03 Thread Jiří Techet via Github-comments
The day has come, merging. 🎉 -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/3849#issuecomment-2266740331 You are receiving this because you are subscribed to this thread. Message ID:

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-08-01 Thread Jiří Techet via Github-comments
> IIUC there was no code changes since my review, so looks good. And history > looks OK as well 👍 OK, if there are no objections, I'll merge this PR during the weekend and will start working on the final version of the plugin for geany-plugins so it can get merged too. I'll then announce the n

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-08-01 Thread Colomban Wendling via Github-comments
> @b4n How does the PR look to you? OK to merge? IIUC there was no code changes since my review, so looks good. And history looks OK as well :+1: > @b4n, IIRC you were the last one to touch it, so how hard is it to extend the > API/ABI versioning system to version the extension interface sepa

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-07-11 Thread elextr via Github-comments
> But speaking of releases, wasn't there the plan make one in the near future? Yes, which was why I asked the question. -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/3849#issuecomment-762522 You are receiving this because you are subscribed to this

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-07-11 Thread Thomas Martitz via Github-comments
As long as we don't put out a release I wouldn't worry much with API changes. Whoever uses the development head gets the development head. But speaking of releases, wasn't there the plan make one in the near future? -- Reply to this email directly or view it on GitHub: https://github.com/geany

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-07-10 Thread elextr via Github-comments
@b4n, IIRC you were the last one to touch it, so how hard is it to extend the API/ABI versioning system to version the extension interface separate from the overall plugin interface, then most plugins can still work if the extension interface is changed in incompatible ways, only extensions need

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-07-10 Thread Jiří Techet via Github-comments
> Then, I would probably try to implement a python-lsp plugin in python, or do > you have a better idea? I'd suggest having a look at `plugins/demopluginext.c` that this PR adds and reimplementing it in Python. Then you can add the additional functions from this interface (for @elextr - pointer

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-07-10 Thread Thomas Martitz via Github-comments
I have made some progress, in that peasy currently cannot generate GI stuff against Geany's master. Need to repair that first. Then, I would probably try to implement a python-lsp plugin in python, or do you have a better idea? I don' think this needs to block this PR, if you're OK that the AP

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-07-10 Thread elextr via Github-comments
@elextr commented on this pull request. > + gboolean (*goto_perform)(GeanyDocument *doc, gint pos, gboolean > definition, gpointer data); + + /** +* Pointer to function called by Geany to check whether the plugin implements +* additional symbol (e.g. type) highlightin

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-07-10 Thread Jiří Techet via Github-comments
> FWIW, I would like to ensure peasy plugins can use this APIs. I'm going to try @kugel- Any progress here? I think this is the only thing that prevents this PR from being merged, right? There's still quite a lot things to do when this gets merged like finalizing the geany-plugins PR, updating d

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-07-10 Thread Jiří Techet via Github-comments
@techee commented on this pull request. > + gboolean (*goto_perform)(GeanyDocument *doc, gint pos, gboolean > definition, gpointer data); + + /** +* Pointer to function called by Geany to check whether the plugin implements +* additional symbol (e.g. type) highlightin

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-07-09 Thread elextr via Github-comments
@elextr commented on this pull request. > + gboolean (*goto_perform)(GeanyDocument *doc, gint pos, gboolean > definition, gpointer data); + + /** +* Pointer to function called by Geany to check whether the plugin implements +* additional symbol (e.g. type) highlightin

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-07-09 Thread Thomas Martitz via Github-comments
@kugel- commented on this pull request. > + gboolean (*goto_perform)(GeanyDocument *doc, gint pos, gboolean > definition, gpointer data); + + /** +* Pointer to function called by Geany to check whether the plugin implements +* additional symbol (e.g. type) highlightin

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-07-02 Thread Jiří Techet via Github-comments
@techee commented on this pull request. > + gboolean (*goto_perform)(GeanyDocument *doc, gint pos, gboolean > definition, gpointer data); + + /** +* Pointer to function called by Geany to check whether the plugin implements +* additional symbol (e.g. type) highlightin

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-07-02 Thread Thomas Martitz via Github-comments
@kugel- commented on this pull request. > + gboolean (*goto_perform)(GeanyDocument *doc, gint pos, gboolean > definition, gpointer data); + + /** +* Pointer to function called by Geany to check whether the plugin implements +* additional symbol (e.g. type) highlightin

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-30 Thread Jiří Techet via Github-comments
@techee commented on this pull request. > + gboolean (*goto_perform)(GeanyDocument *doc, gint pos, gboolean > definition, gpointer data); + + /** +* Pointer to function called by Geany to check whether the plugin implements +* additional symbol (e.g. type) highlightin

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-30 Thread Colomban Wendling via Github-comments
@b4n commented on this pull request. > + gboolean (*goto_perform)(GeanyDocument *doc, gint pos, gboolean > definition, gpointer data); + + /** +* Pointer to function called by Geany to check whether the plugin implements +* additional symbol (e.g. type) highlighting i

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-30 Thread elextr via Github-comments
@elextr commented on this pull request. > + * to the members ending with @c _perform are called by Geany at appropriate + * moments to inform the plugin when to perform the given feature. + * + * The extension is defined by the pointers in the PluginExtension structure and + * is registered in

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-30 Thread Thomas Martitz via Github-comments
@kugel- commented on this pull request. > + * to the members ending with @c _perform are called by Geany at appropriate + * moments to inform the plugin when to perform the given feature. + * + * The extension is defined by the pointers in the PluginExtension structure and + * is registered in

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-30 Thread elextr via Github-comments
@elextr commented on this pull request. > + * to the members ending with @c _perform are called by Geany at appropriate + * moments to inform the plugin when to perform the given feature. + * + * The extension is defined by the pointers in the PluginExtension structure and + * is registered in

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-30 Thread Thomas Martitz via Github-comments
@kugel- commented on this pull request. > + * to the members ending with @c _perform are called by Geany at appropriate + * moments to inform the plugin when to perform the given feature. + * + * The extension is defined by the pointers in the PluginExtension structure and + * is registered in

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-30 Thread Thomas Martitz via Github-comments
@kugel- commented on this pull request. > + gboolean (*goto_perform)(GeanyDocument *doc, gint pos, gboolean > definition, gpointer data); + + /** +* Pointer to function called by Geany to check whether the plugin implements +* additional symbol (e.g. type) highlightin

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-30 Thread Thomas Martitz via Github-comments
FWIW, I would like to ensure peasy plugins can use this APIs. I'm going to try -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/3849#issuecomment-2198541335 You are receiving this because you are subscribed to this thread. Message ID:

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-30 Thread Jiří Techet via Github-comments
> I'd like > https://github.com/geany/geany/commit/d34a0a36e761cb2844ae50ffaceaee18fee0d348 > (and its fix(es?)) be separate; for the rest it's your call. I'd keep the > same separation as you initially did and squash the changes, but if it > becomes too complicated you can also just squash the

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-30 Thread Jiří Techet via Github-comments
@techee pushed 9 commits. 52295a212df524b89808222d60478577940ccc1b Add interface used by plugins to replace some Geany functionality with their own implementation f115ec2ac883f4ef5a658372e70a289a215d8dff Add Geany code delegating autocompletion to plugins 9dda177389b276f6846394af9f82c4b3f09f13

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-29 Thread elextr via Github-comments
@elextr commented on this pull request. > + * + * Then copy or symlink the plugins/demopluginext.so file to ~/.config/geany/plugins + * - it will be loaded at next startup. + */ + +#include + +static gboolean autocomplete_provided(GeanyDocument *doc, gpointer data) +{ +return doc->file_typ

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-29 Thread Colomban Wendling via Github-comments
> @b4n If it's kind of alright, what should I do now - squash into a single > commit or try to preserve the history and squash just the various fixes? I'd like https://github.com/geany/geany/pull/3849/commits/d34a0a36e761cb2844ae50ffaceaee18fee0d348 (and its fix(es?)) be separate; for the rest

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-29 Thread Colomban Wendling via Github-comments
@b4n approved this pull request. LGTM. I didn't re-test it extensively, but not much has changed in the code anyway. A little squashing after @elextr's last proofread if he wants, and we should be golden -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/p

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-29 Thread Colomban Wendling via Github-comments
@b4n commented on this pull request. > + * cd plugins + * make demopluginext.so Ah OK, fair enough then. Doesn't matter much indeed anyway. -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/3849#discussion_r1659970274 You are receiving this because you

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-29 Thread Jiří Techet via Github-comments
@techee commented on this pull request. > + * + * Then copy or symlink the plugins/demopluginext.so file to ~/.config/geany/plugins + * - it will be loaded at next startup. + */ + +#include + +static gboolean autocomplete_provided(GeanyDocument *doc, gpointer data) +{ +return doc->file_typ

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-29 Thread Jiří Techet via Github-comments
> Minor nitpicks, but looks pretty good now I'd say 👍 @b4n If it's kind of alright, what should I do now - squash into a single commit or try to preserve the history and squash just the various fixes? -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/3849

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-29 Thread Jiří Techet via Github-comments
@techee commented on this pull request. > + Geany built-in functionality. + +When the plugin returns @c TRUE from the function assigned to the @c _provided +member of @c PluginExtension, it indicates +it wants to take control of the particular feature and disable Geany's +implementation. Howev

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-29 Thread Jiří Techet via Github-comments
@techee pushed 1 commit. 53a16a2ce0d8d58107c8dd8d3d4ad27013421f9e Add clarification to plugins.dox -- View it on GitHub: https://github.com/geany/geany/pull/3849/files/036ef8e8ead976f52b842c760fb81bbcdb8c51b9..53a16a2ce0d8d58107c8dd8d3d4ad27013421f9e You are receiving this because you are subsc

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-29 Thread Colomban Wendling via Github-comments
@b4n commented on this pull request. > + * + * Then copy or symlink the plugins/demopluginext.so file to ~/.config/geany/plugins + * - it will be loaded at next startup. + */ + +#include + +static gboolean autocomplete_provided(GeanyDocument *doc, gpointer data) +{ +return doc->file_type->

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-29 Thread Jiří Techet via Github-comments
@techee commented on this pull request. > + * cd plugins + * make demopluginext.so I basically just copied this from `demoplugin.c`. So we should either modify both or leave them as they are - IMO it doesn't matter much, I imagine someone would just copy/paste the code from here to their own

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-29 Thread Jiří Techet via Github-comments
@techee pushed 1 commit. 036ef8e8ead976f52b842c760fb81bbcdb8c51b9 Update src/pluginextension.c -- View it on GitHub: https://github.com/geany/geany/pull/3849/files/c72f22bd6cf3563f72f9f088fbd538dcfd0381a7..036ef8e8ead976f52b842c760fb81bbcdb8c51b9 You are receiving this because you are subscribe

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-29 Thread Jiří Techet via Github-comments
@techee pushed 1 commit. c72f22bd6cf3563f72f9f088fbd538dcfd0381a7 Update src/pluginextension.c -- View it on GitHub: https://github.com/geany/geany/pull/3849/files/ec9365127e980d81656f1c5184388ae80ddd7945..c72f22bd6cf3563f72f9f088fbd538dcfd0381a7 You are receiving this because you are subscribe

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-29 Thread Jiří Techet via Github-comments
@techee pushed 1 commit. ec9365127e980d81656f1c5184388ae80ddd7945 Update src/pluginextension.c -- View it on GitHub: https://github.com/geany/geany/pull/3849/files/f5da5508c2c4fe5cf6557f4769e93e590b9397b5..ec9365127e980d81656f1c5184388ae80ddd7945 You are receiving this because you are subscribe

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-29 Thread Jiří Techet via Github-comments
@techee commented on this pull request. > + * + * Then copy or symlink the plugins/demopluginext.so file to ~/.config/geany/plugins + * - it will be loaded at next startup. + */ + +#include + +static gboolean autocomplete_provided(GeanyDocument *doc, gpointer data) +{ +return doc->file_typ

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-28 Thread Colomban Wendling via Github-comments
@b4n commented on this pull request. Minor nitpicks, but looks pretty good now I'd say :+1: > + Geany built-in functionality. + +When the plugin returns @c TRUE from the function assigned to the @c _provided +member of @c PluginExtension, it indicates +it wants to take control of the particula

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-25 Thread Jiří Techet via Github-comments
@techee pushed 1 commit. f5da5508c2c4fe5cf6557f4769e93e590b9397b5 Update the priority of the example extension based on the guidelines -- View it on GitHub: https://github.com/geany/geany/pull/3849/files/935a24f93aa3c053b24c2b53cdb4a2173fc330d7..f5da5508c2c4fe5cf6557f4769e93e590b9397b5 You are

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-25 Thread Jiří Techet via Github-comments
Alright, I hope I addressed all the review comments and didn't forget about anything. I tried to replace most of the `_provided()` functions and friends by something like "functions assigned to the PluginExtension members ending with _provided". I think there were a few exceptions where I referr

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-25 Thread Jiří Techet via Github-comments
@techee commented on this pull request. > @@ -258,6 +259,23 @@ const gchar *symbols_get_context_separator(gint ft_id) } +/** Gets the icon data corresponding to the provided TMIcon. + * @param icon TMIcon. + * + * Returns the GdkPixbuf corresponding to the provided TMIcon. + * + * @since 2.

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-25 Thread Jiří Techet via Github-comments
@techee commented on this pull request. > + * functions can be left to contain the NULL pointer. + * + * Typically, functions from this interface come in pairs. Functins ending with + * @c _provided() inform Geany whether the plugin implements the given feature + * for the passed document. Func

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-25 Thread Jiří Techet via Github-comments
@techee commented on this pull request. > + +#ifndef GEANY_PLUGIN_EXTENSION_H +#define GEANY_PLUGIN_EXTENSION_H 1 + +#include "document.h" + + +G_BEGIN_DECLS + +/** + * Structure serving as an interface between plugins and Geany allowing + * plugins inform Geany about what features they provide

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-25 Thread Jiří Techet via Github-comments
@techee pushed 1 commit. 935a24f93aa3c053b24c2b53cdb4a2173fc330d7 Update documentation based on review comments -- View it on GitHub: https://github.com/geany/geany/pull/3849/files/4e1adce4ef6ee7cacd4d069fe824246b59a71cd2..935a24f93aa3c053b24c2b53cdb4a2173fc330d7 You are receiving this because

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-25 Thread Jiří Techet via Github-comments
@techee pushed 1 commit. 4e1adce4ef6ee7cacd4d069fe824246b59a71cd2 Revert "Export some types/functions so plugins have access to Geany symbol icons" -- View it on GitHub: https://github.com/geany/geany/pull/3849/files/f99af6648bbfd4b2b16b20e6bcfca5e1b6486e00..4e1adce4ef6ee7cacd4d069fe824246b59a

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread Colomban Wendling via Github-comments
@cwendling commented on this pull request. > + */ +#define CALL_PROVIDED(f, doc, ext) \ + G_STMT_START {

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread Jiří Techet via Github-comments
> But you already do understand it, so you are a bad judge of that, there is a > name for this [curse of > knowledge](https://en.wikipedia.org/wiki/Curse_of_knowledge). Better that you > believe the advice from someone who was initially confused (me) that it is > not as obvious as you think it

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread elextr via Github-comments
> I think everyone wanting to implement this interface will understand it But you already do understand it, so you are a bad judge of that, there is a name for this [curse of knowledge](https://en.wikipedia.org/wiki/Curse_of_knowledge). Better that you believe the advice from someone who was

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread Jiří Techet via Github-comments
@techee commented on this pull request. > + +Since Geany 2.1 the PluginExtension API allows plugins to take over some of +the core Geany functionality, such as autocopletion, calltip display, symbol goto, +typename highlighting inside document, etc. + +@section plugin_extension_init Initializat

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread Jiří Techet via Github-comments
> It is confusing the way function pointers that are members of struct > PluginExtension are referred to as eg "_perform() function". They are not > functions, they are function pointers with specific member names that end in > _perform and _provided, the functions they point to are in the plugi

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread elextr via Github-comments
@elextr commented on this pull request. > + * or dynamically. When allocated dynamically, plugins should always + * zero-fill the structure before use. + * + * Depending on the functionality they provide, plugins should assign the + * pointers from the structure to the functions implementing th

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread elextr via Github-comments
@elextr commented on this pull request. > +#include "document.h" + + +G_BEGIN_DECLS + +/** + * Structure serving as an interface between plugins and Geany allowing + * plugins inform Geany about what features they provide and allowing + * Geany to delegate its functionality to the plugins. + *

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread Jiří Techet via Github-comments
@techee commented on this pull request. > + * or dynamically. When allocated dynamically, plugins should always + * zero-fill the structure before use. + * + * Depending on the functionality they provide, plugins should assign the + * pointers from the structure to the functions implementing th

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread elextr via Github-comments
@elextr commented on this pull request. > @@ -258,6 +259,23 @@ const gchar *symbols_get_context_separator(gint ft_id) } +/** Gets the icon data corresponding to the provided TMIcon. + * @param icon TMIcon. + * + * Returns the GdkPixbuf corresponding to the provided TMIcon. + * + * @since 2.

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread Jiří Techet via Github-comments
@techee commented on this pull request. > +#include "document.h" + + +G_BEGIN_DECLS + +/** + * Structure serving as an interface between plugins and Geany allowing + * plugins inform Geany about what features they provide and allowing + * Geany to delegate its functionality to the plugins. + *

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread elextr via Github-comments
@elextr commented on this pull request. > + */ +#define CALL_PROVIDED(f, doc, ext) \ + G_STMT_START {

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread elextr via Github-comments
@elextr commented on this pull request. > + +Since Geany 2.1 the PluginExtension API allows plugins to take over some of +the core Geany functionality, such as autocopletion, calltip display, symbol goto, +typename highlighting inside document, etc. + +@section plugin_extension_init Initializat

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread elextr via Github-comments
@elextr commented on this pull request. > @@ -1116,4 +1118,130 @@ static void proxy_cleanup(GeanyPlugin *plugin, > gpointer pdata) @endcode +@page plugin_extension Plugin Extension HowTo + +@section plugin_extension_intro Introduction + +Since Geany 2.1 the PluginExtension API allows plugi

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread Jiří Techet via Github-comments
@techee commented on this pull request. > @@ -258,6 +259,23 @@ const gchar *symbols_get_context_separator(gint ft_id) } +/** Gets the icon data corresponding to the provided TMIcon. + * @param icon TMIcon. + * + * Returns the GdkPixbuf corresponding to the provided TMIcon. + * + * @since 2.

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread Jiří Techet via Github-comments
@techee commented on this pull request. > + */ +#define CALL_PROVIDED(f, doc, ext) \ + G_STMT_START {

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread Jiří Techet via Github-comments
@techee commented on this pull request. > + +Since Geany 2.1 the PluginExtension API allows plugins to take over some of +the core Geany functionality, such as autocopletion, calltip display, symbol goto, +typename highlighting inside document, etc. + +@section plugin_extension_init Initializat

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread Jiří Techet via Github-comments
@techee commented on this pull request. > @@ -1116,4 +1118,130 @@ static void proxy_cleanup(GeanyPlugin *plugin, > gpointer pdata) @endcode +@page plugin_extension Plugin Extension HowTo + +@section plugin_extension_intro Introduction + +Since Geany 2.1 the PluginExtension API allows plugi

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread elextr via Github-comments
@elextr commented on this pull request. > + +/** + * Registers the provided extension in Geany. There can be multiple extensions + * registered in Geany - these are stored in a list sorted by the priporty + * parameter. When executing @c _perform() functions, Geany goes through + * the list and

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread Colomban Wendling via Github-comments
@b4n commented on this pull request. > + +/** + * Registers the provided extension in Geany. There can be multiple extensions + * registered in Geany - these are stored in a list sorted by the priporty + * parameter. When executing @c _perform() functions, Geany goes through + * the list and exe

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread elextr via Github-comments
@elextr commented on this pull request. > +static gboolean autocomplete_provided(GeanyDocument *doc, gpointer data) +{ +/* Check whether the plugin provides the feature for the passed document */ +return doc->file_type->id == GEANY_FILETYPES_PYTHON; +} + + +static void autocomplete_perfo

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread Colomban Wendling via Github-comments
@b4n commented on this pull request. > +static gboolean autocomplete_provided(GeanyDocument *doc, gpointer data) +{ +/* Check whether the plugin provides the feature for the passed document */ +return doc->file_type->id == GEANY_FILETYPES_PYTHON; +} + + +static void autocomplete_perform(

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread elextr via Github-comments
@elextr commented on this pull request. > + * the list and executes the @c _perform() function of the first extension in + * the list whose @c _provided() function returns @c TRUE. + * + * This function is typically called in the plugin @c init() function. + * + * Plugins wishing to re-registe

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread Colomban Wendling via Github-comments
@b4n commented on this pull request. > + * Plugins wishing to re-register themselves, e.g. with a different priority, + * should first unregister themselves using @c plugin_extension_unregister() + * and call @c plugin_extension_register() afterwards. + * + * @param extension The @c PluginExten

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread Colomban Wendling via Github-comments
@b4n commented on this pull request. > + * the list and executes the @c _perform() function of the first extension in + * the list whose @c _provided() function returns @c TRUE. + * + * This function is typically called in the plugin @c init() function. + * + * Plugins wishing to re-register t

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread elextr via Github-comments
@elextr commented on this pull request. > + g_return_if_fail(ext_name != NULL); + + entry = g_malloc(sizeof *entry); + entry->extension = extension; + entry->data = data; + entry->priority = priority; + + all_extensions = g_list_insert_sorted(all_extensions, ent

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-24 Thread Colomban Wendling via Github-comments
@b4n commented on this pull request. > + g_return_if_fail(ext_name != NULL); + + entry = g_malloc(sizeof *entry); + entry->extension = extension; + entry->data = data; + entry->priority = priority; + + all_extensions = g_list_insert_sorted(all_extensions, entry,

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-23 Thread elextr via Github-comments
@elextr requested changes on this pull request. @techee a (mostly) documentation review, lots of minor tweaks, but a significant point that I have commented on several times and might be best if I summarise here: It is confusing the way function pointers that are members of struct PluginExtens

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-21 Thread Jiří Techet via Github-comments
I've added the howto and a simple example under `plugins/demopluginext.c`. -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/3849#issuecomment-2183290111 You are receiving this because you are subscribed to this thread. Message ID:

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-21 Thread Jiří Techet via Github-comments
@techee pushed 1 commit. f99af6648bbfd4b2b16b20e6bcfca5e1b6486e00 Add PluginExtension HowTo to API documentation -- View it on GitHub: https://github.com/geany/geany/pull/3849/files/b111bc160a2176e158fe83c4d476b8a018d65b59..f99af6648bbfd4b2b16b20e6bcfca5e1b6486e00 You are receiving this becaus

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-21 Thread Jiří Techet via Github-comments
@techee pushed 2 commits. 64a2f5a6b5a72f238cfc303c6a2395ee25c0047b Improve demopluginext.c a little b111bc160a2176e158fe83c4d476b8a018d65b59 Use "modern" Geany API when talking about init() and cleanup() functions -- View it on GitHub: https://github.com/geany/geany/pull/3849/files/2b0b55df39

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-20 Thread Jiří Techet via Github-comments
@techee pushed 2 commits. e5287871054759c45d3f19871daa5d4db2bec769 Fix parameter name 2b0b55df399eb3685c88e254a290f89fb0fb3efd Add simple PluginExtension demo -- View it on GitHub: https://github.com/geany/geany/pull/3849/files/3785bc92bf24e2898ffc2b40abbc516e3a9ba04d..2b0b55df399eb3685c88e254

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-17 Thread Jiří Techet via Github-comments
@elextr Agree, I was thinking about it myself too - the documentation looks the whole thing is much more complicated than it really is. I think I'll create some `PluginExtension` howto similarly to e.g. `Proxy Plugin HowTo` https://www.geany.org/manual/reference/proxy.html with some minimal plu

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-17 Thread elextr via Github-comments
Had a first look at the documentation, will comment in detail soon where needed, but one point that has become apparent is that it would be nice to have some overview to introduce the concept of extensions, what they are (plugins) what is special that makes them "extensions" (replace Geany funct

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-15 Thread Jiří Techet via Github-comments
@techee pushed 1 commit. 3785bc92bf24e2898ffc2b40abbc516e3a9ba04d Rename plugin_name parameter of plugin_extension_register() to ext_name -- View it on GitHub: https://github.com/geany/geany/pull/3849/files/4a40ff0e3a0bb90818c7a31fbe778bf4efcb2039..3785bc92bf24e2898ffc2b40abbc516e3a9ba04d You

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-13 Thread Jiří Techet via Github-comments
@b4n @elextr Alright, documentation pushed, please let me know if I missed something, something should be reworded or fixed. I didn't write much about the "priority" parameter of `_register()` because I don't know yet if Geany itself will use this interface too or not or what priority it will h

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-13 Thread Jiří Techet via Github-comments
@techee pushed 2 commits. 37194e920cd671d660a483d6b813e5ab88dd7e00 Add PluginExtension documentation 4a40ff0e3a0bb90818c7a31fbe778bf4efcb2039 Remove currently unused plugin_name from PluginExtensionEntry -- View it on GitHub: https://github.com/geany/geany/pull/3849/files/052eb37425a3ec32535d

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-12 Thread Jiří Techet via Github-comments
@techee commented on this pull request. > + const PluginExtensionEntry *entry_b = b; + + return entry_b->priority - entry_a->priority; +} + + +GEANY_API_SYMBOL +void plugin_extension_register(PluginExtension *extension, const gchar *plugin_name, + gint priority, gpointer data) +

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-12 Thread Jiří Techet via Github-comments
@techee commented on this pull request. > + plugin_extension_calltips_show(editor->document, FALSE); + plugin_extension_autocomplete_perform(editor->document, FALSE); Well, I have just 2 real-world examples to base this on - the LSP plugin and Geany itself. For Geany, both calltips a

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-12 Thread Colomban Wendling via Github-comments
@b4n commented on this pull request. > + const PluginExtensionEntry *entry_b = b; + + return entry_b->priority - entry_a->priority; +} + + +GEANY_API_SYMBOL +void plugin_extension_register(PluginExtension *extension, const gchar *plugin_name, + gint priority, gpointer data) +{ +

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-12 Thread Colomban Wendling via Github-comments
@b4n commented on this pull request. > + plugin_extension_calltips_show(editor->document, FALSE); + plugin_extension_autocomplete_perform(editor->document, FALSE); OK, if you think extensions implementing those will basically never have to re do this separately because they have some

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-12 Thread Jiří Techet via Github-comments
> Anyway, apart from those two fairly little things, I think I'm happy with how > this looks 🙂 I'm mostly done with the documentation, I just need to read the garbage I have written after myself with a fresh head tomorrow :-) -- Reply to this email directly or view it on GitHub: https://github

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-12 Thread Jiří Techet via Github-comments
@techee commented on this pull request. > + plugin_extension_calltips_show(editor->document, FALSE); + plugin_extension_autocomplete_perform(editor->document, FALSE); Technically they could be obtained from `editor-notify` and plugins could call `plugin_extension_autocomplete_provide

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-12 Thread Jiří Techet via Github-comments
@techee commented on this pull request. > + const PluginExtensionEntry *entry_b = b; + + return entry_b->priority - entry_a->priority; +} + + +GEANY_API_SYMBOL +void plugin_extension_register(PluginExtension *extension, const gchar *plugin_name, + gint priority, gpointer data) +

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-12 Thread Colomban Wendling via Github-comments
Anyway, apart from those two fairly little things, I think I'm happy with how this looks :slightly_smiling_face: -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/3849#issuecomment-2163848773 You are receiving this because you are subscribed to this threa

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-12 Thread Colomban Wendling via Github-comments
@b4n pushed 1 commit. 052eb37425a3ec32535de35b0712f01bf9488317 fixup! Move plugin_extension_calltips_provided() check inside on_editor_notify() -- View it on GitHub: https://github.com/geany/geany/pull/3849/files/09295cea1d13e849f8269da666a96db519e08d6c..052eb37425a3ec32535de35b0712f01bf948831

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-12 Thread Colomban Wendling via Github-comments
@b4n commented on this pull request. > + const PluginExtensionEntry *entry_b = b; + + return entry_b->priority - entry_a->priority; +} + + +GEANY_API_SYMBOL +void plugin_extension_register(PluginExtension *extension, const gchar *plugin_name, + gint priority, gpointer data) +{ +

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-12 Thread Colomban Wendling via Github-comments
@b4n commented on this pull request. > + plugin_extension_calltips_show(editor->document, FALSE); + plugin_extension_autocomplete_perform(editor->document, FALSE); Hum… do we actually want the calls here? I'm fine with them, don't get me wrong, but does this actually help the extens

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-12 Thread Colomban Wendling via Github-comments
> I wouldn't do that, extensions should just behave correctly. OK. Indeed I don't want this to be *necessary*, but if it's there for safety people will start relying on it (and rightfully so, otherwise it's just dead code, right?) > And if the plugin is unloaded and the extension is still regi

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-12 Thread Colomban Wendling via Github-comments
@b4n commented on this pull request. > { + GeanyDocument *doc = document_get_current(); + + if (plugin_extension_goto_provided(doc, NULL)) + return plugin_extension_goto_perform(doc, pos, definition); I'd say 2 or 3 (definitely not 1). I just pushed a version of 3, g

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-12 Thread Colomban Wendling via Github-comments
@b4n pushed 1 commit. 09295cea1d13e849f8269da666a96db519e08d6c Honor selection again in symbols_goto_tag() -- View it on GitHub: https://github.com/geany/geany/pull/3849/files/b7c6b84ee0d77af826994bce8c59073d1f363dd8..09295cea1d13e849f8269da666a96db519e08d6c You are receiving this because you

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-12 Thread Jiří Techet via Github-comments
@techee commented on this pull request. > { + GeanyDocument *doc = document_get_current(); + + if (plugin_extension_goto_provided(doc, NULL)) + return plugin_extension_goto_perform(doc, pos, definition); So what should I do here? The options I see are: 1. Make the fun

[Github-comments] Re: [geany/geany] Plugin extensions (aka LSP API) (PR #3849)

2024-06-12 Thread Jiří Techet via Github-comments
> the idea to e.g. be able to cleanup extensions on plugin unload is starting > to grow on me I wouldn't do that, extensions should just behave correctly. And if the plugin is unloaded and the extension is still registered, there will probably be a huge crash that the extension developer notice

  1   2   >