Thread overview
Atom, ide-dlang and.. a better doc for beginners ?
Feb 09
ffred
Feb 09
ffred
Feb 09
ffred
Feb 10
ffred
Feb 11
ffred
February 09
Hello all,
I'm new to D and looking to set a development environment for it that suits my taste.
I already used VScode when learning Go, but I'm not a big fan of it. so for D I'm trying to use Atom and with ide-dlang it could be fine for me.
I don't mean bad, it's good work and I have to say thank you for that, but the documentation available is not really complete or beginner friendly.

it's working, I can build my first example, but I don't understand how to go further. actually I can build, but how to build & run or at least be able to run after having build.
should I create new settings in the "build" package or install another package in witch I could set commands to run in a terminal (like I did in VScode).

the ide-dlang package's webpage just mentions at the bottom of the page that atom-ide-ui and build packages should also be installed, but doesn't say what need or could be done with them and there's not much info on how to use the whole system.

I searched online, but can't find any page about Dlang with Atom & ide-dlang..

is there someone else here using it who can at least tell me how he/she is using it and if I should use some more packages..?
thanks.
ffred

February 09
well, I found the file "build-provider.js" in the ide-dlang installation directory. it seems that it's the setting for the "build" package and it only contains a 'build' function.
so I probably should look what I can learn about the 'build' package and if I can add more functionality in this file...
February 09
me again, sorry to reply to myself, but in case it could be of any help for another beginner.
I don't know javascript, so I did it simply, but I now have a 'build' and a 'run' working options that I can choose with F7.

here is my modified 'build-provider.js' (don't know how to format code in here, sorry..) :

const path = require('path');
const glob = require('glob');
const util = require('./util');

class DubBuildProvider {
    constructor(cwd) {
        this.cwd = cwd;
    }

    getNiceName() {
        return 'Dub';
    }

    isEligible() {
        return glob.sync(path.join(this.cwd, 'dub.{json,sdl}')).length > 0;
    }

    settings() {
        let args1 = ['build'];
        let args2 = ['run'];
		
        if (util.compiler === 'dmd.exe') {
            args1.push('--arch=x86_mscoff');
	    args2.push('--arch=x86_mscoff');
        }

        return [
	  {
	     name: 'Build',
	     exec: util.dub,
	      cmd: util.dub,
	     args: args1,
	       sh: false,
	      cwd: '{PROJECT_PATH}'
          },
	  {
             name: 'Run',
	     exec: util.dub,
	      cmd: util.dub,
	     args: args2,
	       sh: false,
	      cwd: '{PROJECT_PATH}'
          }		
	];
    }
}

module.exports = DubBuildProvider;
February 10
last comment about that, for other beginners like me..
it was the simplest way right now for me to modify a file from ide-dlang package, but the good way would be to create new settings for the 'build' package (or even create a build provider). I will eventually do that, but I need to learn more how all that works before.
February 11
the package ide-dlang for Atom has been updated by its author.
there's now a 'build', 'run' & 'test' functions included (F7).  :-)
https://atom.io/packages/ide-dlang