'use strict';
var path = require('path');
var vscode = require('vscode');
var vscode_languageclient = require('vscode-languageclient');
function activate(context) {
    console.log("Activated");
    var serverModule = context.asAbsolutePath(path.join('server', 'server.js'));
    var debugOptions = { execArgv: ["--nolazy", "--debug=6004"] };
    var serverOptions = {
        run: { module: serverModule, transport: vscode_languageclient.TransportKind.ipc },
        debug: { module: serverModule, transport: vscode_languageclient.TransportKind.ipc, options: debugOptions }
    };
    // Options to control the language client
    var clientOptions = {
        // Register the server for plain text documents
        documentSelector: ['javascript'],
        synchronize: {
            // Synchronize the setting section 'languageServerExample' to the server
            configurationSection: 'orionToolsServer',
            // Notify the server about file changes to '.clientrc files contain in the workspace
            fileEvents: vscode.workspace.createFileSystemWatcher('**/.clientrc')
        }
    };
    // Create the language client and start the client.
    var client = new vscode_languageclient.LanguageClient('orion-tools-server', serverOptions, clientOptions);
    var disposable = client.start();
    // Push the disposable to the context's subscriptions so that the 
    // client can be deactivated on extension deactivation
    context.subscriptions.push(disposable);
    
    var bugsHover = [];
    var firstTime = true;
    var statusBarE = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
    var statusBarW = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
    var lintWindow = vscode.window.createOutputChannel("Orion Linter");
    
    context.subscriptions.push(statusBarE);
    context.subscriptions.push(statusBarW);
    context.subscriptions.push(lintWindow);

    client.onNotification({method:"testNotification"}, function(output){
        var status = output.pop();
        var tempE = status.errorNum <= 1 ? "JSError: " : "JSErrors: "; 
        var tempW = status.warningNum <= 1 ? "JSWarning: " : "JSWarnings: ";
        var tempIconE = status.errorNum === 0 ? "$(check) " : "$(x) ";
        var tempIconW = status.warningNum === 0 ? "$(check) " : "$(alert) ";
        statusBarE.text = tempIconE + tempE + status.errorNum;
        statusBarW.text = tempIconW + tempW + status.warningNum;
        
        var messageToShow = "";
        for(var i = 0; i < output.length; i++){
            var problem = output[i];
            var tempStart = new vscode.Position(problem.range.start.line, problem.range.start.character);
            var tempEnd = new vscode.Position(problem.range.end.line, problem.range.end.character);
            bugsHover.push({start: tempStart, end:tempEnd, hover: new vscode.Hover(problem.message)});
            messageToShow = messageToShow + tempStart.line + ":" + tempStart.character + " " + problem.message + "\n";
        };
        // console.log((status.errorNum + status.warningNum) === 0);
        if ((status.errorNum + status.warningNum) === 0 && !firstTime){
            lintWindow.clear();
            lintWindow.append("No Errors and Warnings");
            // lintWindow.hide(); // This method does not work as expected: it is not hiding the outputchannel
            
        } else if ((status.errorNum + status.warningNum) > 0 ) {
            lintWindow.clear();
            lintWindow.show(true);
            setTimeout(function() {
                lintWindow.append(messageToShow);
            }, 500);
            
            
        }
        
        bugsHover = [];
        if (firstTime){  
            statusBarE.color = "#faebd7";
            statusBarW.color = "#faebd7";
            statusBarE.show();
            statusBarW.show();statusBarE.color = "#faebd7";
            statusBarE.color = "#faebd7";
            statusBarE.show();
            statusBarW.show();
            var disposable = vscode.languages.registerHoverProvider("javascript", {
                provideHover: function (document, position, token) {
                    for (var index = 0; index < bugsHover.length; index++) {
                        var hover = bugsHover[index];
                        if (position.isAfterOrEqual(hover.start) && position.isBeforeOrEqual(hover.end)){
                            return hover.hover;
                        }
                    }
                    return null;
                }
            }); 
            context.subscriptions.push(disposable);
            firstTime = false;
        }
    });
    

}
exports.activate = activate;
//# sourceMappingURL=extension.js.map
@@ -1920,17 +1920,45 @@
 indow);%0A
+    %0A    var lastJob = null;
 %0A
-
     clie
@@ -2523,16 +2523,656 @@
 w = %22%22;%0A
+        lintWindow.show(true);%0A        if (lastJob !== null) %7B%0A            clearTimeout(lastJob);%0A        %7D%0A        output.sort(function(a, b)%7B%0A           if (a.range.start.line %3E b.range.start.line)%7B%0A               return 1;%0A           %7D else if (a.range.start.line === b.range.start.line)%7B%0A               if(a.range.start.character %3E b.range.start.character)%7B%0A                   return 1%0A               %7D else if (a.range.start.character === b.range.start.character)%7B%0A                   return 0%0A               %7D else %7B%0A                   return -1;%0A               %7D%0A           %7D else %7B%0A               return -1;%0A           %7D%0A        %7D);%0A
         
@@ -3600,16 +3600,29 @@
 ToShow +
+ %22%5BORION%5D %22 +
  tempSta
@@ -3669,25 +3669,28 @@
 %22 + problem.
-m
+rawM
 essage + %22%5Cn
@@ -4139,97 +4139,76 @@
    l
-intWindow.clear();%0A            lintWindow.show(true);%0A            setTimeout(function() %7B
+astJob = setTimeout(function() %7B%0A                lintWindow.clear();
 %0A   
@@ -4250,24 +4250,24 @@
 ageToShow);%0A
+
             
@@ -4279,34 +4279,8 @@
 0);%0A
-            %0A            %0A
     

Fix the bug where outputchannel message may be repeated when user input too fast.