MCPcopy Create free account
hub / github.com/microsoft/typescript-go / isModuleSpecifierMissingOrEmpty

Function isModuleSpecifierMissingOrEmpty

internal/ls/completions.go:5299–5311  ·  view source on GitHub ↗
(specifier *ast.Expression)

Source from the content-addressed store, hash-verified

5297}
5298
5299func isModuleSpecifierMissingOrEmpty(specifier *ast.Expression) bool {
5300 if ast.NodeIsMissing(specifier) {
5301 return true
5302 }
5303 node := specifier
5304 if ast.IsExternalModuleReference(node) {
5305 node = node.Expression()
5306 }
5307 if !ast.IsStringLiteralLike(node) {
5308 return true
5309 }
5310 return node.Text() == ""
5311}
5312
5313func hasDocComment(file *ast.SourceFile, position int) bool {
5314 token := astnav.GetTokenAtPosition(file, position)

Calls 5

NodeIsMissingFunction · 0.92
IsStringLiteralLikeFunction · 0.92
ExpressionMethod · 0.80
TextMethod · 0.65

Tested by

no test coverage detected