Skip to content

Mark .server.ts files as being NetworkType server #200

Open
@Dionysusnu

Description

@Dionysusnu

If a .server.ts file ends up executing, it will always be as a server script*. This means it will have access to things like ServerStorage, regardless of where the script is located. Therefore, RojoResolver should mark it as having NetworkType server. However, currently, it is always marked according to its location.
For example, a server script under StarterPlayerScripts gets NetworkType client. This generates a false-positive diagnostic when that file imports a ServerStorage file.

*I need to check what rojo uses for precedence between file extension and meta files. Can init.server.ts end up as a LocalScript if the meta.json dictates it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions