Dear devs,
I have (again) a few minor things that should be fixed over time. I work mostly with php files.
1) The scope is only functional when the file is freshly saved (else it's 'unknown')
It would be cool if Geany would automatically refresh the scope info (and symbol list) every X seconds or upon change.
2) The scope is not based on the beginning of the function declaration, but after the declaration's {. Inserting a function description when you cursor is at %cursor%
function other_function() { // do stuff }
function my_function %cursor% { // do stuff }
...will add a description to 'other_function()'.
3) The function description is added with '<?php' and '?>' tags, which corrupts the php file.
4) It would also be cool if the command would also detect the input variables and add them to the description
Cheers!
-H-
On Wed, 28 Nov 2007 10:21:27 +0100, Harold Aling h.aling@home.nl wrote:
Hi,
- The scope is only functional when the file is freshly saved (else
it's 'unknown')
Yes, this is a very strange bug, didn't find the cause yet.
It would be cool if Geany would automatically refresh the scope info (and symbol list) every X seconds or upon change.
Well, the symbol list is updated everytime when the file is saved. To update it more often, e.g. regularly just save the file more often. The symbol list can only be updated when the file is saved(i.e. actually written to disk) because the tagmanager only works on files not on buffers. On the TODO there is already an item to get the tagmanager also working on text buffers not only on files. As a workaround, use the autosave plugin.
- The scope is not based on the beginning of the function
declaration, but after the declaration's {. Inserting a function description when you cursor is at %cursor%
function other_function() { // do stuff }
function my_function %cursor% { // do stuff }
...will add a description to 'other_function()'.
Yes, the cursor must be within the { }. This is also documented and I won't change it because it would be a lot of work for a very less change. Just click within the { } before inserting a function comment.
- The function description is added with '<?php' and '?>' tags, which
corrupts the php file.
Fixed in SVN, sorry.
- It would also be cool if the command would also detect the input
variables and add them to the description
Yes it would be cool but it has to be implemented...not a high priority for me.
Regards, Enrico
On Sat, 1 Dec 2007 12:27:57 +0100 Enrico Tröger enrico.troeger@uvena.de wrote:
On Wed, 28 Nov 2007 10:21:27 +0100, Harold Aling h.aling@home.nl wrote:
Hi,
- The scope is only functional when the file is freshly saved (else
it's 'unknown')
Yes, this is a very strange bug, didn't find the cause yet.
When a file has no changes, tagmanager is used to lookup the tag parsed just before the 1st fold level above the cursor position. With changes, the scope has to be parsed from any identifiers the scintilla lexer has styled.
So the scope indication is not going to work perfectly. Currently it might be difficult to improve because the PHP lexer is quite complex (I think there are some unresolved issues with bracket styling for example).
Ideally, we would always use tagmanager, because it is designed to parse tags and categorize them, but there are two problems:
1. At the moment tagmanager works from files (can be fixed with some porting work - on the TODO as Enrico mentions).
2. When will we reparse the current file? TM parses are generally quite fast, but even so you probably wouldn't want a reparse too often. I suppose there could be a setting for reparsing when the scope has changed, based on cursor fold level changes.
Regards, Nick