Atom Editor, hackable to it's core

Community Forums/Monkey2 Talk/Atom Editor, hackable to it's core

Shinkiro1(Posted 2016) [#1]
Hey guys,

just wanted to mention Atom: https://atom.io/
It's a text editor, build by the guys at github and it's completely open source.

The thing I found most special, is that you can open the Webdev-Tools INSIDE the editor! There is also a stylesheet that lets you customize the whole UI.
Docs: https://atom.io/docs/v1.3.2/

I think this could be made into a great IDE with some community effort.

ps: it's cross platform.


marksibly(Posted 2016) [#2]
Can you build it?


dmaz(Posted 2016) [#3]
I love atom... been using for quite awhile now for js and php... tried switching to mscode with the latest update and plug-in support but there's still a few packages that have yet to be duplicated there yet. That said... I like Mark's start with Ted2... and if he give us some good options hacking it, I think it could be very nice for Monkey2.

What makes atom great is its the plugin framework(js,html,css) and the registration/browsing website for it. create you plugin, park it on github, register it... then, straight from the ide, browse and install them. (The search is a bit messed up though.. it needs to tell you when it gets fuzzy)


taumel(Posted 2016) [#4]
I love Sublime, like the best text editor ever made for my needs, it's accessible, powerful, tasty and fast.

Atom looks cute but has some cons like performance, stability, quirks, sizes, ...

Sublime on OS X gives me a feeling of being at the right place like Asm-One was able to on the Amiga.


Shinkiro1(Posted 2016) [#5]
> Can you build it?
Yes, once I start using monkey2 it would be high on my priority list.

I have played around a bit and managed to insert a top bar, style it, to give it more of an IDE feel.
(it doesn't compile anything though, thats the next step)


For those interested, I just altered the init script and the global stylesheet.
You can access those clicking on Atom in the Menubar, then chose "Open Your Init Script" and "Open Your Stylesheet".

script
# monkeybar
header = document.createElement('div')
header.className = 'monkeybar'
header.innerHTML = '
<button class="run">Run</button>
<button class="stop">Stop</button>
<select class="target">
<option>Debug</option>
<option>Release</option>
<select>
'

first = document.body.children[0]
document.body.insertBefore(header, first)

run = header.getElementsByClassName('run')[0]
stop = header.getElementsByClassName('stop')[0]
target = header.getElementsByClassName('target')[0]

run.onclick = () ->
	alert('run, mode: ' + target.value)

stop.onclick = () ->
	alert('stop')



style
.monkeybar {
	display: block;
	height: 48px;
}

.monkeybar button,
.monkeybar select {
	user-select:none;
	border: none;
	cursor: pointer;
	vertical-align:middle;
	white-space:nowrap;
	line-height:1;
	text-decoration:none;
	outline: none;
	-webkit-user-select:none;
	-webkit-font-smoothing:antialiased;
}

.monkeybar button,
.monkeybar select {
	background-color: transparent;
	border: 1px solid;
	border-radius: 3px;
    font-family: Arial;
    font-size: 11px;
    line-height: 11px;
	height: 28px;
	padding: 0;
	margin-right: 8px;
	margin-top: 10px;
	width: 60px;
}

.monkeybar .run {
	margin-left: 12px;
}

.monkeybar .target {
	position: absolute;
	right: 4px;
	width: auto;
}



wiebow(Posted 2016) [#6]
Shin, if you need a language file, I have a blitzmax grammar file for atom that is easily modified to monkey2.


Shinkiro1(Posted 2016) [#7]
@wiebow
That would be awesome, would save me a lot of work. Can you upload the whole package?

Btw, how do you execute bmx, from command line or from Atom?
Because I haven't managed to run shell commands via CoffeeScript in Atom.
I just know that one should be able to to it with node child-processes "spawn".


wiebow(Posted 2016) [#8]
I haven't gotten to that stage yet. I was happy to have the file converted to the coffee thingy. :) Shall I mail to you what I have? Can I use the email in your account profile?


wiebow(Posted 2016) [#9]
NM, here is the public dropbox link to the package. There is probably stuff in there you don't need or want. I cooked this up late last night and then I was done for the day.

https://dl.dropboxusercontent.com/u/12644619/blitzmax.zip


wiebow(Posted 2016) [#10]
I think I will stick with Sublime Text though... It's quick and I have the build tools ready, which can be easily modified for monkey2 I think. I'll give this a go later on.


Nobuyuki(Posted 2016) [#11]
Hi, just wanted to throw in that Visual Studio Code is also a pretty good IDE and is a fork of Atom Electron. May not have all the features that people who are more familiar with Sublime are used to (I don't know what those are!) but it does have Intellisense, which is something VS people should be very used to, and advanced autocomplete really is a killer feature that I think also sold many people on Jungle compared to the other current Monkey IDEs available :)

I have still yet to try ted2.... Kinda wish someone would post a screenshot or something!


skid(Posted 2016) [#12]
I find VS Code quite mysterious, and every now and then it does something cleverer than the previous day.

I suspect it is watching me.

I have started using it's F5 key to kick off my build using following hackery:

build.js
var child_process=require('child_process');

var build="./buildmac.sh"
var run="nitro load ./_test1.nitro"

console.log(build)
console.log("current dir:"+__dirname)

child_process.exec( build,["shell"], function (error, stdout, stderr) {
	console.log(stdout)
	if (error==null){
		child_process.exec( run,[], function (error, stdout, stderr) {
			console.log(stdout);
			console.log("error:"+error);		
		});
	}else{
		console.log("error:"+error);		
	}
	process.exit();
});



wiebow(Posted 2016) [#13]
With Atom, I've found the Process Palette to be ideal to run external commands: https://atom.io/packages/process-palette

Here is an example config to run bmk makemods from Atom. It should be relatively easy now to run all compile and run commands from Atom.


{
"namespace" : "BlitzMax",
"action" : "Build Mods",
"inputDialogs" : [
{
"variableName" : "modName",
"message" : "Which Module?",
"initialInput" : ""
}
],
"command" : "bmk makemods -a {modName}",
"outputTarget" : "panel",
"autoShowOutput" : true,
"successOutput" : "{stdout}",
"errorOutput" : "{stdout}\n{stderr}"
},


Shinkiro1(Posted 2016) [#14]
@wiebow
That looks really ideal for compiling, you can even specify a keybinding.


dragon(Posted 2016) [#15]
STOP!

here is a editor like Atom or Brackets, but it was designed for GAMES (!!!):
(see video)

http://lighttable.com/

Includig Source Code (MIT !)

I never used it, but before you select a main editor, look to this editor first...


nullterm(Posted 2016) [#16]
@dragon, played with it a bit doing a quick dabble with HTML5 in Light Table (just straight up .html and .js coding), it's pretty cool! I have it so I'm editing the HTML on the left half, and browser on the right half. Just have to hit Ctrl+Enter and it re-runs the page/script on the right, very quickly.

If someone figured out how to hookup the MonkeyX command line so you could edit your .monkey, hit Ctrl+Enter, and see the updated HTML5 game in a second that'd be pretty boss.


wiebow(Posted 2016) [#17]
I am working on a package for Sublime Text, as I will be sticking with that for the forseeable future. Go the language working, now getting the build systems up and running. Shouldn't be too hard.