WEB-57985 Provide parameter info for JSX props

GitOrigin-RevId: 91ca0baa7bfc928af219fb870a46f0c2b789ad6e
This commit is contained in:
Christian Ivicevic
2023-01-23 16:18:57 +01:00
committed by intellij-monorepo-bot
parent fb9d572513
commit 5fcd6ac84f

View File

@@ -86,17 +86,22 @@ public class XmlEqTypedHandler extends TypedHandlerDelegate {
PsiElement fileContext = file.getContext();
String toInsert = tryCompleteQuotes(fileContext);
boolean showPopup = true;
boolean showParameterInfo = false;
if (toInsert == null) {
final String quote = getDefaultQuote(file);
AttributeValuePresentation presentation = getValuePresentation(editor, file, quote);
toInsert = presentation.getPrefix() + presentation.getPostfix();
showPopup = presentation.showAutoPopup();
showParameterInfo = "{}".equals(toInsert);
}
editor.getDocument().insertString(offset, toInsert);
editor.getCaretModel().moveToOffset(offset + toInsert.length() / 2);
if (showPopup) {
AutoPopupController.getInstance(project).scheduleAutoPopup(editor);
}
if (showParameterInfo) {
AutoPopupController.getInstance(project).autoPopupParameterInfo(editor, null);
}
needToInsertQuotes = false;
Caret caret = editor.getCaretModel().getCurrentCaret();
caret.putUserData(QUOTE_INSERTED_AT, toInsert.isEmpty() ? null : new QuoteInfo(toInsert.charAt(0), caret.getOffset()));