Thread overview
Emacs users: flycheck-dmd-dub
Mar 06, 2014
Atila Neves
Mar 06, 2014
Mathias Lang
Mar 06, 2014
Atila Neves
Mar 18, 2014
Atila Neves
Mar 20, 2014
Sönke Ludwig
Mar 20, 2014
Jonas Drewsen
Mar 20, 2014
Sönke Ludwig
Mar 20, 2014
Atila Neves
May 10, 2014
Atila Neves
Mar 10, 2014
w0rp
March 06, 2014
https://github.com/atilaneves/flycheck-dmd-dub

I managed to get a pull request accepted by flycheck to have a variable to specify include paths for dmd so that the dmd runs made by flycheck include all of the directories it needs to properly highlight errors.

I wrote the elisp in the repository above to read package.json and fill in that variable automatically. That way any project with dub dependencies has automatic error checking as you type!

It'll probably need some using in real life and bug discovery before it's solid, which is why I haven't tried adding it as a package to marmalade or melpa yet.

Atila
March 06, 2014
Great ! I'll try it out as soon as I get a little free time.
My first remark would be: does it support the new dub.json as well ? DUB is
moving to this file as the standard package file, to prevent clash with
another tool.


2014-03-06 9:13 GMT-08:00 Atila Neves <atila.neves@gmail.com>:

> https://github.com/atilaneves/flycheck-dmd-dub
>
> I managed to get a pull request accepted by flycheck to have a variable to specify include paths for dmd so that the dmd runs made by flycheck include all of the directories it needs to properly highlight errors.
>
> I wrote the elisp in the repository above to read package.json and fill in that variable automatically. That way any project with dub dependencies has automatic error checking as you type!
>
> It'll probably need some using in real life and bug discovery before it's solid, which is why I haven't tried adding it as a package to marmalade or melpa yet.
>
> Atila
>


March 06, 2014
I know about the change to dub.json, but since there are hardly
any projects that have migrated (including mine) and this works
so far, I decided to stick it up sooner rather than later and
change accordingly. Some version strings in dependencies will
probably make it choke.

Atila

On Thursday, 6 March 2014 at 17:35:09 UTC, Mathias Lang wrote:
> Great ! I'll try it out as soon as I get a little free time.
> My first remark would be: does it support the new dub.json as well ? DUB is
> moving to this file as the standard package file, to prevent clash with
> another tool.
>
>
> 2014-03-06 9:13 GMT-08:00 Atila Neves <atila.neves@gmail.com>:
>
>> https://github.com/atilaneves/flycheck-dmd-dub
>>
>> I managed to get a pull request accepted by flycheck to have a variable to
>> specify include paths for dmd so that the dmd runs made by flycheck include
>> all of the directories it needs to properly highlight errors.
>>
>> I wrote the elisp in the repository above to read package.json and fill in
>> that variable automatically. That way any project with dub dependencies has
>> automatic error checking as you type!
>>
>> It'll probably need some using in real life and bug discovery before it's
>> solid, which is why I haven't tried adding it as a package to marmalade or
>> melpa yet.
>>
>> Atila
March 10, 2014
Cool, I should get something similar for Vim. I keep finding myself in the situation where the linting (I think through DMD) with syntastic doesn't know where my source files are a lot of the time, so I get a lot of problems with it not knowing where to find imports.
March 18, 2014
V0.0.4 now supports both package.json and dub.json

Atila

On Thursday, 6 March 2014 at 17:35:09 UTC, Mathias Lang wrote:
> Great ! I'll try it out as soon as I get a little free time.
> My first remark would be: does it support the new dub.json as well ? DUB is
> moving to this file as the standard package file, to prevent clash with
> another tool.
>
>
> 2014-03-06 9:13 GMT-08:00 Atila Neves <atila.neves@gmail.com>:
>
>> https://github.com/atilaneves/flycheck-dmd-dub
>>
>> I managed to get a pull request accepted by flycheck to have a variable to
>> specify include paths for dmd so that the dmd runs made by flycheck include
>> all of the directories it needs to properly highlight errors.
>>
>> I wrote the elisp in the repository above to read package.json and fill in
>> that variable automatically. That way any project with dub dependencies has
>> automatic error checking as you type!
>>
>> It'll probably need some using in real life and bug discovery before it's
>> solid, which is why I haven't tried adding it as a package to marmalade or
>> melpa yet.
>>
>> Atila

March 20, 2014
Am 19.03.2014 00:16, schrieb Atila Neves:
> V0.0.4 now supports both package.json and dub.json
>
> Atila
>

There is one change that I would highly recommend - using the output of "dub describe" instead of directly reading dub.json:

 - It's planned to add an SDL based format, which otherwise then would
   also have to be supported

 - Properly determining the right dependency versions/paths,
   configurations and platform specific values is not easy, but vital
   to get the correct results

 - Parts of the format may get extended in the future, requiring
   constant maintenance of the elisp package

"dub describe" always outputs a JSON document* and has everything resolved down to bare compiler settings, so it's trivial to handle.

Regards,
Sönke


* There is currently a bug where sometimes a non-JSON preamble is output before the actual contents, so it's necessary to skip until the first '{' before interpreting the output. This will be resolved in the next version.


March 20, 2014
On Thursday, 20 March 2014 at 07:17:04 UTC, Sönke Ludwig wrote:
> Am 19.03.2014 00:16, schrieb Atila Neves:
>> V0.0.4 now supports both package.json and dub.json
>>
>> Atila
>>
>
> There is one change that I would highly recommend - using the output of "dub describe" instead of directly reading dub.json:
>
>  - It's planned to add an SDL based format, which otherwise then would
>    also have to be supported

I currently have a tool that read and writes the dub.json files. What would you suggest for this tool since "describe" would only solve the reading part and not the writing. Furthermore adding SDL format as well doubles the effort for this. Is dub usable as a library so that this wouldn't be a problem?

/Jonas
March 20, 2014
Ah, ok. I'll wait for the bug to be fixed.

In the meanwhile, the package is now on MELPA and can be installed as any other emacs package.

Atila

On Thursday, 20 March 2014 at 07:17:04 UTC, Sönke Ludwig wrote:
> Am 19.03.2014 00:16, schrieb Atila Neves:
>> V0.0.4 now supports both package.json and dub.json
>>
>> Atila
>>
>
> There is one change that I would highly recommend - using the output of "dub describe" instead of directly reading dub.json:
>
>  - It's planned to add an SDL based format, which otherwise then would
>    also have to be supported
>
>  - Properly determining the right dependency versions/paths,
>    configurations and platform specific values is not easy, but vital
>    to get the correct results
>
>  - Parts of the format may get extended in the future, requiring
>    constant maintenance of the elisp package
>
> "dub describe" always outputs a JSON document* and has everything resolved down to bare compiler settings, so it's trivial to handle.
>
> Regards,
> Sönke
>
>
> * There is currently a bug where sometimes a non-JSON preamble is output before the actual contents, so it's necessary to skip until the first '{' before interpreting the output. This will be resolved in the next version.

March 20, 2014
Am 20.03.2014 10:10, schrieb Jonas Drewsen:
> On Thursday, 20 March 2014 at 07:17:04 UTC, Sönke Ludwig wrote:
>> Am 19.03.2014 00:16, schrieb Atila Neves:
>>> V0.0.4 now supports both package.json and dub.json
>>>
>>> Atila
>>>
>>
>> There is one change that I would highly recommend - using the output
>> of "dub describe" instead of directly reading dub.json:
>>
>>  - It's planned to add an SDL based format, which otherwise then would
>>    also have to be supported
>
> I currently have a tool that read and writes the dub.json files. What
> would you suggest for this tool since "describe" would only solve the
> reading part and not the writing. Furthermore adding SDL format as well
> doubles the effort for this. Is dub usable as a library so that this
> wouldn't be a problem?
>
> /Jonas

Yes, it has been built to be usable as a library, although there are certain parts of the API that are not yet considered full quality. But package file reading and writing using the "Package" class works fine and is already used by some other projects, such as the package registry.

Having said that, there are of course cases where processing the JSON file directly isn't really problematic. It just may not be the best idea to rebuild the dependency and platform logic as long as the package format isn't fully stable.
May 10, 2014
Now using dub describe. Installable from melpa.

On Thursday, 20 March 2014 at 07:17:04 UTC, Sönke Ludwig wrote:
> Am 19.03.2014 00:16, schrieb Atila Neves:
>> V0.0.4 now supports both package.json and dub.json
>>
>> Atila
>>
>
> There is one change that I would highly recommend - using the output of "dub describe" instead of directly reading dub.json:
>
>  - It's planned to add an SDL based format, which otherwise then would
>    also have to be supported
>
>  - Properly determining the right dependency versions/paths,
>    configurations and platform specific values is not easy, but vital
>    to get the correct results
>
>  - Parts of the format may get extended in the future, requiring
>    constant maintenance of the elisp package
>
> "dub describe" always outputs a JSON document* and has everything resolved down to bare compiler settings, so it's trivial to handle.
>
> Regards,
> Sönke
>
>
> * There is currently a bug where sometimes a non-JSON preamble is output before the actual contents, so it's necessary to skip until the first '{' before interpreting the output. This will be resolved in the next version.