atom/language-php

Disable PHPDoc Highlighting

Opened this issue · 7 comments

Summary

This package appears to interpret /** as a PHPDoc comment, and highlights the rest of the block accordingly. The problem is that /** may be used for other purposes.

Motivation

The package nav-panel-plus, as well as my own packages use this mark to indicate the start of a block, and not a PHPDoc comment.

The JavaScript language does not have any issues with this mark, and I would prefer to us it my own way.

Given that language-php doesn’t actually produce the documentation, as far as I know, I don’t see it as a great necessity to highlight it.

Describe alternatives you've considered

Seriously, if it’s already customizable, I can’t find it.

Additional context

Disabling PHPDoc sounds a wrong way of approaching this issue. You'll need to explain a bit about what you are expecting PHP grammar to do compared to for example JavaScript. The equivalent of PHPDoc in JavaScript - JSDoc exists and behaves much in the same way and you seem to have no problem with it.

The equivalent of PHPDoc in JavaScript - JSDoc exists and behaves much in the same way and you seem to have no problem with it.

In my copy of Atom, at least, /** does not appear to invoke the additional highlighting that that it does in PHP. I guess I should have called it Disabling PHPDoc Highlighting … ?

The package nav-panel-plus, as well as my own packages use this mark to indicate the start of a block, and not a PHPDoc comment.

I wasn't able to find this in default settings of package, but even then you could just set other block start e.g. /*! or something.

The JavaScript language does not have any issues with this mark, and I would prefer to us it my own way.

JSDoc is also a thing, but it does not color lines not starting with * inside block. Comparsion:

image image

Given that language-php doesn’t actually produce the documentation, as far as I know, I don’t see it as a great necessity to highlight it.

However, contrary to JSDoc, PHPDoc is integral part of PHP, it is even tokenized by parser (T_DOC_COMMENT), also is part of PSR standard.

I guess I should have called it Disabling PHPDoc Highlighting … ?

language-php doesn't have any real scripts in it, which would be necessary to add such option. Moreover other editors depends on this package like VScode.

I think the only compromise we can make here is to remove the "invalid line" safety net (if this is what bothers the author) as you are not required to have valid PHPDoc in a comment that begins with T_DOC_COMMENT per language spec.

rsese commented

Sorry if I'm misunderstanding but just to clarify @Ingramz, is your proposal that error highlighting like in line 3 in the example below would no longer be shown as an error?

image

@rsese precisely.

I have included a screen shot of what I am talking about:

Screen Shot 2019-10-02 at 9 00 38 am

I was just looking for a way to remove that coloured highlighting.