MCPcopy Create free account
hub / github.com/nodejs/node / getLabelStatementCompletions

Function getLabelStatementCompletions

test/fixtures/snapshot/typescript.js:133070–133093  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

133068 }
133069 }
133070 function getLabelStatementCompletions(node) {
133071 var entries = [];
133072 var uniques = new ts.Map();
133073 var current = node;
133074 while (current) {
133075 if (ts.isFunctionLike(current)) {
133076 break;
133077 }
133078 if (ts.isLabeledStatement(current)) {
133079 var name = current.label.text;
133080 if (!uniques.has(name)) {
133081 uniques.set(name, true);
133082 entries.push({
133083 name: name,
133084 kindModifiers: "" /* ScriptElementKindModifier.none */,
133085 kind: "label" /* ScriptElementKind.label */,
133086 sortText: Completions.SortText.LocationPriority
133087 });
133088 }
133089 }
133090 current = current.parent;
133091 }
133092 return entries;
133093 }
133094 function getSymbolCompletionFromEntryId(program, log, sourceFile, position, entryId, host, preferences) {
133095 if (entryId.data) {
133096 var autoImport = getAutoImportSymbolFromCompletionEntryData(entryId.name, entryId.data, program, host);

Callers 1

Calls 3

hasMethod · 0.65
setMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected