Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize symbols list for Basic #2431

Open
bernardlj opened this issue Feb 4, 2020 · 3 comments
Open

Customize symbols list for Basic #2431

bernardlj opened this issue Feb 4, 2020 · 3 comments

Comments

@bernardlj
Copy link

Hi. I am using Geany as my editor for Basic for microcontrollers. I would like to customize the symbols list in the leftmost column, to include other than those provided through the FreeBasic extension. Apologies if the info exist, but I need to find out please how to do the said customisation. The info in the manual does not seem to explain the process.
For example: The Basic files I have use the keyword "include" which add the contents of another file. I would like to have that filename shown in the symbols list, under its own heading, and open the file when clicked

@elextr elextr transferred this issue from geany/geany-plugins Feb 4, 2020
@elextr
Copy link
Member

elextr commented Feb 4, 2020

This relates to basic Geany capability, not a plugin.

To have symbols recognised they need to be recognised by the ctags parser, but I doubt it considers an include a symbol, its not a name in the program.

You would have to modify the ctags parser to do it, note its a separate project from Geany here.

Making an include symbol clickable to open the file would then be functionality added in Geany, but somebodys gotta code it.

You are aware that in the edit window you can select the include filename and <ctrl>+<shift>+o to open it as a workaround?

@b4n
Copy link
Member

b4n commented Feb 9, 2020

To have symbols recognised they need to be recognised by the ctags parser, but I doubt it considers an include a symbol, its not a name in the program.

Some parsers do that I believe, just because it's sometimes convenient to see which includes this file has. It however indeed doesn't make perfect sense in languages where this kind of directive don't also declare a symbol (like C, C++ and all those languages where it merely means "grab that file"), whereas it makes a lot of sense for languages where it declares a kind of namespace (e.g. Python's imports).
Anyway, listing include files wouldn't be a problem I think.

Making an include symbol clickable to open the file would then be functionality added in Geany, but somebodys gotta code it.

This is a lot trickier, because in most languages this relies on possibly unknown search paths. It's easy when you have the full path (either relative to the current file or plain absolute), but otherwise it depends a lot on the language and compiler options Geany might not have the slightest knowledge about.
Maybe a plugin could actually do that and hook up on the GtkTreeView's ::row-activated signal of the symbols list and do whatever it pleases there. I didn't test, but that might be doable and so it could have any highly-specific logic it wants.

@elextr
Copy link
Member

elextr commented Feb 9, 2020

IIUC in freebasic include is a preprocessor "just like C" 😀

And yeah it has the -i search path problem too https://www.freebasic.net/wiki/wikka.php?wakka=KeyPgInclude.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants