Jump to page: 1 24  
Page
Thread overview
SublimeLinter-contrib-dmd: dmd feedback as you type
Oct 30, 2017
Bastiaan Veelo
Oct 31, 2017
notna
Oct 31, 2017
Bastiaan Veelo
Oct 31, 2017
SrMordred
Oct 31, 2017
Bastiaan Veelo
Oct 31, 2017
Moritz Maxeiner
Oct 31, 2017
Moritz Maxeiner
SublimeLinter-contrib-dmd: dmd feedback as you type. v1.1.0: DUB integration.
Nov 09, 2017
Bastiaan Veelo
Oct 31, 2017
notna
Oct 31, 2017
Dmitry Olshansky
Oct 31, 2017
Bastiaan Veelo
Nov 01, 2017
Basile B.
Nov 01, 2017
Bastiaan Veelo
Nov 01, 2017
Temtaime
Nov 01, 2017
Bastiaan Veelo
Nov 02, 2017
Bastiaan Veelo
Nov 02, 2017
Temtaime
Nov 02, 2017
Bastiaan Veelo
Nov 02, 2017
Bastiaan Veelo
Nov 02, 2017
Temtaime
Nov 02, 2017
Bastiaan Veelo
Nov 02, 2017
Suliman
Nov 02, 2017
Suliman
Nov 02, 2017
Suliman
Nov 02, 2017
Suliman
Nov 02, 2017
Suliman
Nov 02, 2017
Bastiaan Veelo
Nov 21, 2017
drug
Nov 21, 2017
Bastiaan Veelo
Nov 26, 2017
Manuel Maier
Nov 27, 2017
Bastiaan Veelo
Nov 28, 2017
Manuel Maier
Nov 29, 2017
Bastiaan Veelo
October 30, 2017
SublimeLinter-contrib-dmd [1] is a plug-in for the Sublime Text 3 editor [2]. Unlike linters that are based on DScanner, it actually invokes dmd on the file that is being edited, as you edit. If dmd finds anything to complain about, an annotation is shown in the editor: warnings and deprecations in orange, errors in red. If SublimeLinter (a plug-in dependency) is configured to show tool tips, the error message pops up after a click on the annotation (see screen shots [1]). SublimeLinter offers shortcuts for jumping to errors and it is possible to postpone on-the-fly linting or lint only on request.

The advantages of using dmd for linting are:

1. The parser is always up-to-date.
2. Full symbol resolution, including imports.
3. Mixins are expanded.
4. Templates are validated.
5. Deprecation warnings are included.
6. The "did you mean …" assistance appears right where it is most helpful.

The plug-in is easily installed from within the editor, as described on the project page [1].

Dmd does not always get the column number exactly right, which can cause the annotation to be misplaced, but that is just a cosmetic deficiency. I have not tested this on larger code bases and only on Windows, but I expect it to work on all platforms supported by Sublime Text 3. Please let me know if you find any issues. The editor is not free, but it continues to work after your evaluation period has expired.

On request I can add an option to configure the path to dmd, currently it expects to find dmd using the system path.


Hope you like it,
Bastiaan.

[1] https://github.com/veelo/SublimeLinter-contrib-dmd
[2] http://www.sublimetext.com/
October 31, 2017
On Monday, 30 October 2017 at 22:22:42 UTC, Bastiaan Veelo wrote:
> SublimeLinter-contrib-dmd [1] is a plug-in for the Sublime Text 3 editor [2]. Unlike linters that are based on DScanner, it actually invokes dmd on the file that is being edited, as you edit. If dmd finds anything to complain about, an annotation is shown in the editor: warnings and deprecations in orange, errors in red. If SublimeLinter (a plug-in dependency) is configured to show tool tips, the error message pops up after a click on the annotation (see screen shots [1]). SublimeLinter offers shortcuts for jumping to errors and it is possible to postpone on-the-fly linting or lint only on request.
>
> [...]


My console says:

File "linter in C:\Users\anton\AppData\Roaming\Sublime Text 3\Installed Packages\SublimeLinter-contrib-dmd.sublime-package", line 13, in <module>
ImportError: No module named 'SublimeLinter'
October 31, 2017
On Tuesday, 31 October 2017 at 11:02:23 UTC, notna wrote:
> ImportError: No module named 'SublimeLinter'

Looks like you did not install the SublimeLinter package. You need both.


October 31, 2017
Thank you , works perfectly!

One idea: Integrating with dub.
So you don´t have to manually set lib dirs and flags since its all on 'dub.json' already.


October 31, 2017
On Monday, 30 October 2017 at 22:22:42 UTC, Bastiaan Veelo wrote:
> SublimeLinter-contrib-dmd [1] is a plug-in for the Sublime Text 3 editor [2].
[snip]
>
> The advantages of using dmd for linting are:
>
> 1. The parser is always up-to-date.
> 2. Full symbol resolution, including imports.
> 3. Mixins are expanded.
> 4. Templates are validated.
> 5. Deprecation warnings are included.
> 6. The "did you mean …" assistance appears right where it is most helpful.

Sounds cool, I assume you use -o- option to disable DMD codegen?

Should be fairly fast.


>
> [1] https://github.com/veelo/SublimeLinter-contrib-dmd
> [2] http://www.sublimetext.com/


October 31, 2017
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

October 31, 2017
On Tuesday, 31 October 2017 at 13:32:34 UTC, SrMordred wrote:
> Thank you , works perfectly!
>
> One idea: Integrating with dub.
> So you don´t have to manually set lib dirs and flags since its all on 'dub.json' already.

That would be nice. I don't have a project yet that uses dub though, so I am not well prepared to do that. Currently, settings are read courtesy the parent plug-in SublimeLinter. It is written in Python and quite extensible and well documented [1] -- do you want to have a go at it? (This was my first exposure to Python by the way.)

Out of curiosity, what other plugins from [2] do you use in Sublime Text? How are they integrating with dub?

[1] http://www.sublimelinter.com/en/latest/
[2] https://wiki.dlang.org/Editors
October 31, 2017
On Tuesday, 31 October 2017 at 13:32:34 UTC, SrMordred wrote:
> Thank you , works perfectly!
>
> One idea: Integrating with dub.
> So you don´t have to manually set lib dirs and flags since its all on 'dub.json' already.

You can pretty much copy paste from sublide for this [1] (my own D plugin for ST3).

[1] https://github.com/MoritzMaxeiner/sublide/blob/master/dub.py#L40
October 31, 2017
On Tuesday, 31 October 2017 at 16:00:25 UTC, Bastiaan Veelo wrote:
> [...]
>
> Out of curiosity, what other plugins from [2] do you use in Sublime Text? How are they integrating with dub?

If that question is open to the general public: None, I hacked my own [1] to suit my exact needs.

[1] https://github.com/MoritzMaxeiner/sublide
October 31, 2017
On Tuesday, 31 October 2017 at 11:30:00 UTC, Bastiaan Veelo wrote:
> On Tuesday, 31 October 2017 at 11:02:23 UTC, notna wrote:
>> ImportError: No module named 'SublimeLinter'
>
> Looks like you did not install the SublimeLinter package. You need both.

Thanks, seems to work now ;)
« First   ‹ Prev
1 2 3 4