Class JavaScriptResolver

    • Constructor Detail

      • JavaScriptResolver

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

      • 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​(java.lang.String text)
                                                  throws java.io.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:
        java.io.IOException
      • compileText

        public abstract JavaScriptType compileText​(java.lang.String text)
                                            throws java.io.IOException
        Compiles Text and resolves the type. e.g. "Hello World".length; //resolve as a Number
        Parameters:
        text - to compile and resolve
        Throws:
        java.io.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 java.lang.String getLookupText​(JSMethodData method,
                                                       java.lang.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 java.lang.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.