www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ide - Intellisense madness

reply Ignacious <I.D.T ProjectMaya.com> writes:
I'm sure this has been brought up before... but having 
intellisense list all available accessors in a flat sorted list 
is madness! It prevents one from quickly seeing what kind of 
accessors a type has if they are not familiar with the type.

Surely it would not be difficult to list the direct accessors of 
a type at the top of the list? Or, at the very list, list any 
generic accessors in their own group.

If the coding is too difficult a simple resolution is this:

Take the generic accessors that work on any type and put them at 
the bottom of the list(or color them red or something). This can 
be done easily by just getting the intellisense results off an 
empty type such as Object behind the scenes once and then 
matching them against the type being accessed at hand. Since D 
has many built in generic accessors, it bloats the list with junk 
that I don't need to see most of the time.

In Visual D, intellisense is nearly useless for me. It obfuscates 
rather than helps.

Thanks for investigating this! ;)
Jan 13
parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
On 13.01.2017 21:36, Ignacious wrote:
 I'm sure this has been brought up before... but having intellisense list
 all available accessors in a flat sorted list is madness! It prevents
 one from quickly seeing what kind of accessors a type has if they are
 not familiar with the type.

 Surely it would not be difficult to list the direct accessors of a type
 at the top of the list? Or, at the very list, list any generic accessors
 in their own group.

 If the coding is too difficult a simple resolution is this:

 Take the generic accessors that work on any type and put them at the
 bottom of the list(or color them red or something). This can be done
 easily by just getting the intellisense results off an empty type such
 as Object behind the scenes once and then matching them against the type
 being accessed at hand. Since D has many built in generic accessors, it
 bloats the list with junk that I don't need to see most of the time.

 In Visual D, intellisense is nearly useless for me. It obfuscates rather
 than helps.

 Thanks for investigating this! ;)
It never actually bothered me, but I agree a better sorting might be preferable. There is little access to the layout of the completion box, but the order and the text color can be changed. I'll look into this...
Jan 26
parent reply Profile Anaysis <PA gotacha.com> writes:
On Thursday, 26 January 2017 at 08:28:41 UTC, Rainer Schuetze 
wrote:
 On 13.01.2017 21:36, Ignacious wrote:
 I'm sure this has been brought up before... but having 
 intellisense list
 all available accessors in a flat sorted list is madness! It 
 prevents
 one from quickly seeing what kind of accessors a type has if 
 they are
 not familiar with the type.

 Surely it would not be difficult to list the direct accessors 
 of a type
 at the top of the list? Or, at the very list, list any generic 
 accessors
 in their own group.

 If the coding is too difficult a simple resolution is this:

 Take the generic accessors that work on any type and put them 
 at the
 bottom of the list(or color them red or something). This can 
 be done
 easily by just getting the intellisense results off an empty 
 type such
 as Object behind the scenes once and then matching them 
 against the type
 being accessed at hand. Since D has many built in generic 
 accessors, it
 bloats the list with junk that I don't need to see most of the 
 time.

 In Visual D, intellisense is nearly useless for me. It 
 obfuscates rather
 than helps.

 Thanks for investigating this! ;)
It never actually bothered me, but I agree a better sorting might be preferable. There is little access to the layout of the completion box, but the order and the text color can be changed. I'll look into this...
Then could you not add some options to make it easier to read? Intelligent is about useless to be because it has so much stuff in it that I can never find my functions(and page up/down do not work so scrolling through them is too time consuming). Some options. 1. Do not populate box with globals and templates. Just show direct fields, members, and this. 2. The names have to be ordered in some way. Finding symbols that are ordered last could be used. e.g., zzz_name. Not great but better than nothing. Could be user configurable. Alternatively maybe some hacks could be implemented(again, optionally). One could get the intellisense popup and force a reorder or take over the drawing of it to add a custom list(might be better as one could style it and add more information. Of course, being a hack is not good but it would be better than nothing. Use a custom intellisense similar to the above hack but just intercept the keys and monitor for `.`'s(out side of strings and comments).
Jan 27
parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
On 27.01.2017 12:08, Profile Anaysis wrote:
 1. Do not populate box with globals and templates. Just show direct
 fields, members, and this.
You can already select this by disabling "UFCS expansions" on the options page.
 2. The names have to be ordered in some way. Finding symbols that are
 ordered last could be used. e.g., zzz_name. Not great but better than
 nothing. Could be user configurable.
Not sure what you mean by "ordered last". Least recently used?
Jan 27
parent reply Profile Anaysis <PA gotacha.com> writes:
On Friday, 27 January 2017 at 22:50:37 UTC, Rainer Schuetze wrote:
 On 27.01.2017 12:08, Profile Anaysis wrote:
 1. Do not populate box with globals and templates. Just show 
 direct
 fields, members, and this.
You can already select this by disabling "UFCS expansions" on the options page.
Thanks, that helps a little. Still get about half of stuff I don't care about(ptr, init, _ctor, etc. These things are somewhat universal so not really needed in the list).
 2. The names have to be ordered in some way. Finding symbols
that are
 ordered last could be used. e.g., zzz_name. Not great but
better than
 nothing. Could be user configurable.
Not sure what you mean by "ordered last". Least recently used?
Well, if the names are alphabetically listed, which it looks as if it is, then by using the characters(like z, or _, or ___, or whatever) to prepend the names will put them at the end of the list. This will move the "junk"(whatever you decide that to be, such as ufcs's) to the end of the list. e.g., you could list fields first, then methods: 0_[fieldname1] 0_[fieldname2] 0_[fieldname3] ... 0_[fieldnameN] 1_[methodname1] 1_[methodname2] 1_[methodname3] ... 1_[methodnameN] 2_[commonType1] // e.g., ptr, _ctor, etc.. ... 2_[commonTypeN] 3_[UFCS1] ... 3_[UFCSN] so, the sorting algorithm in VS can be customized. Obviously it's a nasty syntax but it could be an option for some of us if there is no better way. If one can use special characters that are sorted correctly but don't show up visually or are more meaningful, then it would be better. If I had the ability to build VD I would probably add the options to specify the character codes for the different types of entries in intellisense and if they are enabled. e.g., 0x1E - Field names 0x1F - Method names 0x23 - Method names(internal)(ptr, _ctor, etc) 0x2F - UFCS 0x3A = Other I'm not sure what 0x1E would show in the intellisense but for internal method names and UFCS, we would get ... #ptr #_ctor .. /reverse /strip etc in the list. Again, all we are trying to do is control the order and what is shown in the list. This way I can see the most pertinent things in the top of the list, which is what is first shown and the other stuff at the bottom.
Jan 27
parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
On 28.01.2017 04:08, Profile Anaysis wrote:
 Not sure what you mean by "ordered last". Least recently used?
Well, if the names are alphabetically listed, which it looks as if it is, then by using the characters(like z, or _, or ___, or whatever) to prepend the names will put them at the end of the list. This will move the "junk"(whatever you decide that to be, such as ufcs's) to the end of the list.
Visual D has full control over the order, so no workarounds needed for that. I added an option to sort by type (default on). You can grab a preview build here: https://ci.appveyor.com/project/rainers/visuald/build/1.0.101/job/kgw7q005oqw4m5nf/artifacts
Jan 30
parent reply Profile Anaysis <PA gotacha.com> writes:
On Monday, 30 January 2017 at 19:36:37 UTC, Rainer Schuetze wrote:
 On 28.01.2017 04:08, Profile Anaysis wrote:
 Not sure what you mean by "ordered last". Least recently used?
Well, if the names are alphabetically listed, which it looks as if it is, then by using the characters(like z, or _, or ___, or whatever) to prepend the names will put them at the end of the list. This will move the "junk"(whatever you decide that to be, such as ufcs's) to the end of the list.
Visual D has full control over the order, so no workarounds needed for that. I added an option to sort by type (default on). You can grab a preview build here: https://ci.appveyor.com/project/rainers/visuald/build/1.0.101/job/kgw7q005oqw4m5nf/artifacts
Cool, that is much better! Makes it useful to me now! One more simple request! ;) Could you "subsort" them based on inheritance? What I noticed for some of my objects is that I'm seeing the base class members interspersed with the members I added, e.g., class X {x} class Y : x {y} listing is x y because the inheritance is flattened. But I'd rather see y x because it shows the most relevant members(the ones I created) first, then the next relevant, and so on. Probably adding a simple "is(A : B)" to your sorting compassion function would work. (e.g., if A is derived from B then list A first) This isn't a big deal for small classes but for complex hierarchies one almost runs in to the same problem as before. This may not be useful for all cases. If you can just check on the object being references, it would probably be better. I have noticed a few other things: 1. I am used to hitting page down when the intellisense pops up so I can quickly scroll through the list a page at a time without having to take my hands off the keyboard. When I use page down in VD it scrolls the cursor. Not sure if it is possible to temporarily override/hijack the page down/up keys while intellisense is open. Down and Up keys work in intellisense correctly but they are slow to move. Would be better to also add the page keys and possibly home and end. 2. functions and variables in the list from different modules are intermixed. This isn't a bad thing since they are alphabetically sorted, but there is so much stuff in my list that it becomes less effective when I have to search for stuff. I don't think sorting by module would be a good idea but maybe you could color code the names, if possible depending on what module they come from, or sort phobos entries to the bottom and color code them vs modules in the project. I might try to implement some features at some point. I think I would like to get mago working better first though because I feel D's debugging is very poor at this point(sort of bare minimum). I just need to get it to compile ;)
Jan 30
next sibling parent reply Profile Anaysis <PA gotacha.com> writes:
Also, it seems sometimes it seems to fail and not list anything 
from the object I initialized it on, when I backspace and type . 
again it pops up differently(basically not showing the objects 
members then next time shows them, then).


e.g.,

type object.

then backspace over the . and repeat and see if you get different 
listings(one with object's members and one without, should be 
obvious cause the first element in the list will be different).
Jan 31
parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
On 31.01.2017 11:45, Profile Anaysis wrote:
 Also, it seems sometimes it seems to fail and not list anything from the
 object I initialized it on, when I backspace and type . again it pops up
 differently(basically not showing the objects members then next time
 shows them, then).


 e.g.,

 type object.

 then backspace over the . and repeat and see if you get different
 listings(one with object's members and one without, should be obvious
 cause the first element in the list will be different).
I can reproduce this (I usually use explicit expansion with Ctrl+Space, so didn't notice so far). It seems the context is lost and a list of all symbols is shown. I'll investigate...
Feb 01
parent Rainer Schuetze <r.sagitario gmx.de> writes:
On 01.02.2017 23:12, Rainer Schuetze wrote:
 On 31.01.2017 11:45, Profile Anaysis wrote:
 Also, it seems sometimes it seems to fail and not list anything from the
 object I initialized it on, when I backspace and type . again it pops up
 differently(basically not showing the objects members then next time
 shows them, then).


 e.g.,

 type object.

 then backspace over the . and repeat and see if you get different
 listings(one with object's members and one without, should be obvious
 cause the first element in the list will be different).
I can reproduce this (I usually use explicit expansion with Ctrl+Space, so didn't notice so far). It seems the context is lost and a list of all symbols is shown. I'll investigate...
This should be fixed in the build found here: https://ci.appveyor.com/project/rainers/visuald/build/job/fmr6vf36vny6gbum/artifacts
Feb 05
prev sibling next sibling parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
On 31.01.2017 07:27, Profile Anaysis wrote:
 One more simple request! ;)

 Could you "subsort" them based on inheritance? What I noticed for some
 of my objects is that I'm seeing the base class members interspersed
 with the members I added, e.g.,

 class X {x}

 class Y : x {y}

 listing is

 x
 y

 because the inheritance is flattened. But I'd rather see

 y
 x

 because it shows the most relevant members(the ones I created) first,
 then the next relevant, and so on.

 Probably adding a simple "is(A : B)" to your sorting compassion function
 would work. (e.g., if A is derived from B then list A first)

 This isn't a big deal for small classes but for complex hierarchies one
 almost runs in to the same problem as before.

 This may not be useful for all cases. If you can just check on the
 object being references, it would probably be better.
I'll have to dig deeper into the semantic analysis engine, whether this information can easily be made available, as it's written by someone else (the author of Mono-D).
 I have noticed a few other things:

 1. I am used to hitting page down when the intellisense pops up so I can
 quickly scroll through the list a page at a time without having to take
 my hands off the keyboard. When I use page down in VD it scrolls the
 cursor. Not sure if it is possible to temporarily override/hijack the
 page down/up keys while intellisense is open. Down and Up keys work in
 intellisense correctly but they are slow to move. Would be better to
 also add the page keys and possibly home and end.
Yeah, I miss page up/down sometimes, too. Will investigate...
 2. functions and variables in the list from different modules are
 intermixed. This isn't a bad thing since they are alphabetically sorted,
 but there is so much stuff in my list that it becomes less effective
 when I have to search for stuff.

 I don't think sorting by module would be a good idea but maybe you could
 color code the names, if possible depending on what module they come
 from, or sort phobos entries to the bottom and color code them vs
 modules in the project.
Not sure if this will easy become confusing, too. I'll think about it...
 I might try to implement some features at some point. I think I would
 like to get mago working better first though because I feel D's
 debugging is very poor at this point(sort of bare minimum). I just need
 to get it to compile ;)
If you want to hack on mago: You don't need to compile Visual D for it, it is a different (C++) project: https://github.com/rainers/mago. I suggest you should focus on the Concord debugger extension MagoNatCC. It's installation for debugging is very simple: just copy the resulting DLL into <VSInstallPath>\Common7\Packages\Debugger.
Feb 01
next sibling parent reply Profile Anaysis <PA gotacha.com> writes:
On Wednesday, 1 February 2017 at 22:03:34 UTC, Rainer Schuetze 
wrote:
...
Thanks
 I might try to implement some features at some point. I think 
 I would
 like to get mago working better first though because I feel D's
 debugging is very poor at this point(sort of bare minimum). I 
 just need
 to get it to compile ;)
If you want to hack on mago: You don't need to compile Visual D for it, it is a different (C++) project: https://github.com/rainers/mago. I suggest you should focus on the Concord debugger extension MagoNatCC. It's installation for debugging is very simple: just copy the resulting DLL into <VSInstallPath>\Common7\Packages\Debugger.
I tried building Mago and it seems it requires an earlier VS than 2015 as some of the libs report being out of date(MSVC ver 1900 vs 1800 or something) Does the concord debugger extension require mago to build or is it a standalone project? Basically I'd like to be able to investigate the issues with some symbols not showing and possible ways to improve the debugging experience. I feel like I'll have to install a separate older version of VS to get it to compile though.
Feb 01
parent Rainer Schuetze <r.sagitario gmx.de> writes:
On 02.02.2017 01:45, Profile Anaysis wrote:
 On Wednesday, 1 February 2017 at 22:03:34 UTC, Rainer Schuetze wrote:
 ...
Thanks
 I might try to implement some features at some point. I think I would
 like to get mago working better first though because I feel D's
 debugging is very poor at this point(sort of bare minimum). I just need
 to get it to compile ;)
If you want to hack on mago: You don't need to compile Visual D for it, it is a different (C++) project: https://github.com/rainers/mago. I suggest you should focus on the Concord debugger extension MagoNatCC. It's installation for debugging is very simple: just copy the resulting DLL into <VSInstallPath>\Common7\Packages\Debugger.
I tried building Mago and it seems it requires an earlier VS than 2015 as some of the libs report being out of date(MSVC ver 1900 vs 1800 or something)
The release is built with VS2013, but Appveyor builds with both VS2013 and VS2015 (see https://ci.appveyor.com/project/rainers/visuald/build/1.0.103/job/t0u 5ue4vk0u4e39#L799). Some tests require a special library, but I never cared to adopt this (this is another project I "inherited" from its original author, mago originates from http://dsource.org/projects/mago_debugger and is mostly Aldo Nunez' work).
 Does the concord debugger extension require mago to build or is it a
 standalone project? Basically I'd like to be able to investigate the
 issues with some symbols not showing and possible ways to improve the
 debugging experience. I feel like I'll have to install a separate older
 version of VS to get it to compile though.
the debugger extension is project MagoNatCC in the Expression folder of the MagoDbg_2010 solution. It must be compiled with solution configuration "Debug/Release Static DE". It uses parts of mago necesssary for expression evaluation (including reading debug info from the PDB through the DIA API).
Feb 01
prev sibling parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
On 01.02.2017 23:03, Rainer Schuetze wrote:
 1. I am used to hitting page down when the intellisense pops up so I can
 quickly scroll through the list a page at a time without having to take
 my hands off the keyboard. When I use page down in VD it scrolls the
 cursor. Not sure if it is possible to temporarily override/hijack the
 page down/up keys while intellisense is open. Down and Up keys work in
 intellisense correctly but they are slow to move. Would be better to
 also add the page keys and possibly home and end.
Yeah, I miss page up/down sometimes, too. Will investigate...
Page up/down should work in this prebuild: https://ci.appveyor.com/project/rainers/visuald/build/job/9mjrm70mra6or98f/artifacts Home and end don't seem to be supported, they also don't work in C++.
Feb 01
parent reply Profile Anaysis <PA gotacha.com> writes:
On Thursday, 2 February 2017 at 07:21:27 UTC, Rainer Schuetze 
wrote:
 On 01.02.2017 23:03, Rainer Schuetze wrote:
 1. I am used to hitting page down when the intellisense pops 
 up so I can
 quickly scroll through the list a page at a time without 
 having to take
 my hands off the keyboard. When I use page down in VD it 
 scrolls the
 cursor. Not sure if it is possible to temporarily 
 override/hijack the
 page down/up keys while intellisense is open. Down and Up 
 keys work in
 intellisense correctly but they are slow to move. Would be 
 better to
 also add the page keys and possibly home and end.
Yeah, I miss page up/down sometimes, too. Will investigate...
Page up/down should work in this prebuild: https://ci.appveyor.com/project/rainers/visuald/build/job/9mjrm70mra6or98f/artifacts Home and end don't seem to be supported, they also don't work in C++.
cool, thanks! One more minor nitpick. When hovering mouse over a class or struct constructor, it does not show the parameters like a normal function. (seems that "this" does not get resolved properly as a function)
Feb 03
parent Rainer Schuetze <r.sagitario gmx.de> writes:
On 04.02.2017 07:32, Profile Anaysis wrote:
 On Thursday, 2 February 2017 at 07:21:27 UTC, Rainer Schuetze wrote:
 On 01.02.2017 23:03, Rainer Schuetze wrote:
 1. I am used to hitting page down when the intellisense pops up so I
 can
 quickly scroll through the list a page at a time without having to take
 my hands off the keyboard. When I use page down in VD it scrolls the
 cursor. Not sure if it is possible to temporarily override/hijack the
 page down/up keys while intellisense is open. Down and Up keys work in
 intellisense correctly but they are slow to move. Would be better to
 also add the page keys and possibly home and end.
Yeah, I miss page up/down sometimes, too. Will investigate...
Page up/down should work in this prebuild: https://ci.appveyor.com/project/rainers/visuald/build/job/9mjrm70mra6or98f/artifacts Home and end don't seem to be supported, they also don't work in C++.
cool, thanks! One more minor nitpick. When hovering mouse over a class or struct constructor, it does not show the parameters like a normal function. (seems that "this" does not get resolved properly as a function)
Unfortunately, constructors seem to cause some trouble in the semantic engine, there is no information for parameter tooltips, too (see https://issues.dlang.org/show_bug.cgi?id=11942). It works for "__ctor", though.
Feb 05
prev sibling parent Rainer Schuetze <r.sagitario gmx.de> writes:
On 31.01.2017 07:27, Profile Anaysis wrote:
 On Monday, 30 January 2017 at 19:36:37 UTC, Rainer Schuetze wrote:
 On 28.01.2017 04:08, Profile Anaysis wrote:
 Not sure what you mean by "ordered last". Least recently used?
Well, if the names are alphabetically listed, which it looks as if it is, then by using the characters(like z, or _, or ___, or whatever) to prepend the names will put them at the end of the list. This will move the "junk"(whatever you decide that to be, such as ufcs's) to the end of the list.
Visual D has full control over the order, so no workarounds needed for that. I added an option to sort by type (default on). You can grab a preview build here: https://ci.appveyor.com/project/rainers/visuald/build/1.0.101/job/kgw7q005oqw4m5nf/artifacts
Cool, that is much better! Makes it useful to me now! One more simple request! ;)
I've made a couple improvements: - new option to disable exact start match (searches case insensitive sub string) - free functions show different icon than member functions - aliases show other icon than variables - without any match, still keep the completion box open to update when deleting the last character - new sorting mode "by declaration", effectively sorting by scope as discovered by the semantic engine. The last item more or less does what you requested for classes, though it doesn't sort the variables or functions per scope. It also prefers function local variables over class members or globals. A preview build is available here: https://ci.appveyor.com/project/rainers/visuald/build/job/fmr6vf36vny6gbum/artifacts
Feb 05