FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

"Phobos" browse information not built.

 
Post new topic   Reply to topic     Forum Index -> Visual D
View previous topic :: View next topic  
Author Message
ArKay



Joined: 25 Apr 2011
Posts: 1

PostPosted: Sun May 15, 2011 12:39 pm    Post subject: "Phobos" browse information not built. Reply with quote

I am using Tango, so I hope that doesn't make any difference. Smile

Here's the output from the build:

Code:
Building phobos JSON browse information files to C:\Users\arkay\AppData\Roaming\VisualD\json\
Using import C:\D\dmd\windows\bin\\..\import;C:\D\dmd\windows\bin\\..\import\tango\core\vendor\

So I copied the whole tango sources directory over to C:\D\dmd\windows\import

which gives me this structure:

C:\D\dmd\windows\import\tango\ ...

The browse information isn't generated, the C:\Users\...\VisualD\json directory stays empty.

Compilation works. Any ideas?

Cheers,
Rainer
Back to top
View user's profile Send private message
sagitario



Joined: 03 Mar 2007
Posts: 292

PostPosted: Sun May 15, 2011 2:40 pm    Post subject: Reply with quote

I don't think that building tango browse information by the "Build Phobos browse info" command works. It is very much tailored to the directory structure of druntime and phobos.

You should build the tango library with the -X option to create a json file and put this file in a directory specified by the global json path setting.
Back to top
View user's profile Send private message
JoeCoder



Joined: 29 Oct 2005
Posts: 294

PostPosted: Mon Sep 05, 2011 10:22 pm    Post subject: Reply with quote

You should add a note about "Build Phobos Browse info" to the instructions. Or maybe it's not there and I didn't see it.

I've been trying off and on all day to get intellisense for phobos to work.
Back to top
View user's profile Send private message
JoeCoder



Joined: 29 Oct 2005
Posts: 294

PostPosted: Tue Sep 06, 2011 9:06 am    Post subject: Reply with quote

I hope to migrate to D2 eventually, but for now I am also using Tango.

D2 and phobos is working well. I have built the json file from tango 0.99.9 and added it to Options -> Projects and Solutions -> Visual D Directories -> JSON Paths, but parameter info and go to definition are still not working for D1/tango. I did remember to switch the DMD install path and the project's compilation options back to D1.

Is there any way to see error output from VisualD that may be preventing this from working?

Here is my tango json file, in case it is useful to anyone else.
Back to top
View user's profile Send private message
sagitario



Joined: 03 Mar 2007
Posts: 292

PostPosted: Tue Sep 06, 2011 2:15 pm    Post subject: Reply with quote

There is a little info on building the runtime library json info here: http://www.dsource.org/projects/visuald/wiki/Tour/BrowseInfo
But I agree, the section will not help you, if something goes wrong.

The problem with your tango json file is that it cannot be parsed, because it is malformatted. The parser complains about '{' immediately following '}' without a ',' in between on line 26 (I had to patch std.json to get a linenumber). Probably dmd for D1 has not received all the json related patches from the D2 compiler.

I guess it would be helpful to show the error info in the output window. I will put it on my todo list.
Back to top
View user's profile Send private message
JoeCoder



Joined: 29 Oct 2005
Posts: 294

PostPosted: Wed Sep 07, 2011 7:54 am    Post subject: Reply with quote

Thanks for your fast response.

I have fixed the json via find/replace and it now passes this json validator.

But it's still not working. when I type "Thread.sleep(", I get no context help. But typing "test2(" gives me the correct parameter info. Pressing ctrl+shift+space after the sleep( does nothing.

Here is my code:
Code:
module main;

void test2 (int a, int b)
{
}

import tango.core.Thread;

void main(char[][] argv)
{
   Thread.sleep(1000);
   test2(1, 2);
}


I don't think this is the right approach, but if I press Build Phobos Browse Info, I see this in the output window:

Code:
Building phobos JSON browse information files to C:\dev\env\tango\import\tango.0.99.9.json\
cannot create directory C:\dev\env\tango\import\tango.0.99.9.json\


Any ideas?
Back to top
View user's profile Send private message
sagitario



Joined: 03 Mar 2007
Posts: 292

PostPosted: Wed Sep 07, 2011 11:26 am    Post subject: Reply with quote

My guess is that you have specified the json file in the JSON path setting. Instead, you should only pass the directory, i.e. C:\dev\env\tango\import.

I also remember troubles when a trailing \ is given, but IIRC that is fixed.
Back to top
View user's profile Send private message
JoeCoder



Joined: 29 Oct 2005
Posts: 294

PostPosted: Wed Sep 07, 2011 10:00 pm    Post subject: Reply with quote

Thanks again for your quick response.

It's working a little better. Now I get parameter info hints after typing Thread.sleep(

However, after typing Thread. , I don't get any help. If I press ctrl+space (once or twice), I get a list of tokens in the current module, including "module" and "new". But sleep is not included in the list

Additionally, if I create a second file:
Code:
module a;
class A
{   void method(char[] b)
   {}
}


compile (to create the json), and then type
Code:
A a = new A();
a.


in my first file, I get no help. But if I type a.method( , then I get parameter info help. Any ideas? Goto Definition seems to be working in all cases.

I've always preferred Eclipse to Visual Studio, but VisualD is quickly becoming awesome and will likely become my development environment of choice even if these issues aren't resolved. So thank you for your work on this!
Back to top
View user's profile Send private message
JoeCoder



Joined: 29 Oct 2005
Posts: 294

PostPosted: Wed Sep 07, 2011 10:03 pm    Post subject: Reply with quote

Looking at the Language support in the editor page, it looks like dot-completion might not be implemented yet?

When I asked about "Browse Info" earlier, I had been going through the pages in order and thought that all of those features should work by the time I got to the "Editor" page. Maybe the "Browse Info" page should appear before the "Editor" page in the tour?
Back to top
View user's profile Send private message
JoeCoder



Joined: 29 Oct 2005
Posts: 294

PostPosted: Wed Sep 07, 2011 10:15 pm    Post subject: Reply with quote

It looks like the json browse information built for Yage (dsource.org/projects/yage) also has the same no-comma }{ problem described above.

Unless you know a solution, I'll add a post-build-step to fix my json files.
Back to top
View user's profile Send private message
sagitario



Joined: 03 Mar 2007
Posts: 292

PostPosted: Thu Sep 08, 2011 12:12 am    Post subject: Reply with quote

Using the post-build-step to fix the json files is a good idea. You should also report the issue to dmd's bug tracking http://d.puremagic.com/issues/

Visual D does not have semantic analysis, so it has no idea about the context for completion after a '.'. That's why it just lists identifiers from the same buffer that start with the text at the caret (which is already quite helpful, in rare cases even better than sophisticated stuff from the analysis). If you hit Ctrl+Space again, matching identifiers from the JSON files are added to the list.
Back to top
View user's profile Send private message
JoeCoder



Joined: 29 Oct 2005
Posts: 294

PostPosted: Thu Sep 08, 2011 10:45 pm    Post subject: Reply with quote

Quote:
You should also report the issue to dmd's bug tracking


Turns out I'm guilty of using dmd 1.056 that came with Tango 0.99.9. I upgraded to 1.066 (the last version still supported by 0.99.9) and the json is now well formed. So it was my fault.

Thanks for all your help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Visual D All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group