Skip to content

[Feature Request] Allow script globals object type to be passed via .rsp file #23421

@filipw

Description

@filipw

Version Used:
2.4.0

Expected Behavior:

When using an .rsp file with csi, I'd like to be able to set/pass globals object type into the script runner. I'd imagine something like:

/globalstype:Ozzy.OutBack.Kangaroo,MyAssembly

The type could be searched for in the current load context, or there could be an additional configuration parameter for providing the path to the globals assembly.

Actual Behavior:

It is not possible to pass own globals object type. csi hardcodes CommandLineScriptGlobals as globals type.
The functionality would offer excellent flexibility for script authors.

This could also help with tooling for custom script hosts. An .rsp file with host-specific configuration of usings, references and globals type could be parsed by the editor and relevant host-specific language services/intellisense could be offered - which will have a great, positive impact on the C# scripting ecosystem.

Spun off from #23402 (comment)
cc @tmat

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions