Did you identify the specific issues?
Yes, I noticed that when implementing the LSP plugin, see below.
I agree it's sometimes an issue and I believe I've suffered from it with e.g. CSS, bit also that unconditionally using the filetype value everywhere might cause other issues -- or maybe it wouldn't?
I think we should make sure that user-specified wordchars
always contain all characters from GEANY_WORDCHARS
no matter what crazy thing the users define. Apart from that it should be fine IMO except one thing - some languages allow unicode characters to be part of identifiers too and we should possibly allow them as well.
Anyway, identifying the actual problems that this causes would.be great :)
What's below are only the problematic cases - I'm skipping those that seem to be OK. The biggest offender is read_current_word()
from which it propagates to other functions.
1st level - direct usage of GEANY_WORDCHARS
:
https://github.com/geany/geany/blob/c043996a9a3dc1b0aa36571cd5f5d61fd8d2eb59/src/editor.c#L1691
wc
argument, it uses GEANY_WORDCHARS
.2nd level - usage of read_current_word()
:
https://github.com/geany/geany/blob/c043996a9a3dc1b0aa36571cd5f5d61fd8d2eb59/src/editor.c#L1743
GEANY_WORDCHARS
when wc == NULLwordchars
isn't specified, uses GEANY_WORDCHARS
. Note that plugins don't have access to wordchars
from filetype config file and have to hard-code something for every language or add some configuration (see https://github.com/techee/geany-lsp/blob/3a31ec9be8323c668299d1c292b7c401f2e9427b/lsp/data/lsp.conf#L72 in geany-lsp)https://github.com/geany/geany/blob/c043996a9a3dc1b0aa36571cd5f5d61fd8d2eb59/src/editor.c#L2222
GEANY_WORDCHARS
for everything except CSS and Latex and breaks autocompletion of unicode identifiers3rd level - usage of editor_get_word_at_pos()
:
https://github.com/geany/geany/blob/c043996a9a3dc1b0aa36571cd5f5d61fd8d2eb59/src/editor.c#L703
3rd level - usage of editor_find_current_word()
:
https://github.com/geany/geany/blob/c043996a9a3dc1b0aa36571cd5f5d61fd8d2eb59/src/editor.c#L292
https://github.com/geany/geany/blob/c043996a9a3dc1b0aa36571cd5f5d61fd8d2eb59/src/editor.c#L2002
https://github.com/geany/geany/blob/c043996a9a3dc1b0aa36571cd5f5d61fd8d2eb59/src/symbols.c#L1715
https://github.com/geany/geany/blob/c043996a9a3dc1b0aa36571cd5f5d61fd8d2eb59/src/keybindings.c#L1666
In addition, there's also https://github.com/geany/geany/blob/c043996a9a3dc1b0aa36571cd5f5d61fd8d2eb59/src/editor.c#L1752
I haven't checked the places where this function is used and why it's used instead of editor_find_current_word()
and whether this is correct.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.