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

Debugger runs incorrect hashlink file when a display.hxml is present #85

Open
tbrosman opened this issue Jun 20, 2020 · 9 comments
Open

Comments

@tbrosman
Copy link

Version: 1.1.0 (works fine in 1.0.0)

Example project: https://github.com/tbrosman/tube-engine-shell (not quite a "minimal" repro, but not many moving parts)

Steps:

  • Build TestRunner
  • Run TestRunner

Expected: should run TestRunner
Actual: HashLink debugger attempts to run the output hl corresponding to vshaxe-display.hxml. I get the following error

Error: ENOENT: no such file or directory, open 'bin/ignore.hl'

Called from fs.js line 447 column 3
Called from electron/js2c/asar.js line 140 column 31
Called from electron/js2c/asar.js line 140 column 31
Called from fs.js line 349 column 35
Called from fs.readFileSync (electron/js2c/asar.js line 542 column 40)
Called from fs.readFileSync (electron/js2c/asar.js line 542 column 40)
Called from c:\Users\Tommy\.vscode\extensions\haxefoundation.haxe-hl-1.1.0\adapter.js line 314 column 79
Called from c:\Users\Tommy\.vscode\extensions\haxefoundation.haxe-hl-1.1.0\adapter.js line 127 column 29
Called from c:\Users\Tommy\.vscode\extensions\haxefoundation.haxe-hl-1.1.0\node_modules\vscode-debugadapter\lib\debugSession.js line 342 column 22
Called from c:\Users\Tommy\.vscode\extensions\haxefoundation.haxe-hl-1.1.0\node_modules\vscode-debugadapter\lib\protocol.js line 97 column 38
@ncannasse
Copy link
Member

ncannasse commented Jun 20, 2020 via email

@tbrosman
Copy link
Author

I was looking through the VS Haxe documentation earlier. I am not sure how to do this. Which file to I specify it in? (settings.json somehwere?)

@ncannasse
Copy link
Member

ncannasse commented Jun 20, 2020 via email

@tbrosman
Copy link
Author

You mean the haxe.configurations, right? In my case that is my display.hxml. I have multiple sub-projects that each have their own classpaths. To make code completion work across all sub-projects, I've been using a display.hxml that includes the superset of all of those classpaths. It is kind of gimpy, but worked until now.

If display-only hxml isn't supported, I'll have to switch the active configuration when I edit/build different projects (which seems inconvenient). Also, I see that only top-level hxml files are auto-detected by vshaxe, which is a problem for my project structure. Is there a better pattern for this kind of project?

@ncannasse
Copy link
Member

ncannasse commented Jun 21, 2020 via email

@Gama11
Copy link
Member

Gama11 commented Jun 21, 2020

We could look into supporting automatic debug configurations at some point.

@ncannasse
Copy link
Member

ncannasse commented Jun 21, 2020 via email

@Gama11
Copy link
Member

Gama11 commented Jun 21, 2020

But the hashlink-debugger would need the HXML parsing code we wanted to get rid of again.

@tbrosman
Copy link
Author

tbrosman commented Jul 4, 2020

@Gama11 and @ncannasse: I thought about this some more. The root problem is when I edit a file in a multi-hxml project, the debugger doesn't have a way of knowing which hxml intend to build it with. The current solution requires me to specify which hxml file is "most appropriate" for my current configuration. There are a couple approaches that could be taken:

  • A) Allowing the user to specify a project-wide display.hxml (roughly what I was doing). These kinds of files are inconvenient because they have to contain a superset of all the build.hxml libraries/etc.
  • B) The extension detects which hxml is effective for a particular haxe file. This could work similar to how TypeScript resolves the current tsconfig (https://www.typescriptlang.org/docs/handbook/tsconfig-json.html): start in the current directory (in this case, the source file's directory) and work upwards until it finds one. This fails when multiple hxml_s live in a single directory (common) or the hxml it finds is not the "intended" target (uncommon).
  • C) Some kind of project file that isn't an hxml. Similar to (B), but it's not a build target. Example vshaxe-project.json:
{
  "display-hxml": "my-display.hxml"
}

It would only be required in the case where (B) fails.

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

No branches or pull requests

3 participants