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

Editor indentation (tab size) setting prevents running sketches #13

Closed
skilfullycurled opened this issue May 18, 2013 · 5 comments
Closed
Labels

Comments

@skilfullycurled
Copy link

Hi there!

First, thank you so much for creating this mode. I've been really looking forward to learning CS via PJS so it's just what the doctor ordered.

I have installed CS Mode using both the method you have described in the README as well as installing it via the native mode installer in the IDE. However, whenever I start the server, the webpage that opens only contains the following:

Parent Directory
Sat May 18 18:25:20 CDT 2013

The print out in the IDE displays the following in orange:

<from source>
org.mozilla.javascript.JavaScriptException: Error: Parse error on line 15: Unexpected 'INDENT'
    at org.mozilla.javascript.gen.c3._c0(<CoffeeScriptModeProcessing>:0)
    at org.mozilla.javascript.gen.c3.call(<CoffeeScriptModeProcessing>)
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
    at org.mozilla.javascript.gen.c3.call(<CoffeeScriptModeProcessing>)
    at org.mozilla.javascript.gen.c3.exec(<CoffeeScriptModeProcessing>)
    at org.mozilla.javascript.Context.evaluateString(Context.java:1104)
    at de.bezier.mode.coffeescript.compiler.CSCompiler.run(Unknown Source)
    at de.bezier.mode.coffeescript.compiler.CSCompiler.compile(Unknown Source)
    at de.bezier.mode.coffeescript.CoffeeScriptBuild.build(Unknown Source)
    at de.bezier.mode.coffeescript.CoffeeScriptBuild.export(Unknown Source)
    at de.bezier.mode.coffeescript.CoffeeScriptMode.handleExport(Unknown Source)
    at de.bezier.mode.coffeescript.CoffeeScriptEditor.handleExport(Unknown Source)
    at de.bezier.mode.coffeescript.CoffeeScriptEditor.serverStarted(Unknown Source)
    at de.bezier.mode.javascript.BasicServer.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:680)

I do not have this problem when starting the server in Javascript Mode. I am running the program using Processing 2.0b9 on OSX 10.7.5 with both Safari 5.1.7 and Firefox 20.0.

@skilfullycurled
Copy link
Author

Not sure if this will help in diagnosing the problem but if I remove current indentation which starts at 4 spaces (2 tabs) and replace it with indentation starting at 2 spaces (1 tab), then I am at least able to get the gray webpage with the title of the sketch and written in CoffeeScript etc. Also, the size function works. The error message changes too:

<from source>
org.mozilla.javascript.JavaScriptException: Error: Parse error on line 15: Unexpected 'INDENT'
    at org.mozilla.javascript.gen.c24._c0(<CoffeeScriptModeProcessing>:0)
    at org.mozilla.javascript.gen.c24.call(<CoffeeScriptModeProcessing>)
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
    at org.mozilla.javascript.gen.c24.call(<CoffeeScriptModeProcessing>)
    at org.mozilla.javascript.gen.c24.exec(<CoffeeScriptModeProcessing>)
    at org.mozilla.javascript.Context.evaluateString(Context.java:1104)
    at de.bezier.mode.coffeescript.compiler.CSCompiler.run(Unknown Source)
    at de.bezier.mode.coffeescript.compiler.CSCompiler.compile(Unknown Source)
    at de.bezier.mode.coffeescript.CoffeeScriptBuild.build(Unknown Source)
    at de.bezier.mode.coffeescript.CoffeeScriptBuild.export(Unknown Source)
    at de.bezier.mode.coffeescript.CoffeeScriptMode.handleExport(Unknown Source)
    at de.bezier.mode.coffeescript.CoffeeScriptEditor.handleExport(Unknown Source)
    at de.bezier.mode.coffeescript.CoffeeScriptEditor.handleStartServer(Unknown Source)
    at de.bezier.mode.coffeescript.CoffeeScriptEditor$11.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:708)
    at java.awt.EventQueue.access$400(EventQueue.java:82)
    at java.awt.EventQueue$2.run(EventQueue.java:669)
    at java.awt.EventQueue$2.run(EventQueue.java:667)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:678)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

@fjenett
Copy link
Owner

fjenett commented May 19, 2013

Yes, it's a problem i need to figure out.

You can get around it by setting your editor indentation to 4 which is what CS expects in my setting. To do so open "Preferences" in Processing, click the "Preference.txt" link (the file should open), close Processing (!), now change the line:

editor.tabs.size=2

from 2 to 4. Save, close, open Processing and try the examples that come with CS mode.

Did that work for you? ... i know i have to find a better way. :)

fjenett added a commit that referenced this issue May 19, 2013
…sketch tab size setting; plus added version and build to mode; plus readme update
@fjenett
Copy link
Owner

fjenett commented May 19, 2013

This should be fixed now. I'm not sure how fast the PDE picks up this change through the mode manager, so you can just download the "latest.zip" under "tags" here and replace the CS mode in you local installation with it.

Let me know how it goes ..

@fjenett fjenett closed this as completed May 19, 2013
@fjenett
Copy link
Owner

fjenett commented May 19, 2013

@REAS ... issue you reported via email should be fixed now.

@skilfullycurled
Copy link
Author

Success for me using both methods (change tabs in Preference.txt and reinstalling via mode installer). However, it only works for me in Firefox. In Safari 5.1.7 the webpage loads with the gray background, name of sketch etc, but the actual sketch does not load. I receive the following error in the console:

Conditionals1-compiled.js:25
TypeError: 'undefined' is not an object (evaluating '__defineGetter__("displayHeight",function(){return a.displayHeight})') 

Personally, I'm satisfied as it's no problem to use Firefox but there you have it none the less. Let me know if you'd like me to file a separate bug.

Thanks so much for responding so quickly. Super psyched to get started!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants