mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 03:21:12 +07:00
WEB-57985 Provide parameter info for JSX props
GitOrigin-RevId: 91ca0baa7bfc928af219fb870a46f0c2b789ad6e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
fb9d572513
commit
5fcd6ac84f
@@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user