MCPcopy Index your code
hub / github.com/microsoft/typescript-go / emitImportTypeNode

Method emitImportTypeNode

internal/printer/printer.go:2230–2251  ·  view source on GitHub ↗
(node *ast.ImportTypeNode)

Source from the content-addressed store, hash-verified

2228}
2229
2230func (p *Printer) emitImportTypeNode(node *ast.ImportTypeNode) {
2231 state := p.enterNode(node.AsNode())
2232 if node.IsTypeOf {
2233 p.writeKeyword("typeof")
2234 p.writeSpace()
2235 }
2236 p.writeKeyword("import")
2237 p.writePunctuation("(")
2238 p.emitTypeNodeOutsideExtends(node.Argument)
2239 if node.Attributes != nil {
2240 p.writePunctuation(",")
2241 p.writeSpace()
2242 p.emitImportTypeNodeAttributes(node.Attributes.AsImportAttributes())
2243 }
2244 p.writePunctuation(")")
2245 if node.Qualifier != nil {
2246 p.writePunctuation(".")
2247 p.emitEntityName(node.Qualifier)
2248 }
2249 p.emitTypeArguments(node.AsNode(), node.TypeArguments)
2250 p.exitNode(node.AsNode(), state)
2251}
2252
2253// emits a Type node in the `extends` clause of a ConditionalType
2254func (p *Printer) emitTypeNodeInExtends(node *ast.TypeNode) {

Callers 1

emitTypeNodeMethod · 0.95

Calls 11

enterNodeMethod · 0.95
writeKeywordMethod · 0.95
writeSpaceMethod · 0.95
writePunctuationMethod · 0.95
emitEntityNameMethod · 0.95
emitTypeArgumentsMethod · 0.95
exitNodeMethod · 0.95
AsImportAttributesMethod · 0.80
AsNodeMethod · 0.65

Tested by

no test coverage detected