Atom, ide-dlang and.. a better doc for beginners ?

ffred ffred at gmx.us
Sun Feb 9 16:04:32 UTC 2020


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;


More information about the Digitalmars-d-ide mailing list