code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
function poll(checkedIndex) {
var watchedFile = watchedFiles[checkedIndex];
if (!watchedFile) {
return;
}
_fs.stat(watchedFile.fileName, function (err, stats) {
if (err) {
... | List of supported extensions in order of file resolution precedence. | poll | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function addFile(fileName, callback) {
var file = {
fileName: fileName,
callback: callback,
mtime: getModifiedTime(fileName)
};
watchedFiles.push(file);
if (watchedFile... | List of supported extensions in order of file resolution precedence. | addFile | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function removeFile(file) {
watchedFiles = ts.copyListRemovingItem(file, watchedFiles);
} | List of supported extensions in order of file resolution precedence. | removeFile | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isNode4OrLater() {
return parseInt(process.version.charAt(1)) >= 4;
} | List of supported extensions in order of file resolution precedence. | isNode4OrLater | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function readFile(fileName, encoding) {
if (!_fs.existsSync(fileName)) {
return undefined;
}
var buffer = _fs.readFileSync(fileName);
var len = buffer.length;
if (len >= 2 && buffer[0] === 0xFE && buffer[1] === 0xFF) {
... | List of supported extensions in order of file resolution precedence. | readFile | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function writeFile(fileName, data, writeByteOrderMark) {
// If a BOM is required, emit one
if (writeByteOrderMark) {
data = "\uFEFF" + data;
}
var fd;
try {
fd = _fs.openSync(fileName, "w");
... | List of supported extensions in order of file resolution precedence. | writeFile | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getCanonicalPath(path) {
return useCaseSensitiveFileNames ? path.toLowerCase() : path;
} | List of supported extensions in order of file resolution precedence. | getCanonicalPath | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function readDirectory(path, extension, exclude) {
var result = [];
exclude = ts.map(exclude, function (s) { return getCanonicalPath(ts.combinePaths(path, s)); });
visitDirectory(path);
return result;
function visitDirectory(path) {
... | List of supported extensions in order of file resolution precedence. | readDirectory | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function visitDirectory(path) {
var files = _fs.readdirSync(path || ".").sort();
var directories = [];
for (var _i = 0, files_2 = files; _i < files_2.length; _i++) {
var current = files_2[_i];
var name_3 = ts.com... | List of supported extensions in order of file resolution precedence. | visitDirectory | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function tokenIsIdentifierOrKeyword(token) {
return token >= 69 /* Identifier */;
} | List of supported extensions in order of file resolution precedence. | tokenIsIdentifierOrKeyword | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function lookupInUnicodeMap(code, map) {
// Bail out quickly if it couldn't possibly be in the map.
if (code < map[0]) {
return false;
}
// Perform binary search in one of the Unicode range maps
var lo = 0;
var hi = map.length;
var mid;
while (... | List of supported extensions in order of file resolution precedence. | lookupInUnicodeMap | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isUnicodeIdentifierPart(code, languageVersion) {
return languageVersion >= 1 /* ES5 */ ?
lookupInUnicodeMap(code, unicodeES5IdentifierPart) :
lookupInUnicodeMap(code, unicodeES3IdentifierPart);
} | List of supported extensions in order of file resolution precedence. | isUnicodeIdentifierPart | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function makeReverseMap(source) {
var result = [];
for (var name_4 in source) {
if (source.hasOwnProperty(name_4)) {
result[source[name_4]] = name_4;
}
}
return result;
} | List of supported extensions in order of file resolution precedence. | makeReverseMap | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function tokenToString(t) {
return tokenStrings[t];
} | List of supported extensions in order of file resolution precedence. | tokenToString | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function stringToToken(s) {
return textToToken[s];
} | List of supported extensions in order of file resolution precedence. | stringToToken | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getPositionOfLineAndCharacter(sourceFile, line, character) {
return computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character);
} | List of supported extensions in order of file resolution precedence. | getPositionOfLineAndCharacter | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getLineStarts(sourceFile) {
return sourceFile.lineMap || (sourceFile.lineMap = computeLineStarts(sourceFile.text));
} | List of supported extensions in order of file resolution precedence. | getLineStarts | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getLineAndCharacterOfPosition(sourceFile, position) {
return computeLineAndCharacterOfPosition(getLineStarts(sourceFile), position);
} | We assume the first line starts at position 0 and 'position' is non-negative. | getLineAndCharacterOfPosition | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isWhiteSpace(ch) {
// Note: nextLine is in the Zs space, and should be considered to be a whitespace.
// It is explicitly not a line-break as it isn't in the exact set specified by EcmaScript.
return ch === 32 /* space */ ||
ch === 9 /* tab */ ||
ch === 11 /* ver... | We assume the first line starts at position 0 and 'position' is non-negative. | isWhiteSpace | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isLineBreak(ch) {
// ES5 7.3:
// The ECMAScript line terminator characters are listed in Table 3.
// Table 3: Line Terminator Characters
// Code Unit Value Name Formal Name
// \u000A Line Feed <LF>
// ... | We assume the first line starts at position 0 and 'position' is non-negative. | isLineBreak | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isDigit(ch) {
return ch >= 48 /* _0 */ && ch <= 57 /* _9 */;
} | We assume the first line starts at position 0 and 'position' is non-negative. | isDigit | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isOctalDigit(ch) {
return ch >= 48 /* _0 */ && ch <= 55 /* _7 */;
} | We assume the first line starts at position 0 and 'position' is non-negative. | isOctalDigit | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function couldStartTrivia(text, pos) {
// Keep in sync with skipTrivia
var ch = text.charCodeAt(pos);
switch (ch) {
case 13 /* carriageReturn */:
case 10 /* lineFeed */:
case 9 /* tab */:
case 11 /* verticalTab */:
case 12 /* formFeed *... | We assume the first line starts at position 0 and 'position' is non-negative. | couldStartTrivia | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function skipTrivia(text, pos, stopAfterLineBreak) {
// Keep in sync with couldStartTrivia
while (true) {
var ch = text.charCodeAt(pos);
switch (ch) {
case 13 /* carriageReturn */:
if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) {
... | We assume the first line starts at position 0 and 'position' is non-negative. | skipTrivia | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isConflictMarkerTrivia(text, pos) {
ts.Debug.assert(pos >= 0);
// Conflict markers must be at the start of a line.
if (pos === 0 || isLineBreak(text.charCodeAt(pos - 1))) {
var ch = text.charCodeAt(pos);
if ((pos + mergeConflictMarkerLength) < text.length) {
... | We assume the first line starts at position 0 and 'position' is non-negative. | isConflictMarkerTrivia | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function scanConflictMarkerTrivia(text, pos, error) {
if (error) {
error(ts.Diagnostics.Merge_conflict_marker_encountered, mergeConflictMarkerLength);
}
var ch = text.charCodeAt(pos);
var len = text.length;
if (ch === 60 /* lessThan */ || ch === 62 /* greaterThan */) ... | We assume the first line starts at position 0 and 'position' is non-negative. | scanConflictMarkerTrivia | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isShebangTrivia(text, pos) {
// Shebangs check must only be done at the start of the file
ts.Debug.assert(pos === 0);
return shebangTriviaRegex.test(text);
} | We assume the first line starts at position 0 and 'position' is non-negative. | isShebangTrivia | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function scanShebangTrivia(text, pos) {
var shebang = shebangTriviaRegex.exec(text)[0];
pos = pos + shebang.length;
return pos;
} | We assume the first line starts at position 0 and 'position' is non-negative. | scanShebangTrivia | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getCommentRanges(text, pos, trailing) {
var result;
var collecting = trailing || pos === 0;
while (pos < text.length) {
var ch = text.charCodeAt(pos);
switch (ch) {
case 13 /* carriageReturn */:
if (text.charCodeAt(pos + 1) ===... | Extract comments from text prefixing the token closest following `pos`.
The return value is an array containing a TextRange for each comment.
Single-line comment ranges include the beginning '//' characters but not the ending line break.
Multi - line comment ranges include the beginning '/* and ending '<asterisk>/' cha... | getCommentRanges | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getLeadingCommentRanges(text, pos) {
return getCommentRanges(text, pos, /*trailing*/ false);
} | Extract comments from text prefixing the token closest following `pos`.
The return value is an array containing a TextRange for each comment.
Single-line comment ranges include the beginning '//' characters but not the ending line break.
Multi - line comment ranges include the beginning '/* and ending '<asterisk>/' cha... | getLeadingCommentRanges | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getTrailingCommentRanges(text, pos) {
return getCommentRanges(text, pos, /*trailing*/ true);
} | Extract comments from text prefixing the token closest following `pos`.
The return value is an array containing a TextRange for each comment.
Single-line comment ranges include the beginning '//' characters but not the ending line break.
Multi - line comment ranges include the beginning '/* and ending '<asterisk>/' cha... | getTrailingCommentRanges | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function scanExactNumberOfHexDigits(count) {
return scanHexDigits(/*minCount*/ count, /*scanAsManyAsPossible*/ false);
} | Scans the given number of hexadecimal digits in the text,
returning -1 if the given number is unavailable. | scanExactNumberOfHexDigits | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function scanMinimumNumberOfHexDigits(count) {
return scanHexDigits(/*minCount*/ count, /*scanAsManyAsPossible*/ true);
} | Scans as many hexadecimal digits as are available in the text,
returning -1 if the given number of digits was unavailable. | scanMinimumNumberOfHexDigits | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function scanHexDigits(minCount, scanAsManyAsPossible) {
var digits = 0;
var value = 0;
while (digits < minCount || scanAsManyAsPossible) {
var ch = text.charCodeAt(pos);
if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) {
value = value *... | Scans as many hexadecimal digits as are available in the text,
returning -1 if the given number of digits was unavailable. | scanHexDigits | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function scanString() {
var quote = text.charCodeAt(pos++);
var result = "";
var start = pos;
while (true) {
if (pos >= end) {
result += text.substring(start, pos);
tokenIsUnterminated = true;
err... | Scans as many hexadecimal digits as are available in the text,
returning -1 if the given number of digits was unavailable. | scanString | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function scanEscapeSequence() {
pos++;
if (pos >= end) {
error(ts.Diagnostics.Unexpected_end_of_text);
return "";
}
var ch = text.charCodeAt(pos++);
switch (ch) {
case 48 /* _0 */:
return "\0"... | Sets the current 'tokenValue' and returns a NoSubstitutionTemplateLiteral or
a literal component of a TemplateExpression. | scanEscapeSequence | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function scanHexadecimalEscape(numDigits) {
var escapedValue = scanExactNumberOfHexDigits(numDigits);
if (escapedValue >= 0) {
return String.fromCharCode(escapedValue);
}
else {
error(ts.Diagnostics.Hexadecimal_digit_expected);
... | Sets the current 'tokenValue' and returns a NoSubstitutionTemplateLiteral or
a literal component of a TemplateExpression. | scanHexadecimalEscape | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function scanExtendedUnicodeEscape() {
var escapedValue = scanMinimumNumberOfHexDigits(1);
var isInvalidExtendedEscape = false;
// Validate the value of the digit
if (escapedValue < 0) {
error(ts.Diagnostics.Hexadecimal_digit_expected);
isI... | Sets the current 'tokenValue' and returns a NoSubstitutionTemplateLiteral or
a literal component of a TemplateExpression. | scanExtendedUnicodeEscape | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function scanIdentifierParts() {
var result = "";
var start = pos;
while (pos < end) {
var ch = text.charCodeAt(pos);
if (isIdentifierPart(ch, languageVersion)) {
pos++;
}
else if (ch === 92 /* backsl... | Sets the current 'tokenValue' and returns a NoSubstitutionTemplateLiteral or
a literal component of a TemplateExpression. | scanIdentifierParts | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getIdentifierToken() {
// Reserved words are between 2 and 11 characters long and start with a lowercase letter
var len = tokenValue.length;
if (len >= 2 && len <= 11) {
var ch = tokenValue.charCodeAt(0);
if (ch >= 97 /* a */ && ch <= 122 /* z... | Sets the current 'tokenValue' and returns a NoSubstitutionTemplateLiteral or
a literal component of a TemplateExpression. | getIdentifierToken | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function scanBinaryOrOctalDigits(base) {
ts.Debug.assert(base !== 2 || base !== 8, "Expected either base 2 or base 8");
var value = 0;
// For counting number of digits; Valid binaryIntegerLiteral must have at least one binary digit following B or b.
// Similarly valid oct... | Sets the current 'tokenValue' and returns a NoSubstitutionTemplateLiteral or
a literal component of a TemplateExpression. | scanBinaryOrOctalDigits | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function scan() {
startPos = pos;
hasExtendedUnicodeEscape = false;
precedingLineBreak = false;
tokenIsUnterminated = false;
while (true) {
tokenPos = pos;
if (pos >= end) {
return token = 1 /* EndOfFileToken... | Sets the current 'tokenValue' and returns a NoSubstitutionTemplateLiteral or
a literal component of a TemplateExpression. | scan | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function reScanGreaterToken() {
if (token === 27 /* GreaterThanToken */) {
if (text.charCodeAt(pos) === 62 /* greaterThan */) {
if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) {
if (text.charCodeAt(pos + 2) === 61 /* equals */) {
... | Sets the current 'tokenValue' and returns a NoSubstitutionTemplateLiteral or
a literal component of a TemplateExpression. | reScanGreaterToken | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function reScanSlashToken() {
if (token === 39 /* SlashToken */ || token === 61 /* SlashEqualsToken */) {
var p = tokenPos + 1;
var inEscape = false;
var inCharacterClass = false;
while (true) {
// If we reach the end of a f... | Sets the current 'tokenValue' and returns a NoSubstitutionTemplateLiteral or
a literal component of a TemplateExpression. | reScanSlashToken | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function reScanTemplateToken() {
ts.Debug.assert(token === 16 /* CloseBraceToken */, "'reScanTemplateToken' should only be called on a '}'");
pos = tokenPos;
return token = scanTemplateAndSetTokenValue();
} | Unconditionally back up and scan a template expression portion. | reScanTemplateToken | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function reScanJsxToken() {
pos = tokenPos = startPos;
return token = scanJsxToken();
} | Unconditionally back up and scan a template expression portion. | reScanJsxToken | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function scanJsxToken() {
startPos = tokenPos = pos;
if (pos >= end) {
return token = 1 /* EndOfFileToken */;
}
var char = text.charCodeAt(pos);
if (char === 60 /* lessThan */) {
if (text.charCodeAt(pos + 1) === 47 /* slash */) ... | Unconditionally back up and scan a template expression portion. | scanJsxToken | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function speculationHelper(callback, isLookahead) {
var savePos = pos;
var saveStartPos = startPos;
var saveTokenPos = tokenPos;
var saveToken = token;
var saveTokenValue = tokenValue;
var savePrecedingLineBreak = precedingLineBreak;
va... | Unconditionally back up and scan a template expression portion. | speculationHelper | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function lookAhead(callback) {
return speculationHelper(callback, /*isLookahead:*/ true);
} | Unconditionally back up and scan a template expression portion. | lookAhead | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function tryScan(callback) {
return speculationHelper(callback, /*isLookahead:*/ false);
} | Unconditionally back up and scan a template expression portion. | tryScan | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function setText(newText, start, length) {
text = newText || "";
end = length === undefined ? text.length : start + length;
setTextPos(start || 0);
} | Unconditionally back up and scan a template expression portion. | setText | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function setOnError(errorCallback) {
onError = errorCallback;
} | Unconditionally back up and scan a template expression portion. | setOnError | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function setScriptTarget(scriptTarget) {
languageVersion = scriptTarget;
} | Unconditionally back up and scan a template expression portion. | setScriptTarget | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function setLanguageVariant(variant) {
languageVariant = variant;
} | Unconditionally back up and scan a template expression portion. | setLanguageVariant | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function setTextPos(textPos) {
ts.Debug.assert(textPos >= 0);
pos = textPos;
startPos = textPos;
tokenPos = textPos;
token = 0 /* Unknown */;
precedingLineBreak = false;
tokenValue = undefined;
hasExtendedUnicodeEscape = fal... | Unconditionally back up and scan a template expression portion. | setTextPos | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getDeclarationOfKind(symbol, kind) {
var declarations = symbol.declarations;
if (declarations) {
for (var _i = 0, declarations_1 = declarations; _i < declarations_1.length; _i++) {
var declaration = declarations_1[_i];
if (declaration.kind === kind) {... | Unconditionally back up and scan a template expression portion. | getDeclarationOfKind | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getSingleLineStringWriter() {
if (stringWriters.length === 0) {
var str = "";
var writeText = function (text) { return str += text; };
return {
string: function () { return str; },
writeKeyword: writeText,
writeOperator... | Unconditionally back up and scan a template expression portion. | getSingleLineStringWriter | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function releaseStringWriter(writer) {
writer.clear();
stringWriters.push(writer);
} | Unconditionally back up and scan a template expression portion. | releaseStringWriter | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getFullWidth(node) {
return node.end - node.pos;
} | Unconditionally back up and scan a template expression portion. | getFullWidth | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function arrayIsEqualTo(array1, array2, equaler) {
if (!array1 || !array2) {
return array1 === array2;
}
if (array1.length !== array2.length) {
return false;
}
for (var i = 0; i < array1.length; ++i) {
var equals = equaler ? equaler(array1[i], ... | Unconditionally back up and scan a template expression portion. | arrayIsEqualTo | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function hasResolvedModule(sourceFile, moduleNameText) {
return sourceFile.resolvedModules && ts.hasProperty(sourceFile.resolvedModules, moduleNameText);
} | Unconditionally back up and scan a template expression portion. | hasResolvedModule | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getResolvedModule(sourceFile, moduleNameText) {
return hasResolvedModule(sourceFile, moduleNameText) ? sourceFile.resolvedModules[moduleNameText] : undefined;
} | Unconditionally back up and scan a template expression portion. | getResolvedModule | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function setResolvedModule(sourceFile, moduleNameText, resolvedModule) {
if (!sourceFile.resolvedModules) {
sourceFile.resolvedModules = {};
}
sourceFile.resolvedModules[moduleNameText] = resolvedModule;
} | Unconditionally back up and scan a template expression portion. | setResolvedModule | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function containsParseError(node) {
aggregateChildData(node);
return (node.parserContextFlags & 64 /* ThisNodeOrAnySubNodesHasError */) !== 0;
} | Unconditionally back up and scan a template expression portion. | containsParseError | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function aggregateChildData(node) {
if (!(node.parserContextFlags & 128 /* HasAggregatedChildData */)) {
// A node is considered to contain a parse error if:
// a) the parser explicitly marked that it had an error
// b) any of it's children reported that it had an error.
... | Unconditionally back up and scan a template expression portion. | aggregateChildData | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getSourceFileOfNode(node) {
while (node && node.kind !== 248 /* SourceFile */) {
node = node.parent;
}
return node;
} | Unconditionally back up and scan a template expression portion. | getSourceFileOfNode | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getStartPositionOfLine(line, sourceFile) {
ts.Debug.assert(line >= 0);
return ts.getLineStarts(sourceFile)[line];
} | Unconditionally back up and scan a template expression portion. | getStartPositionOfLine | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getStartPosOfNode(node) {
return node.pos;
} | Unconditionally back up and scan a template expression portion. | getStartPosOfNode | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function nodeIsPresent(node) {
return !nodeIsMissing(node);
} | Unconditionally back up and scan a template expression portion. | nodeIsPresent | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getTokenPosOfNode(node, sourceFile) {
// With nodes that have no width (i.e. 'Missing' nodes), we actually *don't*
// want to skip trivia because this will launch us forward to the next token.
if (nodeIsMissing(node)) {
return node.pos;
}
return ts.skipTrivia... | Unconditionally back up and scan a template expression portion. | getTokenPosOfNode | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getNonDecoratorTokenPosOfNode(node, sourceFile) {
if (nodeIsMissing(node) || !node.decorators) {
return getTokenPosOfNode(node, sourceFile);
}
return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.decorators.end);
} | Unconditionally back up and scan a template expression portion. | getNonDecoratorTokenPosOfNode | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia) {
if (includeTrivia === void 0) { includeTrivia = false; }
if (nodeIsMissing(node)) {
return "";
}
var text = sourceFile.text;
return text.substring(includeTrivia ? node.pos : ts.skipTrivia(te... | Unconditionally back up and scan a template expression portion. | getSourceTextOfNodeFromSourceFile | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getTextOfNodeFromSourceText(sourceText, node) {
if (nodeIsMissing(node)) {
return "";
}
return sourceText.substring(ts.skipTrivia(sourceText, node.pos), node.end);
} | Unconditionally back up and scan a template expression portion. | getTextOfNodeFromSourceText | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getTextOfNode(node, includeTrivia) {
if (includeTrivia === void 0) { includeTrivia = false; }
return getSourceTextOfNodeFromSourceFile(getSourceFileOfNode(node), node, includeTrivia);
} | Unconditionally back up and scan a template expression portion. | getTextOfNode | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function makeIdentifierFromModuleName(moduleName) {
return ts.getBaseFileName(moduleName).replace(/^(\d)/, "_$1").replace(/\W/g, "_");
} | Unconditionally back up and scan a template expression portion. | makeIdentifierFromModuleName | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isBlockOrCatchScoped(declaration) {
return (getCombinedNodeFlags(declaration) & 24576 /* BlockScoped */) !== 0 ||
isCatchClauseVariableDeclaration(declaration);
} | Unconditionally back up and scan a template expression portion. | isBlockOrCatchScoped | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isCatchClauseVariableDeclaration(declaration) {
return declaration &&
declaration.kind === 211 /* VariableDeclaration */ &&
declaration.parent &&
declaration.parent.kind === 244 /* CatchClause */;
} | Unconditionally back up and scan a template expression portion. | isCatchClauseVariableDeclaration | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function declarationNameToString(name) {
return getFullWidth(name) === 0 ? "(Missing)" : getTextOfNode(name);
} | Unconditionally back up and scan a template expression portion. | declarationNameToString | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function createDiagnosticForNode(node, message, arg0, arg1, arg2) {
var sourceFile = getSourceFileOfNode(node);
var span = getErrorSpanForNode(sourceFile, node);
return ts.createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2);
} | Unconditionally back up and scan a template expression portion. | createDiagnosticForNode | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function createDiagnosticForNodeFromMessageChain(node, messageChain) {
var sourceFile = getSourceFileOfNode(node);
var span = getErrorSpanForNode(sourceFile, node);
return {
file: sourceFile,
start: span.start,
length: span.length,
code: messageCha... | Unconditionally back up and scan a template expression portion. | createDiagnosticForNodeFromMessageChain | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getSpanOfTokenAtPosition(sourceFile, pos) {
var scanner = ts.createScanner(sourceFile.languageVersion, /*skipTrivia*/ true, sourceFile.languageVariant, sourceFile.text, /*onError:*/ undefined, pos);
scanner.scan();
var start = scanner.getTokenPos();
return ts.createTextSpanFromB... | Unconditionally back up and scan a template expression portion. | getSpanOfTokenAtPosition | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getErrorSpanForNode(sourceFile, node) {
var errorNode = node;
switch (node.kind) {
case 248 /* SourceFile */:
var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false);
if (pos_1 === sourceFile.text.length) {
// f... | Unconditionally back up and scan a template expression portion. | getErrorSpanForNode | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isExternalModule(file) {
return file.externalModuleIndicator !== undefined;
} | Unconditionally back up and scan a template expression portion. | isExternalModule | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isExternalOrCommonJsModule(file) {
return (file.externalModuleIndicator || file.commonJsModuleIndicator) !== undefined;
} | Unconditionally back up and scan a template expression portion. | isExternalOrCommonJsModule | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isDeclarationFile(file) {
return (file.flags & 4096 /* DeclarationFile */) !== 0;
} | Unconditionally back up and scan a template expression portion. | isDeclarationFile | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isConstEnumDeclaration(node) {
return node.kind === 217 /* EnumDeclaration */ && isConst(node);
} | Unconditionally back up and scan a template expression portion. | isConstEnumDeclaration | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function walkUpBindingElementsAndPatterns(node) {
while (node && (node.kind === 163 /* BindingElement */ || isBindingPattern(node))) {
node = node.parent;
}
return node;
} | Unconditionally back up and scan a template expression portion. | walkUpBindingElementsAndPatterns | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isConst(node) {
return !!(getCombinedNodeFlags(node) & 16384 /* Const */);
} | Unconditionally back up and scan a template expression portion. | isConst | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isLet(node) {
return !!(getCombinedNodeFlags(node) & 8192 /* Let */);
} | Unconditionally back up and scan a template expression portion. | isLet | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isPrologueDirective(node) {
return node.kind === 195 /* ExpressionStatement */ && node.expression.kind === 9 /* StringLiteral */;
} | Unconditionally back up and scan a template expression portion. | isPrologueDirective | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getLeadingCommentRangesOfNode(node, sourceFileOfNode) {
return ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos);
} | Unconditionally back up and scan a template expression portion. | getLeadingCommentRangesOfNode | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getLeadingCommentRangesOfNodeFromText(node, text) {
return ts.getLeadingCommentRanges(text, node.pos);
} | Unconditionally back up and scan a template expression portion. | getLeadingCommentRangesOfNodeFromText | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getJsDocComments(node, sourceFileOfNode) {
return getJsDocCommentsFromText(node, sourceFileOfNode.text);
} | Unconditionally back up and scan a template expression portion. | getJsDocComments | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getJsDocCommentsFromText(node, text) {
var commentRanges = (node.kind === 138 /* Parameter */ || node.kind === 137 /* TypeParameter */) ?
ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) :
getLeadingCommentRangesOfNodeFromTe... | Unconditionally back up and scan a template expression portion. | getJsDocCommentsFromText | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isJsDocComment(comment) {
// True if the comment starts with '/**' but not if it is '/**/'
return text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ &&
text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ &&
text.charCodeAt(comment.pos + 3) !== 47 /... | Unconditionally back up and scan a template expression portion. | isJsDocComment | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isRequireCall(expression) {
// of the form 'require("name")'
return expression.kind === 168 /* CallExpression */ &&
expression.expression.kind === 69 /* Identifier */ &&
expression.expression.text === "require" &&
expression.arguments.length === 1 &&
... | Returns true if the node is a CallExpression to the identifier 'require' with
exactly one string literal argument.
This function does not test if the node is in a JavaScript file or not. | isRequireCall | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isExportsPropertyAssignment(expression) {
// of the form 'exports.name = expr' where 'name' and 'expr' are arbitrary
return isInJavaScriptFile(expression) &&
(expression.kind === 181 /* BinaryExpression */) &&
(expression.operatorToken.kind === 56 /* EqualsToken */) &&
... | Returns true if the node is an assignment to a property on the identifier 'exports'.
This function does not test if the node is in a JavaScript file or not. | isExportsPropertyAssignment | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isModuleExportsAssignment(expression) {
// of the form 'module.exports = expr' where 'expr' is arbitrary
return isInJavaScriptFile(expression) &&
(expression.kind === 181 /* BinaryExpression */) &&
(expression.operatorToken.kind === 56 /* EqualsToken */) &&
(... | Returns true if the node is an assignment to the property access expression 'module.exports'.
This function does not test if the node is in a JavaScript file or not. | isModuleExportsAssignment | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getExternalModuleName(node) {
if (node.kind === 222 /* ImportDeclaration */) {
return node.moduleSpecifier;
}
if (node.kind === 221 /* ImportEqualsDeclaration */) {
var reference = node.moduleReference;
if (reference.kind === 232 /* ExternalModuleRefe... | Returns true if the node is an assignment to the property access expression 'module.exports'.
This function does not test if the node is in a JavaScript file or not. | getExternalModuleName | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function hasQuestionToken(node) {
if (node) {
switch (node.kind) {
case 138 /* Parameter */:
case 143 /* MethodDeclaration */:
case 142 /* MethodSignature */:
case 246 /* ShorthandPropertyAssignment */:
case 245 /* Prope... | Returns true if the node is an assignment to the property access expression 'module.exports'.
This function does not test if the node is in a JavaScript file or not. | hasQuestionToken | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.