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

add .hx to MONO_EXTENSIONS #35

Merged
merged 1 commit into from
Jun 16, 2017

Conversation

VysotskiVadim
Copy link

Let's add .hx extension to supported extensions.
Haxe is language which can be compiled to c#, it overrides path and line number using line directive.

This Haxe code:

 public static function main() 
 {
        var array = 1...10;
        for (i in array){
            trace('Hello world $i');
        }
        
 }

will be compiled to this c# code:

public static void main() {
		unchecked {
			#line 5 "/Users/vadzimv/Projects/haxe_cs_debug/sample/Test.hx"
			global::IntIterator array = new global::IntIterator(1, 10);
			{
				#line 6 "/Users/vadzimv/Projects/haxe_cs_debug/sample/Test.hx"
				global::IntIterator _g = array;
				#line 6 "/Users/vadzimv/Projects/haxe_cs_debug/sample/Test.hx"
				while (( _g.min < _g.max )) {
					#line 6 "/Users/vadzimv/Projects/haxe_cs_debug/sample/Test.hx"
					int i = _g.min++;
					global::haxe.Log.trace.__hx_invoke2_o(default(double), global::haxe.lang.Runtime.concat("Hello world ", global::haxe.lang.Runtime.toString(i)), default(double), new global::haxe.lang.DynamicObject(new int[]{302979532, 1547539107, 1648581351}, new object[]{"main", "Test", "Test.hx"}, new int[]{1981972957}, new double[]{((double) (7) )}));
				}
				
			}
			
		}
		#line default
	}

Because of line directive mono debugger works well with .hx files, so I believe mono debugger can be used to debug haxe code for c# target without any other changes.

@weinand
Copy link
Contributor

weinand commented Jun 15, 2017

I would like to verify this. How do I compile Haxe to C# on macOS?

@VysotskiVadim
Copy link
Author

Please install haxe: https://haxe.org/download/
I've published a simple project for you to test: https://github.com/VysotskiVadim/haxe-vscode-monodebug-sample , just open, put breakpoint and launch.

@weinand weinand merged commit 71fadd9 into microsoft:master Jun 16, 2017
@weinand weinand self-assigned this Jun 16, 2017
@weinand weinand added this to the June 2017 milestone Jun 16, 2017
@weinand
Copy link
Contributor

weinand commented Jun 16, 2017

@VysotskiVadim thanks a lot for the PR and even more so for the sample project! That helped a lot.

@VysotskiVadim
Copy link
Author

I'm glad to help! thanks.

@VysotskiVadim VysotskiVadim deleted the feature/add-hx-extension branch September 15, 2018 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants