Eclipse haml/sass editing + html /css generation - text-editor

I've been playing with haml and sass and generating a flat site with staticmatic from the command line.
Has anyone been using an ide for this?
I have the Apatana studio (RadRails) plugin installed and it has haml & sass highlighting out of the box. For this site I just want a lightweight script project (no rails).
What type of project would I use, and how would i add something so i could for example, right click the project folder in order to run
staticmatic build [my-project]
(or other) to generate the site from the haml + sass?
I like staticmatic as I can use ruby libraries as helpers.
Happy to take suggestions about any editor. But i am also keen to stick with one editor for everything. (also WTB auto complete).
Cheers

You can run rake tasks from the RadRails IDE, though I didn't manage to get it work. Ruby is probably right choice for the project type. I don't like IDEs because they complicate and slow things down. So my choice is normally Textmate + terminal.
Take a look at Rakefile in this project: https://github.com/adamstac/staticmatic-bootstrap

This isn't exactly what you're asking for...but take a look at a tiny script that I wrote. It will watch directories of your choosing for changes in SCSS and HAML and compile them to html and css. You could make some minor edits to watch.rb if desired, run this in a terminal, and have the site generated without even having to run a command.
PS - if you decide to try this out, you'll need the fssm gem from github or rubygems.org.

A Ruby or Web project type would be most fitting, though I don't think it would matter which in this case.
You can achieve custom commands a number of ways...
You can write up a Rake task in the project Rakefile as Heikki suggested, and then right click and use the Rake menu (as of Studio 3.0.2) to launch that task, or run it inside the embedded Terminal view.
You can write/edit a custom ruble and add a command for launching staticmatic. See http://wiki.appcelerator.org/display/tis/Executing+an+External+Command
You can go the Eclipse route and create an "External Tool Launch configuration" under Run > External Tools. External Tools configuration... > Program. There you can set up a launch to execute some program (say the ruby interpreter or staticmatic script itself) and pass in the argument. Then you can use the run drop-down menu.

Related

Compiling pascal program in Visual Studio Code for Linux

Recently, I switched my OS to Ubuntu. I just started with collage and I have to learn pascal for my finals. But a problem occurred.
I installed Visual Studio Code and Pascal extension for it, but I am unable to run even a simple Hello World code. I wrote code, it saved automatically as .pas, but when I enter debug & run option in VSC it displays a message that says 'Open a file which can be debugged or run.', followed by 'debug' and 'run' buttons that I am unable to click and another message that says 'To further configure Debug and Run create a launch.json file.'
I am not even sure am I supposed to post questions such as this one on stackoverflow, but I sincerelly hope that someone could give me a hint on what to do. Solve this within Visual Studio Code or switch to another IDE (and which one would you recommend for Linux user) and pretend that nothing happened?
Thanks in advance.
I know this isn't an answer to "how to debug with pascal with vscode" but, perhaps you would find it easier to just use FPC / Lazarus (IDE) to do your work. While it doesn't have a dark theme, contrary to popular belief, that's not necessary to program.
The IDE is feature packed and allows for full code completion, debugging, etc... (everything you really need to do the work for school).
Additionally, you can use this open source tool to install everything you need for your platform in just a few button clicks (also allows for installing common library packages)
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases
download release for your OS
under "FPC Version" & "Lazarus Version" select trunkgit (or stable for an older version)
click the "Install/Update FPC + Lazarus" button
Have you Installed Pascal extension which is available for code to smoothly run pascal code.
If you haven't then try installing this extension using,
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
ext install alefragnani.pascal
You can always check,
https://marketplace.visualstudio.com/items?itemName=alefragnani.pascal
to install and configure pascal in vscode.
I will direct you to the debugging page from the Visual Studio Code documentation that details how to use the debugger and configure a launch.json file. VSCode is a generic IDE so you need to give it some information about your project before it knows how to run the debugger. This is what launch.json is for.
If I could make a suggestion. When you're learning how to program, it's best to start with the basics. Write a small program in a text editor (VSCode is fine, or Vim, or Nano, or Notepad, or whatever). Save the file. Compile and run the program on the command line.
Once you put an IDE in the mix, you have to learn how to use that as well. If you're stuck on both parts, it can be hard to make progress. That said, it's good to learn how to use the IDE, and you should spend some time reading the documentation and working through some of the examples. It takes some time, but it will pay you back a thousand times when you can work more quickly.

Is it possible to use VSCode language-server-protocol engine along with the Vim or NeoVim?

I have tried different code-analysis engines and tools (like tern_for_vim) for Vim, but they do not provide such a great autocompletion, goto and rename functionality as in VSCode.
As I know VSCode uses language-server-protocol technology to provide IDE functionality. So here is my question:
Is it possible to use VSCode language-server-protocol engine inside the Vim or NeoVim? In other words, it is possible to provide the same good quality of IDE-like functionality as VSCode do?
I have tried javascript-typescript-langserver with deoplete.vim, but the quality of autocompletion and goto-declaration was bad.
Yes, you can use it via coc.nvim installing which is a fork of VSCode. You then apply one of its packages for a specific language eg coc-python.
This is the installation guide for coc.nvim. You then need to install the language package with this command in (Neo)Vim:
:CocInstall coc-python
You can then use the default VS Code completion engine immediately (jedi) or upgrade to what will become its successor, MSPLS:
For MSPLS run the command :CocConfig and enter this in to the file which is opened:
{
"python.jediEnabled": false
}
Then run :CocRestart
There are other other engines like coc.nvim such as YouCompleteMe. They all have small variations / tailoring for specific languages.
In theory, yes. http://langserver.org/ provides a list of editor plugins and language server implementations.
With packages like https://github.com/autozimu/LanguageClient-neovim (which is for neovim, there are others for both vim and neovim) you can use language servers in neovim.
However, some implementations are tied to the way it works within vscode (like haxe lsp), so it may be a little hard to get it working. Javascript should be better integrated, but I didn't try it myself.

How to use J2ME sdk 3.0 with command line

i'm trying to create J2ME app with J2ME sdk 3.0 with command line and i'm confused on how to compile and preverify my source code.can anyone show me how to please ?
Pretty much all IDE's allow you to run and compile the code inside them, rather than having a separate pipeline to edit the text files, compile them and run them.
For example, in IDEA you have a "Run" menu that you can use to access all those functionalities.
I suggest that, especially if you are inexperienced, you switch from a "manual" process using separate tools (text editor, compiler, runner) to a more unified one, that will sort out most of the details for you letting you focus on the writing of the code / logic.

Does Intellij automatically update classes you've made changes to while in Debug mode?

I know that for css, html, and gsp files you can just refresh the browser without having to rebuild the application in order to see your updated changes. If you're stepping through code in debug mode, and make a change for a groovy or class file, do you have to rebuild the application in order to see the change?
IntelliJ does not update the classes in your running application automatically. You need to compile them manually (this will not be a full project rebuild - IntelliJ will build the project incrementally and compile only the changed classes and the code that depends on them), and then IntelliJ will offer you to reload the changes (which may fail if the changes you made aren't supported by the Java hotswap).
Note that some Web frameworks may be able to reload the changed classes automatically, independently of whether you're running your code from IntelliJ or not.
Say you're stopped on a break point, and want to edit the source code of the method you're in. Make the edit, save it, then run > Reload Changed Classes. Then, in the debugger controls, Drop Frame. Without dropping the frame, you won't execute the your newly recompiled method body.
By default, there's no keybindings for these 2 commands, but you can create them via the KeyMap in the settings (ctrl + alt + s). Even better, you can make a macro that will execute both these commands for you.
I wish it was easier and automatic, like in eclipse, but oh well.

what's the correct way to develop at the repl using groovy

I'm new to working with Groovy. I'm used to Python and Clojure where I could do most of my coding at the REPL. I'm trying to do the same with Groovy, but I'm not sure if I've found a way that matches up.
The Groovy Eclipse plugin provides a couple of interactive modes but neither seems to cut it for me.
The first way loads a Groovy script into the Groovy Console. The console appears to me as a weak editor without any of the amenities of Eclipse, such as tab completion. There are some nice introspection capabilities, but it doesn't really feel like interactive development.
The second way starts a Groovy Shell in the console tab of Eclipse. So this gives me the REPL I want, but it feels really clunky running in Eclipse. There's no tab completion. And I have to type "go" after entering in code I want it to evaluate.
The Groovy Eclipse plugin wasn't cutting it, but the Groovy shell included in the stand alone distribution of Groovy works great. It does tab completion (except for classnames), and it evaluates code right after you type it in. It's the one that documented here.
I dug a little deeper into the differences between the REPL that runs in Eclipse and the one that runs from the stand alone distribution using the groovysh script. The one from Eclipse is an instance of 'groovy.ui.InteractiveShell' and the one from the groovysh script is and instance of 'org.codehaus.groovy.tools.shell.Main'. And I found the following code in the groovysh script
if [ "x$OLDSHELL" != "x" ]; then </br>
startGroovy groovy.ui.InteractiveShell "$#"
else
startGroovy org.codehaus.groovy.tools.shell.Main "$#"
fi
The above code and this thread tell me groovy.ui.InteractiveShell is going away.
Perhaps there are plans to integrate the new shell more tightly into Eclipse in the future?
Anyways, I was able to hack it out so that I could call the groovysh script with the classpaths needed for working with code from my Eclipse project. Now I can develop happily at the REPL. But it's messy and I'm using the jars in the Groovy stand-alone distribution for starting up Groovy instead of the ones used my Eclipse project. I figure there might be a better way.
Has anyone found a good way integrate the REPL the gets started from the groovysh script and a project in Eclipse. Or have you found an overall better way to develop with a Groovy REPL?
Not much effort has gone into integrating groovysh into groovy-eclipse. The main reason is that groovysh uses all sorts of non-display characters to specify things like color, completion, and caret placement. The Eclipse console does not handle these and spits them out as garbage. Furthermore, the current shell implementation from Groovy does not run very well on windows when inside Eclipse. There are some incompatibilities with the jline library.
If we were to do some integration with groovysh, it would be a large undertaking and a large rewrite. I am not against doing something like this, but so far no one has asked for the feature (you are the first that I am aware of).
What is wrong with running groovysh from the command line while you work in Eclipse? (This is not a rhetorical question, I really do want to know what features are missing.) This is the technique that most Groovy developers use when working inside of Eclipse.
I've found a good way to launch the groovysh in ITerm with a custom classpath from Eclipse. It is specific to OSX and ITerm, but you could modify it to call a different shell depending on how you pass a string to the shell for it to execute.
Setup an external tool in Eclipse that calls a script. The script uses ITerm's applescript commands to open a new ITerm window and executes the command passed in.
The text of the arguments box in the image below:
"cd ${project_loc} && /Users/harishtella/Developer/groovy/groovy-1.8.6/bin/groovysh -cp ${project_loc}/bin:${project_loc}/src:${project_loc}/lib/*:${project_loc}/test"
The ${project_loc} variable is available when defining new external tools. See this for more info.
Be sure to uncheck the "allocate console" box in the "Common" tab
here's is the body of the "iterm-with-command" script
#!/bin/sh
# open a new iterm window and runs all the arguments passed in as a command
# in iterm
osascript <<-eof
tell application "iTerm"
set myterm to (make new terminal)
tell myterm
launch session "Default session"
tell the last session
set name to "console"
write text "$#"
end tell
end tell
end tell
eof

Resources