function validateRequestParams(type, params) {
        var validatedParams = null;

        params = params || {};

        //Don't validate if the formatting is done by the caller
        if (params.format === MESSAGE_FORMAT.LSP) {
            return params;
        }

        switch (type) {
            case ToolingInfo.LANGUAGE_SERVICE.START:
                {
                    if (hasValidProp(params, "rootPaths") || hasValidProp(params, "rootPath")) {
                        validatedParams = params;
                        validatedParams.capabilities = validatedParams.capabilities || false;
                    }
                    break;
                }
            case ToolingInfo.FEATURES.CODE_HINTS:
            case ToolingInfo.FEATURES.PARAMETER_HINTS:
            case ToolingInfo.FEATURES.JUMP_TO_DECLARATION:
            case ToolingInfo.FEATURES.JUMP_TO_DEFINITION:
            case ToolingInfo.FEATURES.JUMP_TO_IMPL:
                {
                    if (hasValidProps(params, ["filePath", "cursorPos"])) {
                        validatedParams = params;
                    }
                    break;
                }
            case ToolingInfo.FEATURES.CODE_HINT_INFO:
                {
                    validatedParams = params;
                    break;
                }
            case ToolingInfo.FEATURES.FIND_REFERENCES:
                {
                    if (hasValidProps(params, ["filePath", "cursorPos"])) {
                        validatedParams = params;
                        validatedParams.includeDeclaration = validatedParams.includeDeclaration || false;
                    }
                    break;
                }
            case ToolingInfo.FEATURES.DOCUMENT_SYMBOLS:
                {
                    if (hasValidProp(params, "filePath")) {
                        validatedParams = params;
                    }
                    break;
                }
            case ToolingInfo.FEATURES.PROJECT_SYMBOLS:
                {
                    if (hasValidProp(params, "query") && typeof params.query === "string") {
                        validatedParams = params;
                    }
                    break;
                }
            case ToolingInfo.LANGUAGE_SERVICE.CUSTOM_REQUEST:
                {
                    validatedParams = params;
                }
        }

        return validatedParams;
    }
function validateRequestParams(type, params) {
        var validatedParams = null;

        params = params || {};

        //Don't validate if the formatting is done by the caller
        if (params.format === MESSAGE_FORMAT.LSP) {
            return params;
        }

        switch (type) {
            case ToolingInfo.LANGUAGE_SERVICE.START:
                {
                    if (hasValidProp(params, "rootPaths") || hasValidProp(params, "rootPath")) {
                        validatedParams = params;
                        validatedParams.capabilities = validatedParams.capabilities || false;
                    }
                    break;
                }
            case ToolingInfo.FEATURES.CODE_HINTS:
            case ToolingInfo.FEATURES.PARAMETER_HINTS:
            case ToolingInfo.FEATURES.JUMP_TO_DECLARATION:
            case ToolingInfo.FEATURES.JUMP_TO_DEFINITION:
            case ToolingInfo.FEATURES.JUMP_TO_IMPL:
                {
                    if (hasValidProps(params, ["filePath", "cursorPos"])) {
                        validatedParams = params;
                    }
                    break;
                }
            case ToolingInfo.FEATURES.CODE_HINT_INFO:
                {
                    validatedParams = params;
                    break;
                }
            case ToolingInfo.FEATURES.FIND_REFERENCES:
                {
                    if (hasValidProps(params, ["filePath", "cursorPos"])) {
                        validatedParams = params;
                        validatedParams.includeDeclaration = validatedParams.includeDeclaration || false;
                    }
                    break;
                }
            case ToolingInfo.FEATURES.DOCUMENT_SYMBOLS:
                {
                    if (hasValidProp(params, "filePath")) {
                        validatedParams = params;
                    }
                    break;
                }
            case ToolingInfo.FEATURES.PROJECT_SYMBOLS:
                {
                    if (hasValidProp(params, "query") && typeof params.query === "string") {
                        validatedParams = params;
                    }
                    break;
                }
            case ToolingInfo.LANGUAGE_SERVICE.CUSTOM_REQUEST:
                {
                    validatedParams = params;
                }
        }

        return validatedParams;
    }
function validateRequestParams ( type , params ) { var validatedParams = null ; params = params || { } ; //Don't validate if the formatting is done by the caller if ( params . format === MESSAGE_FORMAT . LSP ) { return params ; } switch ( type ) { case ToolingInfo . LANGUAGE_SERVICE . START : { if ( hasValidProp ( params , "rootPaths" ) || hasValidProp ( params , "rootPath" ) ) { validatedParams = params ; validatedParams . capabilities = validatedParams . capabilities || false ; } break ; } case ToolingInfo . FEATURES . CODE_HINTS : case ToolingInfo . FEATURES . PARAMETER_HINTS : case ToolingInfo . FEATURES . JUMP_TO_DECLARATION : case ToolingInfo . FEATURES . JUMP_TO_DEFINITION : case ToolingInfo . FEATURES . JUMP_TO_IMPL : { if ( hasValidProps ( params , [ "filePath" , "cursorPos" ] ) ) { validatedParams = params ; } break ; } case ToolingInfo . FEATURES . CODE_HINT_INFO : { validatedParams = params ; break ; } case ToolingInfo . FEATURES . FIND_REFERENCES : { if ( hasValidProps ( params , [ "filePath" , "cursorPos" ] ) ) { validatedParams = params ; validatedParams . includeDeclaration = validatedParams . includeDeclaration || false ; } break ; } case ToolingInfo . FEATURES . DOCUMENT_SYMBOLS : { if ( hasValidProp ( params , "filePath" ) ) { validatedParams = params ; } break ; } case ToolingInfo . FEATURES . PROJECT_SYMBOLS : { if ( hasValidProp ( params , "query" ) && typeof params . query === "string" ) { validatedParams = params ; } break ; } case ToolingInfo . LANGUAGE_SERVICE . CUSTOM_REQUEST : { validatedParams = params ; } } return validatedParams ; }
/*
RequestParams creator - sendNotifications/request
/ * RequestParams creator - sendNotifications / request
Validates the parameters for a request