Running Coffeescript snippets directly in Aptana Studio 3 - coffeescript

Right now I am playing around with CoffeeScript and I loved to see that Aptana now supports it natively. But I am unable to "Run" the Script directly in Aptana to get the results printed to the built-in console.
When i click Ctrl+R as described in the CoffeeScript Bundle I only get a git-help information printed in the console.
For Example
script.coffee
console.log "Hello Coffee"
When I run it through the terminal by typing
$coffee script.coffee
I get the result printed perfectly.
I can't find any documentation or hints for solving this problem.
Am I missing something ?

There is an open ticket here and a brief discussion here.
If this is your issue (look at the console if you get this 'line 3: pre: command not found' error), then a temporary solution I found is to edit Aptana Rubles/coffeescript.ruble/commands/run.rb (located in ~/Documents in a linux installation) and remove ' | pre' from line 11.
After that, restart Aptana or reload the Coffeescript bundle from Bundles View (right-click on it->reload), select the text (will work only if there is selected text) and press Ctrl-R + 1. You should now see a new html file with the 'Hello Coffee' in it.
Hope this helps.

Related

Pylance does not allow me to navigate to the source code, bringing me to the .pyi stub instead

I am using pylance for vs code and it works really nice, except that since I use it, when I try to check code from an installed library, I can get only to the stub, I think generated by pylance.
For example, the information shown about the function:
Or, crtl + click on the function brings me to the .pyi stub, which at
~/.vscode-server/extensions/ms-python.vscode-pylance-2020.11.0/dist/bundled/stubs/pandas/io/parsers.pyi
I can't find a way to navigate to the actual code (of pandas in this case).
If I deactivate Pylance and use Microsoft as language server by setting "python.languageServer": "Microsoft", in setting.json, the navigation to the library works fine.
Is it possible to navigate to the actual code with pylance active?
OS: Ubuntu 18.04
Visual Studio Code: Version: 1.50.1
Pylance: v2020.11.0
I had the same issue and realized I was using Docker. So I set up virtualenv and installed Django using pip.
Then I switched Python interpreter in the bottom-left corner of VS Code and it started working.
I know this is a specific case but I hope this answer helps someone in the same problem.
Let's remove ~/.vscode-server/extensions/ms-python.vscode-pylance-2020.11.0/dist/bundled/stubs/pandas
Then reload vscode
You can navigate to the references by right-clicking on the symbol and selecting "Go to References".
Also, ensure that you have a Python interpreter configured for the script where pandas is installed.
You can select an interpreter by opening Command Palette from the View menu and typing in "Python: Select Interpreter" and following through the dialog.
When you have that set, you should see two references when you Ctrl + click on a symbol: one for the stub and the other from the library.

Can't find pydev console prompt in eclipse

So I'm working on two machines and they both have Eclipse and Pydev on them. The first machine has a console that has a prompt where I can type in and execute commands when I run on:
The second machine doesn't have the same prompt and I can't figure out how to get it:
I've been looking around online and the closest piece of advice I found is that I need to find the console button on the menu bar next to the tabs and select to show/hide the prompt, but as you can see it's doesn't show up on the second machine. Does anyone know how to I can get the console prompt on the second machine?
Found the issue. I was using PyDev 2.8.2 which didn't support the prompt, I updated to 4.5.4 (higher versions don't show up in my eclipse) and now I'm able to see it.

Make eclipse_debug.py work

(In Windows 10, I have installed ...\AppData\Local\Enthought\Canopy that includes Python 2.7, %PATH% points to Canopy)
I have seen this link, and want to make interactively debug Python code running in PyXLL work via that eclipse_debug.py.
So I have done the following:
1) erase PYTHONPATH in the control panel of Windows (as a result, echo %PYTHONPATH% returns %PYTHONPATH%).
2) modify only the first line of eclipse_debug.py to be eclipse_roots = [r"C:\my_path_to\eclipse"].
3) add eclipse_debug.py to pyxll.cfg
4) define a function hello
5) launch debug servier in eclipse, and then launch Excel, and then reload PyXLL
Here is a screenshot:
1) So, it shows that the function hello does work.
2) However, I don't see any excel menu item related to debugger, whereas their link promises This module adds an Excel menu item to attach to the PyDev debugger, and also an Excel macro so that this script can be run outside of Excel and call PyXLL to attach to the PyDev debugger. In other words, I don't see how interactive debug is enabled here.
Could anyone tell me what this eclipse_debug.py supposed to do?
Well, from what I can tell by looking at it, eclipse_debug.py adds the PyDev Remote Debugger (http://www.pydev.org/manual_adv_remote_debugger.html) to the PYTHONPATH and starts it.
Now, how do you make a Python script such as eclipse_debug.py appear as a menu in PyXLL is something I'm not familiar with.
The most likely cause is that it's looking for pydevd but is unable to find it on your python path or where it's looking under the eclipse root. If that's the case there will be some output in the pyxll log file and that will be why the menu item is not appearing.
You should check the log file for errors, and hopefully that will tell you what is going wrong.

VSCode plugin VSCode-PHP-Format not working

I start using vscode less than a month. Please forgive me if this is a dump question.
OS: OS X 10.11.3
VSCode: 0.10.6
Plugin: VSCode-PHP-Format (download via git clone)
Extension path: ~/.vscode/extensions/VSCode-PHP-Format
I restarted VSCode, open php files, but do not see "Format Code" on the right click menu.
Any idea how to debug this? Right now I don't even know if the plugin load correctly.
With tips from Tobiah Zarlez, I found the "Toggle Developer Tools" in VSCode.
It is shown in the console the plugin cannot find js-beautify.
Solution
Inside ~/.vscode/extensions/VSCode-PHP-Format, run
npm install
It will pull in js-beautify. Then restart VSCode.
I am on my phone and not able to double check to see if it is there, but I'd recommend installing from the visual studio marketplace to insure the plug in is installed correctly. You can do so by hitting CTRL+SHIFT+P and typing "install extension"
Beyond that, a quick glance at the code the plug in should be activated when you open a php file... but since this is a third party plugin, I can't speak to if it actually works or not.
(Again, on phone so can't test)
What you could do is modify the extension.js file to add a "console.log ("hello world")" to the activate function. Them check the log to see if the plug in is installed correctly.
I saw you weren't the only person to complain about the plug in not working though. If I were you, I would continue to try and contact the creator

eclipse debug perl curses

I am writing a Perl program that uses curses for output and move the cursor, and color characters. Previously, when I was working under windows I use Komodo it was able to run an external console.
Now I work in Linux environment and use eclipse + epic. If you try to just run the script, it uses the internal console eclipse, which is very cut. You can just run the script using external tool, but I'm interested to debug using external console window. Is this possible?
Unfortunately, use of a File and /dev/pty/1 does not help in solving my problem.
The fact is that in this case it is impossible to get the characters introduced in the console through curses getch(). Always returned 1 instead code of pressed key.
Here is an answer that will take you most of the way (based on post #6 of: http://ubuntuforums.org/showthread.php?t=743131, although since then, in the "Indigo" and "Juno" versions of Eclipse, things have changed somewhat, and this answer is up to date):
Go to "Run -> Debug configurations". Click on the (fourth) "Common" tab. Go to the third frame from top, and there, check-mark the checkbox which says: "File". Enter the file name of the console window you want your output in.