skip to Main Content

Ive been looking on the the internet for answer but none comes close to what i was looking for. What is the folder for? enter image description here

and inside is this json file:

enter image description here

What happen if i delete the folder and do i really need that to be in the folder? Thank you

2

Answers


  1. Short answer:

    If you delete it, probably nothing much bad will happen. It’ll probably get created again. Your live server may or may not end up on the same port. Probably don’t commit it to source control (but maybe you want to).

    Longer answer:

    .vscode as a folder name has a few clues:

    • the leading . kind of means "hide this folder". It comes from *nix operating systems where by default if you name a file or folder .anything it’ll get hidden.
    • being called .vscode, which is the name of the editor you’re using, suggests it relates specifically to using vscode.

    The fact that it gets created when you "do something" suggests that it’ll cope if it’s not there, but probably the way it’ll cope is to re-create it. That’s a pretty common thing too.

    One use for a settings.json file in a folder is for settings that are specific to that folder. Often you’d have settings that you want to apply to vscode wherever you’re using it. But sometimes you have settings that apply to a specific bit of code.

    The people that wrote the LiveServer extension seem to think that what port the live server runs on is one of those "per project" settings. I’d agree. You may want to run 2 or 3 live servers (e.g. a PHP web-site and another one that just does API, maybe), or the port that they chose might be in use by something completely else. So to deal with that, they create this settings file. I’d take a stab that if you edit that, then the LiveServer is going to show up on a different port.

    But you can probably find the code and check it. Probably this document will tell you what to know.
    https://github.com/ritwickdey/vscode-live-server/blob/HEAD/docs/settings.md

    (A possibility here that I’ve chosen the wrong extension, but most vscode extensions are open source, so you should be able to follow the trail to a github repo, and then to either some docs or some code).

    Editor settings are that border-line with source control – whether to check in or not. Lots of projects have defined editor settings, such as tabs vs spaces or linting engines. Lots don’t. Possibly in this case, if you’re part of a large project, the specific ports to use are defined, so it’d go into source control. If it’s just you, do what feels good.

    Login or Signup to reply.
  2. I’m using VS code (v1.74.3),Live Server (v5.7.9). There is no settings.json in .vscode folder of my JS project. Instead the settings.json is created in the folder "C:UsersUSER NAMEAppDataRoamingCodeUser" and it is a global settings file to specify extension properties. Most of the Live Server configuration settings mentioned in the documentation can be applied at global level.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search