Home
last modified time | relevance | path

Searched refs:namedBindings (Results 1 – 25 of 42) sorted by relevance

12

/third_party/typescript/src/services/
DorganizeImports.ts167 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 …]
DimportTracker.ts266 …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) {
DsuggestionDiagnostics.ts96 …urn importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings
97 ? importClause.namedBindings.name
DnavigationBar.ts265 const { namedBindings } = importClause; constant
266 if (namedBindings) {
267 if (namedBindings.kind === SyntaxKind.NamespaceImport) {
268 addLeafNode(namedBindings);
271 for (const element of namedBindings.elements) {
Dcompletions.ts4469 … ? 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
Dutilities.ts828 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/
DmoveToNewFile.ts212 …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 …]
DconvertImport.ts75 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 };
DconvertExport.ts196 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/
DohApi.ts483 …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/
DInteropTypescriptLinter.ts229 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/
DconvertToTypeOnlyImport.ts39 if (importClause.name && importClause.namedBindings) {
40 …eExcludingEnd(context.sourceFile, importClause.name, importDeclaration.importClause.namedBindings);
DimportFixes.ts498 … 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…
576namedBindings?.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 …]
DsplitTypeOnlyImport.ts39 …mportClause(importClause, importClause.isTypeOnly, /*name*/ undefined, importClause.namedBindings),
DfixUnreferenceableDecoratorMetadata.ts46 if (importClause.name && importClause.namedBindings) {
DconvertToEsModule.ts480 …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/
Dutilities.ts48 const bindings = node.importClause && node.importClause.namedBindings;
65 …se && isNamedImports(node.importClause.namedBindings!) && containsDefaultReference(node.importClau…
Ddeclarations.ts769 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) …
Dts.ts2004 …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/
Dsystem.ts961 const namedBindings = importClause.namedBindings; constant
962 if (namedBindings) {
963 switch (namedBindings.kind) {
965 statements = appendExportsOfDeclaration(statements, namedBindings);
969 for (const importBinding of namedBindings.elements) {
Dmodule.ts1507 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/
Dutilities.ts483 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/
DorganizeImports.ts1075 assertEqual(clause1.namedBindings, clause2.namedBindings);
/third_party/typescript/src/deprecatedCompat/4.0/
DnodeFactoryTopLevelExports.ts1194 …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/
DsmartIndenter.ts668 …(!!(child as ImportClause).namedBindings && (child as ImportClause).namedBindings!.kind !== Syntax…

12