mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 11:50:54 +07:00
default namespace insertion fixed
This commit is contained in:
@@ -212,7 +212,7 @@ public abstract class CodeInsightTestCase extends PsiTestCase {
|
||||
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
|
||||
}
|
||||
|
||||
protected VirtualFile configureByFiles(final File rawProjectRoot, final VirtualFile... vFiles) throws IOException {
|
||||
protected VirtualFile configureByFiles(@Nullable final File rawProjectRoot, final VirtualFile... vFiles) throws IOException {
|
||||
myFile = null;
|
||||
myEditor = null;
|
||||
|
||||
|
||||
@@ -147,18 +147,16 @@ public class CreateNSDeclarationIntentionFix implements HintAction, LocalQuickFi
|
||||
final XmlFile xmlFile = extension.getContainingFile(myElement);
|
||||
prefix = ExtendedTagInsertHandler.getPrefixByNamespace(xmlFile, namespace);
|
||||
if (StringUtil.isNotEmpty(prefix)) {
|
||||
// namespace already declared
|
||||
ExtendedTagInsertHandler.qualifyWithPrefix(prefix, myElement);
|
||||
return;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
prefix = ExtendedTagInsertHandler.suggestPrefix(xmlFile, namespace);
|
||||
if (StringUtil.isEmpty(prefix)) {
|
||||
if (!ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
HintManager.getInstance().showInformationHint(editor, "Namespace not found");
|
||||
}
|
||||
return;
|
||||
if (!StringUtil.isEmpty(prefix)) {
|
||||
ExtendedTagInsertHandler.qualifyWithPrefix(prefix, myElement);
|
||||
PsiDocumentManager.getInstance(project).doPostponedOperationsAndUnblockDocument(editor.getDocument());
|
||||
}
|
||||
ExtendedTagInsertHandler.qualifyWithPrefix(prefix, myElement);
|
||||
PsiDocumentManager.getInstance(project).doPostponedOperationsAndUnblockDocument(editor.getDocument());
|
||||
}
|
||||
}
|
||||
final int offset = editor.getCaretModel().getOffset();
|
||||
|
||||
Reference in New Issue
Block a user