dmd support for IDEs

Jeremie Pelletier jeremiep at gmail.com
Sun Oct 11 09:23:55 PDT 2009


Robert Clipsham wrote:
> Walter Bright wrote:
>> In my discussions with companies about adopting D, the major barrier 
>> that comes up over and over isn't Tango vs Phobos, dmd being GPL, 
>> debugger support, libraries, bugs, etc., although those are important.
>>
>> It's the IDE.
>>
>> They say that the productivity gains of D's improvements are 
>> overbalanced by the loss of productivity by moving away from an IDE. 
>> And what is it about an IDE that is so productive? Intellisense 
>> (Microsoft's word for autocompletion).
>>
>> So, while I'm not going to be writing an IDE, I figure that dmd can 
>> help. dmd already puts out .doc and .di files. How about putting out 
>> an xml file giving all the information needed for an IDE to implement 
>> autocompletion? There'd be one .xml file generated per .d source file.
>>
>> The nice thing about an xml file is while D is relatively easy to 
>> parse, xml is trivial. Furthermore, an xml format would be fairly 
>> robust in the face of changes to D syntax.
>>
>> What do you think?
> 
> How well will this work with partially parsable files? Will it recover 
> and continue parsing the rest of the file, so all the gained data is 
> still there in the rest of the file, or will it give an error and make 
> the rest of the file lack autocompletion? Or is the idea to merge the 
> newly parsed output with an old version so everything still has 
> autocompletion but the line in question has an error?
> 
> Will it be possible to pass individual statements (maybe along with a 
> previous symbol table) to dmd to save reparsing the whole file?
> 
> Other than that is sounds like a great idea, I can't wait for someone to 
> write an omnicompletion plugin for vim using this!

That would be hard, if its a missing } then the entire parse tree will 
be in the wrong scope. The best the compiler can do is report an error 
at line x offset y and let the IDE highlight it, while it keeps on 
working with the info from the last successful analysis.



More information about the Digitalmars-d mailing list