예제 #1
0
        private void RunJsHint()
        {
            JsHintRunner.Reset();

            foreach (string file in files)
            {
                JsHintRunner runner = new JsHintRunner(file);
                runner.RunCompiler();
            }
        }
예제 #2
0
        private void RunJsHint()
        {
            JsHintRunner.Reset();

            foreach (string file in files)
            {
                JsHintRunner runner = new JsHintRunner(file);
                runner.RunCompiler();
            }
        }
        public JsHintProjectRunner(ITextDocument document)
        {
            _document = document;
            _document.FileActionOccurred += DocumentSavedHandler;
            _runner = new JsHintRunner(_document.FilePath);

            if (WESettings.GetBoolean(WESettings.Keys.EnableJsHint))
            {
                Dispatcher.CurrentDispatcher.BeginInvoke(new Action(() => _runner.RunCompiler()), DispatcherPriority.ApplicationIdle, null);
            }
        }
        public JsHintProjectRunner(ITextDocument document)
        {
            _document = document;
            _document.FileActionOccurred += DocumentSavedHandler;
            _runner = new JsHintRunner(_document.FilePath);

            if (WESettings.GetBoolean(WESettings.Keys.EnableJsHint))
            {
                Dispatcher.CurrentDispatcher.BeginInvoke(new Action(() => _runner.RunCompiler()), DispatcherPriority.ApplicationIdle, null);
            }
        }
        public static void RunOnAllFilesInProject()
        {
            string dir = ProjectHelpers.GetRootFolder();

            if (dir != null && Directory.Exists(dir))
            {
                foreach (string file in Directory.GetFiles(dir, "*.js", SearchOption.AllDirectories))
                {
                    JsHintRunner runner = new JsHintRunner(file);
                    runner.RunCompiler();
                }
            }
        }
        public static void RunOnAllFilesInProject()
        {
            string dir = ProjectHelpers.GetRootFolder();

            if (dir != null && Directory.Exists(dir))
            {
                foreach (string file in Directory.GetFiles(dir, "*.js", SearchOption.AllDirectories))
                {
                    JsHintRunner runner = new JsHintRunner(file);
                    runner.RunCompiler();
                }
            }
        }
        private void DocumentSavedHandler(object sender, TextDocumentFileActionEventArgs e)
        {
            if (!WESettings.GetBoolean(WESettings.Keys.EnableJsHint))
            {
                return;
            }

            ITextDocument document = (ITextDocument)sender;

            if (document.TextBuffer != null && !_isDisposed && e.FileActionType == FileActionTypes.ContentSavedToDisk)
            {
                Dispatcher.CurrentDispatcher.BeginInvoke(new Action(() => _runner.RunCompiler()), DispatcherPriority.ApplicationIdle, null);
            }
        }
        private void DocumentSavedHandler(object sender, TextDocumentFileActionEventArgs e)
        {
            if (!WESettings.GetBoolean(WESettings.Keys.EnableJsHint))
                return;

            ITextDocument document = (ITextDocument)sender;
            if (_isDisposed || document.TextBuffer == null)
                return;

            switch (e.FileActionType)
            {
                case FileActionTypes.ContentLoadedFromDisk:
                    break;
                case FileActionTypes.DocumentRenamed:
                    _runner.Dispose();
                    _runner = new JsHintRunner(_document.FilePath);

                    goto case FileActionTypes.ContentSavedToDisk;
                case FileActionTypes.ContentSavedToDisk:
                    Dispatcher.CurrentDispatcher.BeginInvoke(new Action(() => _runner.RunCompiler()), DispatcherPriority.ApplicationIdle, null);
                    break;
            }
        }