neild3r / vscode-php-docblocker

Simple docblocker for php
MIT License
94 stars 31 forks source link

Double start delimiters (since Vscode 1.38?) #127

Closed m-thorsen closed 3 years ago

m-thorsen commented 5 years ago

When typing /**<tab> I've been getting this lately (with only this extension enabled):

image

Note that a second set of delimiters is inserted, giving me /**/** and effectively closing the Docblock

m-thorsen commented 5 years ago

The following adjustment seems to fix this problem....

src/doc.js from line 127:

// templateString = "/**\n" + templateString + "\n */";  <-- remove this line 
let stop = 0;
templateString = templateString.replace(/###/gm, function () {
    stop++;
    return stop + "";
});
templateString = templateString.replace(/^$/gm, " *");
templateString = templateString.replace(/^(?!(\s\*|\/\*))/gm, " * $1");
templateString = "\n" + templateString + "\n */"; // <-- insert modified line here
neild3r commented 5 years ago

Hi @m-thorsen thanks for reporting. I'm not seeing the same issue as you. Can you paste in your config or is this from the default set up? (I may disappear for a while as my wife could go in to labour any time now)

m-thorsen commented 5 years ago

It was indeed related to a setting - the culprit seems to be "editor.autoClosingBrackets": "never",.

Something must have changed in VSCode regarding this as I didn't have this issue before the latest version.
Setting this to "languageDefined" seems to work for now.

Worth it adding a notice in the readme that this setting can cause issues?

nleco commented 5 years ago

I was also experiencing this issue, and when I changed:

"editor.autoClosingBrackets": "languageDefined"

it also worked.

neild3r commented 4 years ago

Interesting, apologies for not looking at this sooner. I've not long just become a father so thing have been a bit busy at home but I hope to soon get back to clearing up some of these niggles. Thanks for working out what the issue is, hopefully we can support both settings with a bit of work going forward

alystair commented 4 years ago

Congratulations @neild3r! Guess I'll use the work around for now but rather not have auto closing anything as it gets in the way.

Would m-thorsen's initial adjustment be appropriate for integration given what we know now? https://github.com/neild3r/vscode-php-docblocker/issues/127#issuecomment-533543014

neild3r commented 3 years ago

Fixed as of v2.6.1