klesun / deep-assoc-completion

A phpstorm plugin for associative array key typing and completion
Other
267 stars 17 forks source link

Unable to use <pre> #179

Closed mylemans closed 3 years ago

mylemans commented 3 years ago

This works:

@param array $optionsss = ['a' => '']

This doesn't:

@param array $options <pre>= ['a' => '']</pre>

With pre it looks much cleaner when describing a complex array but when I use it the plugin does not process it.

In addition, the reason I was looking at 'pre' was because there seems to be a length limit on 'per field comment' shown (in my tests this was 103 characters)

image

image

Either improvements/fixes would be sufficient for my needs.

mylemans commented 3 years ago

Well apparently you created an issue for the length thing exactly when I made this issue.. I'd say for my comment remarks, continue at #178

What are the odds.. ;D

klesun commented 3 years ago

Hi. I'm not sure this <pre> thingie can be easily supported. Currently plugin expects such dead simple format:

@param array $varName = validPhpExpression()

To make the format support html tags, I would have to mess with escaping entities and other inconvenient stuff, and I'm so lazy...

With pre it looks much cleaner

Do you have some plugin that makes html content in phpdoc render nicely or are you using some tool that generates documentation pages from the comments? I don't see any difference when adding <pre> in my 2020.3.3 phpstorm... image

mylemans commented 3 years ago

Example:

image

My plugins:

image

Does this make it more clear?

klesun commented 3 years ago

Yeah, thanks, did not realize at once that you were adding this <pre> for ctrl+q popup.

How about such compromise? =-D image

klesun commented 3 years ago

Or even: image

mylemans commented 3 years ago

I'd call that a hacky workaround (2nd option is much cleaner though), but usable for now, but I'd rather see a correct solution.

That said, with this workaround, you could say that turning this into a low prio todo is defendable.

klesun commented 3 years ago

I'm actually considering closing the issue, as the second option seems more "correct" to me than @param $var <pre>= [...]</pre>. Either way it's a preference thing, but to support your initially proposed format, I'd have to complicate the codebase and spend a considerable amount of time I'm most likely not going to have following few years, while // <pre> already works and it does not have extra leading space in the preview.

mylemans commented 3 years ago

I rather have a clean solution in the future, but I'd say, close it for now. While I have your attention, can you do multiline comments? Apparently you can do them for psalm style doc, but I cannot get it to work in the way I shown in my example (ie // on the next line without anything in there)

If you think this could be a bug or missing feature, tell me and I could create another issue.

klesun commented 3 years ago

By multiline comments, do you mean this? image (// on the right continued on next line)

Filed the issue: https://github.com/klesun/deep-assoc-completion/issues/180

P.S. Since I have your blessing, I'm closing this issue with clear conscience ^_^