visuald icon indicating copy to clipboard operation
visuald copied to clipboard

Error list shows lots of errors that the compiler doesn't seem to experience?

Open TurkeyMan opened this issue 5 months ago • 3 comments

Thanks for the latest release! I just installed and trying it out. I noticed improvements on the points in the release.

I've been working a little to get to the bottom of the general unreliability of the intellisense/completion info, and I noticed something just now: Image

This seems to be the list of errors seen only by the linter; none of them are real errors, actual compilation is fine: Image

What reasons could there be that the linter see's a bunch of errors that the compiler doesn't experience? Is the environment for dscanner substantially different than for the compiler?

TurkeyMan avatar Jul 17 '25 08:07 TurkeyMan

Hard to tell without seeing the code and the full error messages.

One thing that happens to me when working on the compiler or the semantic analysis itself: if the frontend code and the runtime library used in the project are out of sync, there are errors because lowerings are missing or new features are introduced that the engine does not understand yet (or not anymore). I suspect you are using a very recent build of dmd with __rvalue and placement new, but dmdserver is built from the frontend of dmd-2.111 which doesn't know about this stuff yet or only partially.

I was considering installing a couple of different versions of dmdserver.exe that match different dmd releases, and then selecting the one the user is actually using. That's a bit troublesome to maintain, though.

rainers avatar Jul 18 '25 07:07 rainers

Yeah that's probably the issue, and definitely a hassle to maintain... How far is the DMD lib from the regular DMD binary? I wonder if a regular DMD compiler could double as the analysis lib? I wonder if you could include an additional DLL entrypoint in a normal .exe file, and then just load the same .exe that the compilation is using as a DLL, and dmdserver might bind to that? I never heard of a .exe also being loadable as a lib, but I can't actually imagine why it wouldn't be possible... the regular windows DLL loader might not like it, but maybe could load the PE file and find the dll entrypoint manually? :/

TurkeyMan avatar Jul 18 '25 07:07 TurkeyMan

These are currently the changes to the frontend: https://github.com/dlang/dmd/compare/master...rainers:dmd:dmdserver It does not include the visitors that implement the intellisense functionality. I don't think it is currently feasible to integrate that through a DLL interface.

BTW: I noticed a stupid mistake matching identically named modules in different packages that results in errors "module found twice on the command line" and follow up errors. If that is bothering you I can make a new release with the fix.

rainers avatar Jul 18 '25 08:07 rainers