Class JavaScriptResolver

java.lang.Object
org.fife.rsta.ac.js.resolver.JavaScriptResolver
Direct Known Subclasses:
JavaScriptCompletionResolver

public abstract class JavaScriptResolver extends Object
  • Field Details

  • Constructor Details

    • JavaScriptResolver

      public JavaScriptResolver(SourceCompletionProvider provider)
      Base JavaScriptResolver
      Parameters:
      provider - SourceCompletionProvider
  • Method Details

    • resolveNode

      public abstract TypeDeclaration resolveNode(org.mozilla.javascript.ast.AstNode node)
      Resolve node type to TypeDeclaration. Called instead of #compileText(String text) when document is already parsed
      Parameters:
      node - AstNode to resolve
      Returns:
      TypeDeclaration for node or null if not found.
    • resolveParamNode

      public abstract TypeDeclaration resolveParamNode(String text) throws IOException
      Resolve node type to TypeDeclaration. Called instead of #compileText(String text) when document is already parsed
      Parameters:
      text - The type of node to resolve
      Returns:
      TypeDeclaration for node or null if not found.
      Throws:
      IOException
    • compileText

      public abstract JavaScriptType compileText(String text) throws IOException
      Compiles Text and resolves the type. e.g. "Hello World".length; //resolve as a Number
      Parameters:
      text - to compile and resolve
      Throws:
      IOException
    • resolveNativeType

      protected abstract TypeDeclaration resolveNativeType(org.mozilla.javascript.ast.AstNode node)
      Resolve node type to TypeDeclaration
      Parameters:
      node - AstNode to resolve
      Returns:
      TypeDeclaration for node or null if not found.
    • getLookupText

      public abstract String getLookupText(JSMethodData method, String name)
      Get lookup string for function completions
      Parameters:
      method - JSMethodData holding method information
      name - name of method
      Returns:
      The lookup text.
    • getFunctionNameLookup

      public abstract String getFunctionNameLookup(org.mozilla.javascript.ast.FunctionCall call, SourceCompletionProvider provider)
      Returns same string format as getLookupText(JSMethodData, String) but from AstNode Function
      Parameters:
      call -
      provider -
      Returns:
      The function name.