Class JsHinter


  • class JsHinter
    extends java.lang.Object
    Launches jshint as an external process to parse JavaScript in an RSyntaxTextArea. Note that this is pretty inefficient, and was mainly done as a test of jshint integration. In the future, the external process should be launched in a separate thread.
    Version:
    1.0
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  JsHinter.MarkStrategy
      What exactly to mark as the error in the document, based on an error code from JSHint.
      (package private) static class  JsHinter.StreamReaderThread
      A thread dedicated to reading either the stdout or stderr stream of an external process.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private JsHinter​(JavaScriptParser parser, org.fife.ui.rsyntaxtextarea.RSyntaxDocument doc, org.fife.ui.rsyntaxtextarea.parser.DefaultParseResult result)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static JsHinter.MarkStrategy getMarkStrategy​(java.lang.String msgCode)  
      static void parse​(JavaScriptParser parser, org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea, org.fife.ui.rsyntaxtextarea.parser.DefaultParseResult result)  
      private void parseOutput​(org.fife.ui.rsyntaxtextarea.RSyntaxDocument doc, java.lang.String output)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • result

        private org.fife.ui.rsyntaxtextarea.parser.DefaultParseResult result
      • MARK_STRATEGIES

        private static final java.util.Map<java.lang.String,​JsHinter.MarkStrategy> MARK_STRATEGIES
    • Constructor Detail

      • JsHinter

        private JsHinter​(JavaScriptParser parser,
                         org.fife.ui.rsyntaxtextarea.RSyntaxDocument doc,
                         org.fife.ui.rsyntaxtextarea.parser.DefaultParseResult result)
    • Method Detail

      • parse

        public static void parse​(JavaScriptParser parser,
                                 org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea,
                                 org.fife.ui.rsyntaxtextarea.parser.DefaultParseResult result)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • parseOutput

        private void parseOutput​(org.fife.ui.rsyntaxtextarea.RSyntaxDocument doc,
                                 java.lang.String output)