toggle() {
        let controller = require('./controller');
        console.log("func-static-checker was successfully toggled");
        atom.notifications.addInfo("Func static-checker is alive.");
        if (atom.workspace.getActiveTextEditor() == null) return;
        this.destroyNotifications();
        atom.workspace.getActiveTextEditor().buffer.onDidSave(() => {
          this.destroyNotifications();
            const path = require("path");
            this.destroyMarkers();
            const filePath = atom.workspace.getActiveTextEditor().buffer.file.getPath();
            if (path.extname(filePath) === ".func") { //in case of func language file do
                const fs = require("fs");
                fs.readFile(filePath, (err, data) => {
                    if (err) throw err;
                    console.log("success in reading file content");
                    controller.main(data);
                });
            }
        });
    }
/**
     * This function is called then the package is activated.
     * It sets that on save, the content of the file with '.func' suffix is loaded
     * and the static analysis process is triggered.
     */
This function is called then the package is activated.
It sets that on save, the content of the file with '.func' suffix is loaded
and the static analysis process is triggered.
This function is called then the package is activated . It sets that on save the content of the file with ' . func ' suffix is loaded and the static analysis process is triggered .
toggle() {
        let controller = require('./controller');
        console.log("func-static-checker was successfully toggled");
        atom.notifications.addInfo("Func static-checker is alive.");
        if (atom.workspace.getActiveTextEditor() == null) return;
        this.destroyNotifications();
        atom.workspace.getActiveTextEditor().buffer.onDidSave(() => {
          this.destroyNotifications();
            const path = require("path");
            this.destroyMarkers();
            const filePath = atom.workspace.getActiveTextEditor().buffer.file.getPath();
            if (path.extname(filePath) === ".func") { 
                const fs = require("fs");
                fs.readFile(filePath, (err, data) => {
                    if (err) throw err;
                    console.log("success in reading file content");
                    controller.main(data);
                });
            }
        });
    }
toggle ( ) { let controller = require ( './controller' ) ; console . log ( "func-static-checker was successfully toggled" ) ; atom . notifications . addInfo ( "Func static-checker is alive." ) ; if ( atom . workspace . getActiveTextEditor ( ) == null ) return ; this . destroyNotifications ( ) ; atom . workspace . getActiveTextEditor ( ) . buffer . onDidSave ( ( ) => { this . destroyNotifications ( ) ; const path = require ( "path" ) ; this . destroyMarkers ( ) ; const filePath = atom . workspace . getActiveTextEditor ( ) . buffer . file . getPath ( ) ; if ( path . extname ( filePath ) === ".func" ) { const fs = require ( "fs" ) ; fs . readFile ( filePath , ( err , data ) => { if ( err ) throw err ; console . log ( "success in reading file content" ) ; controller . main ( data ) ; } ) ; } } ) ; }
This function is called then the package is activated.
This function is called then the package is activated .
//in case of func language file do