VisualD's Intellisense not workign with gtk

Rainer Schuetze via Digitalmars-d-ide digitalmars-d-ide at puremagic.com
Sun Aug 6 04:43:17 PDT 2017



On 05.08.2017 14:20, Johnson Jones wrote:
> On Friday, 4 August 2017 at 07:27:54 UTC, Rainer Schuetze wrote:
>>
>>
>> On 04.08.2017 04:31, Johnson Jones wrote:
>>> On Friday, 4 August 2017 at 01:33:53 UTC, Johnson Jones wrote:
>>>> On Thursday, 13 July 2017 at 06:30:07 UTC, Rainer Schuetze wrote:
>>>>>
>>>>>
>>>>> On 13.07.2017 01:55, FoxyBrown wrote:
>>>>>> [...]
>>>>>
>>>>> It works for me, but takes a couple of seconds to digest all the 
>>>>> gtk files. There is no completion before that finishes. I've tried 
>>>>> it with a file looking like this:
>>>>>
>>>>> module gtkAll;
>>>>>
>>>>> public import gtk.AboutDialog;
>>>>> public import gtk.AccelGroup;
>>>>> ...
>>>>>
>>>>>
>>>>>>     [...]
>>>>> ...
>>>>>> [...]
>>>>>
>>>>> The project built JSON file only covers the files actually in the 
>>>>> project. You can create a full JSON file with the help of rdmd, e.g.
>>>>>
>>>>> rdmd -X gtkd\gtkAll.d
>>>>>
>>>>> That will likely fail due to object file generation or link errors, 
>>>>> but should still build the JSON file.
>>>>
>>>> What do I do with the json file when it is created? Where does it 
>>>> go? I'd like to get intellisense to work with gtkD. I tried adding 
>>>> the gtkD but it locked up VS. The files are 10MB+. There are two files.
>>>>
>>>> gtkD_all.exe.json
>>>> gtkD_all.json
>>>>
>>>> How do I tell visual D to look in those files to use for intellisense?
>>>>
>>>> Visual D has a "Build Phobos Browse Info". Is that essentially what 
>>>> it does but on the phobos src directory?
>>>
>>> I put the files in a dir and told that under the JSON edit box in 
>>> properties in visual D/studio and eventually it seems that 
>>> intelligent started working. (it didn't work at first but after a few 
>>> hours I noticed that I was getting intellisense, not sure if that is 
>>> what did it or something else I might have fiddled with).
>>>
>>> How does Visual D use those files? Does the file name have anything 
>>> to do with it or does it just load any files inside the dir and then 
>>> search the json for a match?
>>
>> Yes, more or less the latter. You can also browse the loaded JSON 
>> files in the "Object Browser" window.
> 
> It seems to be working. I haven't done any thorough testing but what I 
> have noticed is that it seems to list any functions that match rather 
> than reduce the number.
> 
> e.g.,
> 
> I have a gtkApplicationWindow called mainWindow.
> 
> I do
> 
> mainWindow.getSize(...)
> 
> It lists all the getSizes that exist. There are 11... but only one for 
> mainWindow. e.g., it shows one for glib, one for atk, etc.
> 
> Not sure if the json is incomplete or visual D does not try to match the 
> function to the object type it is used on?
> 
> Not a huge deal but through me off for a second until I realized what 
> was going on. Not ideal but better than nothing. Maybe a simple fix?

As noted before, the JSON support predates semantic analysis. It doesn't 
have any scope/symbol lookup information so it just lists matching 
identifiers. That's sometimes useful (e.g. if an import is still 
missing), but the semantic analysis result is often more accurate (but 
much harder to implement).

It might be nice to integrate these two approaches, so that Visual D 
could insert an import automatically when selecting a completion without 
appropriate import. That's unlikely to happen very soon, though.


More information about the Digitalmars-d-ide mailing list