clemos / haxe-sublime-bundle

Sublime Text bundle for Haxe programming language
Apache License 2.0
237 stars 85 forks source link

Compiling with ctrl+enter gives me "Error: Could not process argument js Class name must start with uppercase character" #238

Closed dougcharnley closed 9 years ago

dougcharnley commented 9 years ago

When I use the ctrl + enter shortcut to compile my Haxe code in ST3 I'm getting this error:

Error: Could not process argument js Class name must start with uppercase character [Finished in 0.1s with exit code 1] [cmd: ['haxe', '--connect', '6001', '--cwd', '/Users/dougcharnley/_Git/TMNT-Mutations/src', '-cp', '/Users/dougcharnley/_Git/TMNT-Mutations/src', '--no-output', 'js', '/Users/dougcharnley/_Git/TMNT-Mutations/src/tmnt.tmntcontext.js']] [dir: /Users/dougcharnley/_Git/TMNT-Mutations/src] [path: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/bin]

I can't understand where its coming from or whats at fault. None of my classes start with a lower case letter and if I use terminal to compile by typing in 'flambe build' it builds perfectly fine so it has to be something to do with the code thats running as a result of the Sublime ctrl + enter shortcut right?

At a guess it looks like theres something wrong with the compiled js file tmntcontext.js - which doesnt compile incorrectly when I use terminal so it seems to me (although I could easily be wrong) that its something do with the Haxe compiler package - which is why I'm posting here.

Any light that can be shed on this would be really helpful as its so much better to just use Sublime that have to have terminal open all the time. I just don't get it, it used to work just fine!

ghost commented 9 years ago

Can you share your build file (flambe.yaml)?

dougcharnley commented 9 years ago

I copy pasted - guess thats not the best way to share it. How should I share it?

ghost commented 9 years ago

Add ``` at the top and at the bottom of your comment. Like here.

You are using Flambe / HTML5 - build only target in ST3. Right?

dougcharnley commented 9 years ago
 # Basic information about the game.
name: name
description: desc

# Information about the game developer.
developer:
  name: Name
  url: url

# The game's unique identifier.
id: flambe.tmnt

# The game's version string.
version: 1.0.1

# The main class name.
main: tmnt.Main

# Disable WebGL (force use canvas)
#haxe_flags: -D flambe_disable_webgl

# The platform to use when invoking `run` or `build` with no arguments.
default_platform: html

# The initial orientation and fullscreen state on mobile devices.
orientation: landscape
fullscreen: true

# Additional flags to pass to the Haxe compiler.
#haxe_flags: --macro include('tmnt.scenes')

# Additional flags to pass to the Typescript compiler.
# tsc_flags: --noImplicitAny

# Additional paths to include in the build.
# extra_paths:
#   assets: dir1 dir
#   libs: dir1 dir2
#   src: ../dir1 ../dir2
#   platform: ["dir1 with spaces", "dir2"]

# Android-specific configuration.
android:
  # https://developer.android.com/guide/topics/manifest/manifest-intro.html
  AndroidManifest.xml: |
    <manifest android:installLocation="auto">
      <uses-permission android:name="android.permission.INTERNET" />
    </manifest>

# iOS-specific configuration.
ios:
  # http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference
  Info.plist: |
    <key>UIDeviceFamily</key>
    <array>
      <string>1</string>
      <string>2</string>
    </array>
    <key>UIPrerenderedIcon</key>
    <true/>

# Firefox App-specific configuration.
firefox:
  # https://developer.mozilla.org/en-US/docs/Web/Apps/Manifest
  manifest.webapp:
    {
      default_locale: "en",
      # type: "privileged",
      # permissions: [...]
    }
dougcharnley commented 9 years ago

That's right. I've managed to keep going by installing the Haxe plugin for ST2 instead. That compiles and runs fine - I just have to put up with the 'purchase now' pop up box as, unlike ST3 I haven't paid for ST2. So its strange that the bundle works perfect on ST2 but has that weid error on ST3 for the exact same project and set of files.

ghost commented 9 years ago

Yep its strange. I'll try to fix this issue.

dougcharnley commented 9 years ago

Thanks I appreciate it - let me know if you need any more info as I know your going to have a hard time fixing it if you can't reproduce it.

ghost commented 9 years ago

This package uses the same command (flambe build) to compile flambe projects. It seems that the problem is in your ST3/flambe settings. Try to reinstall ST3/flambe.

ghost commented 9 years ago

The last commit can fix this issue. Please test.

dougcharnley commented 9 years ago

I actually uninstalled and reinstalled the lot; Sublime, the Haxe plugin, Haxe itself, Flambé and now it seems to be working fine so I guess your last commit fixed it!

Thanks