susanBuck / e15-spring22

0 stars 0 forks source link

PHP code is not being formatted in VSC #16

Closed archerdave closed 2 years ago

archerdave commented 2 years ago

This is a minor issue, but an annoyance. Visual Studio Code (VSC) is not actually formatting my PHP code.

Any thoughts?

susanBuck commented 2 years ago

@archerdave Looks like you've got everything set up correctly. Do you mind if I log into your server to take a look?

archerdave commented 2 years ago

@susanBuck Go right ahead.

susanBuck commented 2 years ago

Cool, taking a look now, will report back shortly.

susanBuck commented 2 years ago

When I first logged in, I saw the issue you were describing - it wouldn't format.

I spent a couple minutes double checking the settings, trying some files, and then it just started working without me actually changing anything.

I did notice that when it wasn't working that there was a message in the status bar about intelephense indexing the project. It's possible the formatter couldn't work until that was complete.

Can you try it again on your end to see if it's resolved or if you're still seeing the same issue?

archerdave commented 2 years ago

Issue is still present. Working from your comment, I have further noticed the following: Screen Shot 2022-02-15 at 9 51 22 PM

Screen Shot 2022-02-15 at 9 51 42 PM

susanBuck commented 2 years ago

Ah, ok - interesting.

In my local settings config file, I have the default formatter for PHP set to junstyle.php-cs-fixer:

 "[php]": {
        "editor.defaultFormatter": "junstyle.php-cs-fixer"
    },

That would explain why it worked for me but not you.

Go ahead and choose php cs fixer as your default formatter and report back on whether that resolves the issue.

If it does, I'm trying to figure out why this issue hasn't been faced/reported by students in past semesters. 🤔

archerdave commented 2 years ago

Yep, that did resolve the issue.

My first thoughts wonder if it is related to