SublimeLinter-contrib-dmd: dmd feedback as you type

Manuel Maier mjmaier at gmx.de
Tue Nov 28 18:07:35 UTC 2017


On Monday, 27 November 2017 at 11:26:51 UTC, Bastiaan Veelo wrote:
> On Sunday, 26 November 2017 at 10:15:05 UTC, Manuel Maier wrote:
>> On Monday, 30 October 2017 at 22:22:42 UTC, Bastiaan Veelo 
>> wrote:
>>> [...] Unlike linters that are based on DScanner, it actually 
>>> invokes dmd on the file that is being edited, as you edit. 
>>> [...]
>>
>> I just tried the plugin and it seems to work very well! Thanks 
>> for the good work.
>
> Thanks.
>
>> Have you considered invoking dub instead of dmd if there's a 
>> dub.json/.sdl file? I imagine when people use 
>> "preBuildCommands" to generate code, for example, the linter 
>> might report false positives. Same goes for custom D versions 
>> (e.g. `version(Have_foo) { ... }`).
>
> No I haven't considered using dub. Does dub allow the 
> processing of a single file from the project without generating 
> code? Note that you don't want to build the whole project upon 
> every activation of the linter, because of speed but also 
> because of errors that do not apply to the file in the current 
> view.

Not sure about that, would need some investigating. From what I 
can tell, dub docs have improved quite a bit in the past year.

>> There's also the --single feature of dub: 
>> https://code.dlang.org/advanced_usage Such files may not work 
>> correctly with this linter at this time I presume.
>
> I don't see why not?

Sorry, let me rephrase. What I meant is that, with dub, you can 
add dependencies (e.g. some http library) and define D versions. 
So even tho it's only a single file, the invocation of dmd alone 
is not sufficient to understand the code completely. I guess it 
would be most useful if I created some test cases and documented 
them.

>> All in all they way this plugin works is a great idea! The 
>> more it knows about the full commandline of the resulting dmd 
>> invocation, the more accurate it is.
>
> If you have a case where it isn't sufficient, I am interested 
> to see how it can be improved. You can experiment with it as 
> explained here: 
> https://forum.dlang.org/post/zugbovfvfviapcjqdhxw@forum.dlang.org

Haven't experimented with it yet so it's all just speculation so 
far. I'm quite interested in a dub linter. As far as I can tell 
from a first glance at your plugin code, it doesn't seem too 
complicated. I think I will investigate whether dub is suitable 
for this endeavor and implement that aspect of the plugin myself. 
If I have enough time in the coming days, of course. Will keep 
you posted!


More information about the Digitalmars-d-announce mailing list