-
Notifications
You must be signed in to change notification settings - Fork 417
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Support RSP-based configuration for scripting project system #1112
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with the reflection based stuff (It's not like we haven't done this before...)
There is a conflict that needs merging. 😄 |
src/OmniSharp.Script/ScriptHelper.cs
Outdated
|
||
private CSharpCommandLineArguments CreateCommandLineArguments() | ||
{ | ||
var scriptRunnerParserProperty = typeof(CSharpCommandLineParser).GetProperty("ScriptRunner", BindingFlags.Static | BindingFlags.NonPublic); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, I don't think you need this anymore. CSharpCommandLineParser.Script
appears to be public in Roslyn 2.7.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right! removed the reflection
bd5b26c
to
eb81551
Compare
thanks - I forgot about this PR 😇😇 It's rebased now. Remarkable in how many conflicts I got in with myself. |
Fixes #1024
This PR introduces the ability to configure a path to RSP file which is picked up by the scripting project system.
The RSP is not supported in the compiler-specific traditional way (where it can configure almost all of the compilation options) but rather is just a vessel to provide custom assembly references (
/r:...
) and global namespaces (/u:...
). This is consistent with CSI behavior, which also uses RSP files only for these two types of input (when it comes to compilation options at least).The obvious user benefit of all of this is, if I built my own custom script runner using Roslyn Scripting Engine, I could use OmniSharp for intellisense and language services against it (or at least to certain degree). That's due to the fact that I'd be able to predefine my implicitly available namespaces and assembly references using an RSP file now.
The way it all works:
omnisharp.json
file - at global or local level, relative or absoluteobject
reference - this is default requirement of C# scripting anyway, hence the merge not replace)As a bonus, I added strongly typed scripting configuration (it was dictionary based).
I will try to invent some creative way to test this, at the moment the PR comes without any tests unfortunately.