0

I'm really not sure what's happening. The live server keeps defaulting to something it isn't on port 5501 so I searched stack overflow and found this help for the problem

but when I go to settings.json it looks different and on closer inspection it looks like the settings for a different extension (prettier).

{
    "[html]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "workbench.colorTheme": "Monokai",
    "liveServer.settings.donotShowInfoMsg": true,
    "window.zoomLevel": 0,
    "files.autoSave": "off",
    "[javascript]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "[json]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "[css]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "security.workspace.trust.untrustedFiles": "open",
    "liveServer.settings.CustomBrowser": "chrome",
    "[typescriptreact]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "files.associations": {
        "*.php": "php"
    },
    "liveServer.settings.useLocalIp": true
}

I've tried uninstalling prettier and live-server(and live sass) but all that happens is the file stays the same and it doesn't recognize the "esbenp.prettier-vscode".

I am relatively new to programming and have no idea what's happening?

I'm guessing if I can just get a copy of the correct settings.json I can copy, paste, save it and it'll work? but I can't find the file on the github page.

Can anyone help me out?

Thanks

EDIT: below is my current code

{
    "[html]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "workbench.colorTheme": "Monokai",
    "liveServer.settings.donotShowInfoMsg": true,
    "window.zoomLevel": 0,
    "files.autoSave": "off",
    "[javascript]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "[json]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "[css]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "security.workspace.trust.untrustedFiles": "open",
    "liveServer.settings.CustomBrowser": "chrome",
    "[typescriptreact]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "files.associations": {
        "*.php": "php"
    },
    
    "liveServer.settings.multiRootWorkspaceName": "",
    "liveServer.settings.port": 0
}
Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
  • you have to add the named settings from the link to your settings.json file – rioV8 Jan 13 '22 at 16:28
  • Hi thanks for replying. I've tried doing that (adding "liveServer.settings.port": 0" ) after the liveserver setting above and nothing changes. The only thing i can think is that maybe the content of settings is wrong ? The reason i think this is because in the solution proposed by "Inayat Ullah Shinwari" in step 6, their document suggests theres 70 lines of code whereas mine is only about 30 lines? Unfortunately adding this line to my settings.json makes no noticeable difference – newby webber Jan 13 '22 at 17:15
  • edit your question and show how your `settings.json` looks now. be sure to edit the correct `settings.json`, global or correct workspace version – rioV8 Jan 13 '22 at 20:45
  • Hi, i've added an edit below my original question. As far as i can see in the extension settings there are three options (Advance Custom Browser Cmd Line,Chrome Debugging Attachment and Port) that allow me to "edit settings in json". All three are the same for me? I cant find a second type? Thank you for your continued help! – newby webber Jan 13 '22 at 22:49
  • if you want the live server at port `5501`, why do you set the port number to `0` – rioV8 Jan 13 '22 at 23:02
  • sorry for late reply it was bed time here. I think 5501 is just the port it either originally was set to or maybe i changed it to that as part of another solution. it doesn't have to be port 5501 its just stuck there currently. I dont mind which port its at. I npx killed 5501 and live server errored and on restart defaults to 5501. I want to set it to 0 so it doesn't get stuck. Not sure if i am making sense or not sorry – newby webber Jan 14 '22 at 10:42

0 Answers0