/third_party/typescript/src/services/ |
D | organizeImports.ts | 167 let { name, namedBindings } = importClause; 174 if (namedBindings) { 175 if (isNamespaceImport(namedBindings)) { 177 if (!isDeclarationUsed(namedBindings.name)) { 178 namedBindings = undefined; 183 … const newElements = namedBindings.elements.filter(e => isDeclarationUsed(e.name)); 184 if (newElements.length < namedBindings.elements.length) { 185 namedBindings = newElements.length 186 ? factory.updateNamedImports(namedBindings, newElements) 192 if (name || namedBindings) { [all …]
|
D | importTracker.ts | 266 …const { name, namedBindings } = decl.importClause || { name: undefined, namedBindings: undefined }; constant 268 if (namedBindings) { 269 switch (namedBindings.kind) { 271 handleNamespaceImportLike(namedBindings.name); 276 searchForNamedImport(namedBindings); 280 Debug.assertNever(namedBindings); 305 function searchForNamedImport(namedBindings: NamedImportsOrExports | undefined): void { 306 if (!namedBindings) { 310 for (const element of namedBindings.elements) {
|
D | suggestionDiagnostics.ts | 96 …urn importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings… 97 ? importClause.namedBindings.name
|
D | navigationBar.ts | 265 const { namedBindings } = importClause; constant 266 if (namedBindings) { 267 if (namedBindings.kind === SyntaxKind.NamespaceImport) { 268 addLeafNode(namedBindings); 271 for (const element of namedBindings.elements) {
|
D | completions.ts | 4469 … ? getPotentiallyInvalidImportSpecifier(top.importClause?.namedBindings) ?? top.moduleSpecifier 4495 function getPotentiallyInvalidImportSpecifier(namedBindings: NamedImportBindings | undefined) { 4497 tryCast(namedBindings, isNamedImports)?.elements, 4500 …findPrecedingToken(e.name.pos, namedBindings!.getSourceFile(), namedBindings)?.kind !== SyntaxKind… 4508 function canCompleteFromNamedBindings(namedBindings: NamedImportBindings) { 4509 …if (!isModuleSpecifierMissingOrEmpty(namedBindings.parent.parent.moduleSpecifier) || namedBindings… 4512 if (isNamedImports(namedBindings)) { 4516 const invalidNamedImport = getPotentiallyInvalidImportSpecifier(namedBindings); 4517 …const validImports = invalidNamedImport ? namedBindings.elements.indexOf(invalidNamedImport) : nam… constant
|
D | utilities.ts | 828 if (node.importClause.name && node.importClause.namedBindings) { 845 if (node.importClause.namedBindings) { 846 if (isNamedImports(node.importClause.namedBindings)) { 848 const onlyBinding = singleOrUndefined(node.importClause.namedBindings.elements); 854 else if (isNamespaceImport(node.importClause.namedBindings)) { 855 return node.importClause.namedBindings.name;
|
/third_party/typescript/src/services/refactors/ |
D | moveToNewFile.ts | 212 …return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kin… 213 node.importClause.namedBindings.name : undefined; 373 const { name, namedBindings } = importDecl.importClause; constant 375 const namedBindingsUnused = !namedBindings || 376 …(namedBindings.kind === SyntaxKind.NamespaceImport ? isUnused(namedBindings.name) : namedBindings.… 384 if (namedBindings) { 392 else if (namedBindings.kind === SyntaxKind.NamedImports) { 393 for (const element of namedBindings.elements) { 599 … const namedBindings = clause.namedBindings && filterNamedBindings(clause.namedBindings, keep); constant 600 return defaultImport || namedBindings [all …]
|
D | convertImport.ts | 75 if (!importClause.namedBindings) { 79 if (importClause.namedBindings.kind === SyntaxKind.NamespaceImport) { 80 return { convertTo: ImportKind.Named, import: importClause.namedBindings }; 85 ? { convertTo: ImportKind.Default, import: importClause.namedBindings } 86 : { convertTo: ImportKind.Namespace, import: importClause.namedBindings };
|
D | convertExport.ts | 196 const { namedBindings } = clause; constant 197 if (!namedBindings) { 201 else if (namedBindings.kind === SyntaxKind.NamespaceImport) { 203 …e(importingSourceFile, { pos: ref.getStart(importingSourceFile), end: namedBindings.getStart(impor… 211 … changes.insertNodeAtEndOfList(importingSourceFile, namedBindings.elements, spec);
|
/third_party/typescript/src/compiler/ |
D | ohApi.ts | 483 …const namedBindings = visitNode(node.namedBindings, visitNamedImportBindings, isNamedImportBinding… constant 484 return (name || namedBindings) ? 485 factory.updateImportClause(node, /*isTypeOnly*/ false, name, namedBindings) : 536 let namedBindings: NamedImportBindings | undefined; 538 namedBindings = currentTypeImportInfo.namespaceImport; 541 namedBindings = factory.createNamedImports(currentTypeImportInfo.namedImports); 547 if (namedBindings !== undefined) { 548 …rtClauses.push(factory.createImportClause(/*isTypeOnly*/ true, /*name*/ undefined, namedBindings)); 647 let namedBindings: NamedExports | undefined; 649 namedBindings = factory.createNamedExports(currentTypeExportInfo.namedExports); [all …]
|
/third_party/typescript/src/linter/ArkTSLinter_1_1/ |
D | InteropTypescriptLinter.ts | 229 if (importClause.namedBindings && ts.isNamedImports(importClause.namedBindings)) { 230 this.checkKitImportClause(importClause.namedBindings, baseFileName); 287 if (!node.namedBindings) { 290 if (ts.isNamespaceImport(node.namedBindings)) { 291 this.incrementCounters(node.namedBindings, FaultID.NoTsImportEts); 294 if (ts.isNamedImports(node.namedBindings)) { 295 node.namedBindings.elements.forEach(element => {
|
/third_party/typescript/src/services/codefixes/ |
D | convertToTypeOnlyImport.ts | 39 if (importClause.name && importClause.namedBindings) { 40 …eExcludingEnd(context.sourceFile, importClause.name, importDeclaration.importClause.namedBindings);
|
D | importFixes.ts | 498 … const namespaceImport = tryCast(declaration.importClause?.namedBindings, isNamespaceImport); 512 … return tryCast(declaration.importClause?.namedBindings, isNamespaceImport)?.name.text; 560 const { name, namedBindings } = importClause; constant 563 …if (importClause.isTypeOnly && !(importKind === ImportKind.Named && namedBindings)) return undefin… 572 …addAsTypeOnly === AddAsTypeOnly.Required && namedBindings // Cannot add a default import as type-o… 576 …namedBindings?.kind === SyntaxKind.NamespaceImport // Cannot add a named import to a declar… 1120 const namedImports = tryCast(importClause.namedBindings, isNamedImports); 1160 …const existingSpecifiers = clause.namedBindings && tryCast(clause.namedBindings, isNamedImports)?.… 1190 …changes.insertImportSpecifierAtIndex(sourceFile, spec, clause.namedBindings as NamedImports, inser… 1201 if (clause.namedBindings) { [all …]
|
D | splitTypeOnlyImport.ts | 39 …mportClause(importClause, importClause.isTypeOnly, /*name*/ undefined, importClause.namedBindings),
|
D | fixUnreferenceableDecoratorMetadata.ts | 46 if (importClause.name && importClause.namedBindings) {
|
D | convertToEsModule.ts | 480 …const namedBindings = namedBindingsNames.size === 0 ? undefined : arrayFrom(mapIterator(namedBindi… constant 482 if (!namedBindings) { 487 …Import(needDefaultImport ? getSynthesizedDeepClone(name) : undefined, namedBindings, moduleSpecifi…
|
/third_party/typescript/src/compiler/transformers/ |
D | utilities.ts | 48 const bindings = node.importClause && node.importClause.namedBindings; 65 …se && isNamedImports(node.importClause.namedBindings!) && containsDefaultReference(node.importClau…
|
D | declarations.ts | 769 if (!decl.importClause.namedBindings) { 778 if (decl.importClause.namedBindings.kind === SyntaxKind.NamespaceImport) { 780 …const namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.import… constant 781 …return visibleDefaultBinding || namedBindings ? factory.updateImportDeclaration(decl, decl.modifie… 785 namedBindings, 789 …const bindingList = mapDefined(decl.importClause.namedBindings.elements, b => resolver.isDeclarati… 798 … && bindingList.length ? factory.updateNamedImports(decl.importClause.namedBindings, bindingList) …
|
D | ts.ts | 2004 …const namedBindings = visitNode(node.namedBindings, visitNamedImportBindings, isNamedImportBinding… constant 2005 …return (name || namedBindings) ? factory.updateImportClause(node, /*isTypeOnly*/ false, name, name…
|
/third_party/typescript/src/compiler/transformers/module/ |
D | system.ts | 961 const namedBindings = importClause.namedBindings; constant 962 if (namedBindings) { 963 switch (namedBindings.kind) { 965 statements = appendExportsOfDeclaration(statements, namedBindings); 969 for (const importBinding of namedBindings.elements) {
|
D | module.ts | 1507 const namedBindings = importClause.namedBindings; constant 1508 if (namedBindings) { 1509 switch (namedBindings.kind) { 1511 statements = appendExportsOfDeclaration(statements, namedBindings); 1515 for (const importBinding of namedBindings.elements) {
|
/third_party/typescript/src/compiler/factory/ |
D | utilities.ts | 483 let namedBindings: NamedImportBindings | undefined; 502 namedBindings = nodeFactory.createNamedImports( 518 namedBindings = nodeFactory.createNamespaceImport(externalHelpersModuleName); 521 if (namedBindings) { 524 … nodeFactory.createImportClause(/*isTypeOnly*/ false, /*name*/ undefined, namedBindings),
|
/third_party/typescript/src/testRunner/unittests/services/ |
D | organizeImports.ts | 1075 assertEqual(clause1.namedBindings, clause2.namedBindings);
|
/third_party/typescript/src/deprecatedCompat/4.0/ |
D | nodeFactoryTopLevelExports.ts | 1194 …g.deprecate(function createImportClause(name: Identifier | undefined, namedBindings: NamedImportBi… 1195 return factory.createImportClause(isTypeOnly, name, namedBindings); 1199 … updateImportClause(node: ImportClause, name: Identifier | undefined, namedBindings: NamedImportBi… 1200 return factory.updateImportClause(node, isTypeOnly, name, namedBindings);
|
/third_party/typescript/src/services/formatting/ |
D | smartIndenter.ts | 668 …(!!(child as ImportClause).namedBindings && (child as ImportClause).namedBindings!.kind !== Syntax…
|