Inconsistent behavior between Visual-D and Mono-D

beannaich via Digitalmars-d-ide digitalmars-d-ide at
Mon Oct 5 07:54:34 PDT 2015

On Sunday, 4 October 2015 at 07:34:54 UTC, extrawurst wrote:
> Go for the dub package format as a common denominator: 
> dub as a tool can generate visual-d projects (sln etc.) and 
> mono-d can already natively load dub files (the json version of 
> the format at least)

Thanks for the heads-up! Up until now, I've used dub to create 
and build projects. I didn't know that it also acted as a sort of 
"CMake" for D. I also actively refuse to use the SDL dub files, 
so JSON is perfect for me. :P

On Sunday, 4 October 2015 at 17:41:02 UTC, Rainer Schuetze wrote:
> Mono-D seems to be using msbuild-project files, while Visual D 
> predates VS2010 which introduced these for C++. You might have 
> been familiar with these before that time if you were using C#, 
> but not me.

Microsoft is moving to a more unified project system soon (One 
more breaking release before stability is claimed):

Perhaps it would be easier to make a D project system once this 
is stable?

Also, most people who use visual studio are using it for .NET 
languages and web development. Having project files that look 
similar to the project files for those project types definitely 
wouldn't hurt your extension. It also would help for those rare 
times when you have to do some manual project file surgery.

> The project files for Visual D have extension .visualdproj, so 
> they are different.

I could have sworn I was using Mono-D and the person I work with 
was using Visual-D and couldn't open the solution files I created 
in monodevelop. Could be that the solution file was referencing 
the *.dproj and Visual-D couldn't open that. I'm sorry for 
jumping the gun on this one.

However, if that's the case, then *.dproj support should be added 
for Visual-D, and *.visualdproj support should be added to Mono-D 
(Or one format should be agreed upon). The fact that there isn't 
a common project format really locks you in to one editor or 
another, and that's never good for open source projects.

I could maintain 2 project files, but adding/removing files then 
becomes really annoying, and raises the chances that one is out 
of date and/or broken.

> Getting any semantic analysis correct for D is not a small 
> task. Mono-D and Visual-D share the same semantic analyzer, 
> though, so VD could get the same highlighting, but that never 
> got high priority. I notice identifier highlighting when coding 
> C++, but it always seems pretty random to me...

C++ semantic parsing/highlighting has gotten much better with 
each new version of Visual Studio, and highlighting overall is 
definitely part of the VS experience. I would think it would be 
pretty easy to add support for, since there's already a way to 
match tokens with type names and colorize them. It seems all 
you'd have to do is point Visual-D at a different location for 
the "type name bucket".

If I knew more about how Visual-D parses the source files then 
I'd clone the code and try to add this myself. I might just do 
this anyway, since the only real way to learn a code base is to 
play around with it.

> There will be two new-item commands available "Add Filter" 
> (that's for the current functionality which is also what 
> happens with C++ projects) and "Add Package" (that's what you 
> and C# people expect) in the next release, but it was not as 
> easy as you might expect because there is no official 
> information how to change entries in that specific sub-menu.

Having made VS extensions in the past, I totally understand the 
lack of documentation.

I really think the menu should be called "Add Folder" because 
under the hood, that should be all it's doing. How do filters and 
folders exist side-by-side in the solution explorer? Do filters 
have a different icon? I could see that being very confusing, 
especially if you're loading up someone else's project.

I know the way C++ projects handle this discrepancy, and that 
isn't very pretty either.

PS: I don't want to come off like I'm ragging on Visual-D, it's a 
great (and very necessary) extension. Just the fact that it and 
Mono-D don't play well together is very unfortunate, but it's 
something that can be fixed.

More information about the Digitalmars-d-ide mailing list