Hello,
I just tried my patch again to make scope completion work better (see r4840), but I now noticed that scope completion doesn't work at all anymore.
tm_workspace_find() in autocomplete_scope() in editor.c returns NULL. I didn't investigate further. Could the recent tagmanager changes have caused this?
Best regards.
Am 18.04.2011 15:04, schrieb Thomas Martitz:
Hello,
I just tried my patch again to make scope completion work better (see r4840), but I now noticed that scope completion doesn't work at all anymore.
Just for completeness. My way to open the scope completion list was (in this case) to type "editor->" or "editor." in e.g. autocomplete_scope().
Best regards.
Hi,
Le 18/04/2011 15:17, Thomas Martitz a écrit :
Am 18.04.2011 15:04, schrieb Thomas Martitz:
Hello,
I just tried my patch again to make scope completion work better (see r4840), but I now noticed that scope completion doesn't work at all anymore.
Just for completeness. My way to open the scope completion list was (in this case) to type "editor->" or "editor." in e.g. autocomplete_scope().
It still works for me, and I'd be surprised it to be broken by recent changes. Maybe r5642 would have broken this, but it has been reverted by r5711 because it did actually broke calltips.
However, scope completion only works when the variable type is known, e.g. with globals only.
Cheers, Colomban
Am 18.04.2011 15:26, schrieb Colomban Wendling:
Hi,
Le 18/04/2011 15:17, Thomas Martitz a écrit :
Am 18.04.2011 15:04, schrieb Thomas Martitz:
Hello,
I just tried my patch again to make scope completion work better (see r4840), but I now noticed that scope completion doesn't work at all anymore.
Just for completeness. My way to open the scope completion list was (in this case) to type "editor->" or "editor." in e.g. autocomplete_scope().
It still works for me, and I'd be surprised it to be broken by recent changes. Maybe r5642 would have broken this, but it has been reverted by r5711 because it did actually broke calltips.
However, scope completion only works when the variable type is known, e.g. with globals only.
Pretty sure it worked with locals also, but I may be wrong.
Anyway, I tried it with something global and it doesn't work too. In editor.c, no list at all with editor_prefs, and a wrong list with editor_info.
Best regards.
Le 18/04/2011 15:38, Thomas Martitz a écrit :
Am 18.04.2011 15:26, schrieb Colomban Wendling:
Hi,
Le 18/04/2011 15:17, Thomas Martitz a écrit :
Am 18.04.2011 15:04, schrieb Thomas Martitz:
Hello,
I just tried my patch again to make scope completion work better (see r4840), but I now noticed that scope completion doesn't work at all anymore.
Just for completeness. My way to open the scope completion list was (in this case) to type "editor->" or "editor." in e.g. autocomplete_scope().
It still works for me, and I'd be surprised it to be broken by recent changes. Maybe r5642 would have broken this, but it has been reverted by r5711 because it did actually broke calltips.
However, scope completion only works when the variable type is known, e.g. with globals only.
Pretty sure it worked with locals also, but I may be wrong.
Since all completions, including scope ones, are based on tags, and we never had local tags parsed AFAIK, I'm pretty sure it never worked. But I'd be happy to be proven wrong :)
Anyway, I tried it with something global and it doesn't work too. In editor.c, no list at all with editor_prefs, and a wrong list with editor_info.
Hum, true. I'm investigating this, but first things I found:
1) scope completion of anonymous structs/unions got "broken" since r5563, because it made these anonymous have a non-unique name in the whole workspace (and since scope completion is based upon var type, it gets the completion for all who shares a name). This prehaps may be fixable in scope completion itself to chose only one -- and the right one :D -- parent. However a quick & dirty "fix" is to revert r5563, but it was meant to stop reparsing to lead to infinite increasing of the anonymous suffix.
2) if there is more than one possible candidate in the whole project for scope completion, the first match is taken without further care (AFAICT).
However I can't tell yet why editor_prefs don't complete at all, since it works with a resolver I wrote for debugging (e.g. replicating what I understand tm_workspace_find_scope_members() does). I think I gonna need understanding tm_workspace... :'(
Cheers, Colomban
Am 18.04.2011 19:12, schrieb Colomban Wendling:
Le 18/04/2011 15:38, Thomas Martitz a écrit :
Am 18.04.2011 15:26, schrieb Colomban Wendling:
Hi,
Le 18/04/2011 15:17, Thomas Martitz a écrit :
Am 18.04.2011 15:04, schrieb Thomas Martitz:
Hello,
I just tried my patch again to make scope completion work better (see r4840), but I now noticed that scope completion doesn't work at all anymore.
Just for completeness. My way to open the scope completion list was (in this case) to type "editor->" or "editor." in e.g. autocomplete_scope().
It still works for me, and I'd be surprised it to be broken by recent changes. Maybe r5642 would have broken this, but it has been reverted by r5711 because it did actually broke calltips.
However, scope completion only works when the variable type is known, e.g. with globals only.
Pretty sure it worked with locals also, but I may be wrong.
Since all completions, including scope ones, are based on tags, and we never had local tags parsed AFAIK, I'm pretty sure it never worked. But I'd be happy to be proven wrong :)
Nah, I suspect my memory is just wrong. It's been a long time since I paid attention to scope completion.
Best regards.
Hey,
Le 18/04/2011 19:12, Colomban Wendling a écrit :
Le 18/04/2011 15:38, Thomas Martitz a écrit : [...]
Anyway, I tried it with something global and it doesn't work too. In editor.c, no list at all with editor_prefs, and a wrong list with editor_info.
Hum, true. I'm investigating this, but first things I found:
Well, well, well... I still haven't found enough courage to try fixing the tagmanager implementation (tm_workspace_find_scope_members()), but I've finished writing another finder, which seem to work, so proving the needed tags are here and usable.
I attach it here if anybody wants to try it, maybe it'd be helpful to correctly fix tm_workspace_find_scope_members() -- or just replace it :D
- scope completion of anonymous structs/unions got "broken" since
r5563, because it made these anonymous have a non-unique name in the whole workspace (and since scope completion is based upon var type, it gets the completion for all who shares a name). This prehaps may be fixable in scope completion itself to chose only one -- and the right one :D -- parent. However a quick & dirty "fix" is to revert r5563, but it was meant to stop reparsing to lead to infinite increasing of the anonymous suffix.
This one should be addressed in my test attempt, by always searching the type/typedef first in the file that holds the variable/typedef referring to it.
- if there is more than one possible candidate in the whole project for
scope completion, the first match is taken without further care (AFAICT).
Same for this one, and I doubt we could do better... if there are name clashes, there is a limit to the magic we can do I guess.
Cheers, Colomban
Note for myself: it seems that the TM is broken if we have infinite typedef recursion (e.g. typedef a b; typedef b a;), need to fix this too.