Repository: microsoft/TypeScript
File: src/services/completions.ts (TypeScript)

Code before:
                    break;
                default:
                    // There is nothing that precedes the dot, so this likely just a stray character
                    // or leading into a '...' token. Just bail out instead.
                    return undefined;
            }
        }
        else if (!importStatementCompletion) {
            // <UI.Test /* completion position */ />
            // If the tagname is a property access expression, we will then walk up to the top most of property access expression.
            // Then, try to get a JSX container and its associated attributes type.
            if (parent && parent.kind === SyntaxKind.PropertyAccessExpression) {
                contextToken = parent;
                parent = parent.parent;
            }

            // Fix location
            if (currentToken.parent === location) {
                switch (currentToken.kind) {
                    case SyntaxKind.GreaterThanToken:
                        if (currentToken.parent.kind === SyntaxKind.JsxElement || currentToken.parent.kind === SyntaxKind.JsxOpeningElement) {
                            location = currentToken;
                        }
                        break;

                    case SyntaxKind.LessThanSlashToken:
                        if (currentToken.parent.kind === SyntaxKind.JsxSelfClosingElement) {
                            location = currentToken;
                        }
                        break;
                }
            }

            switch (parent.kind) {
                case SyntaxKind.JsxClosingElement:
                    if (contextToken.kind === SyntaxKind.LessThanSlashToken) {
                        isStartingCloseTag = true;
                        location = contextToken;
                    }
                    break;

                case SyntaxKind.BinaryExpression:
                    if (!binaryExpressionMayBeOpenTag(parent as BinaryExpression)) {
                        break;
                    }
                // falls through

                case SyntaxKind.JsxSelfClosingElement:
                case SyntaxKind.JsxElement:
                case SyntaxKind.JsxOpeningElement:
                    isJsxIdentifierExpected = true;

Review comment (suggestion):
These three instances should use `LessThanSlashToken` instead of `SlashToken` to properly revert the JSX token handling changes and maintain consistency with the original implementation.

Code after:
                    break;
                default:
                    // There is nothing that precedes the dot, so this likely just a stray character
                    // or leading into a '...' token. Just bail out instead.
                    return undefined;
            }
        }
        else if (!importStatementCompletion) {
            // <UI.Test /* completion position */ />
            // If the tagname is a property access expression, we will then walk up to the top most of property access expression.
            // Then, try to get a JSX container and its associated attributes type.
            if (parent && parent.kind === SyntaxKind.PropertyAccessExpression) {
                contextToken = parent;
                parent = parent.parent;
            }

            // Fix location
            if (currentToken.parent === location) {
                switch (currentToken.kind) {
                    case SyntaxKind.GreaterThanToken:
                        if (currentToken.parent.kind === SyntaxKind.JsxElement || currentToken.parent.kind === SyntaxKind.JsxOpeningElement) {
                            location = currentToken;
                        }
                        break;

                    case SyntaxKind.SlashToken:
                        if (currentToken.parent.kind === SyntaxKind.JsxSelfClosingElement) {
                            location = currentToken;
                        }
                        break;
                }
            }

            switch (parent.kind) {
                case SyntaxKind.JsxClosingElement:
                    if (contextToken.kind === SyntaxKind.SlashToken) {
                        isStartingCloseTag = true;
                        location = contextToken;
                    }
                    break;

                case SyntaxKind.BinaryExpression:
                    if (!binaryExpressionMayBeOpenTag(parent as BinaryExpression)) {
                        break;
                    }
                // falls through

                case SyntaxKind.JsxSelfClosingElement:
                case SyntaxKind.JsxElement:
                case SyntaxKind.JsxOpeningElement:
                    isJsxIdentifierExpected = true;