Noob with vscode, why can't I see my scripts in ServerScriptService?

So this is my json file
image

The problem is this is what I see in studio
image

image
It seems like my source folder in vscode is copied into replicated Storage

My question is how can I put a script inside Server Script Service?
Do I have to change my json file?

Yep your JSON file structure is a bit odd looks like you are missing the path for your server script service within the complicated bracket nesting that is a JSON file that’s all.

    "ReplicatedStorage": {
      "$className": "ReplicatedStorage",
      "Source": {
        "$path": "src/ReplicatedStorage"
      }
    },
    "ServerScriptService": {
      "$className": "ServerScriptService",
      "Source": {
        "$path": "src/ServerScriptService"
      }
    },

yeah looking further into it we gotta put the “Source” bracket within the “ServerScriptService” bracket.

Here is the entire Json file you can copy and paste which includes server storage as well, I made it from editing the auto generated JSON on rojo initialize:

Rojo json
{
  "name": "UrProjectNamelol",
  "tree": {
    "$className": "DataModel",
    "HttpService": {
      "$className": "HttpService",
      "$properties": {
        "HttpEnabled": true
      }
    },
    "Lighting": {
      "$className": "Lighting",
      "$properties": {
        "Outlines": false,
        "Technology": "Voxel",
        "GlobalShadows": true,
        "Brightness": 2.0,
        "Ambient": [
          0.0,
          0.0,
          0.0
        ]
      }
    },
    "ReplicatedStorage": {
      "$className": "ReplicatedStorage",
      "Source": {
        "$path": "src/ReplicatedStorage"
      }
    },
    "ServerStorage": {
      "$className": "ServerStorage",
      "Source": {
        "$path": "src/ServerStorage"
      }
    },
    "ServerScriptService": {
      "$className": "ServerScriptService",
      "Source": {
        "$path": "src/ServerScriptService"
      }
    },
    "SoundService": {
      "$className": "SoundService",
      "$properties": {
        "RespectFilteringEnabled": true
      }
    },
    "Workspace": {
      "$className": "Workspace",
      "$properties": {
        "FilteringEnabled": true
      },
      "Baseplate": {
        "$className": "Part",
        "$properties": {
          "Anchored": true,
          "Locked": true,
          "Position": [
            0.0,
            -10.0,
            0.0
          ],
          "Size": [
            512.0,
            20.0,
            512.0
          ],
          "Color": [
            0.38823,
            0.37254,
            0.38823
          ]
        }
      }
    }
  }
}
1 Like
{
  "name": "MY_GAMES_NAME_HERE_THIS_CAN_BE_ANYTHING",
  "tree": {
    "$className": "DataModel",

    "ServerScriptService": {
      "$className": "ServerScriptService",
  
      "GameFiles": {
        "$className": "Folder",
        "Source": { 
          "$path": "src/ServerScriptService"
        }
      }
    }, 

    "ReplicatedStorage": {
      "$className": "ReplicatedStorage", 
      "Source": { 
        "$path": "src/ReplicatedStorage"

      }
    }
  }
}

So I tried adding source into my json file but I still end up with the same thing. The source folder gets copied into replicated storage

image

Have you tried deleting the Folder and restarting Rojo? I’ve experienced a similar problem despite changing the tree.

1 Like

is restarting rojo clicking this button?
image

or should i close down vs code and try again

I suggest checking out the tree structure for the JSON file as well here is mine which works it’s under tree:

Screenshot 2020-11-29 at 10.47.57 PM

yours is quite odd since the source is under “GameFiles”

For restarting Vscode typically I just close the folder and reopen it, it should restart everything.

Edit: Try this out which moves the source to under server script service

    "ServerScriptService": {
      "$className": "ServerScriptService",
          "Source": { 
          "$path": "src/ServerScriptService"
        }
      "GameFiles": {
        "$className": "Folder",
      }

    }, 

Also, I found out from github you can do ```json to format the text to json and remove all the red text which the default formatter thinks it’s a lua string

1 Like

So I copied your json file from above and it works, I’m just curious what all the source folders are for?
image
if i get rid of the source here
image
will it get rid of the source folder?

You don’t actually need them, it’s possible just to set a path for the services themselves:

"ServerScriptService": {
    "$className": "ServerScriptService",
    "$path": "src/ServerScriptService"
}
2 Likes

@ReturnedTrue Never knew that :sob:

You can also rename it like what Aero does

As noticed instead of “Source”: {} it’s renamed to “Aero”:

    "ServerScriptService": {
      "$className": "ServerScriptService",
      "Aero": {
        "$className": "Folder",
        "Internal": {
          "$path": "src/_framework/server_internal"
        }
      }
    },

also I have another question when using vs code, how do you reference models or parts that are in your workspace

If you want Intellisense with parts in workspace, you have to run the Roblox LSP extension and its studio plugin.

1 Like

Where can I find the studio plugin?

edit: I found it and it works now