This is my second attempt on the LSP API as originally proposed by #3571.
I changed several things:
1. I renamed the struct `Lsp` to `PluginExtension` - there's nothing LSP-specific in this interface and it could be used by other plugins too (or possibly extended in the future if some plugins wanted to provide another functionality, we could extend this API).
2. I reduced the number of functions in the API to the absolute minimum and tried to do as much as possible in the plugin itself.
3. For this PR I removed the API related to the sidebar symbol tree - this one requires most changes on the Geany side and possibly more discussion and I don't want to block this PR by it. One possible alternative is also just keep using TM for the symbol tree, ignoring the symbols provided by LSP (the symbol tree is the least problematic part of TM IMO and could stay the way it is). I'll post the extra patches to allow sidebar symbols in a separate PR.
I also updated the combined Geany+LSP plugin at https://github.com/techee/geany-lsp to use the new API and also to work even when compiled against unmodified Geany. This is quite clumsy, however - to avoid conflicts between Geany's TM implementation and the plugin, it requires disabling TM by adding
```
[settings]
tag_parser=
```
to the filetype config file of the affected filetypes, basically disabling all TM features. It also requires separate keybindings for e.g. tag goto or autocompletion instead of re-using the Geany ones.
You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3849
-- Commit Summary --
* Add interface used by plugins to replace some Geany functionality with their own implementation
* Add Geany code delegating autocompletion to plugins
* Add Geany code delegating calltips to plugins
* Add Geany code delegating symbol goto to plugins
* Add Geany code delegating keyword highlighting to plugins
-- File Changes --
M meson.build (3)
M plugins/geanyplugin.h (1)
M src/Makefile.am (2)
M src/document.c (4)
M src/editor.c (34)
M src/keybindings.c (13)
A src/pluginextension.c (141)
A src/pluginextension.h (76)
M src/symbols.c (11)
M src/symbols.h (2)
-- Patch Links --
https://github.com/geany/geany/pull/3849.patchhttps://github.com/geany/geany/pull/3849.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3849
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany/pull/3849(a)github.com>
For details, check the individual commit messages.
I suspect this is a result of https://github.com/geany/geany/pull/3891 and some different timings of when the affected functions get called. I haven't investigated the exact reasons, the extra added checks are probably just fine.
You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3921
-- Commit Summary --
* Fix runtime warning when opening Geany without open files
* Fix runtime warning when closing project to a session without open files
-- File Changes --
M src/document.c (6)
-- Patch Links --
https://github.com/geany/geany/pull/3921.patchhttps://github.com/geany/geany/pull/3921.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3921
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany/pull/3921(a)github.com>
Running the latest geany from Ubuntu 2404:
geany 2.0-1build2
geany-common 2.0-1build2
geany-plugins 2.0-4ubuntu5
Selecting a C file function name and then Tools/Documentation Generator/Document Current Symbol
results in a crash.
Running from gdb gives:
`Starting program: /usr/bin/geany `
`[Thread debugging using libthread_db enabled]`
`Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".`
`[New Thread 0x7ffff2c006c0 (LWP 242811)]`
`[New Thread 0x7ffff22006c0 (LWP 242812)]`
`[New Thread 0x7ffff18006c0 (LWP 242813)]`
`[New Thread 0x7ffff0e006c0 (LWP 242814)]`
`[New Thread 0x7fffeb8006c0 (LWP 242815)]`
`[New Thread 0x7fffeae006c0 (LWP 242816)]`
`[New Thread 0x7fffea4006c0 (LWP 242817)]`
`[Thread 0x7fffeae006c0 (LWP 242816) exited]`
`[Thread 0x7fffeb8006c0 (LWP 242815) exited]`
`[Detaching after fork from child process 242819]`
`[New Thread 0x7fffeb8006c0 (LWP 242826)]`
`Thread 1 "geany" received signal SIGSEGV, Segmentation fault.`
`Downloading source file /usr/src/glib2.0-2.80.0-6ubuntu3.1/debian/build/deb/../../../glib/ghash.c`
`g_str_hash (v=0x0) at ../../../glib/ghash.c:2463 `
`warning: 2463 ../../../glib/ghash.c: No such file or directory`
Does anyone have a suggestion how to narrow this down?
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/issues/1362
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany-plugins/issues/1362(a)github.com>