Skip to content
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

Change the semantics of #load to only allow to be used at the top #105

Closed
filipw opened this issue Mar 13, 2013 · 10 comments · Fixed by #106
Closed

Change the semantics of #load to only allow to be used at the top #105

filipw opened this issue Mar 13, 2013 · 10 comments · Fixed by #106
Labels

Comments

@filipw
Copy link
Member

filipw commented Mar 13, 2013

This is consistent with C# interactive window.
No inline use of #load.

@dschenkelman
Copy link
Contributor

@filipw this would make #71 and #68 a lot simpler. how would this go?

  1. First usings, then #loads, finally body
  2. First #loads, then usings, finally body
  3. Any combination of usings and #loads before the body

Please let me know which one it is so I can create the necessary unit tests for this feature. After that, we would simply need to add #line lineNumber 'fileName.csx' after all usings and #loads.

@filipw
Copy link
Member Author

filipw commented Mar 13, 2013

I have this running locally already.

  1. distinct #r directives (these are relevant for roslyn to load DLLs without references)
  2. Then all distinct usings from all files - both main and loaded via #load
  3. bodies of all #load files
  4. body of the main file

@dschenkelman
Copy link
Contributor

@filipw I see, so basically it's something similar to my 1 but adding #r at the head of the pack :)

Seeing that you already have this running I'll assume it is already implemented and place the #line after all #loads.

@dschenkelman
Copy link
Contributor

@filipw. please let me know when this is available so I can merge it. I assume there are a bunch of updates in the unit tests.

@filipw
Copy link
Member Author

filipw commented Mar 13, 2013

it's in the commit above in my branch.
it fixes #r and sets #load to be at the top only (and adds filename as comment before #load).

you'll have to add #line stuff seperately

@dschenkelman
Copy link
Contributor

Great! I'll merge once I have #line done.

On Wed, Mar 13, 2013 at 1:03 AM, Filip W notifications@github.com wrote:

it's in the commit above in my branch.
it fixes #r and sets #load to be at the top only (and adds filename as
comment before #load).

you'll have to add #line stuff seperately


Reply to this email directly or view it on GitHubhttps://github.com//issues/105#issuecomment-14823343
.

@filipw
Copy link
Member Author

filipw commented Mar 13, 2013

Awesome, I PR'd it so it should go in soon.
If you find problems, you know what to do :-)

@glennblock
Copy link
Contributor

It's in.

@dschenkelman
Copy link
Contributor

@filipw @glennblock just left a couple of questions in the PR code http://t.co/YdGaADlZXL.

@glennblock
Copy link
Contributor

Responded to one of your comments on the file comment being embedded.

On Tue, Mar 12, 2013 at 10:39 PM, dschenkelman notifications@github.comwrote:

@filipw https://github.com/filipw @glennblockhttps://github.com/glennblockjust left a couple of questions in the PR code
http://t.co/YdGaADlZXL.


Reply to this email directly or view it on GitHubhttps://github.com//issues/105#issuecomment-14825488
.

ztone pushed a commit to ztone/scriptcs that referenced this issue May 4, 2014
# By Nick Berardi (8) and others
# Via dschenkelman (6) and others
* dev:
  Added error messages with line number when using -debug in console
  # Deleted DebugFilePreProcessor.cs. No longer needed with support for debugging in VS
  # Updated FilePreProcessor.cs, FileProcessorTests.cs and RoslynScriptDebuggerEngine.cs to add #line directives after #loads
  fixed bug with #r not loading, and set #load to only be available at the top scriptcs#105 scriptcs#98 scriptcs#21
  removed IDisposable from ScriptPackSession
  Update ScriptCs.Engine.Roslyn.csproj
  Update ScriptCs.Engine.Roslyn.Tests.csproj
  Update ScriptCs.Engine.Roslyn.csproj
  moved ScriptHostFactory into Roslyn since the script host is Roslyn specific
  # Simplified code for IScriptEngine constructor convention. Thanks to @khellang for the code review.
  # Removed namespaces that are no longer used
  added [InheritedExport] back onto IScriptEngine
  refactored code to bring ScriptPackSession back into the core
  # Updated code base to get rid of MEF attributes and use RegistrationBuilder
  refactored roslyn out of core to fix scriptcs#90 in preperation for scriptcs#80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants