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 aggregate(node) {
if (node.kind === 208 /* ThrowStatement */) {
statementAccumulator.push(node);
}
else if (node.kind === 209 /* TryStatement */) {
var tryStatement = node;
... | Aggregates all throw-statements within this node *without* crossing
into function boundaries and try-blocks with catch-clauses. | aggregate | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function aggregateAllBreakAndContinueStatements(node) {
var statementAccumulator = [];
aggregate(node);
return statementAccumulator;
function aggregate(node) {
if (node.kind === 203 /* BreakStatement */ || node.kind ... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | aggregateAllBreakAndContinueStatements | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function aggregate(node) {
if (node.kind === 203 /* BreakStatement */ || node.kind === 202 /* ContinueStatement */) {
statementAccumulator.push(node);
}
else if (!ts.isFunctionLike(node)) {
ts... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | aggregate | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function ownsBreakOrContinueStatement(owner, statement) {
var actualOwner = getBreakOrContinueOwner(statement);
return actualOwner && actualOwner === owner;
} | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | ownsBreakOrContinueStatement | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getBreakOrContinueOwner(statement) {
for (var node_2 = statement.parent; node_2; node_2 = node_2.parent) {
switch (node_2.kind) {
case 206 /* SwitchStatement */:
if (statement.kind === 202 /* ContinueStateme... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | getBreakOrContinueOwner | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getModifierOccurrences(modifier, declaration) {
var container = declaration.parent;
// Make sure we only highlight the keyword when it makes sense to do so.
if (ts.isAccessibilityModifier(modifier)) {
if (!(container.kind === 2... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | getModifierOccurrences | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getFlagFromModifier(modifier) {
switch (modifier) {
case 112 /* PublicKeyword */:
return 8 /* Public */;
case 110 /* PrivateKeyword */:
return 16 /* Private */;
... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | getFlagFromModifier | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function pushKeywordIf(keywordList, token) {
var expected = [];
for (var _i = 2; _i < arguments.length; _i++) {
expected[_i - 2] = arguments[_i];
}
if (token && ts.contains(expected, token.kind)) {
... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | pushKeywordIf | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getGetAndSetOccurrences(accessorDeclaration) {
var keywords = [];
tryPushAccessorKeyword(accessorDeclaration.symbol, 145 /* GetAccessor */);
tryPushAccessorKeyword(accessorDeclaration.symbol, 146 /* SetAccessor */);
return ts.map(k... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | getGetAndSetOccurrences | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function tryPushAccessorKeyword(accessorSymbol, accessorKind) {
var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind);
if (accessor) {
ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 12... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | tryPushAccessorKeyword | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getConstructorOccurrences(constructorDeclaration) {
var declarations = constructorDeclaration.symbol.getDeclarations();
var keywords = [];
ts.forEach(declarations, function (declaration) {
ts.forEach(declaration.getChildren(), ... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | getConstructorOccurrences | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getLoopBreakContinueOccurrences(loopNode) {
var keywords = [];
if (pushKeywordIf(keywords, loopNode.getFirstToken(), 86 /* ForKeyword */, 104 /* WhileKeyword */, 79 /* DoKeyword */)) {
// If we succeeded and got a do-while loop, then start looking... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | getLoopBreakContinueOccurrences | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getBreakOrContinueStatementOccurrences(breakOrContinueStatement) {
var owner = getBreakOrContinueOwner(breakOrContinueStatement);
if (owner) {
switch (owner.kind) {
case 199 /* ForStatement */:
... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | getBreakOrContinueStatementOccurrences | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getSwitchCaseDefaultOccurrences(switchStatement) {
var keywords = [];
pushKeywordIf(keywords, switchStatement.getFirstToken(), 96 /* SwitchKeyword */);
// Go through each clause in the switch statement, collecting the 'case'/'default' keywords.
... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | getSwitchCaseDefaultOccurrences | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getTryCatchFinallyOccurrences(tryStatement) {
var keywords = [];
pushKeywordIf(keywords, tryStatement.getFirstToken(), 100 /* TryKeyword */);
if (tryStatement.catchClause) {
pushKeywordIf(keywords, tryStatement.catchClause.getF... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | getTryCatchFinallyOccurrences | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getThrowOccurrences(throwStatement) {
var owner = getThrowStatementOwner(throwStatement);
if (!owner) {
return undefined;
}
var keywords = [];
ts.forEach(aggregateOwnedThrowStatements(own... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | getThrowOccurrences | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getReturnOccurrences(returnStatement) {
var func = ts.getContainingFunction(returnStatement);
// If we didn't find a containing function with a block body, bail out.
if (!(func && hasKind(func.body, 192 /* Block */))) {
return ... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | getReturnOccurrences | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getIfElseOccurrences(ifStatement) {
var keywords = [];
// Traverse upwards through all parent if-statements linked by their else-branches.
while (hasKind(ifStatement.parent, 196 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) {... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | getIfElseOccurrences | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getOccurrencesAtPositionCore(fileName, position) {
synchronizeHostData();
return convertDocumentHighlights(getDocumentHighlights(fileName, position, [fileName]));
function convertDocumentHighlights(documentHighlights) {
if (!documentHighlights) {
... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | getOccurrencesAtPositionCore | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function convertDocumentHighlights(documentHighlights) {
if (!documentHighlights) {
return undefined;
}
var result = [];
for (var _i = 0, documentHighlights_1 = documentHighlights; _i < documentHighlights_1.length; _i++) {
... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | convertDocumentHighlights | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function convertReferences(referenceSymbols) {
if (!referenceSymbols) {
return undefined;
}
var referenceEntries = [];
for (var _i = 0, referenceSymbols_1 = referenceSymbols; _i < referenceSymbols_1.length; _i++) {
var referenceSymbol = ref... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | convertReferences | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function findRenameLocations(fileName, position, findInStrings, findInComments) {
var referencedSymbols = findReferencedSymbols(fileName, position, findInStrings, findInComments);
return convertReferences(referencedSymbols);
} | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | findRenameLocations | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getReferencesAtPosition(fileName, position) {
var referencedSymbols = findReferencedSymbols(fileName, position, /*findInStrings:*/ false, /*findInComments:*/ false);
return convertReferences(referencedSymbols);
} | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | getReferencesAtPosition | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function findReferences(fileName, position) {
var referencedSymbols = findReferencedSymbols(fileName, position, /*findInStrings:*/ false, /*findInComments:*/ false);
// Only include referenced symbols that have a valid definition.
return ts.filter(referencedSymbols, function (rs) { r... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | findReferences | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function findReferencedSymbols(fileName, position, findInStrings, findInComments) {
synchronizeHostData();
var sourceFile = getValidSourceFile(fileName);
var node = ts.getTouchingPropertyName(sourceFile, position);
if (!node) {
return undefined;
... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | findReferencedSymbols | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getReferencedSymbolsForNode(node, sourceFiles, findInStrings, findInComments) {
var typeChecker = program.getTypeChecker();
// Labels
if (isLabelName(node)) {
if (isJumpStatementTarget(node)) {
var labelDefinition = getTargetLabel(node.par... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | getReferencedSymbolsForNode | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getDefinition(symbol) {
var info = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, node.getSourceFile(), getContainerNode(node), node);
var name = ts.map(info.displayParts, function (p) { return p.text; }).join("");
var declarations = symbol.declarations;... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | getDefinition | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isImportOrExportSpecifierImportSymbol(symbol) {
return (symbol.flags & 8388608 /* Alias */) && ts.forEach(symbol.declarations, function (declaration) {
return declaration.kind === 226 /* ImportSpecifier */ || declaration.kind === 230 /* ExportSpecifier */;
})... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | isImportOrExportSpecifierImportSymbol | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getInternedName(symbol, location, declarations) {
// If this is an export or import specifier it could have been renamed using the 'as' syntax.
// If so we want to search for whatever under the cursor.
if (ts.isImportOrExportSpecifierName(location)) {
... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | getInternedName | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getSymbolScope(symbol) {
// If this is the symbol of a named function expression or named class expression,
// then named references are limited to its own scope.
var valueDeclaration = symbol.valueDeclaration;
if (valueDeclaration && (valueDeclar... | Determines the smallest scope in which a symbol may have named references.
Note that not every construct has been accounted for. This function can
probably be improved.
@returns undefined if the scope cannot be determined, implying that
a reference to a symbol can occur anywhere. | getSymbolScope | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getPossibleSymbolReferencePositions(sourceFile, symbolName, start, end) {
var positions = [];
/// TODO: Cache symbol existence for files to save text search
// Also, need to make this work for unicode escapes.
// Be resilient in the face of a symb... | Determines the smallest scope in which a symbol may have named references.
Note that not every construct has been accounted for. This function can
probably be improved.
@returns undefined if the scope cannot be determined, implying that
a reference to a symbol can occur anywhere. | getPossibleSymbolReferencePositions | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getLabelReferencesInNode(container, targetLabel) {
var references = [];
var sourceFile = container.getSourceFile();
var labelName = targetLabel.text;
var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, labelName, container.getS... | Determines the smallest scope in which a symbol may have named references.
Note that not every construct has been accounted for. This function can
probably be improved.
@returns undefined if the scope cannot be determined, implying that
a reference to a symbol can occur anywhere. | getLabelReferencesInNode | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isValidReferencePosition(node, searchSymbolName) {
if (node) {
// Compare the length so we filter out strict superstrings of the symbol we are looking for
switch (node.kind) {
case 69 /* Identifier */:
r... | Determines the smallest scope in which a symbol may have named references.
Note that not every construct has been accounted for. This function can
probably be improved.
@returns undefined if the scope cannot be determined, implying that
a reference to a symbol can occur anywhere. | isValidReferencePosition | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getReferencesInNode(container, searchSymbol, searchText, searchLocation, searchMeaning, findInStrings, findInComments, result, symbolToIndex) {
var sourceFile = container.getSourceFile();
var tripleSlashDirectivePrefixRegex = /^\/\/\/\s*</;
var possiblePositions ... | Search within node "container" for references for a search value, where the search value is defined as a
tuple of(searchSymbol, searchText, searchLocation, and searchMeaning).
searchLocation: a node where the search value | getReferencesInNode | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getReferencedSymbol(symbol) {
var symbolId = ts.getSymbolId(symbol);
var index = symbolToIndex[symbolId];
if (index === undefined) {
index = result.length;
symbolToIndex[symbolId] = index;
... | Search within node "container" for references for a search value, where the search value is defined as a
tuple of(searchSymbol, searchText, searchLocation, and searchMeaning).
searchLocation: a node where the search value | getReferencedSymbol | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isInNonReferenceComment(sourceFile, position) {
return ts.isInCommentHelper(sourceFile, position, isNonReferenceComment);
function isNonReferenceComment(c) {
var commentText = sourceFile.text.substring(c.pos, c.end);
return... | Search within node "container" for references for a search value, where the search value is defined as a
tuple of(searchSymbol, searchText, searchLocation, and searchMeaning).
searchLocation: a node where the search value | isInNonReferenceComment | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isNonReferenceComment(c) {
var commentText = sourceFile.text.substring(c.pos, c.end);
return !tripleSlashDirectivePrefixRegex.test(commentText);
} | Search within node "container" for references for a search value, where the search value is defined as a
tuple of(searchSymbol, searchText, searchLocation, and searchMeaning).
searchLocation: a node where the search value | isNonReferenceComment | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getReferencesForSuperKeyword(superKeyword) {
var searchSpaceNode = ts.getSuperContainer(superKeyword, /*includeFunctions*/ false);
if (!searchSpaceNode) {
return undefined;
}
// Whether 'super' occurs in a static context within... | Search within node "container" for references for a search value, where the search value is defined as a
tuple of(searchSymbol, searchText, searchLocation, and searchMeaning).
searchLocation: a node where the search value | getReferencesForSuperKeyword | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles) {
var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false);
// Whether 'this' occurs in a static context within a class.
var staticFlag = 64 /* Static */;
... | Search within node "container" for references for a search value, where the search value is defined as a
tuple of(searchSymbol, searchText, searchLocation, and searchMeaning).
searchLocation: a node where the search value | getReferencesForThisKeyword | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result) {
ts.forEach(possiblePositions, function (position) {
cancellationToken.throwIfCancellationRequested();
var node = ts.getTouchingWord(sourceFile, position);
... | Search within node "container" for references for a search value, where the search value is defined as a
tuple of(searchSymbol, searchText, searchLocation, and searchMeaning).
searchLocation: a node where the search value | getThisReferencesInFile | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function populateSearchSymbolSet(symbol, location) {
// The search set contains at least the current symbol
var result = [symbol];
// If the symbol is an alias, add what it alaises to the list
if (isImportOrExportSpecifierImportSymbol(symbol)) {
... | Search within node "container" for references for a search value, where the search value is defined as a
tuple of(searchSymbol, searchText, searchLocation, and searchMeaning).
searchLocation: a node where the search value | populateSearchSymbolSet | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) {
if (symbol && symbol.flags & (32 /* Class */ | 64 /* Interface */)) {
ts.forEach(symbol.getDeclarations(), function (declaration) {
if (declaration.kind === 214 /* ClassDeclaration */) {
... | Search within node "container" for references for a search value, where the search value is defined as a
tuple of(searchSymbol, searchText, searchLocation, and searchMeaning).
searchLocation: a node where the search value | getPropertySymbolsFromBaseTypes | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getPropertySymbolFromTypeReference(typeReference) {
if (typeReference) {
var type = typeChecker.getTypeAtLocation(typeReference);
if (type) {
var propertySymbol = typeChecker.getPropertyOfType(type, propertyName);
... | Search within node "container" for references for a search value, where the search value is defined as a
tuple of(searchSymbol, searchText, searchLocation, and searchMeaning).
searchLocation: a node where the search value | getPropertySymbolFromTypeReference | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getRelatedSymbol(searchSymbols, referenceSymbol, referenceLocation) {
if (searchSymbols.indexOf(referenceSymbol) >= 0) {
return referenceSymbol;
}
// If the reference symbol is an alias, check if what it is aliasing is one of the search
... | Search within node "container" for references for a search value, where the search value is defined as a
tuple of(searchSymbol, searchText, searchLocation, and searchMeaning).
searchLocation: a node where the search value | getRelatedSymbol | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getPropertySymbolsFromContextualType(node) {
if (isNameOfPropertyAssignment(node)) {
var objectLiteral = node.parent.parent;
var contextualType = typeChecker.getContextualType(objectLiteral);
var name_37 = node.text;
... | Search within node "container" for references for a search value, where the search value is defined as a
tuple of(searchSymbol, searchText, searchLocation, and searchMeaning).
searchLocation: a node where the search value | getPropertySymbolsFromContextualType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function containErrors(diagnostics) {
return ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
} | A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment | containErrors | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getEmitOutput(fileName) {
synchronizeHostData();
var sourceFile = getValidSourceFile(fileName);
var outputFiles = [];
function writeFile(fileName, data, writeByteOrderMark) {
outputFiles.push({
name: fileName,
... | A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment | getEmitOutput | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function writeFile(fileName, data, writeByteOrderMark) {
outputFiles.push({
name: fileName,
writeByteOrderMark: writeByteOrderMark,
text: data
});
} | A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment | writeFile | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getMeaningFromDeclaration(node) {
switch (node.kind) {
case 138 /* Parameter */:
case 211 /* VariableDeclaration */:
case 163 /* BindingElement */:
case 141 /* PropertyDeclaration */:
case 140 /* PropertySignature */:
... | A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment | getMeaningFromDeclaration | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isTypeReference(node) {
if (ts.isRightSideOfQualifiedNameOrPropertyAccess(node)) {
node = node.parent;
}
return node.parent.kind === 151 /* TypeReference */ ||
(node.parent.kind === 188 /* ExpressionWithTypeArguments */ && !ts.isExpressionWith... | A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment | isTypeReference | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isNamespaceReference(node) {
return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node);
} | A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment | isNamespaceReference | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isPropertyAccessNamespaceReference(node) {
var root = node;
var isLastClause = true;
if (root.parent.kind === 166 /* PropertyAccessExpression */) {
while (root.parent && root.parent.kind === 166 /* PropertyAccessExpression */) {
root = roo... | A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment | isPropertyAccessNamespaceReference | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isQualifiedNameNamespaceReference(node) {
var root = node;
var isLastClause = true;
if (root.parent.kind === 135 /* QualifiedName */) {
while (root.parent && root.parent.kind === 135 /* QualifiedName */) {
root = root.parent;
... | A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment | isQualifiedNameNamespaceReference | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isInRightSideOfImport(node) {
while (node.parent.kind === 135 /* QualifiedName */) {
node = node.parent;
}
return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node;
} | A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment | isInRightSideOfImport | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getMeaningFromRightHandSideOfImportEquals(node) {
ts.Debug.assert(node.kind === 69 /* Identifier */);
// import a = |b|; // Namespace
// import a = |b.c|; // Value, type, namespace
// import a = |b.c|.d; // Namespace
if (node.parent.kind =... | A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment | getMeaningFromRightHandSideOfImportEquals | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getMeaningFromLocation(node) {
if (node.parent.kind === 227 /* ExportAssignment */) {
return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */;
}
else if (isInRightSideOfImport(node)) {
return getMeaningFromRightHandSideOfImportEquals(node);
... | A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment | getMeaningFromLocation | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function processNode(node) {
// Only walk into nodes that intersect the requested span.
if (node && ts.textSpanIntersectsWith(span, node.getFullStart(), node.getFullWidth())) {
var kind = node.kind;
checkForClassificationCancellation(kind);
... | Returns true if there exists a module that introduces entities on the value side. | processNode | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getClassificationTypeName(type) {
switch (type) {
case 1 /* comment */: return ClassificationTypeNames.comment;
case 2 /* identifier */: return ClassificationTypeNames.identifier;
case 3 /* keyword */: return ClassificationTypeNames.keyword;
... | Returns true if there exists a module that introduces entities on the value side. | getClassificationTypeName | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function convertClassifications(classifications) {
ts.Debug.assert(classifications.spans.length % 3 === 0);
var dense = classifications.spans;
var result = [];
for (var i = 0, n = dense.length; i < n; i += 3) {
result.push({
textSpan: t... | Returns true if there exists a module that introduces entities on the value side. | convertClassifications | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getSyntacticClassifications(fileName, span) {
return convertClassifications(getEncodedSyntacticClassifications(fileName, span));
} | Returns true if there exists a module that introduces entities on the value side. | getSyntacticClassifications | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getEncodedSyntacticClassifications(fileName, span) {
// doesn't use compiler - no need to synchronize with host
var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
var spanStart = span.start;
var spanLength = span.length;
// Make a scanne... | Returns true if there exists a module that introduces entities on the value side. | getEncodedSyntacticClassifications | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function pushClassification(start, length, type) {
result.push(start);
result.push(length);
result.push(type);
} | Returns true if there exists a module that introduces entities on the value side. | pushClassification | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function classifyLeadingTriviaAndGetTokenStart(token) {
triviaScanner.setTextPos(token.pos);
while (true) {
var start = triviaScanner.getTextPos();
// only bother scanning if we have something that could be trivia.
if (!ts.could... | Returns true if there exists a module that introduces entities on the value side. | classifyLeadingTriviaAndGetTokenStart | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function classifyComment(token, kind, start, width) {
if (kind === 3 /* MultiLineCommentTrivia */) {
// See if this is a doc comment. If so, we'll classify certain portions of it
// specially.
var docCommentAndDiagnostics = ts.parseIsolatedJSD... | Returns true if there exists a module that introduces entities on the value side. | classifyComment | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function pushCommentRange(start, width) {
pushClassification(start, width, 1 /* comment */);
} | Returns true if there exists a module that introduces entities on the value side. | pushCommentRange | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function classifyJSDocComment(docComment) {
var pos = docComment.pos;
for (var _i = 0, _a = docComment.tags; _i < _a.length; _i++) {
var tag = _a[_i];
// As we walk through each tag, classify the portion of text from the end of
... | Returns true if there exists a module that introduces entities on the value side. | classifyJSDocComment | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function processJSDocParameterTag(tag) {
if (tag.preParameterName) {
pushCommentRange(pos, tag.preParameterName.pos - pos);
pushClassification(tag.preParameterName.pos, tag.preParameterName.end - tag.preParameterName.pos, 17 /* parameterName */);
... | Returns true if there exists a module that introduces entities on the value side. | processJSDocParameterTag | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function processJSDocTemplateTag(tag) {
for (var _i = 0, _a = tag.getChildren(); _i < _a.length; _i++) {
var child = _a[_i];
processElement(child);
}
} | Returns true if there exists a module that introduces entities on the value side. | processJSDocTemplateTag | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function classifyDisabledMergeCode(text, start, end) {
// Classify the line that the ======= marker is on as a comment. Then just lex
// all further tokens and add them to the result.
for (var i = start; i < end; i++) {
if (ts.isLineBreak(text.charCod... | Returns true if there exists a module that introduces entities on the value side. | classifyDisabledMergeCode | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function classifyDisabledCodeToken() {
var start = mergeConflictScanner.getTextPos();
var tokenKind = mergeConflictScanner.scan();
var end = mergeConflictScanner.getTextPos();
var type = classifyTokenType(tokenKind);
if (type) {
... | Returns true if there exists a module that introduces entities on the value side. | classifyDisabledCodeToken | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function classifyToken(token) {
if (ts.nodeIsMissing(token)) {
return;
}
var tokenStart = classifyLeadingTriviaAndGetTokenStart(token);
var tokenWidth = token.end - tokenStart;
ts.Debug.assert(tokenWidth >= 0);
... | Returns true if there exists a module that introduces entities on the value side. | classifyToken | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function classifyTokenType(tokenKind, token) {
if (ts.isKeyword(tokenKind)) {
return 3 /* keyword */;
}
// Special case < and > If they appear in a generic context they are punctuation,
// not operators.
if (tokenKind =... | Returns true if there exists a module that introduces entities on the value side. | classifyTokenType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function processElement(element) {
if (!element) {
return;
}
// Ignore nodes that don't intersect the original span to classify.
if (ts.decodedTextSpanIntersectsWith(spanStart, spanLength, element.pos, element.getFullWidth())) {
... | Returns true if there exists a module that introduces entities on the value side. | processElement | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getOutliningSpans(fileName) {
// doesn't use compiler - no need to synchronize with host
var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
return ts.OutliningElementsCollector.collectElements(sourceFile);
} | Returns true if there exists a module that introduces entities on the value side. | getOutliningSpans | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getBraceMatchingAtPosition(fileName, position) {
var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
var result = [];
var token = ts.getTouchingToken(sourceFile, position);
if (token.getStart(sourceFile) === position) {
var matchKind ... | Returns true if there exists a module that introduces entities on the value side. | getBraceMatchingAtPosition | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getMatchingTokenKind(token) {
switch (token.kind) {
case 15 /* OpenBraceToken */: return 16 /* CloseBraceToken */;
case 17 /* OpenParenToken */: return 18 /* CloseParenToken */;
case 19 /* OpenBracketToken */: return 20 /* CloseBracket... | Returns true if there exists a module that introduces entities on the value side. | getMatchingTokenKind | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getIndentationAtPosition(fileName, position, editorOptions) {
var start = new Date().getTime();
var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
log("getIndentationAtPosition: getCurrentSourceFile: " + (new Date().getTime() - start));
start = new ... | Returns true if there exists a module that introduces entities on the value side. | getIndentationAtPosition | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getFormattingEditsForRange(fileName, start, end, options) {
var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
return ts.formatting.formatSelection(start, end, sourceFile, getRuleProvider(options), options);
} | Returns true if there exists a module that introduces entities on the value side. | getFormattingEditsForRange | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getFormattingEditsForDocument(fileName, options) {
var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
return ts.formatting.formatDocument(sourceFile, getRuleProvider(options), options);
} | Returns true if there exists a module that introduces entities on the value side. | getFormattingEditsForDocument | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getFormattingEditsAfterKeystroke(fileName, position, key, options) {
var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
if (key === "}") {
return ts.formatting.formatOnClosingCurly(position, sourceFile, getRuleProvider(options), options);
}
... | Returns true if there exists a module that introduces entities on the value side. | getFormattingEditsAfterKeystroke | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getDocCommentTemplateAtPosition(fileName, position) {
var start = new Date().getTime();
var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
// Check if in a context where we don't want to perform any insertion
if (ts.isInString(sourceFile, position) ... | Checks if position points to a valid position to add JSDoc comments, and if so,
returns the appropriate template. Otherwise returns an empty string.
Valid positions are
- outside of comments, statements, and expressions, and
- preceding a:
- function/constructor/method declaration
- class de... | getDocCommentTemplateAtPosition | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getParametersForJsDocOwningNode(commentOwner) {
if (ts.isFunctionLike(commentOwner)) {
return commentOwner.parameters;
}
if (commentOwner.kind === 193 /* VariableStatement */) {
var varStatement = commentOwner;
var varDeclarati... | " + newLine +
indentationStr + " * ";
var result = preamble + newLine +
docParams +
indentationStr + " | getParametersForJsDocOwningNode | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getTodoComments(fileName, descriptors) {
// Note: while getting todo comments seems like a syntactic operation, we actually
// treat it as a semantic operation here. This is because we expect our host to call
// this on every single file. If we treat this syntactically, th... | Digs into an an initializer or RHS operand of an assignment operation
to get the parameters of an apt signature corresponding to a
function expression or a class expression.
@param rightHandSide the expression which may contain an appropriate set of parameters
@returns the parameters of a signature found on the RHS if... | getTodoComments | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function escapeRegExp(str) {
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
} | Digs into an an initializer or RHS operand of an assignment operation
to get the parameters of an apt signature corresponding to a
function expression or a class expression.
@param rightHandSide the expression which may contain an appropriate set of parameters
@returns the parameters of a signature found on the RHS if... | escapeRegExp | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getTodoCommentsRegExp() {
// NOTE: ?: means 'non-capture group'. It allows us to have groups without having to
// filter them out later in the final result array.
// TODO comments can appear in one of the following forms:
//
// ... | Digs into an an initializer or RHS operand of an assignment operation
to get the parameters of an apt signature corresponding to a
function expression or a class expression.
@param rightHandSide the expression which may contain an appropriate set of parameters
@returns the parameters of a signature found on the RHS if... | getTodoCommentsRegExp | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function canFollow(keyword1, keyword2) {
if (ts.isAccessibilityModifier(keyword1)) {
if (keyword2 === 123 /* GetKeyword */ ||
keyword2 === 129 /* SetKeyword */ ||
keyword2 === 121 /* ConstructorKeyword */ ||
keyword2 === 113 /* Stat... | Returns true if 'keyword2' can legally follow 'keyword1' in any language construct. | canFollow | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function convertClassifications(classifications, text) {
var entries = [];
var dense = classifications.spans;
var lastEnd = 0;
for (var i = 0, n = dense.length; i < n; i += 3) {
var start = dense[i];
var length_3 = dense[i + 1];
... | Returns true if 'keyword2' can legally follow 'keyword1' in any language construct. | convertClassifications | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function convertClassification(type) {
switch (type) {
case 1 /* comment */: return TokenClass.Comment;
case 3 /* keyword */: return TokenClass.Keyword;
case 4 /* numericLiteral */: return TokenClass.NumberLiteral;
case 5 /* operator */: return... | Returns true if 'keyword2' can legally follow 'keyword1' in any language construct. | convertClassification | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getClassificationsForLine(text, lexState, syntacticClassifierAbsent) {
return convertClassifications(getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent), text);
} | Returns true if 'keyword2' can legally follow 'keyword1' in any language construct. | getClassificationsForLine | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent) {
var offset = 0;
var token = 0 /* Unknown */;
var lastNonTriviaToken = 0 /* Unknown */;
// Empty out the template stack for reuse.
while (templateStack.length > 0) {
... | Returns true if 'keyword2' can legally follow 'keyword1' in any language construct. | getEncodedLexicalClassifications | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function processToken() {
var start = scanner.getTokenPos();
var end = scanner.getTextPos();
addResult(start, end, classFromKind(token));
if (end >= text.length) {
if (token === 9 /* StringLiteral */) {
// Check ... | Returns true if 'keyword2' can legally follow 'keyword1' in any language construct. | processToken | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function addResult(start, end, classification) {
if (classification === 8 /* whiteSpace */) {
// Don't bother with whitespace classifications. They're not needed.
return;
}
if (start === 0 && offset > 0) {
// We... | Returns true if 'keyword2' can legally follow 'keyword1' in any language construct. | addResult | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isBinaryExpressionOperatorToken(token) {
switch (token) {
case 37 /* AsteriskToken */:
case 39 /* SlashToken */:
case 40 /* PercentToken */:
case 35 /* PlusToken */:
case 36 /* MinusToken */:
case 43 /* ... | Returns true if 'keyword2' can legally follow 'keyword1' in any language construct. | isBinaryExpressionOperatorToken | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isPrefixUnaryExpressionOperatorToken(token) {
switch (token) {
case 35 /* PlusToken */:
case 36 /* MinusToken */:
case 50 /* TildeToken */:
case 49 /* ExclamationToken */:
case 41 /* PlusPlusToken */:
ca... | Returns true if 'keyword2' can legally follow 'keyword1' in any language construct. | isPrefixUnaryExpressionOperatorToken | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isKeyword(token) {
return token >= 70 /* FirstKeyword */ && token <= 134 /* LastKeyword */;
} | Returns true if 'keyword2' can legally follow 'keyword1' in any language construct. | isKeyword | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function classFromKind(token) {
if (isKeyword(token)) {
return 3 /* keyword */;
}
else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) {
return 5 /* operator */;
}
else if (token >= 15 ... | Returns true if 'keyword2' can legally follow 'keyword1' in any language construct. | classFromKind | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function initializeServices() {
ts.objectAllocator = {
getNodeConstructor: function () { return NodeObject; },
getSourceFileConstructor: function () { return SourceFileObject; },
getSymbolConstructor: function () { return SymbolObject; },
getTypeConstructor: funct... | Get the path of the default library files (lib.d.ts) as distributed with the typescript
node package.
The functionality is not supported if the ts module is consumed outside of a node module. | initializeServices | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function spanInSourceFileAtLocation(sourceFile, position) {
// Cannot set breakpoint in dts file
if (sourceFile.flags & 4096 /* DeclarationFile */) {
return undefined;
}
var tokenAtLocation = ts.getTokenAtPosition(sourceFile, position);
var lin... | Get the breakpoint span in given sourceFile | spanInSourceFileAtLocation | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function textSpan(startNode, endNode) {
return ts.createTextSpanFromBounds(startNode.getStart(), (endNode || startNode).getEnd());
} | Get the breakpoint span in given sourceFile | textSpan | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function spanInNodeIfStartsOnSameLine(node, otherwiseOnNode) {
if (node && lineOfPosition === sourceFile.getLineAndCharacterOfPosition(node.getStart()).line) {
return spanInNode(node);
}
return spanInNode(otherwiseOnNode);
} | Get the breakpoint span in given sourceFile | spanInNodeIfStartsOnSameLine | 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.