update/plugins/org.eclipse.wildwebdeveloper_0.5.8.202005190736/node_modules/@angular/language-service/src/diagnostics.js
/**
     * Checks that URLs on a directive point to a valid file.
     * Note that this diagnostic check may require a filesystem hit, and thus may be slower than other
     * checks.
     *
     * @param urls urls to check for validity
     * @param tsLsHost TS LS host used for querying filesystem information
     * @return diagnosed url errors, if any
     */
Checks that URLs on a directive point to a valid file.
Note that this diagnostic check may require a filesystem hit, and thus may be slower than other
checks.

@param urls urls to check for validity
@param tsLsHost TS LS host used for querying filesystem information
@return diagnosed url errors, if any
Checks that URLs on a directive point to a valid file . Note that this diagnostic check may require a filesystem hit and thus may be slower than other checks . @param urls urls to check for validity @param tsLsHost TS LS host used for querying filesystem information @return diagnosed url errors if any
function validateUrls(urls, tsLsHost) {
        if (!tsLsHost.fileExists) {
            return [];
        }
        var allErrors = [];
        for (var i = 0; i < urls.length; ++i) {
            var urlNode = urls[i];
            if (!ts.isStringLiteralLike(urlNode)) {
                continue;
            }
            var curPath = urlNode.getSourceFile().fileName;
            var url = path.join(path.dirname(curPath), urlNode.text);
            if (tsLsHost.fileExists(url))
                continue;
            allErrors.push({
                kind: ng.DiagnosticKind.Error,
                message: "URL does not point to a valid file",
                span: { start: urlNode.getStart() + 1, end: urlNode.end - 1 },
            });
        }
        return allErrors;
    }
function validateUrls ( urls , tsLsHost ) { if ( ! tsLsHost . fileExists ) { return [ ] ; } var allErrors = [ ] ; for ( var i = 0 ; i < urls . length ; ++ i ) { var urlNode = urls [ i ] ; if ( ! ts . isStringLiteralLike ( urlNode ) ) { continue ; } var curPath = urlNode . getSourceFile ( ) . fileName ; var url = path . join ( path . dirname ( curPath ) , urlNode . text ) ; if ( tsLsHost . fileExists ( url ) ) continue ; allErrors . push ( { kind : ng . DiagnosticKind . Error , message : "URL does not point to a valid file" , span : { start : urlNode . getStart ( ) + 1 , end : urlNode . end - 1 } , } ) ; } return allErrors ; }
Checks that URLs on a directive point to a valid file.
Checks that URLs on a directive point to a valid file .
// TODO(ayazhafiz): most of this logic can be unified with the logic in // definitions.ts#getUrlFromProperty. Create a utility function to be used by both. // If a non-string value is assigned to a URL node (like `templateUrl`), a type error will be // picked up by the TS Language Server. // Exclude opening and closing quotes in the url span.