November 01, 2017
On Tuesday, 31 October 2017 at 15:43:08 UTC, Bastiaan Veelo wrote:
> On Tuesday, 31 October 2017 at 13:47:26 UTC, Dmitry Olshansky wrote:
>
>> Sounds cool, I assume you use -o- option to disable DMD codegen?
>
> yes
>
>> Should be fairly fast.
>
> indeed

Surprising. Back in 2014 i used something similar to display the AST in my IDE (also -o- but to get the JSON output) and found it slow (especially in projects since the dmd command line had to include all the imports and sources to avoid false positives). Tt's been replaced by something based on libdparse, which also allows to  show syntax errors fast.
November 01, 2017
On Wednesday, 1 November 2017 at 12:54:38 UTC, Basile B. wrote:
> On Tuesday, 31 October 2017 at 15:43:08 UTC, Bastiaan Veelo wrote:
>> On Tuesday, 31 October 2017 at 13:47:26 UTC, Dmitry Olshansky wrote:
>>
>>> Sounds cool, I assume you use -o- option to disable DMD codegen?
>>
>> yes
>>
>>> Should be fairly fast.
>>
>> indeed
>
> Surprising. Back in 2014 i used something similar to display the AST in my IDE (also -o- but to get the JSON output) and found it slow (especially in projects since the dmd command line had to include all the imports and sources to avoid false positives). Tt's been replaced by something based on libdparse, which also allows to  show syntax errors fast.

To be frank, I have only tested this on the minimal examples from dlang.org. "Fast" and "slow" are subjective measures, the question is: when is it too slow? I am interested to hear how this does for people with large code bases, but because dmd works in the background and you don't have to wait for it to get your code typed out, I suppose speed is not very important as long as it stays within a few seconds. Remember it is used for linting only, if it were used for code completion or go-to-definition it could be too slow.
November 01, 2017
Works too strange.
Seems it checks only syntax and doesn't display non-syntax related errors.
November 01, 2017
On Wednesday, 1 November 2017 at 20:09:02 UTC, Temtaime wrote:
> Works too strange.
> Seems it checks only syntax and doesn't display non-syntax related errors.

It may be that the regex needs to be adjusted. Could you please post a reduced example at https://github.com/veelo/SublimeLinter-contrib-dmd/issues?

Thanks.
November 02, 2017
On Wednesday, 1 November 2017 at 20:09:02 UTC, Temtaime wrote:
> Works too strange.
> Seems it checks only syntax and doesn't display non-syntax related errors.

Also, what is your compiler version, OS, and do you have other plugins active?
November 02, 2017
On Thursday, 2 November 2017 at 06:43:36 UTC, Bastiaan Veelo wrote:
> On Wednesday, 1 November 2017 at 20:09:02 UTC, Temtaime wrote:
>> Works too strange.
>> Seems it checks only syntax and doesn't display non-syntax related errors.
>
> Also, what is your compiler version, OS, and do you have other plugins active?

No way to post a reduced example.
I tried it with one-file test example and it displays all the errors correctly, but in my projects with 30 KLOCS it displays only syntax erorrs.

DMD from git master branch, windows, no other plugins.
November 02, 2017
On Thursday, 2 November 2017 at 08:35:08 UTC, Temtaime wrote:
> On Thursday, 2 November 2017 at 06:43:36 UTC, Bastiaan Veelo wrote:
>> On Wednesday, 1 November 2017 at 20:09:02 UTC, Temtaime wrote:
>>> Works too strange.
>>> Seems it checks only syntax and doesn't display non-syntax related errors.
>>
>> Also, what is your compiler version, OS, and do you have other plugins active?
>
> No way to post a reduced example.
> I tried it with one-file test example and it displays all the errors correctly, but in my projects with 30 KLOCS it displays only syntax erorrs.
>
> DMD from git master branch, windows, no other plugins.

Maybe the error is actually detected but shown in a different location? Use Tools->SublimeLinter->Show All Errors to see if it is there.

You can turn on debugging from the menu Tools->SublimeLinter->Debug Mode, and open the console (Ctrl+` or icon in lower left corner) to see the dmd output. Do you see the error messages you expect?
The linter calls dmd on just the file that is in your view (in a temp directory). That is probably not how you compile your 30KLOCS project, maybe errors depend on that? Does dmd give the error message you expect when you call dmd on that particular file by hand? The linter uses these command line switches: -o- -w -wi -vcolumns.

If there is a difference in what dmd produces and what is picked up by the linter, we should adjust the python regex [1]. Note that it should discard tracebacks like "called from here". I used [5] to help with that. If you want to hack on it yourself, you can remove the package SublimeLinter-contrib-dmd and clone [2] into C:\Users\<user>\AppData\Roaming\Sublime Text 3\Packages. Maybe dmd sends some of its output to stdout. Change [3] from util.STREAM_STDERR to util.STREAM_BOTH to make it read from both streams.

Does it help setting the linter working directory [4]? Note that currently the regex relies on the substring "SublimeLinter3" being present in the path to the temp file, I am unsure whether that would still work then.

[1] https://github.com/veelo/SublimeLinter-contrib-dmd/blob/e2b4270c2318381eb113620631e93de2b18d436e/linter.py#L24-L33
[2] https://github.com/veelo/SublimeLinter-contrib-dmd
[3] https://github.com/veelo/SublimeLinter-contrib-dmd/blob/e2b4270c2318381eb113620631e93de2b18d436e/linter.py#L37
[4] http://www.sublimelinter.com/en/latest/linter_settings.html?highlight=working#chdir
[5] https://regex101.com/, select python flavor.
November 02, 2017
On Thursday, 2 November 2017 at 09:26:48 UTC, Bastiaan Veelo wrote:
> Does dmd give the error message you expect when you call dmd on that particular file by hand? The linter uses these command line switches: -o- -w -wi -vcolumns.

How long does that take? Could be timeout...
November 02, 2017
On Thursday, 2 November 2017 at 09:43:11 UTC, Bastiaan Veelo wrote:
> On Thursday, 2 November 2017 at 09:26:48 UTC, Bastiaan Veelo wrote:
>> Does dmd give the error message you expect when you call dmd on that particular file by hand? The linter uses these command line switches: -o- -w -wi -vcolumns.
>
> How long does that take? Could be timeout...

Takes about 3s to compile single file.

Sorry, figured out an error : missed some include path for dub package.
Support for dub will be great :)

Now all works
Thanks !
November 02, 2017
On Thursday, 2 November 2017 at 10:00:25 UTC, Temtaime wrote:
> Support for dub will be great :)
Yes...

> Now all works
> Thanks !

Alright :-)