-
Notifications
You must be signed in to change notification settings - Fork 420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Watch .csx files in order to add/remove script projects to workspace. #1056
Watch .csx files in order to add/remove script projects to workspace. #1056
Conversation
if (changeType == FileChangeType.Unspecified && File.Exists(filePath) || | ||
changeType == FileChangeType.Create) | ||
{ | ||
AddToWorkspace(filePath); |
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.
Here we'll want to run TryGetCompilationDependencies
again, because that would resolve #r nuget:
and #load nuget:
if these are used inside of the file. However, there is no API at the moment to do it other than for a current folder so this needs to go on a TODO list for later. I plan to adjust some APIs to facilitate that soon.
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.
Ah, I see. Dependencies are not added automatically by the NuGet Resolvers (NuGetSourceReferenceResolver
and NuGetMetadataReferenceResolver
)?
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.
That is the long term goal, but at the moment they can't due to a current limitation in Roslyn which prevents a reference from resolving into more than a single MetadataReference
.
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.
Ok, in that case, will it add any value to run TryGetCompilationDependencies
again here? Since a recently added file will most of the time be blank... Unless, it’s a rename, move or copy from within VSCode?
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 think for now let's just leave it as is - and when we upgrade to "self contained" resolvers the problem will fix itself. If that doesn't come soon enough, we'll do something smarter here - what you have in this PR is a big step forward anyway 👍
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.
Not to mention for the primary scenario we want to support - CSI - it will already work as expected.
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.
06340f2
to
3915f1b
Compare
@DustinCampbell changelog updated. |
@mholo65 there is a changelog conflict that needs resolving now 😄 |
thanks! |
@filipw resolved conflict using Github GUI. |
Builds upon PR #1053. (Merge that first, and then rebase this...)
Add created .csx files to workspace and remove deleted .csx files from workspace.
ping @filipw