I want to transfer custom .api file created for SciTE to Geany .tags file
I changed the file to confirm to Tagmanager format as described in documentation
Here is example part: ======================================== ... dialog.hr||( dlg )|Draws a horizontal separator across the dialog dialog.label||( dlg, text )|Adds some informative text to the dialog dialog.new||( title, buttons )|Creates a new dialog object ... ========================================
1. Now autocomplete drop-down menu appears after typing 4-th character and I don't see setting to make . (dot) be autocomplete trigger. In SciTE property this can be defined with:
autocomplete.$(filetype).start.characters=.
Is it possible to make this in Geany?
2. Calltip doesn't appear after I open bracket as I expected
Why could that be?
On 26 February 2012 14:47, klo uo klonuo@gmail.com wrote:
I want to transfer custom .api file created for SciTE to Geany .tags file
I changed the file to confirm to Tagmanager format as described in documentation
Here is example part:
... dialog.hr||( dlg )|Draws a horizontal separator across the dialog dialog.label||( dlg, text )|Adds some informative text to the dialog dialog.new||( title, buttons )|Creates a new dialog object ... ========================================
- Now autocomplete drop-down menu appears after typing 4-th character and I
don't see setting to make . (dot) be autocomplete trigger. In SciTE property this can be defined with:
autocomplete.$(filetype).start.characters=.
Is it possible to make this in Geany?
No, autocomplete is trigerred by typing a number of characters (default 4) of a known symbol or manually with ctrl-space.
- Calltip doesn't appear after I open bracket as I expected
Why could that be?
Because for example geany is looking for a function symbol called hr, but there is no such symbol, the pipe format does not support nested structures, all symbols must be simple identifiers.
Cheers Lex
On Sun, Feb 26, 2012 at 4:47 AM, klo uo klonuo@gmail.com wrote:
I want to transfer custom .api file created for SciTE to Geany .tags file
I changed the file to confirm to Tagmanager format as described in documentation
Well I made a mistake, it's not Tagmanger format but pipe-separated format.
So I can't convert already made .api files, using this simple pipe-separated format and at the same time be useful, but I need to use Tagmanager format which is not described and it is generated by Geany from already prepared sources. But how can I find source that has all possible functions in it? And this way it seems impossible to supply description text.
Looking for ctags format, then etags format, I see they are not the same as Geany'.
From provided .tags files I distil this scheme:
funtion {xCC} [2^(x)] {xCD} (**params) {xCF} Description
All is fine except, [2^(x)] which seems like some kind of identifier, although I noticed number 131072 in php.tags which is not exponent of 2.
How can I know this number, so that I may create some Lua function to reparse my SciTE .api files to Geany .tags?
On Sun, Feb 26, 2012 at 6:33 AM, klo uo klonuo@gmail.com wrote:
funtion {xCC} [2^(x)] {xCD} (**params) {xCF} Description
It seems {xCF} does not separate description, but function return type. I have not yet found .tags with description in it
On 26 February 2012 16:33, klo uo klonuo@gmail.com wrote:
On Sun, Feb 26, 2012 at 4:47 AM, klo uo klonuo@gmail.com wrote:
I want to transfer custom .api file created for SciTE to Geany .tags file
I changed the file to confirm to Tagmanager format as described in documentation
Well I made a mistake, it's not Tagmanger format but pipe-separated format.
So I can't convert already made .api files, using this simple pipe-separated format and at the same time be useful, but I need to use Tagmanager format which is not described and it is generated by Geany from already prepared sources.
Yes, tagmanager format is not described because there is some dissatisfaction with tagmanager and when we have sufficient resources we would like to replace it. The format may then change (personally I hope to etags or ctags, but that depends on the implementation). So we do not want to be bound by a described tagmanager format.
But how can I find source that has all possible functions in it?
Tags are usually made from the language header files.
And this way it seems impossible to supply description text.
No, also the manual notes that it is ignored anyway.
Looking for ctags format, then etags format, I see they are not the same as Geany'. From provided .tags files I distil this scheme:
funtion {xCC} [2^(x)] {xCD} (**params) {xCF} Description
the 0xCC field is a type code, see [1] below the 0xCF field is labelled VAR_TYPE is the code, I'm not sure its a description?
All is fine except, [2^(x)] which seems like some kind of identifier, although I noticed number 131072 in php.tags which is not exponent of 2.
How can I know this number, so that I may create some Lua function to reparse my SciTE .api files to Geany .tags?
Its worth a try, but you might have to figure out how nested scopes are encoded to get the dialog.hr to work. Not sure though.
Cheers Lex
[1] type codes
tm_tag_undef_t = 0, /*!< Unknown type */ tm_tag_class_t = 1, /*!< Class declaration */ tm_tag_enum_t = 2, /*!< Enum declaration */ tm_tag_enumerator_t = 4, /*!< Enumerator value */ tm_tag_field_t = 8, /*!< Field (Java only) */ tm_tag_function_t = 16, /*!< Function definition */ tm_tag_interface_t = 32, /*!< Interface (Java only) */ tm_tag_member_t = 64, /*!< Member variable of class/struct */ tm_tag_method_t = 128, /*!< Class method (Java only) */ tm_tag_namespace_t = 256, /*!< Namespace declaration */ tm_tag_package_t = 512, /*!< Package (Java only) */ tm_tag_prototype_t = 1024, /*!< Function prototype */ tm_tag_struct_t = 2048, /*!< Struct declaration */ tm_tag_typedef_t = 4096, /*!< Typedef */ tm_tag_union_t = 8192, /*!< Union */ tm_tag_variable_t = 16384, /*!< Variable */ tm_tag_externvar_t = 32768, /*!< Extern or forward declaration */ tm_tag_macro_t = 65536, /*!< Macro (without arguments) */ tm_tag_macro_with_arg_t = 131072, /*!< Parameterized macro */ tm_tag_file_t = 262144, /*!< File (Pseudo tag) */ tm_tag_other_t = 524288, /*!< Other (non C/C++/Java tag) */ tm_tag_max_t = 1048575 /*!< Maximum value of TMTagType */
Thanks for the info. I was browsing tagmanager folder in Geany source at the same time and now it doesn't seem like great idea to convert what I have to Tagmanager format, which is perhaps used by symbol browser and some Geany internals probably, and doesn't fit calltips usage
OTOH, pipe-separated format can show Description (which docs state that is "currently unused and should be left empty.") if simply pipe isn't entered before description text.
Now my problem is how to tell Geany to parse function name that has . (dot) in the name. For example I'm creating .tags file for Geany Lua plugin and in filetypes.lua file I added:
whitespace_chars=\s\t!"#$%&'()*+,-/:;<=>?@[\]^`{|}~
(taken from "filetypes.common" without . (dot) in it). My idea was to tell Geany to treat . (dot) like word character. Unfortunately this didn't work, and I guess there must be some way to do it.
BTW I noticed that Geany displays drop-down autocomplete list with max 30 entries, and does not reduce entries as I type, which is no good
On 26 February 2012 18:12, klo uo klonuo@gmail.com wrote:
Thanks for the info. I was browsing tagmanager folder in Geany source at the same time and now it doesn't seem like great idea to convert what I have to Tagmanager format, which is perhaps used by symbol browser and some Geany internals probably, and doesn't fit calltips usage
You now understand our ambivalence to that code :)
OTOH, pipe-separated format can show Description (which docs state that is "currently unused and should be left empty.") if simply pipe isn't entered before description text.
Now my problem is how to tell Geany to parse function name that has . (dot) in the name. For example I'm creating .tags file for Geany Lua plugin and in filetypes.lua file I added:
whitespace_chars=\s\t!"#$%&'()*+,-/:;<=>?@[\]^`{|}~
(taken from "filetypes.common" without . (dot) in it). My idea was to tell Geany to treat . (dot) like word character. Unfortunately this didn't work, and I guess there must be some way to do it.
IIUC its in Scintilla lua lexer. Probably hard coded though I'd guess.
BTW I noticed that Geany displays drop-down autocomplete list with max 30 entries, and does not reduce entries as I type, which is no good
Yes its limited to 30, but it should decrease, does for me, but maybe its because of the dots.
Cheers Lex
Geany mailing list Geany@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany
probably, and doesn't fit calltips usage
You now understand our ambivalence to that code :)
I have some picture, and it can be sensed from documentation ;) never heard about tagmanager before
IIUC its in Scintilla lua lexer. Probably hard coded though I'd guess.
Hm... I'll wait if maybe others have idea, if not I'll search in Scintilla source and maybe recompile again
BTW I noticed that Geany displays drop-down autocomplete list with max 30 entries, and does not reduce entries as I type, which is no good
Yes its limited to 30, but it should decrease, does for me, but maybe its because of the dots.
You are right, it's fine on other languages, it's perhaps because of this dots.
My concern is that I've created this .api files for numpy/scipy/matplotlib, and matplotlib give me a headache as it wasn't easy to scrap those nastily interconnected modules and classes. It is of great help when I type in SciTE or not to mention something like IPython. I want the same thing in Geany :D
I tried also with
wordchars=._abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 whitespace_chars=\s\t!"#$%&'()*+,-/:;<=>?@[\]^`{|}~
in filetypes.* - still not enought
I found yet another setting, "preferences > various: use_gtk_word_boundaries" at the bottom of dialog, which was set "on" by default
I toggled it, and together with previously mentioned settings, still no luck...
On Sun, Feb 26, 2012 at 8:58 AM, klo uo klonuo@gmail.com wrote:
I tried also with
wordchars=._abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 whitespace_chars=\s\t!"#$%&'()*+,-/:;<=>?@[\]^`{|}~
in filetypes.* - still not enought
I would appreciate assistance by some Geany developer here. I wasn't able to resolve this, and as mentioned I don't know C/C++
1. Is this Geany bug?
- I set word characters in filetypes definition file to include . (dot) as word character, and at the same time - I removed . (dot) from whitespace characters, and at the same time - I disabled "preferences > various: use_gtk_word_boundaries" setting
Resulting in no change.
- None of Geany 'tags' files contain . (dot)
2. Word characters in Geany are defined in 'editor.h:30':
++++++++++++++++++++++++++++++++++++++++ /** Default character set to define which characters should be treated as part of a word. */ #define GEANY_WORDCHARS "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" #define GEANY_MAX_WORD_LENGTH 192 ========================================
This is obviously far from smart way to change word definition
3. In SciTE calltips word definition is defined in 'SciTEProps.cxx:1015':
++++++++++++++++++++++++++++++++++++++++ calltipWordCharacters = FindLanguageProperty("calltip.*.word.characters", "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); ========================================
How they communicate to Scintilla, I'm unable to find, but I guess it's call to ScintillaBase.cxx
In SciTE calltips word characters can be defined in properties file separately then common word character definitions
4. Most obvious place where this can be set in Geany seems to me 'editor.c' file
So I would like to ask my main question - what do I need to change in 'editor.c' (presumably) so that Geany treats .(dot) as word character only for calltips?
Thanks for reading
On 27 February 2012 17:59, klo uo klonuo@gmail.com wrote:
I would appreciate assistance by some Geany developer here. I wasn't able to resolve this, and as mentioned I don't know C/C++
- Is this Geany bug?
- I set word characters in filetypes definition file to include . (dot) as word character, and at the same time - I removed . (dot) from whitespace characters, and at the same time - I disabled "preferences > various: use_gtk_word_boundaries" setting
Resulting in no change.
- None of Geany 'tags' files contain . (dot)
Whese settings won't affect tag parsing AFAIK, as I said before I think tag parsers are mostly hard coded. The use of the dot is usually part of the language syntax and not considered part of an identifier. What language are you making tags for?
- Word characters in Geany are defined in 'editor.h:30':
++++++++++++++++++++++++++++++++++++++++ /** Default character set to define which characters should be treated as part of a word. */ #define GEANY_WORDCHARS "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
#define GEANY_MAX_WORD_LENGTH 192
This is obviously far from smart way to change word definition
This is just the default, it can be overridden by various settings, eg in filetypes files, but you did set that anyway.
- In SciTE calltips word definition is defined in 'SciTEProps.cxx:1015':
++++++++++++++++++++++++++++++++++++++++ calltipWordCharacters = FindLanguageProperty("calltip.*.word.characters", "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); ========================================
How they communicate to Scintilla, I'm unable to find, but I guess it's call to ScintillaBase.cxx
In SciTE calltips word characters can be defined in properties file separately then common word character definitions
Scintilla settings don't affect the tag parsers anyway, unless Geany happens to send the same setting to both which is rare.
- Most obvious place where this can be set in Geany seems to me 'editor.c' file
So I would like to ask my main question - what do I need to change in 'editor.c' (presumably) so that Geany treats .(dot) as word character only for calltips?
I doubt it is that simple, as I said above most tag parsers don't consider dot to be an identifier character so you won't get tags with dots in them. The changes you have made to date should let Geany decide that the thing it wants to autocomplete has a dot in it, but that doesn't matter if the tag parser doesn't consider a dot to be a word character. It won't output tags with dots in them and so looking up tags with dots will never find anything.
As I said before the "right" way might be to figure out how to use the scope feature of tag files. But there are bugs in the scope lookup anyway and I don't think it works well outside of the C filetype for which it was invented.
Cheers Lex
Just a postscript. You could try your modified version of Geany with tags imported from your pipe separated tag file that has tags with dots in them.
Cheers Lex
On Mon, Feb 27, 2012 at 8:48 AM, Lex Trotman elextr@gmail.com wrote:
Just a postscript. You could try your modified version of Geany with tags imported from your pipe separated tag file that has tags with dots in them.
Sorry but I don't follow what you suggest here
On Mon, Feb 27, 2012 at 8:34 AM, Lex Trotman elextr@gmail.com wrote:
Whese settings won't affect tag parsing AFAIK, as I said before I think tag parsers are mostly hard coded. The use of the dot is usually part of the language syntax and not considered part of an identifier. What language are you making tags for?
I mentioned that: Lua and Python Where are they hard-coded as only place where word characters are defined is 'editor.h:30' which should be overwritten with provided setting for "wordcharacter" property
I doubt it is that simple, as I said above most tag parsers don't consider dot to be an identifier character so you won't get tags with dots in them. The changes you have made to date should let Geany decide that the thing it wants to autocomplete has a dot in it, but that doesn't matter if the tag parser doesn't consider a dot to be a word character. It won't output tags with dots in them and so looking up tags with dots will never find anything.
As I said before the "right" way might be to figure out how to use the scope feature of tag files. But there are bugs in the scope lookup anyway and I don't think it works well outside of the C filetype for which it was invented.
It should be easy to set, IMHO, and I don't know if it's easy to be set in Geany.
I would not expect same calltip for:
numpy.core.load(file) Wrapper around cPickle.load which accepts either a file-like object ora filename json.load(file) Deserialize fp to a Python object.
which according Geany login should be set as:
load||(file) Wrapper around cPickle.load which accepts either a file-like object ora filename load||(file) Deserialize fp to a Python object.
or similar.
And it's not just that, but I'd like more to solve this problem instead opening discussion
[...]
I mentioned that: Lua and Python Where are they hard-coded as only place where word characters are defined is 'editor.h:30' which should be overwritten with provided setting for "wordcharacter" property
The Lua tag parser only gets function names, nothing else, so I don't see how it will find symbols that you can address as something.somethingelse.
The Python tag parser has *hard coded* identifier characters. See tagmanager/python.c:49-56.
You cannot set this.
[...]
I would not expect same calltip for:
numpy.core.load(file) Wrapper around cPickle.load which accepts either a file-like object ora filename json.load(file) Deserialize fp to a Python object.
Scope autocompletion does not work for these languages, see http://www.geany.org/manual/current/index.html#scope-autocompletion
[...]
And it's not just that, but I'd like more to solve this problem instead opening discussion
To solve it properly you will have to fix how scoped tags are handled for these languages.
Cheers Lex
Thanks for delving me in :)
On Mon, Feb 27, 2012 at 9:31 AM, Lex Trotman elextr@gmail.com wrote:
The Lua tag parser only gets function names, nothing else, so I don't see how it will find symbols that you can address as something.somethingelse.
The Python tag parser has *hard coded* identifier characters. See tagmanager/python.c:49-56.
You cannot set this.
Well, can't I do, something like (python.c:53-56):
static boolean isIdentifierCharacter (int c) { return (boolean) (isalnum (c) || c == '_' || c == '.'); }
?
On 27 February 2012 19:48, klo uo klonuo@gmail.com wrote:
Thanks for delving me in :)
On Mon, Feb 27, 2012 at 9:31 AM, Lex Trotman elextr@gmail.com wrote:
The Lua tag parser only gets function names, nothing else, so I don't see how it will find symbols that you can address as something.somethingelse.
The Python tag parser has *hard coded* identifier characters. See tagmanager/python.c:49-56.
You cannot set this.
Well, can't I do, something like (python.c:53-56):
static boolean isIdentifierCharacter (int c) { return (boolean) (isalnum (c) || c == '_' || c == '.'); }
At this point I think you are just going to have to try it and see what might work and what else it might break.
Cheers Lex
? _______________________________________________ Geany mailing list Geany@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany
It doesn't work. I recompiled Geany with above mentioned change and added 'numpy.python.tags' file to ~/.config/geany/tags' folder
++++++++++++++++++++++++++++++++++++++++ #format=pipe numpy.alen||(a) Return the length of the first dimension of the input array numpy.all||(a, axis=None, out=None) [ndarray, optional] Test whether all array elements along a given axis evaluate to True numpy.allclose||(a, b, rtol=1e-05, atol=1e-08) Returns True if two arrays are element-wise equal within a tolerance ... ========================================
Then launching 'geany -v' I see 'numpy.python.tags' is still not loaded. I load it through menu, and terminal reports:
Geany-INFO: Loaded ~/.config/geany/tags/numpy.python.tags (None), 530 tag(s).
However it does nothing when I type 'nump' in python file
On 27 February 2012 21:39, klo uo klonuo@gmail.com wrote:
It doesn't work. I recompiled Geany with above mentioned change and added 'numpy.python.tags' file to ~/.config/geany/tags' folder
should be numpy.py.tags the middle part is the language extension, see the manual.
Cheers Lex
On Mon, Feb 27, 2012 at 12:18 PM, Lex Trotman elextr@gmail.com wrote:
should be numpy.py.tags the middle part is the language extension, see the manual.
Thanks So these: http://wiki.geany.org/tags/start#python_tags aren't valid?
Anyhow autocomplete drop-down list appears buggy like in Lua case because of this dots, and calltip does not show
On 27 February 2012 22:29, klo uo klonuo@gmail.com wrote:
On Mon, Feb 27, 2012 at 12:18 PM, Lex Trotman elextr@gmail.com wrote:
should be numpy.py.tags the middle part is the language extension, see the manual.
Thanks So these: http://wiki.geany.org/tags/start#python_tags aren't valid?
You need to raise that with Matthew.
Anyhow autocomplete drop-down list appears buggy like in Lua case because of this dots, and calltip does not show
Well, you *are* trying to bend Geany to do something it doesn't do, it is not surprising that it is going to take some effort :)
Cheers Lex
Isn't this whole thread showing that I invested enough effort as anyone can expect from "user" that doesn't code C, and for reasonable (at least to me) feature. I don't think I should mess with src code any more, as apart from not knowing C, I'm not Geany developer to know how things works even if I knew C.
If anyone knows how to make dot behave nice please show me the patch
On Mon, Feb 27, 2012 at 12:35 PM, Lex Trotman elextr@gmail.com wrote:
On 27 February 2012 22:29, klo uo klonuo@gmail.com wrote:
On Mon, Feb 27, 2012 at 12:18 PM, Lex Trotman elextr@gmail.com wrote:
should be numpy.py.tags the middle part is the language extension, see the manual.
Thanks So these: http://wiki.geany.org/tags/start#python_tags aren't valid?
You need to raise that with Matthew.
Anyhow autocomplete drop-down list appears buggy like in Lua case because of this dots, and calltip does not show
Well, you *are* trying to bend Geany to do something it doesn't do, it is not surprising that it is going to take some effort :)
Cheers Lex _______________________________________________ Geany mailing list Geany@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany
On 12-02-27 03:35 AM, Lex Trotman wrote:
On 27 February 2012 22:29, klo uoklonuo@gmail.com wrote:
On Mon, Feb 27, 2012 at 12:18 PM, Lex Trotmanelextr@gmail.com wrote:
should be numpy.py.tags the middle part is the language extension, see the manual.
Thanks So these: http://wiki.geany.org/tags/start#python_tags aren't valid?
You need to raise that with Matthew.
IIRC there is a script in `scripts/` that generates the tags. I think it was using `__builtins__` or some such. Only the tags included with Geany itself are considered "stable", the ones on the Wiki are just ones I whipped up with various shell-hackery to save others the work.
Cheers, Matthew Brush
Sorry I forgot, it would be ungrateful without saying thanks to Lex
Thanks
On Mon, Feb 27, 2012 at 12:35 PM, Lex Trotman elextr@gmail.com wrote:
On 27 February 2012 22:29, klo uo klonuo@gmail.com wrote:
...