Support '/' as a trigger character in path completions (#24042)

This commit is contained in:
Andy
2018-05-10 16:50:26 -07:00
committed by GitHub
parent 6ae4d3a516
commit 2be6aaf813
2 changed files with 11 additions and 4 deletions

View File

@@ -2218,7 +2218,9 @@ namespace ts.Completions {
// Opening JSX tag
return contextToken.kind === SyntaxKind.LessThanToken && contextToken.parent.kind !== SyntaxKind.BinaryExpression;
case "/":
return isJsxClosingElement(contextToken.parent);
return isStringLiteralLike(contextToken)
? !!tryGetImportFromModuleSpecifier(contextToken)
: contextToken.kind === SyntaxKind.SlashToken && isJsxClosingElement(contextToken.parent);
default:
return Debug.assertNever(triggerCharacter);
}