Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Disable PHPDoc Highlighting #371

Open
manngo opened this issue Sep 12, 2019 · 7 comments
Open

Disable PHPDoc Highlighting #371

manngo opened this issue Sep 12, 2019 · 7 comments

Comments

@manngo
Copy link

manngo commented Sep 12, 2019

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

@Ingramz
Copy link
Contributor

Ingramz commented Sep 12, 2019

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.

@manngo
Copy link
Author

manngo commented Sep 12, 2019

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 … ?

@manngo manngo changed the title Disable PHPDoc Disable PHPDoc Highlighting Sep 12, 2019
@KapitanOczywisty
Copy link
Contributor

KapitanOczywisty commented Sep 12, 2019

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.

@Ingramz
Copy link
Contributor

Ingramz commented Sep 12, 2019

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
Copy link

rsese commented Oct 1, 2019

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

@Ingramz
Copy link
Contributor

Ingramz commented Oct 1, 2019

@rsese precisely.

@manngo
Copy link
Author

manngo commented Oct 2, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants