Visual D Privileged instruction

Alex AJ at gmail.com
Fri May 17 09:55:10 UTC 2019


On Friday, 17 May 2019 at 07:40:32 UTC, Rainer Schuetze wrote:
>
>
> On 16/05/2019 17:47, Alex wrote:
>> Also, when I do a search for some things and it returns back 
>> the Visual D search, When I double click on an entry it does 
>> not take me to the location.
>> 
>> everything checks out in the list but the path is relative 
>> "..\Libs\moduleX.d"
>> 
>> I'm thinking that is the reason it doesn't open it because it 
>> doesn't turn that in to an absolute path. It's obviously 
>> collecting the right info since it's displaying it all 
>> correctly but the open file routine when double clicking on an 
>> entry is failing to open the file... suggesting it is most 
>> likely due to the relative path.
>> 
>> 
>
> Do you mean the "Search File/Symbol" from the Visual D menu? 
> And your
> project contains files that are outside the folder with the 
> project
> file? Seems to work here with a simple test. What project type 
> do you use?

When I use "Go to definition"[right mouse button on a function 
id, say] it pops up the same dialog from Search File/Symbol if 
there are multiple matches or it see's an ambiguity(I've seen it 
pop up 0 and 1). Sometimes it takes me to the definition, 
sometimes it pops up the dialog, sometimes it does nothing.

I'm using standard D project(not the C/C++/D).

I have a hard link in the project dir which points to other 
files. The hard link is dragged in to the project.

..\Libs

SolutionDir\ProjectDir
SolutionDir\Libs

Hence ..\Libs goes down from the Project Dir and goes in to the 
Libs dir(which is a hard link to Libs somewhere else but it 
shouldn't matter). The search that pops up tends to use ..\Libs 
because that seems to be where it has the most trouble but also 
because I use oop a lot in Libs.

This actually happens for a lot of symbols that exist in an 
interface and a class.

It seems the "search" is finding the symbol in the interface and 
the symbol in the class(and derived) but cannot figure out which 
one to go to. It shows all 3 but then I can't double click any 
one to open up the file and go to that line.

i.e., we know it is finding the right stuff but it's just not 
opening the file when clicked. So this is almost surely a path 
issue.

Again, we already had an issue like this because of path's not 
being properly handled in D. (or maybe it was just a problem I 
had, but there is something were with std.path and relative 
paths).

Also, There are two options:

1.Go to definition
2 Go to declaration

they both do the same thing it seems.

I don't mind the dialog popping up but if there are 0, 1, or 2 
matches it seems it could avoid popping up the dialog in most of 
these cases. Ideally it would determine which is the actual call 
being made and choose that one.

What I mean is that if I have something like

interface X { foo }
class Y : X { foo }
class Z : T { foo }

and I'm calling Y.foo(if it is clear) then it takes me to class 
Y. From there I could use goto definition again it would jump up 
higher in the chain and take me to X's foo.

Basically work up the hierarchy from the lowest to the highest. 
This might not be good for large chains though but if it's 2(just 
a class and interface) then it might be best to have go to 
declaration use the interface and go to definition go to the 
class.

Not a huge deal here as long as the search did work as it's just 
a click away.

Maybe a better way to do all this would be to show the hierarchy 
in the search(as a tree) and then that would be far more 
informative.

e.g.,

X.foo ..\Libs\mod.d 43
    Y.foo ..\Libs\mod.d 55
         Z.foo ..\Libs\modZ.d 22
    F.foo ..\Libs\foo.d 4444
Q.bar
    ...
      ...


(just determine the hierarchy and use tabs for inheritance level 
and maybe marking them as interface, class, abstract class, 
struct, etc so it's easier to tell without having to open the 
file).

Anyways, not a huge deal since I could get by without that stuff 
if I could just get the search to work in the first place...

But my feeling is this issue also is related to many of the other 
problems I experience such as when debugging and I can't step in 
to a function since it's not seeing the source code.

They all seem to happen for code that is in ..\Lib but not 
absolutely specified files.

One of the problems is that when VD can't seem to find the file 
it does't report anything such as an error message saying the 
file is not found.

Also, I had this issue with std.stdio; I was trying to jump to 
stdout.

import std.stdio;
stdout.close();

"go to definition" on stdout failed with "no definition found for 
stdout".

but "go to definition" on std.stdio worked fine and opened up 
std.stdio which I then could search for stdout.

	import std.stdio;
	stdout.open("CON", "w");
	stderr.open("CON", "w");

It would be nice if the "no definition found for ..." was more 
informative such as giving the files it is trying to look for. 
(such as a popup window listing all them in a text window or in 
the output window)

Without knowing why stuff fails it's hard to figure out why stuff 
fails ;/

Thanks again!















More information about the Digitalmars-d-ide mailing list