Skip to content

Conversation

@glennblock
Copy link
Contributor

@glennblock glennblock commented Jan 9, 2017

DO NOT MERGE YET

Fix for #225

Creating this PR so others can review the approach.

This adds a new ScriptInfo class that is set with the path of the file that is executed. Ultimately the path is exposed off of the ambient Env property. The approach minimizes signature changes as it depends on ctor injection to get the ScriptInfo class passed around.

@scriptcs/core @rossipedia appreciate your thoughts.

Yes this issue is 2 1/2 years old.....

@glennblock
Copy link
Contributor Author

Added LoadedScripts property which lets you access any scripts that were loaded via #load

@glennblock
Copy link
Contributor Author

Here is a screenshot of both new properties being used.

screen shot 2017-01-09 at 12 05 59 am

}

public string ScriptPath { get; set; }
public IList<string> LoadedScripts { get; private set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think maybe this can even be HashSet<string> since there is no need to show the same script twice

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should use Hashset as it does not guarantee ordering. I want the order to be the load order.

@filipw
Copy link
Member

filipw commented Jan 9, 2017

maybe we could add current script to FilePreProcessorResult as a standalone property, then we could avoid relying on result.LoadedScripts.Skip(1) (first == current script) as I have a feeling this might become a problem in the future

@glennblock
Copy link
Contributor Author

glennblock commented Jan 9, 2017 via email

@glennblock
Copy link
Contributor Author

glennblock commented Jan 9, 2017 via email

@glennblock
Copy link
Contributor Author

Man Travis STILL causes us problems.....this is annoying

…/ FilePreProcessorResult and removing skip logic
@glennblock
Copy link
Contributor Author

@filipw I did a refactoring so skip is no longer needed / I made everything first class in the FilePreProcessor. This provides other benefits so that there is no magic logic needed upstream.

@filipw
Copy link
Member

filipw commented Jan 9, 2017

cool - LGTM

@filipw filipw merged commit 80a4c51 into scriptcs:dev Jan 9, 2017
@glennblock
Copy link
Contributor Author

@filipw I said "DON'T MERGE" did you read the top? :-)

I wanted to add unit tests. But I can add those separately now I guess.

@filipw
Copy link
Member

filipw commented Jan 9, 2017

haha I thought that was regarding the 1st commit, and that subsequent commits negated it 😄

@glennblock
Copy link
Contributor Author

:-) Next time I'll put checkboxes. with a title like "Filip, don't commit until these are done:" :p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants