snowkit / sublime_flow Goto Github PK
View Code? Open in Web Editor NEWSublime Text support for Haxe flow build tool
Sublime Text support for Haxe flow build tool
I've installed haxe from homebrew, set up everything according to flow documentation within sublime but, every time I try to set "project.flow" as the current flow project, the following exception is thrown into sublime's console:
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 535, in run_
return self.run()
File "commands.flow_set_project_file in /Users/jppg/Library/Application Support/Sublime Text 3/Installed Packages/sublime_flow.sublime-package", line 11, in run
File "flow in /Users/jppg/Library/Application Support/Sublime Text 3/Installed Packages/sublime_flow.sublime-package", line 62, in set_flow_file
File "flow in /Users/jppg/Library/Application Support/Sublime Text 3/Installed Packages/sublime_flow.sublime-package", line 88, in refresh_info
File "flow in /Users/jppg/Library/Application Support/Sublime Text 3/Installed Packages/sublime_flow.sublime-package", line 300, in run_process
File "./subprocess.py", line 824, in __init__
File "./subprocess.py", line 1448, in _execute_child
FileNotFoundError: [Errno 2] No such file or directory: 'haxelib'
haxe and haxelib is accessible from the OS terminal but not on sublime. The reason for this is that GUI applications do not have access to env variable set on .bashrc/.bash_profile files.
There are two possible solutions that I found:
Sorry if this shouldn't be considered an issue here.
Cheers,
João.
Otherwise validly traced paths appear incorrect.
Fixed in 9c14415
I'm following the guide at https://underscorediscovery.github.io/flow/guide/sublimetext.html, using the sample project.flow
in luxe/tests/features/draw. Completion seems to... do nothing. Opening the console, looks like there's an exception:
[flow] set flow file to /home/s/Code/haxe/luxe/tests/features/draw/project.flow
[flow] refresh info/hxml on /home/s/Code/haxe/luxe/tests/features/draw/project.flow
[flow] set build target to linux
[flow] refresh info/hxml on /home/s/Code/haxe/luxe/tests/features/draw/project.flow
Traceback (most recent call last):
File "/opt/sublime_text/sublime_plugin.py", line 358, in on_query_completions
res = callback.on_query_completions(v, prefix, locations)
File "flow in /home/s/.config/sublime-text-3/Installed Packages/sublime_flow.sublime-package", line 86, in on_query_completions
File "flow in /home/s/.config/sublime-text-3/Installed Packages/sublime_flow.sublime-package", line 127, in completion
KeyError: 'hxml'
Right clicking on a flow file and setting it as the current flow project does't always work—no errors or warnings are issued, just the command doesn't do anything (trying to check flow status says "no flow file, specify a flow file first".
Seems somewhat random. I can only sometimes replicate this by having a folder open which is not a flow project, then opening a folder with a flow file in a new window. Setting the project in the new window does not work.
It almost seems like it may have something to do with length of time a window / folder has been open?
Not sure if this is sublime_flow or sublime_haxe, but autocomplete doesn't seem to pick up a library unless its explicitly set in a project .flow file, rather than the .flow file of the project's dependencies.
Example: in tusk.flow, I include promhx
as a dependency. In the sample project.flow file, I depend on tusk
, which should mean I depend on snow
and promhx
and be picked up by autocompletion. Instead, autocompletion doesn't detect promhx
until I include it as a dependency in project.flow
.
I'm specifically using the thx libraries, which are named as "thx.culture", "thx.format", etc.
In the haxelib folder, these are stored using commas rather than periods (even though they were installed using haxelib install thx.core
):
~/.haxe $ ls
buddy flow gltf hxcpp hxtemplo markdown partials react thx,core thx,format
dox format hxargs hxparse luxe mint promhx snow thx,culture tusk
When trying to use the libraries in flow (with periods):
dependencies: {
"thx.culture": "*",
"thx.format": "*"
}
The generated .hxml contains:
-cp /Users/kenton/.haxe/thx.culture/0,4,0/
-cp /Users/kenton/.haxe/thx.culture/0,4,0/src/
-cp /Users/kenton/.haxe/thx.format/0,5,1/
-cp /Users/kenton/.haxe/thx.core/0,37,1/
-cp /Users/kenton/.haxe/thx.core/0,37,1/src/
(the folders of which do not exist as haxelib replaces the periods with commas).
If, you instead use commas in the flow file as such:
dependencies: {
"thx,culture": "*",
"thx,format": "*"
}
Flow fails with the message:
flow / prepare - failed due to missing dependencies!
flow / you will probably need to use haxelib to correct this.
flow / > thx,culture *
flow / > thx,format *
Here's a real-time GIF showing the problem in action:
The status bar reads "no info/hxml for flow file, caching...
" (printet from here).
The console outputs this:
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 359, in on_query_completions
res = callback.on_query_completions(v, prefix, locations)
File "flow in /Users/nissen/Library/Application Support/Sublime Text 3/Installed Packages/sublime_flow.sublime-package", line 115, in on_query_completions
File "flow in /Users/nissen/Library/Application Support/Sublime Text 3/Installed Packages/sublime_flow.sublime-package", line 132, in completion
File "flow in /Users/nissen/Library/Application Support/Sublime Text 3/Installed Packages/sublime_flow.sublime-package", line 93, in refresh_info
File "./json/__init__.py", line 319, in loads
File "./json/decoder.py", line 352, in decode
File "./json/decoder.py", line 370, in raw_decode
ValueError: No JSON object could be decoded
The HXML-part of the JSON that is parsed in refresh_info
in flow.py
seems to be correct:
"hxml": "-main LuxeApp\n-D no-compilation\n-D mac\n-D arch-64\n-D desktop\n-D hxcpp_static_std\n-D absolute-path\n-D snow_module_input_sdl\n-D snow_module_audio_openal\n-D snow_module_windowing_sdl\n-D luxe_native\n-D parcel_thread_disabled\n-D snow_native\n-D luxe\n-D hxcpp\n-D snow\n-cp /Users/nissen/code/snowkit/luxe/\n-cp /usr/local/lib/haxelib/hxcpp/3,2,180/\n-cp /Users/nissen/code/snowkit/snow/\n-cp src/\n-resource version@version\n-resource build@build\n-resource phoenix/defaults/shaders/[email protected]\n-resource phoenix/defaults/shaders/[email protected]\n-resource phoenix/defaults/shaders/[email protected]\n-resource phoenix/defaults/shaders/[email protected]\n-resource luxe/defaults/fonts/[email protected]\n-resource luxe/defaults/fonts/[email protected]\n--macro snow.system.module.Module.set(\"Audio\",\"snow.core.native.audio.Audio\")\n--macro snow.system.module.Module.set(\"IO\",\"snow.core.native.io.IO\")\n--macro snow.system.module.Module.set(\"Input\",\"snow.core.native.input.Input\")\n--macro snow.system.module.Module.set(\"Windowing\",\"snow.core.native.window.Windowing\")\n--macro snow.system.module.Module.set(\"Assets\",\"snow.core.native.assets.Assets\")\n--macro snow.system.module.Module.set(\"Input\",\"snow.modules.sdl.Input\")\n--macro snow.system.module.Module.set(\"Windowing\",\"snow.modules.sdl.Windowing\")\n--macro snow.system.module.Module.set(\"Audio\",\"snow.modules.openal.Audio\")\n-cp bin/mac64.build/haxe\n-cpp bin/mac64.build/cpp\n",
... and the complete JSON-data is valid JSON.
I'm running OS X El Capitan with Haxe 3.2.1 and the newest flow
, sublime_flow
and sublime_haxe
. The problem started occurring after I upgraded to El Capitan, but not immediately after.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.