Snapshot idea/141.1532.4 from git://git.jetbrains.org/idea/community.git
Change-Id: I2511752825b530c329f9185aeca60a881b106427
diff --git a/build/conf/mac/Contents/MacOS/idea b/build/conf/mac/Contents/MacOS/idea
index e6f4390..2f7dd40 100755
--- a/build/conf/mac/Contents/MacOS/idea
+++ b/build/conf/mac/Contents/MacOS/idea
Binary files differ
diff --git a/build/conf/nsis/paths.nsi b/build/conf/nsis/paths.nsi
index c9cc2cd..0e9299a 100644
--- a/build/conf/nsis/paths.nsi
+++ b/build/conf/nsis/paths.nsi
@@ -1,6 +1,6 @@
; Installer images
-!define IMAGES_LOCATION ${BASE_DIR}\build\images\idea
-!define LICENSE_FILE ${BASE_DIR}\license\IDEA_license
-!define PRODUCT_PROPERTIES_FILE ${BASE_DIR}\out\release\dist.all\bin\idea.properties
+!define IMAGES_LOCATION "${BASE_DIR}\build\images\idea"
+!define LICENSE_FILE "${BASE_DIR}\license\IDEA_license"
+!define PRODUCT_PROPERTIES_FILE "${BASE_DIR}\out\release\dist.all\bin\idea.properties"
!define PRODUCT_VM_OPTIONS_NAME idea*.exe.vmoptions
-!define PRODUCT_VM_OPTIONS_FILE ${BASE_DIR}\out\release\dist.win\bin\${PRODUCT_VM_OPTIONS_NAME}
\ No newline at end of file
+!define PRODUCT_VM_OPTIONS_FILE "${BASE_DIR}\out\release\dist.win\bin\${PRODUCT_VM_OPTIONS_NAME}"
\ No newline at end of file
diff --git a/build/conf/nsis/pathsCE.nsi b/build/conf/nsis/pathsCE.nsi
index f168e1f..9c84bba 100644
--- a/build/conf/nsis/pathsCE.nsi
+++ b/build/conf/nsis/pathsCE.nsi
@@ -1,5 +1,5 @@
; Installer images
-!define IMAGES_LOCATION ${BASE_DIR}\build\images\idea
-!define PRODUCT_PROPERTIES_FILE ${BASE_DIR}\out\release\dist.all.ce\bin\idea.properties
+!define IMAGES_LOCATION "${BASE_DIR}\build\images\idea"
+!define PRODUCT_PROPERTIES_FILE "${BASE_DIR}\out\release\dist.all.ce\bin\idea.properties"
!define PRODUCT_VM_OPTIONS_NAME idea*.exe.vmoptions
-!define PRODUCT_VM_OPTIONS_FILE ${BASE_DIR}\out\release\dist.win.ce\bin\${PRODUCT_VM_OPTIONS_NAME}
\ No newline at end of file
+!define PRODUCT_VM_OPTIONS_FILE "${BASE_DIR}\out\release\dist.win.ce\bin\${PRODUCT_VM_OPTIONS_NAME}"
\ No newline at end of file
diff --git a/community-resources/src/idea/IdeaApplicationInfo.xml b/community-resources/src/idea/IdeaApplicationInfo.xml
index d6d3720..226feb6 100644
--- a/community-resources/src/idea/IdeaApplicationInfo.xml
+++ b/community-resources/src/idea/IdeaApplicationInfo.xml
@@ -1,5 +1,5 @@
<component>
- <version codename="Community Edition" major="14" minor="1.3" eap="false"/>
+ <version codename="Community Edition" major="14" minor="1.4" eap="false"/>
<company name="JetBrains s.r.o." url="https://www.jetbrains.com/?fromIDE"/>
<build number="__BUILD_NUMBER__" date="__BUILD_DATE__"/>
<install-over minbuild="129.1" maxbuild="139.9999" version="14"/>
diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/MethodEvaluator.java b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/MethodEvaluator.java
index bb36ecf..7387c7f 100644
--- a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/MethodEvaluator.java
+++ b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/MethodEvaluator.java
@@ -20,6 +20,7 @@
*/
package com.intellij.debugger.engine.evaluation.expression;
+import com.intellij.Patches;
import com.intellij.debugger.DebuggerBundle;
import com.intellij.debugger.engine.DebugProcess;
import com.intellij.debugger.engine.DebugProcessImpl;
@@ -180,7 +181,7 @@
return debugProcess.invokeInstanceMethod(context, objRef, jdiMethod, args, ObjectReference.INVOKE_NONVIRTUAL);
}
// fix for default methods in interfaces, see IDEA-124066
- if (myCheckDefaultInterfaceMethod && jdiMethod.declaringType() instanceof InterfaceType) {
+ if (Patches.JDK_BUG_ID_8042123 && myCheckDefaultInterfaceMethod && jdiMethod.declaringType() instanceof InterfaceType) {
try {
return invokeDefaultMethod(debugProcess, context, objRef, myMethodName);
} catch (EvaluateException e) {
diff --git a/java/debugger/impl/src/com/intellij/debugger/settings/IconObjectRenderer.java b/java/debugger/impl/src/com/intellij/debugger/settings/IconObjectRenderer.java
index 2850a85..12cb7dc 100644
--- a/java/debugger/impl/src/com/intellij/debugger/settings/IconObjectRenderer.java
+++ b/java/debugger/impl/src/com/intellij/debugger/settings/IconObjectRenderer.java
@@ -25,6 +25,7 @@
import com.intellij.debugger.ui.tree.ValueDescriptor;
import com.intellij.debugger.ui.tree.render.DescriptorLabelListener;
import com.intellij.icons.AllIcons;
+import com.intellij.openapi.util.registry.Registry;
import com.intellij.xdebugger.frame.XFullValueEvaluator;
import org.jetbrains.annotations.Nullable;
@@ -44,7 +45,7 @@
public Icon calcValueIcon(ValueDescriptor descriptor, EvaluationContext evaluationContext, DescriptorLabelListener listener)
throws EvaluateException {
String getterName = AllIcons.Debugger.Value.getIconHeight() <= 16 ? "iconToBytesPreviewNormal" : "iconToBytesPreviewRetina";
- if (DebuggerUtilsImpl.isRemote(evaluationContext.getDebugProcess())) {
+ if (!Registry.is("debugger.auto.fetch.icons") || DebuggerUtilsImpl.isRemote(evaluationContext.getDebugProcess())) {
return null; // do not auto load icon for remote
}
else {
diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ModulesConfigurator.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ModulesConfigurator.java
index fe55b16..b910598 100644
--- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ModulesConfigurator.java
+++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ModulesConfigurator.java
@@ -69,18 +69,20 @@
private static final Logger LOG = Logger.getInstance("#" + ModulesConfigurator.class.getName());
private final Project myProject;
- private final List<ModuleEditor> myModuleEditors = new ArrayList<ModuleEditor>();
- private final Comparator<ModuleEditor> myModuleEditorComparator = new Comparator<ModuleEditor>() {
- @Override
- public int compare(ModuleEditor editor1, ModuleEditor editor2) {
- return ModulesAlphaComparator.INSTANCE.compare(editor1.getModule(), editor2.getModule());
- }
- @SuppressWarnings({"EqualsWhichDoesntCheckParameterClass"})
- public boolean equals(Object o) {
- return false;
+ private final Map<Module, ModuleEditor> myModuleEditors = new TreeMap<Module, ModuleEditor>(new Comparator<Module>() {
+ @Override
+ public int compare(Module o1, Module o2) {
+ String n1 = o1.getName();
+ String n2 = o2.getName();
+ int result = n1.compareToIgnoreCase(n2);
+ if (result != 0) {
+ return result;
+ }
+ return n1.compareTo(n2);
}
- };
+ });
+
private boolean myModified = false;
private ModifiableModuleModel myModuleModel;
private boolean myModuleModelCommitted = false;
@@ -107,7 +109,7 @@
ApplicationManager.getApplication().runWriteAction(new Runnable() {
@Override
public void run() {
- for (final ModuleEditor moduleEditor : myModuleEditors) {
+ for (final ModuleEditor moduleEditor : myModuleEditors.values()) {
Disposer.dispose(moduleEditor);
}
myModuleEditors.clear();
@@ -119,7 +121,6 @@
}
}
});
-
}
@Override
@@ -140,12 +141,7 @@
@Nullable
public ModuleEditor getModuleEditor(Module module) {
- for (final ModuleEditor moduleEditor : myModuleEditors) {
- if (module.equals(moduleEditor.getModule())) {
- return moduleEditor;
- }
- }
- return null;
+ return myModuleEditors.get(module);
}
@Override
@@ -170,7 +166,7 @@
}
};
- myModuleEditors.add(moduleEditor);
+ myModuleEditors.put(moduleEditor.getModule(), moduleEditor);
moduleEditor.addChangeListener(this);
Disposer.register(moduleEditor, new Disposable() {
@@ -202,7 +198,6 @@
for (Module module : modules) {
getOrCreateModuleEditor(module);
}
- Collections.sort(myModuleEditors, myModuleEditorComparator);
}
}
});
@@ -226,7 +221,7 @@
// validate content and source roots
final Map<VirtualFile, String> contentRootToModuleNameMap = new HashMap<VirtualFile, String>();
final Map<VirtualFile, VirtualFile> srcRootsToContentRootMap = new HashMap<VirtualFile, VirtualFile>();
- for (final ModuleEditor moduleEditor : myModuleEditors) {
+ for (final ModuleEditor moduleEditor : myModuleEditors.values()) {
final ModifiableRootModel rootModel = moduleEditor.getModifiableRootModel();
final ContentEntry[] contents = rootModel.getContentEntries();
for (ContentEntry contentEntry : contents) {
@@ -278,7 +273,7 @@
}
final List<ModifiableRootModel> models = new ArrayList<ModifiableRootModel>(myModuleEditors.size());
- for (ModuleEditor moduleEditor : myModuleEditors) {
+ for (ModuleEditor moduleEditor : myModuleEditors.values()) {
moduleEditor.canApply();
}
@@ -287,8 +282,8 @@
for (Map.Entry<Sdk, Sdk> entry : projectJdksModel.getProjectSdks().entrySet()) {
modifiedToOriginalMap.put(entry.getValue(), entry.getKey());
}
-
- for (final ModuleEditor moduleEditor : myModuleEditors) {
+
+ for (final ModuleEditor moduleEditor : myModuleEditors.values()) {
final ModifiableRootModel model = moduleEditor.apply();
if (model != null) {
if (!model.isSdkInherited()) {
@@ -407,7 +402,6 @@
@Override
public void run() {
getOrCreateModuleEditor(module);
- Collections.sort(myModuleEditors, myModuleEditorComparator);
}
});
processModuleCountChanged();
@@ -466,13 +460,13 @@
return false;
}
// do remove
- myModuleEditors.remove(selectedEditor);
+ myModuleEditors.remove(selectedEditor.getModule());
// destroyProcess removed module
final Module moduleToRemove = selectedEditor.getModule();
// remove all dependencies on the module that is about to be removed
List<ModifiableRootModel> modifiableRootModels = new ArrayList<ModifiableRootModel>();
- for (final ModuleEditor moduleEditor : myModuleEditors) {
+ for (final ModuleEditor moduleEditor : myModuleEditors.values()) {
final ModifiableRootModel modifiableRootModel = moduleEditor.getModifiableRootModelProxy();
modifiableRootModels.add(modifiableRootModel);
}
@@ -487,13 +481,13 @@
private void processModuleCountChanged() {
- for (ModuleEditor moduleEditor : myModuleEditors) {
+ for (ModuleEditor moduleEditor : myModuleEditors.values()) {
moduleEditor.moduleCountChanged();
}
}
public void processModuleCompilerOutputChanged(String baseUrl) {
- for (ModuleEditor moduleEditor : myModuleEditors) {
+ for (ModuleEditor moduleEditor : myModuleEditors.values()) {
moduleEditor.updateCompilerOutputPathChanged(baseUrl, moduleEditor.getName());
}
}
@@ -502,7 +496,7 @@
if (myModuleModel.isChanged()) {
return true;
}
- for (ModuleEditor moduleEditor : myModuleEditors) {
+ for (ModuleEditor moduleEditor : myModuleEditors.values()) {
if (moduleEditor.isModified()) {
return true;
}
@@ -552,13 +546,12 @@
}
public void moduleRenamed(Module module, final String oldName, final String name) {
- for (ModuleEditor moduleEditor : myModuleEditors) {
- if (module == moduleEditor.getModule() && Comparing.strEqual(moduleEditor.getName(), oldName)) {
- moduleEditor.setModuleName(name);
- moduleEditor.updateCompilerOutputPathChanged(ProjectStructureConfigurable.getInstance(myProject).getProjectConfig().getCompilerOutputUrl(), name);
- myContext.getDaemonAnalyzer().queueUpdate(new ModuleProjectStructureElement(myContext, module));
- return;
- }
+ ModuleEditor moduleEditor = myModuleEditors.get(module);
+ if (moduleEditor != null && Comparing.strEqual(moduleEditor.getName(), oldName)) {
+ moduleEditor.setModuleName(name);
+ moduleEditor.updateCompilerOutputPathChanged(
+ ProjectStructureConfigurable.getInstance(myProject).getProjectConfig().getCompilerOutputUrl(), name);
+ myContext.getDaemonAnalyzer().queueUpdate(new ModuleProjectStructureElement(myContext, module));
}
}
diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/RefCountHolder.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/RefCountHolder.java
index 2e4a45ed..4195f01 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/RefCountHolder.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/RefCountHolder.java
@@ -278,18 +278,22 @@
TextRange dirtyScope,
@NotNull ProgressIndicator indicator,
@NotNull Runnable analyze) {
+ ProgressIndicator result;
if (myState.compareAndSet(EMPTY, indicator)) {
if (!file.getTextRange().equals(dirtyScope)) {
// empty holder needs filling before it can be used, so restart daemon to re-analyze the whole file
myState.set(EMPTY);
return false;
}
+ result = EMPTY;
}
- else if (!myState.compareAndSet(READY, indicator)) {
+ else if (myState.compareAndSet(READY, indicator)) {
+ result = READY;
+ }
+ else {
log("a: failed to change ", myState, "->", indicator);
return false;
}
- boolean success = false;
try {
log("a: changed ", myState, "->", indicator);
if (dirtyScope != null) {
@@ -302,11 +306,10 @@
}
analyze.run();
- success = true;
+ result = READY;
return true;
}
finally {
- ProgressIndicator result = success ? READY : EMPTY;
boolean set = myState.compareAndSet(indicator, result);
assert set : myState.get();
log("a: changed after analyze", indicator, "->", result);
diff --git a/java/java-impl/java-impl.iml b/java/java-impl/java-impl.iml
index cf601bb..ee71056 100644
--- a/java/java-impl/java-impl.iml
+++ b/java/java-impl/java-impl.iml
@@ -56,11 +56,11 @@
<orderEntry type="module" module-name="java-structure-view" exported="" />
<orderEntry type="module" module-name="spellchecker" />
<orderEntry type="library" name="nekohtml" level="project" />
+ <orderEntry type="module" module-name="built-in-server" />
</component>
<component name="copyright">
<Base>
<setting name="state" value="1" />
</Base>
</component>
-</module>
-
+</module>
\ No newline at end of file
diff --git a/java/java-impl/src/com/intellij/codeInsight/javadoc/JavaDocExternalFilter.java b/java/java-impl/src/com/intellij/codeInsight/javadoc/JavaDocExternalFilter.java
index 07338fc..9eb6939 100644
--- a/java/java-impl/src/com/intellij/codeInsight/javadoc/JavaDocExternalFilter.java
+++ b/java/java-impl/src/com/intellij/codeInsight/javadoc/JavaDocExternalFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,8 +24,9 @@
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.NullableComputable;
-import com.intellij.openapi.util.Trinity;
import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.openapi.vfs.CharsetToolkit;
+import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.JavaPsiFacade;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiElement;
@@ -34,7 +35,10 @@
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.builtInWebServer.BuiltInServerOptions;
+import org.jetbrains.builtInWebServer.WebServerPathToFileManager;
+import java.io.InputStreamReader;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -49,10 +53,10 @@
public class JavaDocExternalFilter extends AbstractExternalFilter {
private final Project myProject;
- private static final Trinity<Pattern, Pattern, Boolean> ourPackageInfoSettings = Trinity.create(
+ private static final ParseSettings ourPackageInfoSettings = new ParseSettings(
Pattern.compile("package\\s+[^\\s]+\\s+description", Pattern.CASE_INSENSITIVE),
Pattern.compile("START OF BOTTOM NAVBAR", Pattern.CASE_INSENSITIVE),
- Boolean.TRUE
+ true, false
);
protected static @NonNls final Pattern ourHTMLsuffix = Pattern.compile("[.][hH][tT][mM][lL]?");
@@ -116,33 +120,55 @@
@Override
@Nullable
- public String getExternalDocInfoForElement(final String docURL, final PsiElement element) throws Exception {
- String externalDoc = super.getExternalDocInfoForElement(docURL, element);
- if (externalDoc != null) {
- if (element instanceof PsiMethod) {
- final String className = ApplicationManager.getApplication().runReadAction(
- new NullableComputable<String>() {
- @Override
- @Nullable
- public String compute() {
- PsiClass aClass = ((PsiMethod)element).getContainingClass();
- return aClass == null ? null : aClass.getQualifiedName();
- }
- }
- );
- Matcher matcher = ourMethodHeading.matcher(externalDoc);
- final StringBuilder buffer = new StringBuilder();
- DocumentationManager.createHyperlink(buffer, className, className, false);
- //noinspection HardCodedStringLiteral
- return matcher.replaceFirst("<H3>" + buffer.toString() + "</H3>");
+ public String getExternalDocInfoForElement(@NotNull String docURL, final PsiElement element) throws Exception {
+ CharSequence externalDoc = null;
+ String builtInServer = "http://localhost:" + BuiltInServerOptions.getInstance().getEffectiveBuiltInServerPort() + "/" + myProject.getName() + "/";
+ if (docURL.startsWith(builtInServer)) {
+ VirtualFile file = WebServerPathToFileManager.getInstance(myProject).get(docURL.substring(builtInServer.length()));
+ if (file != null) {
+ InputStreamReader reader = new InputStreamReader(file.getInputStream(), CharsetToolkit.UTF8_CHARSET);
+ StringBuilder result = new StringBuilder();
+ try {
+ doBuildFromStream(docURL, reader, result);
+ }
+ finally {
+ reader.close();
+ }
+
+ externalDoc = result;
}
}
- return externalDoc;
+
+ if (externalDoc == null) {
+ externalDoc = super.getExternalDocInfoForElement(docURL, element);
+ }
+
+ if (externalDoc == null) {
+ return null;
+ }
+
+ if (element instanceof PsiMethod) {
+ final String className = ApplicationManager.getApplication().runReadAction(
+ new NullableComputable<String>() {
+ @Override
+ @Nullable
+ public String compute() {
+ PsiClass aClass = ((PsiMethod)element).getContainingClass();
+ return aClass == null ? null : aClass.getQualifiedName();
+ }
+ }
+ );
+ Matcher matcher = ourMethodHeading.matcher(externalDoc);
+ StringBuilder buffer = new StringBuilder("<h3>");
+ DocumentationManager.createHyperlink(buffer, className, className, false);
+ return matcher.replaceFirst(buffer.append("</h3>").toString());
+ }
+ return externalDoc.toString();
}
@NotNull
@Override
- protected Trinity<Pattern, Pattern, Boolean> getParseSettings(@NotNull String url) {
+ protected ParseSettings getParseSettings(@NotNull String url) {
return url.endsWith(JavaDocumentationProvider.PACKAGE_SUMMARY_FILE) ? ourPackageInfoSettings : super.getParseSettings(url);
}
}
diff --git a/java/java-impl/src/com/intellij/ide/fileTemplates/JavaCreateFromTemplateHandler.java b/java/java-impl/src/com/intellij/ide/fileTemplates/JavaCreateFromTemplateHandler.java
index 0d0d105..039be69 100644
--- a/java/java-impl/src/com/intellij/ide/fileTemplates/JavaCreateFromTemplateHandler.java
+++ b/java/java-impl/src/com/intellij/ide/fileTemplates/JavaCreateFromTemplateHandler.java
@@ -109,6 +109,9 @@
}
public boolean canCreate(final PsiDirectory[] dirs) {
+ for (PsiDirectory dir : dirs) {
+ if (canCreate(dir)) return true;
+ }
return false;
}
diff --git a/java/java-impl/src/com/intellij/ide/fileTemplates/JavaInternalTemplatesHandler.java b/java/java-impl/src/com/intellij/ide/fileTemplates/JavaInternalTemplatesHandler.java
new file mode 100644
index 0000000..5637e83
--- /dev/null
+++ b/java/java-impl/src/com/intellij/ide/fileTemplates/JavaInternalTemplatesHandler.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2000-2015 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.ide.fileTemplates;
+
+import com.intellij.psi.PsiDirectory;
+import com.intellij.util.ArrayUtil;
+
+public class JavaInternalTemplatesHandler extends JavaCreateFromTemplateHandler {
+
+ @Override
+ public boolean handlesTemplate(FileTemplate template) {
+ return ArrayUtil.contains(template.getName(), JavaTemplateUtil.INTERNAL_JAVA_TEMPLATES);
+ }
+
+ @Override
+ public boolean canCreate(PsiDirectory[] dirs) {
+ return false;
+ }
+}
diff --git a/java/java-impl/src/com/intellij/ide/fileTemplates/JavaTemplateUtil.java b/java/java-impl/src/com/intellij/ide/fileTemplates/JavaTemplateUtil.java
index a3fc37e..8f872d0 100644
--- a/java/java-impl/src/com/intellij/ide/fileTemplates/JavaTemplateUtil.java
+++ b/java/java-impl/src/com/intellij/ide/fileTemplates/JavaTemplateUtil.java
@@ -32,11 +32,15 @@
@NonNls public static final String TEMPLATE_I18NIZED_EXPRESSION = "I18nized Expression.java";
@NonNls public static final String TEMPLATE_I18NIZED_CONCATENATION = "I18nized Concatenation.java";
@NonNls public static final String TEMPLATE_I18NIZED_JSP_EXPRESSION = "I18nized JSP Expression.jsp";
+
@NonNls public static final String INTERNAL_CLASS_TEMPLATE_NAME = "Class";
@NonNls public static final String INTERNAL_INTERFACE_TEMPLATE_NAME = "Interface";
@NonNls public static final String INTERNAL_ANNOTATION_TYPE_TEMPLATE_NAME = "AnnotationType";
@NonNls public static final String INTERNAL_ENUM_TEMPLATE_NAME = "Enum";
+ public static final String[] INTERNAL_JAVA_TEMPLATES = new String[]{INTERNAL_CLASS_TEMPLATE_NAME,
+ INTERNAL_INTERFACE_TEMPLATE_NAME, INTERNAL_ANNOTATION_TYPE_TEMPLATE_NAME, INTERNAL_ENUM_TEMPLATE_NAME};
+
private JavaTemplateUtil() {
}
diff --git a/java/java-impl/src/com/intellij/ide/hierarchy/call/CallerMethodsTreeStructure.java b/java/java-impl/src/com/intellij/ide/hierarchy/call/CallerMethodsTreeStructure.java
index 3253764..6e724c7 100644
--- a/java/java-impl/src/com/intellij/ide/hierarchy/call/CallerMethodsTreeStructure.java
+++ b/java/java-impl/src/com/intellij/ide/hierarchy/call/CallerMethodsTreeStructure.java
@@ -49,14 +49,18 @@
PsiMember enclosingElement = ((CallHierarchyNodeDescriptor)descriptor).getEnclosingElement();
HierarchyNodeDescriptor nodeDescriptor = getBaseDescriptor();
- if (isLocalOrAnonymousClass(enclosingElement)) {
- enclosingElement = CallHierarchyNodeDescriptor.getEnclosingElement(enclosingElement.getParent());
- } else if (enclosingElement instanceof PsiMethod) {
+ if (enclosingElement instanceof PsiMethod) {
PsiClass clazz = enclosingElement.getContainingClass();
if (isLocalOrAnonymousClass(clazz)) {
- enclosingElement = CallHierarchyNodeDescriptor.getEnclosingElement(clazz.getParent());
+ PsiElement parent = clazz.getParent();
+ PsiElement grandParent = parent instanceof PsiNewExpression ? parent.getParent() : null;
+ if (grandParent instanceof PsiExpressionList) {
+ // for created anonymous class that immediately passed as argument use instantiation point as next call point (IDEA-73312)
+ enclosingElement = CallHierarchyNodeDescriptor.getEnclosingElement(grandParent);
+ }
}
}
+
if (!(enclosingElement instanceof PsiMethod) || nodeDescriptor == null) {
return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
diff --git a/java/java-impl/src/com/intellij/lang/java/JavaDocumentationProvider.java b/java/java-impl/src/com/intellij/lang/java/JavaDocumentationProvider.java
index 8baf408..8da8efb 100644
--- a/java/java-impl/src/com/intellij/lang/java/JavaDocumentationProvider.java
+++ b/java/java-impl/src/com/intellij/lang/java/JavaDocumentationProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -50,11 +50,14 @@
import com.intellij.psi.util.PsiFormatUtilBase;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.util.PsiUtil;
+import com.intellij.util.SmartList;
+import com.intellij.util.Url;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.HashMap;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.builtInWebServer.BuiltInWebBrowserUrlProvider;
import java.util.LinkedHashSet;
import java.util.List;
@@ -268,8 +271,8 @@
PsiClass parentClass = method.getContainingClass();
- if (parentClass != null) {
- if (method.isConstructor() && !(parentClass instanceof PsiAnonymousClass)) {
+ if (parentClass != null && !(parentClass instanceof PsiAnonymousClass)) {
+ if (method.isConstructor()) {
generatePackageInfo(buffer, parentClass);
}
@@ -552,14 +555,14 @@
@Nullable
- private static String fetchExternalJavadoc(final PsiElement element, String fromUrl, JavaDocExternalFilter filter) {
+ private static String fetchExternalJavadoc(final PsiElement element, String fromUrl, @NotNull JavaDocExternalFilter filter) {
try {
String externalDoc = filter.getExternalDocInfoForElement(fromUrl, element);
- if (externalDoc != null && externalDoc.length() > 0) {
+ if (!StringUtil.isEmpty(externalDoc)) {
return externalDoc;
}
}
- catch (Exception e) {
+ catch (Exception ignored) {
//try to generate some javadoc
}
return null;
@@ -689,7 +692,7 @@
}
@Nullable
- public static List<String> findUrlForClass(PsiClass aClass) {
+ public static List<String> findUrlForClass(@NotNull PsiClass aClass) {
String qName = aClass.getQualifiedName();
if (qName == null) return null;
@@ -701,18 +704,18 @@
String packageName = ((PsiJavaFile)file).getPackageName();
String relPath;
- if (packageName.length() > 0) {
- relPath = packageName.replace('.', '/') + '/' + qName.substring(packageName.length() + 1) + HTML_EXTENSION;
+ if (packageName.isEmpty()) {
+ relPath = qName + HTML_EXTENSION;
}
else {
- relPath = qName + HTML_EXTENSION;
+ relPath = packageName.replace('.', '/') + '/' + qName.substring(packageName.length() + 1) + HTML_EXTENSION;
}
return findUrlForVirtualFile(file.getProject(), virtualFile, relPath);
}
@Nullable
- public static List<String> findUrlForVirtualFile(final Project project, final VirtualFile virtualFile, final String relPath) {
+ public static List<String> findUrlForVirtualFile(@NotNull Project project, @NotNull VirtualFile virtualFile, @NotNull String relPath) {
final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
Module module = fileIndex.getModuleForFile(virtualFile);
if (module == null) {
@@ -733,11 +736,25 @@
}
}
- final List<OrderEntry> orderEntries = fileIndex.getOrderEntriesForFile(virtualFile);
- for (OrderEntry orderEntry : orderEntries) {
- final String[] files = JavadocOrderRootType.getUrls(orderEntry);
- final List<String> httpRoot = PlatformDocumentationUtil.getHttpRoots(files, relPath);
- if (httpRoot != null) return httpRoot;
+ for (OrderEntry orderEntry : fileIndex.getOrderEntriesForFile(virtualFile)) {
+ for (VirtualFile root : orderEntry.getFiles(JavadocOrderRootType.getInstance())) {
+ if (root.getFileSystem() == JarFileSystem.getInstance()) {
+ VirtualFile file = root.findFileByRelativePath(relPath);
+ List<Url> urls = file == null ? null : BuiltInWebBrowserUrlProvider.getUrls(file, project, null);
+ if (!ContainerUtil.isEmpty(urls)) {
+ List<String> result = new SmartList<String>();
+ for (Url url : urls) {
+ result.add(url.toExternalForm());
+ }
+ return result;
+ }
+ }
+ }
+
+ List<String> httpRoot = PlatformDocumentationUtil.getHttpRoots(JavadocOrderRootType.getUrls(orderEntry), relPath);
+ if (httpRoot != null) {
+ return httpRoot;
+ }
}
return null;
}
@@ -761,7 +778,7 @@
}
@Override
- public String fetchExternalDocumentation(final Project project, PsiElement element, final List<String> docUrls) {
+ public String fetchExternalDocumentation(Project project, PsiElement element, List<String> docUrls) {
return fetchExternalJavadoc(element, project, docUrls);
}
@@ -780,9 +797,7 @@
}
public static String fetchExternalJavadoc(PsiElement element, final Project project, final List<String> docURLs) {
- final JavaDocExternalFilter docFilter = new JavaDocExternalFilter(project);
-
- return fetchExternalJavadoc(element, docURLs, docFilter);
+ return fetchExternalJavadoc(element, docURLs, new JavaDocExternalFilter(project));
}
public static String fetchExternalJavadoc(PsiElement element, List<String> docURLs, @NotNull JavaDocExternalFilter docFilter) {
diff --git a/java/java-impl/src/com/intellij/refactoring/safeDelete/JavaSafeDeleteDelegateImpl.java b/java/java-impl/src/com/intellij/refactoring/safeDelete/JavaSafeDeleteDelegateImpl.java
index b3d10e6..a57af58 100644
--- a/java/java-impl/src/com/intellij/refactoring/safeDelete/JavaSafeDeleteDelegateImpl.java
+++ b/java/java-impl/src/com/intellij/refactoring/safeDelete/JavaSafeDeleteDelegateImpl.java
@@ -76,7 +76,7 @@
newText.append(StringUtil.join(parameters, new Function<PsiParameter, String>() {
@Override
public String fun(PsiParameter psiParameter) {
- return parameter.getType().getCanonicalText();
+ return psiParameter.getType().getCanonicalText();
}
}, ","));
newText.append(")*/");
diff --git a/java/java-psi-api/src/com/intellij/codeInsight/NullableNotNullManager.java b/java/java-psi-api/src/com/intellij/codeInsight/NullableNotNullManager.java
index 6e74999..d5cf095 100644
--- a/java/java-psi-api/src/com/intellij/codeInsight/NullableNotNullManager.java
+++ b/java/java-psi-api/src/com/intellij/codeInsight/NullableNotNullManager.java
@@ -169,13 +169,16 @@
@Nullable
private PsiAnnotation findNullabilityAnnotationWithDefault(@NotNull PsiModifierListOwner owner, boolean checkBases, boolean nullable) {
- PsiAnnotation annotation = findPlainNullabilityAnnotation(owner, checkBases, nullable);
+ PsiAnnotation annotation = findPlainNullabilityAnnotation(owner, checkBases);
if (annotation != null) {
+ String qName = annotation.getQualifiedName();
+ if (qName == null) return null;
+
+ List<String> contradictory = nullable ? getNotNulls() : getNullables();
+ if (contradictory.contains(qName)) return null;
+
return annotation;
}
- if (findPlainNullabilityAnnotation(owner, checkBases, !nullable) != null) {
- return null;
- }
PsiType type = getOwnerType(owner);
if (type == null || TypeConversionUtil.isPrimitiveAndNotNull(type)) return null;
@@ -192,8 +195,9 @@
return findNullabilityDefaultInHierarchy(owner, nullable);
}
- private PsiAnnotation findPlainNullabilityAnnotation(@NotNull PsiModifierListOwner owner, boolean checkBases, boolean nullable) {
- Set<String> qNames = ContainerUtil.newHashSet(nullable ? getNullables() : getNotNulls());
+ private PsiAnnotation findPlainNullabilityAnnotation(@NotNull PsiModifierListOwner owner, boolean checkBases) {
+ Set<String> qNames = ContainerUtil.newHashSet(getNullables());
+ qNames.addAll(getNotNulls());
return checkBases && owner instanceof PsiMethod
? AnnotationUtil.findAnnotationInHierarchy(owner, qNames)
: AnnotationUtil.findAnnotation(owner, qNames);
diff --git a/java/java-psi-api/src/com/intellij/patterns/PsiExpressionPattern.java b/java/java-psi-api/src/com/intellij/patterns/PsiExpressionPattern.java
index 2ef65dc..1b4b184 100644
--- a/java/java-psi-api/src/com/intellij/patterns/PsiExpressionPattern.java
+++ b/java/java-psi-api/src/com/intellij/patterns/PsiExpressionPattern.java
@@ -18,6 +18,7 @@
import com.intellij.psi.*;
import com.intellij.util.ProcessingContext;
+import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
/**
@@ -37,10 +38,15 @@
}
public PsiMethodCallPattern methodCall(final ElementPattern<? extends PsiMethod> method) {
+ final PsiNamePatternCondition nameCondition = ContainerUtil.findInstance(method.getCondition().getConditions(), PsiNamePatternCondition.class);
return new PsiMethodCallPattern().and(this).with(new PatternCondition<PsiMethodCallExpression>("methodCall") {
public boolean accepts(@NotNull PsiMethodCallExpression callExpression, ProcessingContext context) {
- final JavaResolveResult[] results = callExpression.getMethodExpression().multiResolve(true);
- for (JavaResolveResult result : results) {
+ PsiReferenceExpression methodExpression = callExpression.getMethodExpression();
+ if (nameCondition != null && !nameCondition.getNamePattern().accepts(methodExpression.getReferenceName())) {
+ return false;
+ }
+
+ for (JavaResolveResult result : methodExpression.multiResolve(true)) {
if (method.accepts(result.getElement(), context)) {
return true;
}
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/java/stubs/JavaModifierListElementType.java b/java/java-psi-impl/src/com/intellij/psi/impl/java/stubs/JavaModifierListElementType.java
index f919104..6f9e9f0 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/java/stubs/JavaModifierListElementType.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/java/stubs/JavaModifierListElementType.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,7 +22,6 @@
import com.intellij.psi.impl.cache.RecordUtil;
import com.intellij.psi.impl.java.stubs.impl.PsiModifierListStubImpl;
import com.intellij.psi.impl.source.PsiModifierListImpl;
-import com.intellij.psi.impl.source.tree.JavaElementType;
import com.intellij.psi.impl.source.tree.java.ModifierListElement;
import com.intellij.psi.stubs.IndexSink;
import com.intellij.psi.stubs.StubElement;
@@ -33,6 +32,8 @@
import java.io.IOException;
+import static com.intellij.psi.impl.source.tree.JavaElementType.*;
+
/**
* @author max
*/
@@ -80,8 +81,8 @@
return shouldCreateStub(parentType);
}
- private static boolean shouldCreateStub(final IElementType parentType) {
- return parentType != null && parentType != JavaElementType.LOCAL_VARIABLE && parentType != JavaElementType.RESOURCE_VARIABLE;
+ private static boolean shouldCreateStub(IElementType parentType) {
+ return parentType != null && parentType != LOCAL_VARIABLE && parentType != RESOURCE_VARIABLE && parentType != RESOURCE_LIST;
}
@NotNull
@@ -91,6 +92,5 @@
}
@Override
- public void indexStub(@NotNull final PsiModifierListStub stub, @NotNull final IndexSink sink) {
- }
+ public void indexStub(@NotNull final PsiModifierListStub stub, @NotNull final IndexSink sink) { }
}
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/constraints/PsiMethodReferenceCompatibilityConstraint.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/constraints/PsiMethodReferenceCompatibilityConstraint.java
index 83e7151..b3e7d3c 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/constraints/PsiMethodReferenceCompatibilityConstraint.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/constraints/PsiMethodReferenceCompatibilityConstraint.java
@@ -185,7 +185,7 @@
//the constraint reduces to the bound set B3 which would be used to determine the method reference's invocation type
//when targeting the return type of the function type, as defined in 18.5.2.
session.collectApplicabilityConstraints(myExpression, ((MethodCandidateInfo)resolve), groundTargetType);
- session.registerReturnTypeConstraints(referencedMethodReturnType, returnType);
+ session.registerReturnTypeConstraints(psiSubstitutor.substitute(referencedMethodReturnType), returnType);
return true;
}
}
diff --git a/java/java-tests/testData/codeInsight/documentation/ReferenceStyleDoesntMatchBytecodeVersion.html b/java/java-tests/testData/codeInsight/documentation/ReferenceStyleDoesntMatchBytecodeVersion.html
new file mode 100644
index 0000000..c95a84e
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/documentation/ReferenceStyleDoesntMatchBytecodeVersion.html
@@ -0,0 +1,29 @@
+<HTML><base href="placeholder"><style type="text/css"> ul.inheritance {
+ margin:0;
+ padding:0;
+ }
+ ul.inheritance li {
+ display:inline;
+ list-style:none;
+ }
+ ul.inheritance li ul.inheritance {
+ margin-left:15px;
+ padding-left:15px;
+ padding-top:1px;
+ }
+</style><a name="param()">
+<!-- -->
+</a>
+<ul class="blockListLast">
+<h3><a href="psi_element://com.jetbrains.TestAnnotation"><code>com.jetbrains.TestAnnotation</code></a></h3>
+<pre>public abstract java.lang.String param</pre>
+<div class="block">Some info</div>
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</div>
+</HTML>
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/documentation/library-javadoc.jar b/java/java-tests/testData/codeInsight/documentation/library-javadoc.jar
index 1b4c027..0cef56a 100644
--- a/java/java-tests/testData/codeInsight/documentation/library-javadoc.jar
+++ b/java/java-tests/testData/codeInsight/documentation/library-javadoc.jar
Binary files differ
diff --git a/java/java-tests/testData/codeInsight/documentation/library.jar b/java/java-tests/testData/codeInsight/documentation/library.jar
index 09fef7a..3a251a0 100644
--- a/java/java-tests/testData/codeInsight/documentation/library.jar
+++ b/java/java-tests/testData/codeInsight/documentation/library.jar
Binary files differ
diff --git a/java/java-tests/testData/ide/hierarchy/call/Anonymous/A.java b/java/java-tests/testData/ide/hierarchy/call/Anonymous/A.java
deleted file mode 100644
index e69b30f..0000000
--- a/java/java-tests/testData/ide/hierarchy/call/Anonymous/A.java
+++ /dev/null
@@ -1,15 +0,0 @@
-abstract class A {
- A(int a) {}
-
- abstract void g();
-
- void h() {
- f();
- }
-
- void f() {
- A x = new A(42) {
- void g() {}
- };
- }
-}
\ No newline at end of file
diff --git a/java/java-tests/testData/ide/hierarchy/call/Anonymous/Anonymous_verification.xml b/java/java-tests/testData/ide/hierarchy/call/Anonymous/Anonymous_verification.xml
deleted file mode 100644
index b4ba745..0000000
--- a/java/java-tests/testData/ide/hierarchy/call/Anonymous/Anonymous_verification.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<node text="A.A(int) ()" base="true">
- <node text="Anonymous in f() in A ()">
- <node text="A.h() ()"/>
- </node>
-</node>
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/NotNullOverridesNullable.java b/java/java-tests/testData/inspection/dataFlow/fixture/NotNullOverridesNullable.java
new file mode 100644
index 0000000..34bae955
--- /dev/null
+++ b/java/java-tests/testData/inspection/dataFlow/fixture/NotNullOverridesNullable.java
@@ -0,0 +1,26 @@
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.lang.Object;
+import java.lang.Override;
+
+class Super {
+ @Nullable Object foo() {
+ return null;
+ }
+}
+
+class Main extends Super {
+ @NotNull
+ @Override
+ Object foo() {
+ return 2;
+ }
+
+ void bar(@NotNull Object o) {}
+
+ void goo() {
+ bar(foo());
+ }
+
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/safeDelete/DeleteParameterAndUpdateJavadocRef.java b/java/java-tests/testData/refactoring/safeDelete/DeleteParameterAndUpdateJavadocRef.java
new file mode 100644
index 0000000..d2db572
--- /dev/null
+++ b/java/java-tests/testData/refactoring/safeDelete/DeleteParameterAndUpdateJavadocRef.java
@@ -0,0 +1,6 @@
+class Test {
+ public void abc(Integer arg1, String ar<caret>g2, Integer arg3) {}
+
+ /** {@link #abc(Integer, String, Integer)} */
+ public void def() {}
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/safeDelete/DeleteParameterAndUpdateJavadocRef_after.java b/java/java-tests/testData/refactoring/safeDelete/DeleteParameterAndUpdateJavadocRef_after.java
new file mode 100644
index 0000000..c4703325
--- /dev/null
+++ b/java/java-tests/testData/refactoring/safeDelete/DeleteParameterAndUpdateJavadocRef_after.java
@@ -0,0 +1,6 @@
+class Test {
+ public void abc(Integer arg1, Integer arg3) {}
+
+ /** {@link #abc(Integer, Integer)} */
+ public void def() {}
+}
\ No newline at end of file
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/JavaDocumentationTest.groovy b/java/java-tests/testSrc/com/intellij/codeInsight/JavaDocumentationTest.groovy
index 306367f..d19a988 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/JavaDocumentationTest.groovy
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/JavaDocumentationTest.groovy
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@
class JavaDocumentationTest extends LightCodeInsightFixtureTestCase {
public void testConstructorDoc() {
- myFixture.configureByText 'a.java', '''
+ configure '''
class Foo { Foo() {} Foo(int param) {} }
class Foo2 {{
@@ -43,7 +43,7 @@
}
public void testConstructorDoc2() {
- myFixture.configureByText 'a.java', '''
+ configure '''
class Foo { Foo() {} Foo(int param) {} }
class Foo2 {{
@@ -62,7 +62,7 @@
}
public void testMethodDocWhenInArgList() {
- myFixture.configureByText 'a.java', '''
+ configure '''
class Foo { void doFoo() {} }
class Foo2 {{
@@ -79,7 +79,7 @@
}
public void testGenericMethod() {
- myFixture.configureByText 'a.java', '''
+ configure '''
class Bar<T> { java.util.List<T> foo(T param); }
class Foo {{
@@ -92,7 +92,7 @@
}
public void testGenericField() {
- myFixture.configureByText 'a.java', '''
+ configure '''
class Bar<T> { T field; }
class Foo {{
@@ -103,5 +103,24 @@
assert CtrlMouseHandler.getInfo(ref.resolve(), ref.element) == """Bar
java.lang.Integer field"""
}
+
+ public void testMethodInAnonymousClass() {
+ configure '''
+class Foo {{
+ new Runnable() {
+ @Override
+ public void run() {
+ <caret>m();
+ }
+
+ private void m() {}
+ }.run();
+}}
+'''
+ assert CtrlMouseHandler.getInfo(editor, CtrlMouseHandler.BrowseMode.Declaration) == "private void m ()"
+ }
+ private void configure(String text) {
+ myFixture.configureByText 'a.java', text
+ }
}
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/JavaExternalDocumentationTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/JavaExternalDocumentationTest.java
index 603ffb0..49c12a4 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/JavaExternalDocumentationTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/JavaExternalDocumentationTest.java
@@ -30,30 +30,35 @@
import com.intellij.openapi.roots.OrderRootType;
import com.intellij.openapi.roots.libraries.Library;
import com.intellij.openapi.roots.libraries.LibraryTablesRegistrar;
-import com.intellij.openapi.ui.popup.JBPopup;
import com.intellij.openapi.util.ActionCallback;
import com.intellij.openapi.util.Disposer;
-import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.JarFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiFileFactory;
+import com.intellij.testFramework.EditorTestUtil;
import com.intellij.testFramework.PlatformTestCase;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
-import javax.swing.*;
-import javax.swing.text.html.HTML;
-import javax.swing.text.html.HTMLDocument;
import java.io.File;
-import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
public class JavaExternalDocumentationTest extends PlatformTestCase {
- public void testImagesInsideJavadocJar() throws Exception {
+
+ public static final Pattern BASE_URL_PATTERN = Pattern.compile("(<base href=\")([^\"]*)");
+ public static final Pattern IMG_URL_PATTERN = Pattern.compile("<img src=\"([^\"]*)");
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
final VirtualFile libClasses = getJarFile("library.jar");
final VirtualFile libJavadocJar = getJarFile("library-javadoc.jar");
@@ -71,32 +76,37 @@
ModuleRootModificationUtil.addDependency(modules[0], library);
}
});
+ }
- PsiFile psiFile =
- PsiFileFactory.getInstance(myProject).createFileFromText(JavaLanguage.INSTANCE, "class Foo { com.jetbrains.Test field; }");
- Document document = PsiDocumentManager.getInstance(myProject).getDocument(psiFile);
- assertNotNull(document);
- Editor editor = EditorFactory.getInstance().createEditor(document, myProject);
+ public void testImagesInsideJavadocJar() throws Exception {
+ String text = getDocumentationText("class Foo { com.jetbrains.<caret>Test field; }");
+ Matcher baseUrlmatcher = BASE_URL_PATTERN.matcher(text);
+ assertTrue(baseUrlmatcher.find());
+ String baseUrl = baseUrlmatcher.group(2);
+ Matcher imgMatcher = IMG_URL_PATTERN.matcher(text);
+ assertTrue(imgMatcher.find());
+ String relativeUrl = imgMatcher.group(1);
+ URL imageUrl = new URL(new URL(baseUrl), relativeUrl);
+ InputStream stream = imageUrl.openStream();
try {
- editor.getCaretModel().moveToOffset(document.getText().indexOf("Test"));
- DocumentationManager documentationManager = DocumentationManager.getInstance(myProject);
- documentationManager.showJavaDocInfo(editor, psiFile, false);
- waitTillDone(documentationManager.getLastAction());
- JBPopup popup = documentationManager.getDocInfoHint();
- assertNotNull(popup);
- DocumentationComponent documentationComponent = (DocumentationComponent)popup.getContent().getComponent(0);
- try {
- byte[] imageData = getImageDataFromDocumentationComponent(documentationComponent);
- assertEquals(228, imageData.length);
- }
- finally {
- Disposer.dispose(documentationComponent);
- }
+ assertEquals(228, FileUtil.loadBytes(stream).length);
}
finally {
- EditorFactory.getInstance().releaseEditor(editor);
+ stream.close();
}
}
+
+ // We're guessing style of references in javadoc by bytecode version of library class file
+ // but displaying quick doc should work even if javadoc was generated using a JDK not corresponding to bytecode version
+ public void testReferenceStyleDoesntMatchBytecodeVersion() throws Exception {
+ String actualText = getDocumentationText("@com.jetbrains.TestAnnotation(<caret>param = \"foo\") class Foo {}");
+ String expectedText = StringUtil.convertLineSeparators(FileUtil.loadFile(getDataFile(getTestName(false) + ".html")));
+ assertEquals(expectedText, replaceBaseUrlWithPlaceholder(actualText));
+ }
+
+ private static String replaceBaseUrlWithPlaceholder(String actualText) {
+ return BASE_URL_PATTERN.matcher(actualText).replaceAll("$1placeholder");
+ }
private static void waitTillDone(ActionCallback actionCallback) throws InterruptedException {
long start = System.currentTimeMillis();
@@ -109,47 +119,74 @@
fail("Timed out waiting for documentation to show");
}
+ private static File getDataFile(String name) {
+ return new File(JavaTestUtil.getJavaTestDataPath() + "/codeInsight/documentation/" + name);
+ }
+
@NotNull
private static VirtualFile getJarFile(String name) {
- VirtualFile file = getVirtualFile(new File(JavaTestUtil.getJavaTestDataPath() + "/codeInsight/documentation/" + name));
+ VirtualFile file = getVirtualFile(getDataFile(name));
assertNotNull(file);
VirtualFile jarFile = JarFileSystem.getInstance().getJarRootForLocalFile(file);
assertNotNull(jarFile);
return jarFile;
}
-
- private static byte[] getImageDataFromDocumentationComponent(DocumentationComponent documentationComponent) throws Exception {
- JEditorPane editorPane = (JEditorPane)documentationComponent.getComponent();
- final HTMLDocument document = (HTMLDocument)editorPane.getDocument();
- final Ref<byte[]> result = new Ref<byte[]>();
- document.render(new Runnable() {
- @Override
- public void run() {
- try {
- HTMLDocument.Iterator it = document.getIterator(HTML.Tag.IMG);
- assertTrue(it.isValid());
- String relativeUrl = (String)it.getAttributes().getAttribute(HTML.Attribute.SRC);
- it.next();
- assertFalse(it.isValid());
- URL imageUrl = new URL(document.getBase(), relativeUrl);
- InputStream stream = imageUrl.openStream();
- try {
- result.set(FileUtil.loadBytes(stream));
- }
- finally {
- stream.close();
- }
- }
- catch (IOException e) {
- throw new RuntimeException(e);
- }
+
+ private String getDocumentationText(String sourceEditorText) throws Exception {
+ int caretPosition = sourceEditorText.indexOf(EditorTestUtil.CARET_TAG);
+ if (caretPosition >= 0) {
+ sourceEditorText = sourceEditorText.substring(0, caretPosition) +
+ sourceEditorText.substring(caretPosition + EditorTestUtil.CARET_TAG.length());
+ }
+ PsiFile psiFile = PsiFileFactory.getInstance(myProject).createFileFromText(JavaLanguage.INSTANCE, sourceEditorText);
+ Document document = PsiDocumentManager.getInstance(myProject).getDocument(psiFile);
+ assertNotNull(document);
+ Editor editor = EditorFactory.getInstance().createEditor(document, myProject);
+ try {
+ if (caretPosition >= 0) {
+ editor.getCaretModel().moveToOffset(caretPosition);
}
- });
- return result.get();
+ DocumentationManager documentationManager = DocumentationManager.getInstance(myProject);
+ MockDocumentationComponent documentationComponent = new MockDocumentationComponent(documentationManager);
+ try {
+ documentationManager.setDocumentationComponent(documentationComponent);
+ documentationManager.showJavaDocInfo(editor, psiFile, false);
+ waitTillDone(documentationManager.getLastAction());
+ return documentationComponent.getText();
+ }
+ finally {
+ Disposer.dispose(documentationComponent);
+ }
+ }
+ finally {
+ EditorFactory.getInstance().releaseEditor(editor);
+ }
}
@Override
protected boolean isRunInWriteAction() {
return false;
}
+
+ private static class MockDocumentationComponent extends DocumentationComponent {
+ private String myText;
+
+ public MockDocumentationComponent(DocumentationManager manager) {
+ super(manager);
+ }
+
+ @Override
+ public void setText(String text, PsiElement element, boolean clean, boolean clearHistory) {
+ myText = text;
+ }
+
+ @Override
+ public void setData(PsiElement _element, String text, boolean clearHistory, String effectiveExternalUrl) {
+ myText = text;
+ }
+
+ public String getText() {
+ return myText;
+ }
+ }
}
diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspectionTest.java b/java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspectionTest.java
index 2aa0ab7..c89db89 100644
--- a/java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspectionTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspectionTest.java
@@ -278,6 +278,8 @@
public void testSameComparisonTwice() { doTest(); }
public void testRootThrowableCause() { doTest(); }
+ public void testNotNullOverridesNullable() { doTest(); }
+
public void testOverridingInferredNotNullMethod() { doTest(); }
public void testUseInferredContracts() { doTest(); }
public void testContractWithNoArgs() { doTest(); }
diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspectionTestSuite.java b/java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspectionTestSuite.java
index fd8147b..674a0f8 100644
--- a/java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspectionTestSuite.java
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspectionTestSuite.java
@@ -37,6 +37,8 @@
suite.addTestSuite(SliceBackwardTest.class);
suite.addTestSuite(SmartTypeCompletionDfaTest.class);
suite.addTestSuite(NormalCompletionDfaTest.class);
+ suite.addTestSuite(NullableStuffInspectionTest.class);
+ suite.addTestSuite(NullableStuffInspection14Test.class);
return suite;
}
}
diff --git a/java/java-tests/testSrc/com/intellij/ide/fileTemplates/JavaFileTemplatesTest.java b/java/java-tests/testSrc/com/intellij/ide/fileTemplates/JavaFileTemplatesTest.java
new file mode 100644
index 0000000..65f4a60
--- /dev/null
+++ b/java/java-tests/testSrc/com/intellij/ide/fileTemplates/JavaFileTemplatesTest.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2000-2015 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.ide.fileTemplates;
+
+import com.intellij.ide.fileTemplates.actions.CreateFromTemplateAction;
+import com.intellij.ide.fileTemplates.actions.CreateFromTemplateGroup;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.util.Condition;
+import com.intellij.testFramework.TestActionEvent;
+import com.intellij.testFramework.TestDataProvider;
+import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
+import com.intellij.util.containers.ContainerUtil;
+
+public class JavaFileTemplatesTest extends LightCodeInsightFixtureTestCase {
+
+ public void testCreateFromTemplateGroup() throws Exception {
+
+ myFixture.configureByText("foo.java", "");
+ AnAction[] children = new CreateFromTemplateGroup().getChildren(new TestActionEvent(new TestDataProvider(getProject())));
+ assertNull(ContainerUtil.find(children, new Condition<AnAction>() {
+ @Override
+ public boolean value(AnAction action) {
+ return action instanceof CreateFromTemplateAction && ((CreateFromTemplateAction)action).getTemplate().getName().equals("Class");
+ }
+ }));
+ assertNotNull(ContainerUtil.find(children, new Condition<AnAction>() {
+ @Override
+ public boolean value(AnAction action) {
+ return action instanceof CreateFromTemplateAction && ((CreateFromTemplateAction)action).getTemplate().getName().equals("Singleton");
+ }
+ }));
+ }
+}
diff --git a/java/java-tests/testSrc/com/intellij/ide/hierarchy/JavaCallHierarchyTest.java b/java/java-tests/testSrc/com/intellij/ide/hierarchy/JavaCallHierarchyTest.java
index 985489f..f457742 100644
--- a/java/java-tests/testSrc/com/intellij/ide/hierarchy/JavaCallHierarchyTest.java
+++ b/java/java-tests/testSrc/com/intellij/ide/hierarchy/JavaCallHierarchyTest.java
@@ -57,10 +57,6 @@
doJavaCallTypeHierarchyTest("A", "main", "B.java", "A.java");
}
- public void testAnonymous() throws Exception {
- doJavaCallTypeHierarchyTest("A", "A", "A.java");
- }
-
public void testAnonymous2() throws Exception {
doJavaCallTypeHierarchyTest("A", "doIt", "A.java");
}
diff --git a/java/java-tests/testSrc/com/intellij/psi/JavaStubBuilderTest.java b/java/java-tests/testSrc/com/intellij/psi/JavaStubBuilderTest.java
index 13116a0..230b9f4 100644
--- a/java/java-tests/testSrc/com/intellij/psi/JavaStubBuilderTest.java
+++ b/java/java-tests/testSrc/com/intellij/psi/JavaStubBuilderTest.java
@@ -285,6 +285,7 @@
" try (Resource r = new Resource() {\n" +
" @Override public void close() { }\n" +
" }) { }\n" +
+ " try (new Resource()) { }" +
" }\n" +
"}",
diff --git a/java/java-tests/testSrc/com/intellij/psi/impl/smartPointers/SmartPsiElementPointersTest.java b/java/java-tests/testSrc/com/intellij/psi/impl/smartPointers/SmartPsiElementPointersTest.java
index eea4d02..6fd6e05 100644
--- a/java/java-tests/testSrc/com/intellij/psi/impl/smartPointers/SmartPsiElementPointersTest.java
+++ b/java/java-tests/testSrc/com/intellij/psi/impl/smartPointers/SmartPsiElementPointersTest.java
@@ -19,7 +19,6 @@
import com.intellij.codeInsight.CodeInsightTestCase;
import com.intellij.ide.highlighter.HtmlFileType;
import com.intellij.ide.highlighter.JavaFileType;
-import com.intellij.ide.highlighter.XmlFileType;
import com.intellij.lang.FileASTNode;
import com.intellij.openapi.command.WriteCommandAction;
import com.intellij.openapi.editor.Document;
@@ -515,12 +514,26 @@
}
public void testInXml2() {
- final PsiFile file = configureByText(XmlFileType.INSTANCE,
+ final PsiFile file = configureByText(HtmlFileType.INSTANCE,
+ "<!DOCTYPE html>\n" +
"<html>\n" +
+ "<head>\n" +
+ " <title></title>\n" +
+ "</head>\n" +
+ "<body>\n" +
+ "<div class=\"cls\">\n" +
" <ul class=\"dropdown-menu\">\n" +
+ " <li><a href=\"#\">Action</a></li>\n" +
+ " <li><a href=\"#\">Another action</a></li>\n" +
+ " <li><a href=\"#\">Something else here</a></li>\n" +
+ " <li class=\"divider\"></li>\n" +
+ " <li class=\"dropdown-header\">Nav header</li>\n" +
+ " <li><a href=\"#\">Separated link</a></li>\n" +
" <li><a href=\"#\">One more separated link</a></li>\n" +
" </ul>\n" +
"<caret>\n" +
+ "</div>\n" +
+ "</body>\n" +
"</html>"
);
@@ -529,14 +542,17 @@
assertEquals("ul", ul.getName());
assertEquals("dropdown-menu", ul.getAttributeValue("class"));
- SmartPsiElementPointer<XmlTag> ulPointer = SmartPointerManager.getInstance(getProject()).createSmartPsiElementPointer(ul);
+ final SmartPsiElementPointer<XmlTag> ulPointer = SmartPointerManager.getInstance(getProject()).createSmartPsiElementPointer(
+ ul);
WriteCommandAction.runWriteCommandAction(getProject(), new Runnable() {
@Override
public void run() {
- int offset = getEditor().getCaretModel().getOffset();
- getEditor().getDocument().insertString(offset, " <ul class=\"nav navbar-nav navbar-right\">\n" +
- " </ul>\n");
+ getEditor().getDocument().insertString(getEditor().getCaretModel().getOffset(), " <ul class=\"nav navbar-nav navbar-right\">\n" +
+ " <li><a href=\"../navbar/\">Default</a></li>\n" +
+ " <li class=\"active\"><a href=\"./\">Static top</a></li>\n" +
+ " <li><a href=\"../navbar-fixed-top/\">Fixed top</a></li>\n" +
+ " </ul>\n");
}
});
diff --git a/java/java-tests/testSrc/com/intellij/refactoring/SafeDeleteTest.java b/java/java-tests/testSrc/com/intellij/refactoring/SafeDeleteTest.java
index efba685..9d1e405 100644
--- a/java/java-tests/testSrc/com/intellij/refactoring/SafeDeleteTest.java
+++ b/java/java-tests/testSrc/com/intellij/refactoring/SafeDeleteTest.java
@@ -112,6 +112,10 @@
doSingleFileTest();
}
+ public void testDeleteParameterAndUpdateJavadocRef() throws Exception {
+ doSingleFileTest();
+ }
+
public void testDeleteConstructorParameterWithAnonymousClassUsage() throws Exception {
doSingleFileTest();
}
diff --git a/java/java-tests/testSrc/com/intellij/roots/OrderEnumeratorTest.java b/java/java-tests/testSrc/com/intellij/roots/OrderEnumeratorTest.java
index 493ff00..7d54a48 100644
--- a/java/java-tests/testSrc/com/intellij/roots/OrderEnumeratorTest.java
+++ b/java/java-tests/testSrc/com/intellij/roots/OrderEnumeratorTest.java
@@ -85,6 +85,8 @@
getJDomJar());
assertClassRoots(orderEntries(myModule).withoutSdk().withoutDepModules().withoutModuleSourceEntries());
assertEnumeratorRoots(orderEntries(myModule).productionOnly().withoutModuleSourceEntries().withoutSdk().withoutDepModules().classes());
+
+ assertOrderedEquals(orderEntries(myModule).getAllLibrariesAndSdkClassesRoots(), getRtJarJdk17(), getJDomJar());
}
public void testModuleDependencyScope() throws Exception {
diff --git a/native/MacLauncher/Launcher.m b/native/MacLauncher/Launcher.m
index bb5d31a..2aed256 100644
--- a/native/MacLauncher/Launcher.m
+++ b/native/MacLauncher/Launcher.m
@@ -231,7 +231,26 @@
return jdkBundle;
}
}
-
+
+ NSFileManager *fileManager = [NSFileManager defaultManager];
+
+ NSString *pathForFile = [NSString stringWithFormat:@"%@/%@.jdk", getPreferencesFolderPath(), getExecutable()];
+
+ if ([fileManager fileExistsAtPath:pathForFile]){
+ NSString* fileContents = [NSString stringWithContentsOfFile:pathForFile encoding:NSUTF8StringEncoding error:nil];
+ NSArray* allLinedStrings = [fileContents componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]];
+ if (allLinedStrings.count > 0) {
+ NSString* jdkFromProfile = allLinedStrings[0];
+ NSBundle *jdkBundle = [NSBundle bundleWithPath:jdkFromProfile];
+ if (jdkBundle != nil && ![jvmVersion(jdkBundle) isEqualToString:@"0"]) {
+ // If the user chooses a VM, use it even if it doesn't satisfy Info.pList
+ debugLog(@"User VM from IDE profile:");
+ debugLog([jdkBundle bundlePath]);
+ return jdkBundle;
+ }
+ }
+ }
+
NSArray *vmBundles = [allVms() sortedArrayUsingFunction:compareVMVersions context:NULL];
if (isDebugEnabled()) {
diff --git a/platform/built-in-server/src/org/jetbrains/builtInWebServer/DefaultWebServerRootsProvider.java b/platform/built-in-server/src/org/jetbrains/builtInWebServer/DefaultWebServerRootsProvider.java
index fa09f74..d5e53af 100644
--- a/platform/built-in-server/src/org/jetbrains/builtInWebServer/DefaultWebServerRootsProvider.java
+++ b/platform/built-in-server/src/org/jetbrains/builtInWebServer/DefaultWebServerRootsProvider.java
@@ -33,6 +33,8 @@
import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.openapi.vfs.JarFileSystem;
+import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.PairFunction;
import com.intellij.util.PlatformUtils;
@@ -207,7 +209,8 @@
DirectoryInfo info = directoryIndex.getInfoForFile(file);
// we serve excluded files
if (!info.isExcluded() && !info.isInProject()) {
- return null;
+ // javadoc jars is "not under project", but actually is, so, let's check project library table
+ return file.getFileSystem() == JarFileSystem.getInstance() ? getInfoForDocJar(file, project) : null;
}
VirtualFile root = info.getSourceRoot();
@@ -246,6 +249,59 @@
}
@Nullable
+ private static PathInfo getInfoForDocJar(@NotNull final VirtualFile file, @NotNull final Project project) {
+ final OrderRootType javaDocRootType = JavadocOrderRootType.getInstance();
+ if (javaDocRootType == null) {
+ return null;
+ }
+
+ class LibraryProcessor implements Processor<Library> {
+ PathInfo result;
+ Module module;
+
+ @Override
+ public boolean process(Library library) {
+ for (VirtualFile root : library.getFiles(javaDocRootType)) {
+ if (VfsUtilCore.isAncestor(root, file, false)) {
+ result = new PathInfo(file, root, getModuleNameQualifier(project, module), true);
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+
+ LibraryProcessor processor = new LibraryProcessor();
+ AccessToken token = ReadAction.start();
+ try {
+ ModuleManager moduleManager = ModuleManager.getInstance(project);
+ for (Module module : moduleManager.getModules()) {
+ if (module.isDisposed()) {
+ continue;
+ }
+
+ processor.module = module;
+ ModuleRootManager.getInstance(module).orderEntries().forEachLibrary(processor);
+ if (processor.result != null) {
+ return processor.result;
+ }
+ }
+
+ processor.module = null;
+ for (Library library : LibraryTablesRegistrar.getInstance().getLibraryTable(project).getLibraries()) {
+ if (!processor.process(library)) {
+ return processor.result;
+ }
+ }
+ }
+ finally {
+ token.finish();
+ }
+
+ return null;
+ }
+
+ @Nullable
private static String getModuleNameQualifier(@NotNull Project project, @Nullable Module module) {
if (module != null &&
PlatformUtils.isIntelliJ() &&
diff --git a/platform/built-in-server/src/org/jetbrains/io/FileResponses.java b/platform/built-in-server/src/org/jetbrains/io/FileResponses.java
index c9323e0..b572d39 100644
--- a/platform/built-in-server/src/org/jetbrains/io/FileResponses.java
+++ b/platform/built-in-server/src/org/jetbrains/io/FileResponses.java
@@ -95,9 +95,7 @@
try {
long fileLength = raf.length();
- if (request.method() != HttpMethod.HEAD) {
- HttpHeaderUtil.setContentLength(response, fileLength);
- }
+ HttpHeaderUtil.setContentLength(response, fileLength);
channel.write(response);
if (request.method() != HttpMethod.HEAD) {
diff --git a/platform/built-in-server/testSrc/BinaryRequestHandlerTest.kt b/platform/built-in-server/testSrc/BinaryRequestHandlerTest.kt
index 05fca4a..46af5ba 100644
--- a/platform/built-in-server/testSrc/BinaryRequestHandlerTest.kt
+++ b/platform/built-in-server/testSrc/BinaryRequestHandlerTest.kt
@@ -1,26 +1,26 @@
package org.jetbrains.ide
-import io.netty.channel.ChannelInitializer
-import io.netty.channel.Channel
-import org.jetbrains.io.Decoder
-import io.netty.channel.ChannelHandlerContext
-import io.netty.buffer.ByteBuf
import com.intellij.util.Consumer
-import java.util.UUID
-import io.netty.channel.ChannelHandler
-import io.netty.util.CharsetUtil
-import org.jetbrains.io.ChannelExceptionHandler
-import org.jetbrains.io.NettyUtil
+import com.intellij.util.concurrency.Semaphore
import com.intellij.util.net.NetUtils
+import io.netty.buffer.ByteBuf
import io.netty.buffer.Unpooled
+import io.netty.channel.Channel
+import io.netty.channel.ChannelHandler
+import io.netty.channel.ChannelHandlerContext
+import io.netty.channel.ChannelInitializer
+import io.netty.util.CharsetUtil
import junit.framework.TestCase
-import org.junit.rules.RuleChain
-import org.junit.Rule
-import org.junit.Test
-import org.jetbrains.io.MessageDecoder
import org.jetbrains.concurrency.AsyncPromise
import org.jetbrains.concurrency.Promise
-import com.intellij.util.concurrency.Semaphore
+import org.jetbrains.io.ChannelExceptionHandler
+import org.jetbrains.io.Decoder
+import org.jetbrains.io.MessageDecoder
+import org.jetbrains.io.NettyUtil
+import org.junit.Rule
+import org.junit.Test
+import org.junit.rules.RuleChain
+import java.util.UUID
// we don't handle String in efficient way - because we want to test readContent/readChars also
public class BinaryRequestHandlerTest {
diff --git a/platform/built-in-server/testSrc/TestManager.kt b/platform/built-in-server/testSrc/TestManager.kt
index 818da87..178ed6c 100644
--- a/platform/built-in-server/testSrc/TestManager.kt
+++ b/platform/built-in-server/testSrc/TestManager.kt
@@ -1,19 +1,18 @@
package org.jetbrains.ide
+import com.intellij.openapi.roots.ModuleRootManager
+import com.intellij.openapi.roots.ModuleRootModificationUtil
+import com.intellij.openapi.util.io.FileUtilRt
+import com.intellij.openapi.util.text.StringUtil
import com.intellij.openapi.vfs.VirtualFile
+import com.intellij.testFramework.fixtures.IdeaProjectTestFixture
import org.junit.rules.TestWatcher
import org.junit.runner.Description
-
+import java.io.File
import java.lang.annotation.ElementType
import java.lang.annotation.Retention
import java.lang.annotation.RetentionPolicy
import java.lang.annotation.Target
-import com.intellij.openapi.util.text.StringUtil
-import com.intellij.testFramework.fixtures.IdeaProjectTestFixture
-import com.intellij.openapi.roots.ModuleRootManager
-import com.intellij.openapi.roots.ModuleRootModificationUtil
-import com.intellij.openapi.util.io.FileUtilRt
-import java.io.File
class TestManager(val projectFixture: IdeaProjectTestFixture) : TestWatcher() {
class object {
diff --git a/platform/core-api/src/com/intellij/concurrency/Job.java b/platform/core-api/src/com/intellij/concurrency/Job.java
index 50b6fc4..3380b3e 100644
--- a/platform/core-api/src/com/intellij/concurrency/Job.java
+++ b/platform/core-api/src/com/intellij/concurrency/Job.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,6 +30,7 @@
public interface Job<T> {
// the lower the priority the more important the task is
+ @Deprecated
int DEFAULT_PRIORITY = 100;
String getTitle();
diff --git a/platform/core-api/src/com/intellij/lang/CustomUncommenter.java b/platform/core-api/src/com/intellij/lang/CustomUncommenter.java
index bd2af1a..c0d2d6e 100644
--- a/platform/core-api/src/com/intellij/lang/CustomUncommenter.java
+++ b/platform/core-api/src/com/intellij/lang/CustomUncommenter.java
@@ -30,10 +30,10 @@
public interface CustomUncommenter {
/**
- * Finds commented block in selected text
+ * Finds commented block in provided text.
*
- * @param text selected text
- * @return commented block (including comment prefix and suffix!) or null if text is not commented
+ * @param text text to search comment for.
+ * @return commented block (including comment prefix and suffix!) or null if text does not contain any commented blocks.
*/
@Nullable
TextRange findMaximumCommentedRange(@NotNull CharSequence text);
diff --git a/platform/core-impl/src/com/intellij/codeInsight/documentation/PlatformDocumentationUtil.java b/platform/core-impl/src/com/intellij/codeInsight/documentation/PlatformDocumentationUtil.java
index 966d817..a607e23 100644
--- a/platform/core-impl/src/com/intellij/codeInsight/documentation/PlatformDocumentationUtil.java
+++ b/platform/core-impl/src/com/intellij/codeInsight/documentation/PlatformDocumentationUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,10 +19,11 @@
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.openapi.vfs.ex.http.HttpFileSystem;
+import com.intellij.util.SmartList;
import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.regex.Matcher;
@@ -30,7 +31,6 @@
import java.util.regex.PatternSyntaxException;
public class PlatformDocumentationUtil {
-
private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.documentation.PlatformDocumentationUtil");
private static final @NonNls Pattern ourLtFixupPattern = Pattern.compile("<([^/^\\w^!])");
@@ -38,19 +38,23 @@
private static final @NonNls String LT_ENTITY = "<";
@Nullable
- public static List<String> getHttpRoots(final String[] roots, String relPath) {
- final ArrayList<String> result = new ArrayList<String>();
+ public static List<String> getHttpRoots(@NotNull String[] roots, String relPath) {
+ List<String> result = new SmartList<String>();
for (String root : roots) {
- final VirtualFile virtualFile = VirtualFileManager.getInstance().findFileByUrl(root);
+ VirtualFile virtualFile = VirtualFileManager.getInstance().findFileByUrl(root);
if (virtualFile != null) {
if (virtualFile.getFileSystem() instanceof HttpFileSystem) {
String url = virtualFile.getUrl();
- if (!url.endsWith("/")) url += "/";
+ if (!url.endsWith("/")) {
+ url += "/";
+ }
result.add(url + relPath);
}
else {
VirtualFile file = virtualFile.findFileByRelativePath(relPath);
- if (file != null) result.add(file.getUrl());
+ if (file != null) {
+ result.add(file.getUrl());
+ }
}
}
}
@@ -66,7 +70,7 @@
return x;
}
- public static String fixupText(String docText) {
+ public static String fixupText(@NotNull CharSequence docText) {
Matcher fixupMatcher = ourLtFixupPattern.matcher(docText);
LinkedList<String> secondSymbols = new LinkedList<String>();
@@ -90,6 +94,6 @@
}
}
- return docText;
+ return docText.toString();
}
}
diff --git a/platform/core-impl/src/com/intellij/concurrency/JobLauncher.java b/platform/core-impl/src/com/intellij/concurrency/JobLauncher.java
index 47cea3c..583ba12 100644
--- a/platform/core-impl/src/com/intellij/concurrency/JobLauncher.java
+++ b/platform/core-impl/src/com/intellij/concurrency/JobLauncher.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package com.intellij.concurrency;
+import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.progress.ProgressIndicator;
@@ -49,23 +50,27 @@
* or we were unable to start read action in at least one thread
* @throws ProcessCanceledException if at least one task has thrown ProcessCanceledException
*/
- public abstract <T> boolean invokeConcurrentlyUnderProgress(@NotNull List<? extends T> things,
- ProgressIndicator progress,
- boolean failFastOnAcquireReadAction,
- @NotNull Processor<T> thingProcessor) throws ProcessCanceledException;
+ public <T> boolean invokeConcurrentlyUnderProgress(@NotNull List<T> things,
+ ProgressIndicator progress,
+ boolean failFastOnAcquireReadAction,
+ @NotNull Processor<? super T> thingProcessor) throws ProcessCanceledException {
+ return invokeConcurrentlyUnderProgress(things, progress, ApplicationManager.getApplication().isReadAccessAllowed(),
+ failFastOnAcquireReadAction, thingProcessor);
+ }
- public abstract <T> boolean invokeConcurrentlyUnderProgress(@NotNull List<? extends T> things,
+
+ public abstract <T> boolean invokeConcurrentlyUnderProgress(@NotNull List<T> things,
ProgressIndicator progress,
boolean runInReadAction,
boolean failFastOnAcquireReadAction,
- @NotNull Processor<T> thingProcessor) throws ProcessCanceledException;
+ @NotNull Processor<? super T> thingProcessor) throws ProcessCanceledException;
@NotNull
- public abstract <T> AsyncFuture<Boolean> invokeConcurrentlyUnderProgressAsync(@NotNull List<? extends T> things,
+ @Deprecated // use invokeConcurrentlyUnderProgress() instead
+ public abstract <T> AsyncFuture<Boolean> invokeConcurrentlyUnderProgressAsync(@NotNull List<T> things,
ProgressIndicator progress,
boolean failFastOnAcquireReadAction,
- @NotNull Processor<T> thingProcessor);
-
+ @NotNull Processor<? super T> thingProcessor);
/**
* NEVER EVER submit runnable which can lock itself for indeterminate amount of time.
@@ -73,15 +78,5 @@
* Use {@link com.intellij.openapi.application.Application#executeOnPooledThread(java.lang.Runnable)} instead
*/
@NotNull
- public abstract Job<Void> submitToJobThread(int priority, @NotNull final Runnable action, @Nullable Consumer<Future> onDoneCallback);
-
- /**
- * NEVER EVER submit runnable which can lock itself for indeterminate amount of time.
- * This will cause deadlock since this thread pool is an easily exhaustible resource.
- * Use {@link com.intellij.openapi.application.Application#executeOnPooledThread(java.lang.Runnable)} instead
- */
- @NotNull
- public Job<Void> submitToJobThread(int priority, @NotNull final Runnable action) {
- return submitToJobThread(priority, action, null);
- }
+ public abstract Job<Void> submitToJobThread(@NotNull final Runnable action, @Nullable Consumer<Future> onDoneCallback);
}
diff --git a/platform/core-impl/src/com/intellij/core/CoreApplicationEnvironment.java b/platform/core-impl/src/com/intellij/core/CoreApplicationEnvironment.java
index fd6b4e5..cce44c3 100644
--- a/platform/core-impl/src/com/intellij/core/CoreApplicationEnvironment.java
+++ b/platform/core-impl/src/com/intellij/core/CoreApplicationEnvironment.java
@@ -43,7 +43,6 @@
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.fileTypes.FileTypeExtension;
import com.intellij.openapi.fileTypes.FileTypeRegistry;
-import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.progress.impl.CoreProgressManager;
@@ -151,10 +150,11 @@
protected JobLauncher createJobLauncher() {
return new JobLauncher() {
@Override
- public <T> boolean invokeConcurrentlyUnderProgress(@NotNull List<? extends T> things,
+ public <T> boolean invokeConcurrentlyUnderProgress(@NotNull List<T> things,
ProgressIndicator progress,
+ boolean runInReadAction,
boolean failFastOnAcquireReadAction,
- @NotNull Processor<T> thingProcessor) throws ProcessCanceledException {
+ @NotNull Processor<? super T> thingProcessor) {
for (T thing : things) {
if (!thingProcessor.process(thing))
return false;
@@ -162,27 +162,18 @@
return true;
}
- @Override
- public <T> boolean invokeConcurrentlyUnderProgress(@NotNull List<? extends T> things,
- ProgressIndicator progress,
- boolean runInReadAction,
- boolean failFastOnAcquireReadAction,
- @NotNull Processor<T> thingProcessor) {
- return invokeConcurrentlyUnderProgress(things, progress, failFastOnAcquireReadAction, thingProcessor);
- }
-
@NotNull
@Override
- public <T> AsyncFuture<Boolean> invokeConcurrentlyUnderProgressAsync(@NotNull List<? extends T> things,
+ public <T> AsyncFuture<Boolean> invokeConcurrentlyUnderProgressAsync(@NotNull List<T> things,
ProgressIndicator progress,
boolean failFastOnAcquireReadAction,
- @NotNull Processor<T> thingProcessor) {
+ @NotNull Processor<? super T> thingProcessor) {
return AsyncUtil.wrapBoolean(invokeConcurrentlyUnderProgress(things, progress, failFastOnAcquireReadAction, thingProcessor));
}
@NotNull
@Override
- public Job<Void> submitToJobThread(int priority, @NotNull Runnable action, Consumer<Future> onDoneCallback) {
+ public Job<Void> submitToJobThread(@NotNull Runnable action, Consumer<Future> onDoneCallback) {
action.run();
if (onDoneCallback != null)
onDoneCallback.consume(new Future() {
diff --git a/platform/core-impl/src/com/intellij/lang/impl/PsiBuilderImpl.java b/platform/core-impl/src/com/intellij/lang/impl/PsiBuilderImpl.java
index 6635e9b..e344068 100644
--- a/platform/core-impl/src/com/intellij/lang/impl/PsiBuilderImpl.java
+++ b/platform/core-impl/src/com/intellij/lang/impl/PsiBuilderImpl.java
@@ -83,8 +83,8 @@
private CharTable myCharTable;
private final CharSequence myText;
private final char[] myTextArray;
- private boolean myDebugMode;
- private int myLexemeCount;
+ private boolean myDebugMode = false;
+ private int myLexemeCount = 0;
private boolean myTokenTypeChecked;
private ITokenTypeRemapper myRemapper;
private WhitespaceSkippedCallback myWhitespaceSkippedCallback;
@@ -93,7 +93,7 @@
private final MyTreeStructure myParentLightTree;
private final int myOffset;
- private Map<Key, Object> myUserData;
+ private Map<Key, Object> myUserData = null;
private IElementType myCachedTokenType;
private final LimitedPool<StartMarker> START_MARKERS = new LimitedPool<StartMarker>(2000, new LimitedPool.ObjectFactory<StartMarker>() {
@@ -591,7 +591,7 @@
private static class DoneMarker extends ProductionMarker {
private StartMarker myStart;
- private boolean myCollapse;
+ private boolean myCollapse = false;
public DoneMarker() {
myEdgeTokenBinder = WhitespacesBinders.DEFAULT_RIGHT_BINDER;
@@ -872,7 +872,7 @@
return myCurrentLexeme >= myLexemeCount;
}
- @SuppressWarnings("SuspiciousMethodCalls")
+ @SuppressWarnings({"SuspiciousMethodCalls"})
private void rollbackTo(Marker marker) {
myCurrentLexeme = ((StartMarker)marker).myLexemeIndex;
myTokenTypeChecked = true;
@@ -904,7 +904,7 @@
return false;
}
- @SuppressWarnings("SuspiciousMethodCalls")
+ @SuppressWarnings({"SuspiciousMethodCalls"})
public void drop(Marker marker) {
final DoneMarker doneMarker = ((StartMarker)marker).myDoneMarker;
if (doneMarker != null) {
@@ -929,7 +929,7 @@
myProduction.add(doneMarker);
}
- @SuppressWarnings("SuspiciousMethodCalls")
+ @SuppressWarnings({"SuspiciousMethodCalls"})
public void errorBefore(Marker marker, String message, Marker before) {
doValidityChecks(marker, before);
@@ -957,7 +957,7 @@
myProduction.add(doneMarker);
}
- @SuppressWarnings("SuspiciousMethodCalls")
+ @SuppressWarnings({"SuspiciousMethodCalls"})
public void doneBefore(Marker marker, Marker before) {
doValidityChecks(marker, before);
@@ -1129,9 +1129,9 @@
@NotNull
private DiffLog merge(@NotNull final ASTNode oldRoot, @NotNull StartMarker newRoot) {
DiffLog diffLog = new DiffLog();
- DiffTreeChangeBuilder<ASTNode, LighterASTNode> builder = new ConvertFromTokensToASTBuilder(newRoot, diffLog);
- MyTreeStructure treeStructure = new MyTreeStructure(newRoot, null);
- ShallowNodeComparator<ASTNode, LighterASTNode> comparator = new MyComparator(getUserDataUnprotected(CUSTOM_COMPARATOR), treeStructure);
+ final ConvertFromTokensToASTBuilder builder = new ConvertFromTokensToASTBuilder(newRoot, diffLog);
+ final MyTreeStructure treeStructure = new MyTreeStructure(newRoot, null);
+ final MyComparator comparator = new MyComparator(getUserDataUnprotected(CUSTOM_COMPARATOR), treeStructure);
final ProgressIndicator indicator = ProgressIndicatorProvider.getGlobalProgressIndicator();
BlockSupportImpl.diffTrees(oldRoot, builder, comparator, treeStructure, indicator == null ? new EmptyProgressIndicator() : indicator);
@@ -1153,9 +1153,7 @@
final Stack<StartMarker> nodes = ContainerUtil.newStack();
nodes.push(rootMarker);
- int lastErrorIndex = -1;
- int maxDepth = 0;
- int curDepth = 0;
+ @SuppressWarnings({"MultipleVariablesInDeclaration"}) int lastErrorIndex = -1, maxDepth = 0, curDepth = 0;
for (int i = 1; i < myProduction.size(); i++) {
final ProductionMarker item = myProduction.get(i);
@@ -1650,7 +1648,7 @@
private void insertLeaf(@NotNull IElementType type, @NotNull PsiBuilderImpl builder, int startLexemeIndex, int endLexemeIndex) {
final int start = builder.myLexStarts[startLexemeIndex];
final int end = builder.myLexStarts[endLexemeIndex];
- if (start > end || start == end && !(type instanceof ILeafElementType)) return;
+ if (start > end || ((start == end) && !(type instanceof ILeafElementType))) return;
final Token lexeme;
if (type instanceof ILightLazyParseableElementType) {
@@ -1670,12 +1668,6 @@
ensureCapacity();
nodes[count++] = lexeme;
}
-
- @NotNull
- @Override
- public CharSequence toString(@NotNull LighterASTNode node) {
- return myRoot.myBuilder.myText.subSequence(node.getStartOffset(), node.getEndOffset());
- }
}
private static class ASTConverter implements Convertor<Node, ASTNode> {
diff --git a/platform/core-impl/src/com/intellij/psi/impl/source/tree/ASTStructure.java b/platform/core-impl/src/com/intellij/psi/impl/source/tree/ASTStructure.java
index 947d748..1f1a286 100644
--- a/platform/core-impl/src/com/intellij/psi/impl/source/tree/ASTStructure.java
+++ b/platform/core-impl/src/com/intellij/psi/impl/source/tree/ASTStructure.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2015 JetBrains s.r.o.
+ * Copyright 2000-2009 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -77,10 +77,4 @@
@Override
public void disposeChildren(final ASTNode[] nodes, final int count) {
}
-
- @NotNull
- @Override
- public CharSequence toString(@NotNull ASTNode node) {
- return node.getChars();
- }
}
diff --git a/platform/dvcs-impl/src/com/intellij/dvcs/DvcsUtil.java b/platform/dvcs-impl/src/com/intellij/dvcs/DvcsUtil.java
index 47303f6..96bba32 100644
--- a/platform/dvcs-impl/src/com/intellij/dvcs/DvcsUtil.java
+++ b/platform/dvcs-impl/src/com/intellij/dvcs/DvcsUtil.java
@@ -71,6 +71,7 @@
private static final Logger LOGGER = Logger.getInstance(DvcsUtil.class);
private static final int IO_RETRIES = 3; // number of retries before fail if an IOException happens during file read.
private static final int SHORT_HASH_LENGTH = 8;
+ private static final int LONG_HASH_LENGTH = 40;
public static void installStatusBarWidget(@NotNull Project project, @NotNull StatusBarWidget widget) {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
@@ -163,13 +164,13 @@
@NotNull
public static String getShortHash(@NotNull String hash) {
- if (hash.length() == 0) return "";
- if (hash.length() == 40) return hash.substring(0, SHORT_HASH_LENGTH);
- if (hash.length() > 40) // revision string encoded with date too
- {
- return hash.substring(hash.indexOf("[") + 1, SHORT_HASH_LENGTH);
+ if (hash.length() < SHORT_HASH_LENGTH) {
+ LOG.debug("Unexpectedly short hash: [" + hash + "]");
}
- return hash;
+ if (hash.length() > LONG_HASH_LENGTH) {
+ LOG.debug("Unexpectedly long hash: [" + hash + "]");
+ }
+ return hash.substring(0, Math.min(SHORT_HASH_LENGTH, hash.length()));
}
@NotNull
diff --git a/platform/editor-ui-api/src/com/intellij/ide/ui/UISettings.java b/platform/editor-ui-api/src/com/intellij/ide/ui/UISettings.java
index 048c186..bc66b1b 100644
--- a/platform/editor-ui-api/src/com/intellij/ide/ui/UISettings.java
+++ b/platform/editor-ui-api/src/com/intellij/ide/ui/UISettings.java
@@ -23,6 +23,7 @@
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.SimpleModificationTracker;
import com.intellij.openapi.util.SystemInfo;
+import com.intellij.openapi.util.registry.Registry;
import com.intellij.util.EventDispatcher;
import com.intellij.util.PlatformUtils;
import com.intellij.util.SystemProperties;
@@ -264,7 +265,7 @@
UISettings uiSettings = getInstance();
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
- if (!isRemoteDesktopConnected() && UIUtil.isRetina()) {
+ if (!isRemoteDesktopConnected() && UIUtil.isRetina() && !Registry.is("force.default.lcd.rendering.settings")) {
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
}
else {
@@ -304,4 +305,4 @@
}
return false;
}
-}
\ No newline at end of file
+}
diff --git a/platform/lang-api/src/com/intellij/psi/stubs/SerializationManagerImpl.java b/platform/lang-api/src/com/intellij/psi/stubs/SerializationManagerImpl.java
index 058256e..4e4dea2 100644
--- a/platform/lang-api/src/com/intellij/psi/stubs/SerializationManagerImpl.java
+++ b/platform/lang-api/src/com/intellij/psi/stubs/SerializationManagerImpl.java
@@ -19,8 +19,8 @@
import com.intellij.openapi.components.ApplicationComponent;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.ShutDownTracker;
-import com.intellij.openapi.util.io.FileUtil;
import com.intellij.util.io.AbstractStringEnumerator;
+import com.intellij.util.io.IOUtil;
import com.intellij.util.io.PersistentStringEnumerator;
import org.jetbrains.annotations.NotNull;
@@ -81,14 +81,7 @@
myNameStorage.close();
}
- final File[] files = myFile.getParentFile().listFiles();
- if (files != null) {
- for (File file : files) {
- if (file.getName().startsWith(myFile.getName())) {
- FileUtil.delete(file);
- }
- }
- }
+ IOUtil.deleteAllFilesStartingWith(myFile);
myNameStorage = new PersistentStringEnumerator(myFile, true);
myStubSerializationHelper = new StubSerializationHelper(myNameStorage);
for (ObjectStubSerializer serializer : myAllSerializers) {
@@ -104,7 +97,9 @@
@Override
public void flushNameStorage() {
- myNameStorage.force();
+ if (myNameStorage.isDirty()) {
+ myNameStorage.force();
+ }
}
@Override
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/impl/LiftShorterItemsClassifier.java b/platform/lang-impl/src/com/intellij/codeInsight/completion/impl/LiftShorterItemsClassifier.java
index 75493de..b9b180c 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/completion/impl/LiftShorterItemsClassifier.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/impl/LiftShorterItemsClassifier.java
@@ -89,7 +89,10 @@
}
private void internListToLift(LookupElement longer) {
- myToLift.put(longer, myListInterner.intern(myToLift.get(longer)));
+ final Collection<LookupElement> elements = myToLift.get(longer);
+ if (elements.size() > 10) return;
+
+ myToLift.put(longer, myListInterner.intern(elements));
}
private void calculateToLift(LookupElement element) {
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java
index b3de08e..936ca6e 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java
@@ -239,6 +239,9 @@
public List<HighlightInfo> runMainPasses(@NotNull PsiFile psiFile,
@NotNull Document document,
@NotNull final ProgressIndicator progress) {
+ setUpdateByTimerEnabled(true); // by default we disable daemon while in modal dialog, but here we need to re-enable it because otherwise the paused daemon will conflict with our started passes
+ restart(); // clear status maps to run passes from scratch so that refCountHolder won't conflict and try to restart itself on partially filled maps
+
final List<HighlightInfo> result = new ArrayList<HighlightInfo>();
final VirtualFile virtualFile = psiFile.getVirtualFile();
if (virtualFile != null && !virtualFile.getFileType().isBinary()) {
@@ -255,10 +258,18 @@
}
});
- for (TextEditorHighlightingPass pass : passes) {
- pass.doCollectInformation(progress);
- result.addAll(pass.getInfos());
+ LOG.debug("All passes for " + psiFile.getName()+ " started (" + passes+"). progress canceled: "+progress.isCanceled());
+ try {
+ for (TextEditorHighlightingPass pass : passes) {
+ pass.doCollectInformation(progress);
+ result.addAll(pass.getInfos());
+ }
}
+ catch (ProcessCanceledException e) {
+ LOG.debug("Canceled: " + progress);
+ throw e;
+ }
+ LOG.debug("All passes for " + psiFile.getName()+ " run. progress canceled: "+progress.isCanceled()+"; infos: "+result);
}
return result;
@@ -869,5 +880,4 @@
private List<Editor> getActiveEditors() {
return myEditorTracker.getActiveEditors();
}
-
}
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/PassExecutorService.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/PassExecutorService.java
index 7522664..b56e0c45 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/PassExecutorService.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/PassExecutorService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -46,7 +46,6 @@
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.util.ConcurrencyUtil;
import com.intellij.util.Consumer;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.MultiMap;
@@ -60,20 +59,22 @@
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
/**
* @author cdr
*/
-public class PassExecutorService implements Disposable {
+class PassExecutorService implements Disposable {
private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.daemon.impl.PassExecutorService");
private static final boolean CHECK_CONSISTENCY = ApplicationManager.getApplication().isUnitTestMode();
private final Map<ScheduledPass, Job<Void>> mySubmittedPasses = new ConcurrentHashMap<ScheduledPass, Job<Void>>();
private final Project myProject;
- protected volatile boolean isDisposed;
+ private volatile boolean isDisposed;
private final AtomicInteger nextPassId = new AtomicInteger(100);
- public PassExecutorService(@NotNull Project project) {
+ PassExecutorService(@NotNull Project project) {
myProject = project;
}
@@ -83,7 +84,7 @@
isDisposed = true;
}
- public void cancelAll(boolean waitForTermination) {
+ void cancelAll(boolean waitForTermination) {
for (Job<Void> submittedPass : mySubmittedPasses.values()) {
submittedPass.cancel();
}
@@ -109,17 +110,19 @@
mySubmittedPasses.clear();
}
- public void submitPasses(@NotNull Map<FileEditor, HighlightingPass[]> passesMap, @NotNull DaemonProgressIndicator updateProgress) {
+ void submitPasses(@NotNull Map<FileEditor, HighlightingPass[]> passesMap, @NotNull DaemonProgressIndicator updateProgress) {
if (isDisposed()) return;
// null keys are ok
MultiMap<Document, FileEditor> documentToEditors = MultiMap.createSet();
MultiMap<FileEditor, TextEditorHighlightingPass> documentBoundPasses = MultiMap.createSmart();
MultiMap<FileEditor, EditorBoundHighlightingPass> editorBoundPasses = MultiMap.createSmart();
+ Set<VirtualFile> vFiles = new HashSet<VirtualFile>();
+
for (Map.Entry<FileEditor, HighlightingPass[]> entry : passesMap.entrySet()) {
FileEditor fileEditor = entry.getKey();
HighlightingPass[] passes = entry.getValue();
- Document document = null;
+ Document document;
if (fileEditor instanceof TextEditor) {
Editor editor = ((TextEditor)fileEditor).getEditor();
LOG.assertTrue(!(editor instanceof EditorWindow));
@@ -129,6 +132,9 @@
VirtualFile virtualFile = ((FileEditorManagerEx)FileEditorManager.getInstance(myProject)).getFile(fileEditor);
document = virtualFile == null ? null : FileDocumentManager.getInstance().getDocument(virtualFile);
}
+ if (document != null) {
+ vFiles.add(FileDocumentManager.getInstance().getFile(document));
+ }
int prevId = 0;
for (final HighlightingPass pass : passes) {
@@ -185,7 +191,7 @@
assertConsistency(freePasses, toBeSubmitted, threadsToStartCountdown);
}
- log(updateProgress, null, "---------------------starting------------------------ " + threadsToStartCountdown.get(), freePasses);
+ log(updateProgress, null, vFiles + " ----- starting " + threadsToStartCountdown.get(), freePasses);
for (ScheduledPass dependentPass : dependentPasses) {
mySubmittedPasses.put(dependentPass, Job.NULL_JOB);
@@ -227,7 +233,7 @@
id2Visits.put(succId, Pair.create(succ, newPred));
assert newPred >= 0;
if (newPred == 0) {
- checkConsistency((succ), id2Visits);
+ checkConsistency(succ, id2Visits);
}
}
}
@@ -356,7 +362,7 @@
private void submit(@NotNull ScheduledPass pass) {
if (!pass.myUpdateProgress.isCanceled()) {
- Job<Void> job = JobLauncher.getInstance().submitToJobThread(Job.DEFAULT_PRIORITY, pass, new Consumer<Future>() {
+ Job<Void> job = JobLauncher.getInstance().submitToJobThread(pass, new Consumer<Future>() {
@Override
public void consume(Future future) {
try {
@@ -534,7 +540,7 @@
}
@NotNull
- public List<TextEditorHighlightingPass> getAllSubmittedPasses() {
+ List<TextEditorHighlightingPass> getAllSubmittedPasses() {
List<TextEditorHighlightingPass> result = new ArrayList<TextEditorHighlightingPass>(mySubmittedPasses.size());
for (ScheduledPass scheduledPass : mySubmittedPasses.keySet()) {
if (!scheduledPass.myUpdateProgress.isCanceled()) {
@@ -548,24 +554,25 @@
private static void sortById(@NotNull List<TextEditorHighlightingPass> result) {
ContainerUtil.quickSort(result, new Comparator<TextEditorHighlightingPass>() {
@Override
- public int compare(TextEditorHighlightingPass o1, TextEditorHighlightingPass o2) {
+ public int compare(@NotNull TextEditorHighlightingPass o1, @NotNull TextEditorHighlightingPass o2) {
return o1.getId() - o2.getId();
}
});
}
- private static final ConcurrentMap<Thread, Integer> threads = new ConcurrentHashMap<Thread, Integer>();
private static int getThreadNum() {
- return ConcurrencyUtil.cacheOrGet(threads, Thread.currentThread(), threads.size());
+ Matcher matcher = Pattern.compile("JobScheduler FJ pool (\\d*)/(\\d*)").matcher(Thread.currentThread().getName());
+ String num = matcher.matches() ? matcher.group(1) : null;
+ return StringUtil.parseInt(num, 0);
}
- public static void log(ProgressIndicator progressIndicator, TextEditorHighlightingPass pass, @NonNls @NotNull Object... info) {
+ static void log(ProgressIndicator progressIndicator, TextEditorHighlightingPass pass, @NonNls @NotNull Object... info) {
if (LOG.isDebugEnabled()) {
CharSequence docText = pass == null ? "" : StringUtil.first(pass.getDocument().getCharsSequence(), 10, true);
synchronized (PassExecutorService.class) {
StringBuilder s = new StringBuilder();
for (Object o : info) {
- s.append(o.toString()).append(" ");
+ s.append(o).append(" ");
}
String message = StringUtil.repeatSymbol(' ', getThreadNum() * 4)
+ " " + pass + " "
@@ -584,13 +591,12 @@
indicator.putUserDataIfAbsent(THROWABLE_KEY, e);
}
@TestOnly
- public static Throwable getSavedException(@NotNull DaemonProgressIndicator indicator) {
+ static Throwable getSavedException(@NotNull DaemonProgressIndicator indicator) {
return indicator.getUserData(THROWABLE_KEY);
}
// return true if terminated
- public boolean waitFor(int millis) throws Throwable {
- ApplicationManager.getApplication().assertIsDispatchThread();
+ boolean waitFor(int millis) throws Throwable {
try {
for (Job<Void> job : mySubmittedPasses.values()) {
job.waitForCompletion(millis);
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/documentation/AbstractExternalFilter.java b/platform/lang-impl/src/com/intellij/codeInsight/documentation/AbstractExternalFilter.java
index 812fc77..17f2551 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/documentation/AbstractExternalFilter.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/documentation/AbstractExternalFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,8 +21,8 @@
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.util.Computable;
-import com.intellij.openapi.util.Trinity;
import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.openapi.util.text.StringUtilRt;
import com.intellij.openapi.vfs.CharsetToolkit;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
@@ -74,15 +74,15 @@
protected abstract String convertReference(String root, String href);
- public String refFilter(final String root, String read) {
- String toMatch = StringUtil.toUpperCase(read);
+ public CharSequence refFilter(final String root, @NotNull CharSequence read) {
+ CharSequence toMatch = StringUtilRt.toUpperCase(read);
StringBuilder ready = new StringBuilder();
int prev = 0;
Matcher matcher = mySelector.matcher(toMatch);
while (matcher.find()) {
- String before = read.substring(prev, matcher.start(1) - 1); // Before reference
- final String href = read.substring(matcher.start(1), matcher.end(1)); // The URL
+ CharSequence before = read.subSequence(prev, matcher.start(1) - 1); // Before reference
+ final CharSequence href = read.subSequence(matcher.start(1), matcher.end(1)); // The URL
prev = matcher.end(1) + 1;
ready.append(before);
ready.append("\"");
@@ -90,16 +90,16 @@
new Computable<String>() {
@Override
public String compute() {
- return convertReference(root, href);
+ return convertReference(root, href.toString());
}
}
));
ready.append("\"");
}
- ready.append(read.substring(prev, read.length()));
+ ready.append(read, prev, read.length());
- return ready.toString();
+ return ready;
}
}
@@ -114,13 +114,11 @@
return path;
}
- public String correctRefs(String root, String read) {
- String result = read;
-
+ public CharSequence correctRefs(String root, CharSequence read) {
+ CharSequence result = read;
for (RefConvertor myReferenceConvertor : getRefConverters()) {
result = myReferenceConvertor.refFilter(root, result);
}
-
return result;
}
@@ -158,7 +156,12 @@
throw exception;
}
- final String docText = correctRefs(ourAnchorSuffix.matcher(url).replaceAll(""), fetcher.data.toString());
+ return correctDocText(url, fetcher.data);
+ }
+
+ @NotNull
+ protected String correctDocText(@NotNull String url, @NotNull CharSequence data) {
+ CharSequence docText = correctRefs(ourAnchorSuffix.matcher(url).replaceAll(""), data);
if (LOG.isDebugEnabled()) {
LOG.debug("Filtered JavaDoc: " + docText + "\n");
}
@@ -175,10 +178,10 @@
}
protected void doBuildFromStream(final String url, Reader input, final StringBuilder data, boolean searchForEncoding, boolean matchStart) throws IOException {
- Trinity<Pattern, Pattern, Boolean> settings = getParseSettings(url);
- @NonNls Pattern startSection = settings.first;
- @NonNls Pattern endSection = settings.second;
- boolean useDt = settings.third;
+ ParseSettings settings = getParseSettings(url);
+ @NonNls Pattern startSection = settings.startPattern;
+ @NonNls Pattern endSection = settings.endPattern;
+ boolean useDt = settings.useDt;
@NonNls String greatestEndSection = "<!-- ========= END OF CLASS DATA ========= -->";
data.append(HTML);
@@ -232,7 +235,7 @@
if (read == null) {
data.setLength(0);
- if (matchStart && input instanceof MyReader) {
+ if (matchStart && !settings.forcePatternSearch && input instanceof MyReader) {
try {
final MyReader reader = contentEncoding != null ? new MyReader(((MyReader)input).myInputStream, contentEncoding)
: new MyReader(((MyReader)input).myInputStream, ((MyReader)input).getEncoding());
@@ -295,26 +298,19 @@
data.append(HTML_CLOSE);
}
- /**
- * Decides what settings should be used for parsing content represented by the given url.
- *
- * @param url url which points to the target content
- * @return following data: (start interested data boundary pattern; end interested data boundary pattern;
- * replace table data by <dt>)
- */
@NotNull
- protected Trinity<Pattern, Pattern, Boolean> getParseSettings(@NotNull String url) {
+ protected ParseSettings getParseSettings(@NotNull String url) {
Pattern startSection = ourClassDataStartPattern;
Pattern endSection = ourClassDataEndPattern;
- boolean useDt = true;
+ boolean anchorPresent = false;
Matcher anchorMatcher = ourAnchorSuffix.matcher(url);
if (anchorMatcher.find()) {
- useDt = false;
+ anchorPresent = true;
startSection = Pattern.compile(Pattern.quote("<a name=\"" + anchorMatcher.group(1) + "\""), Pattern.CASE_INSENSITIVE);
endSection = ourNonClassDataEndPattern;
}
- return Trinity.create(startSection, endSection, useDt);
+ return new ParseSettings(startSection, endSection, !anchorPresent, anchorPresent);
}
private static boolean reachTheEnd(StringBuilder data, String read, StringBuilder classDetails) {
@@ -437,4 +433,35 @@
myInputStream = in;
}
}
+
+ /**
+ * Settings used for parsing of external documentation
+ */
+ protected static class ParseSettings {
+ @NotNull
+ /**
+ * Pattern defining the start of target fragment
+ */
+ private final Pattern startPattern;
+ @NotNull
+ /**
+ * Pattern defining the end of target fragment
+ */
+ private final Pattern endPattern;
+ /**
+ * If <code>false</code>, and line matching start pattern is not found, whole document will be processed
+ */
+ private final boolean forcePatternSearch;
+ /**
+ * Replace table data by <dt>
+ */
+ private final boolean useDt;
+
+ public ParseSettings(@NotNull Pattern startPattern, @NotNull Pattern endPattern, boolean useDt, boolean forcePatternSearch) {
+ this.startPattern = startPattern;
+ this.endPattern = endPattern;
+ this.useDt = useDt;
+ this.forcePatternSearch = forcePatternSearch;
+ }
+ }
}
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationComponent.java b/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationComponent.java
index a0a0af7..a01b166 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationComponent.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,6 @@
import com.intellij.ide.actions.ExternalJavaDocAction;
import com.intellij.lang.documentation.CompositeDocumentationProvider;
import com.intellij.lang.documentation.DocumentationProvider;
-import com.intellij.lang.documentation.ExternalDocumentationHandler;
import com.intellij.lang.documentation.ExternalDocumentationProvider;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.actionSystem.*;
@@ -705,32 +704,25 @@
@Override
public void actionPerformed(AnActionEvent e) {
- if (myElement != null) {
- final PsiElement element = myElement.getElement();
- final DocumentationProvider provider = DocumentationManager.getProviderFromElement(element);
- final PsiElement originalElement = DocumentationManager.getOriginalElement(element);
- boolean processed = false;
- if (provider instanceof CompositeDocumentationProvider) {
- for (DocumentationProvider p : ((CompositeDocumentationProvider)provider).getAllProviders()) {
- if (p instanceof ExternalDocumentationHandler && ((ExternalDocumentationHandler)p).handleExternal(element, originalElement)) {
- processed = true;
- break;
- }
- }
- }
+ if (myElement == null) {
+ return;
+ }
- if (!processed) {
- final Component component = PlatformDataKeys.CONTEXT_COMPONENT.getData(e.getDataContext());
- final List<String> urls;
- if (!StringUtil.isEmptyOrSpaces(myEffectiveExternalUrl)) {
- urls = Collections.singletonList(myEffectiveExternalUrl);
- } else {
- urls = provider.getUrlFor(element, originalElement);
- assert urls != null : provider;
- assert !urls.isEmpty() : provider;
- }
- ExternalJavaDocAction.showExternalJavadoc(urls, component);
+ final PsiElement element = myElement.getElement();
+ final DocumentationProvider provider = DocumentationManager.getProviderFromElement(element);
+ final PsiElement originalElement = DocumentationManager.getOriginalElement(element);
+ if (!(provider instanceof CompositeDocumentationProvider &&
+ ((CompositeDocumentationProvider)provider).handleExternal(element, originalElement))) {
+ List<String> urls;
+ if (!StringUtil.isEmptyOrSpaces(myEffectiveExternalUrl)) {
+ urls = Collections.singletonList(myEffectiveExternalUrl);
}
+ else {
+ urls = provider.getUrlFor(element, originalElement);
+ assert urls != null : provider;
+ assert !urls.isEmpty() : provider;
+ }
+ ExternalJavaDocAction.showExternalJavadoc(urls, PlatformDataKeys.CONTEXT_COMPONENT.getData(e.getDataContext()));
}
}
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java b/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java
index a9e6e31..a4d7c40 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java
@@ -104,6 +104,7 @@
private boolean myCloseOnSneeze;
private ActionCallback myLastAction;
+ private DocumentationComponent myTestDocumentationComponent;
@Override
protected String getToolwindowId() {
@@ -431,7 +432,8 @@
PopupUpdateProcessor updateProcessor,
final PsiElement originalElement,
@Nullable final Runnable closeCallback) {
- final DocumentationComponent component = new DocumentationComponent(this);
+ final DocumentationComponent component = myTestDocumentationComponent == null ? new DocumentationComponent(this) :
+ myTestDocumentationComponent;
component.setNavigateCallback(new Consumer<PsiElement>() {
@Override
public void consume(PsiElement psiElement) {
@@ -1039,6 +1041,11 @@
public ActionCallback getLastAction() {
return myLastAction;
}
+
+ @TestOnly
+ public void setDocumentationComponent(DocumentationComponent documentationComponent) {
+ myTestDocumentationComponent = documentationComponent;
+ }
private interface DocumentationCollector {
@Nullable
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/BackspaceHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/BackspaceHandler.java
index d43f33a..ce48ded 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/BackspaceHandler.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/BackspaceHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
import com.intellij.lang.injection.InjectedLanguageManager;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataContext;
+import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Caret;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.EditorModificationUtil;
@@ -35,6 +36,7 @@
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiFile;
import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
@@ -45,6 +47,8 @@
import java.util.List;
public class BackspaceHandler extends EditorWriteActionHandler {
+ private static final Logger LOGGER = Logger.getInstance(BackspaceHandler.class);
+
protected final EditorActionHandler myOriginalHandler;
public BackspaceHandler(EditorActionHandler originalHandler) {
@@ -188,11 +192,20 @@
}
public static void deleteToTargetPosition(@NotNull Editor editor, @NotNull LogicalPosition pos) {
- final int offset = editor.getCaretModel().getOffset();
- final int targetOffset = editor.logicalPositionToOffset(pos);
- editor.getSelectionModel().setSelection(targetOffset, offset);
- EditorModificationUtil.deleteSelectedText(editor);
- editor.getCaretModel().moveToLogicalPosition(pos);
+ LogicalPosition logicalPosition = editor.getCaretModel().getLogicalPosition();
+ if (logicalPosition.line != pos.line) {
+ LOGGER.error("Unexpected caret position: " + logicalPosition + ", target indent position: " + pos);
+ return;
+ }
+ if (pos.column < logicalPosition.column) {
+ int targetOffset = editor.logicalPositionToOffset(pos);
+ int offset = editor.getCaretModel().getOffset();
+ editor.getSelectionModel().setSelection(targetOffset, offset);
+ EditorModificationUtil.deleteSelectedText(editor);
+ }
+ else if (pos.column > logicalPosition.column) {
+ EditorModificationUtil.insertStringAtCaret(editor, StringUtil.repeatSymbol(' ', pos.column - logicalPosition.column));
+ }
}
public static boolean isWhitespaceBeforeCaret(Editor editor) {
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByBlockCommentHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByBlockCommentHandler.java
index b750824..57100e1 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByBlockCommentHandler.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByBlockCommentHandler.java
@@ -238,8 +238,15 @@
final String prefix;
final String suffix;
- if (commenter instanceof CustomUncommenter) {
- return ((CustomUncommenter)commenter).findMaximumCommentedRange(text);
+ // Custom uncommenter is able to find commented block inside of selected text
+ final String selectedText = myCaret.getSelectedText();
+ if ((commenter instanceof CustomUncommenter) && selectedText != null) {
+ final TextRange commentedRange = ((CustomUncommenter)commenter).findMaximumCommentedRange(selectedText);
+ if (commentedRange == null) {
+ return null;
+ }
+ // Uncommenter returns range relative to text start, so we need to shift it to make abosolute.
+ return commentedRange.shiftRight(myCaret.getSelectionStart());
}
if (commenter instanceof SelfManagingCommenter) {
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/navigation/CtrlMouseHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/navigation/CtrlMouseHandler.java
index ecf185b..f3aaac8 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/navigation/CtrlMouseHandler.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/navigation/CtrlMouseHandler.java
@@ -113,7 +113,7 @@
@Nullable private Point myPrevMouseLocation;
private LightweightHint myHint;
- private enum BrowseMode {None, Declaration, TypeDeclaration, Implementation}
+ public enum BrowseMode {None, Declaration, TypeDeclaration, Implementation}
private final KeyListener myEditorKeyListener = new KeyAdapter() {
@Override
@@ -307,6 +307,17 @@
return generateInfo(element, atPointer).text;
}
+ @Nullable
+ @TestOnly
+ public static String getInfo(@NotNull Editor editor, BrowseMode browseMode) {
+ Project project = editor.getProject();
+ if (project == null) return null;
+ PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
+ if (file == null) return null;
+ Info info = getInfoAt(project, editor, file, editor.getCaretModel().getOffset(), browseMode);
+ return info == null ? null : info.getInfo().text;
+ }
+
@NotNull
private static DocInfo generateInfo(PsiElement element, PsiElement atPointer) {
final DocumentationProvider documentationProvider = DocumentationManager.getProviderFromElement(element, atPointer);
@@ -479,6 +490,12 @@
@Nullable
private Info getInfoAt(@NotNull final Editor editor, @NotNull PsiFile file, int offset, @NotNull BrowseMode browseMode) {
+ return getInfoAt(myProject, editor, file, offset, browseMode);
+ }
+
+ @Nullable
+ private static Info getInfoAt(@NotNull Project project, @NotNull final Editor editor, @NotNull PsiFile file, int offset,
+ @NotNull BrowseMode browseMode) {
PsiElement targetElement = null;
if (browseMode == BrowseMode.TypeDeclaration) {
@@ -486,7 +503,7 @@
targetElement = GotoTypeDeclarationAction.findSymbolType(editor, offset);
}
catch (IndexNotReadyException e) {
- showDumbModeNotification(myProject);
+ showDumbModeNotification(project);
}
}
else if (browseMode == BrowseMode.Declaration) {
@@ -494,7 +511,7 @@
final List<PsiElement> resolvedElements = ref == null ? Collections.<PsiElement>emptyList() : resolve(ref);
final PsiElement resolvedElement = resolvedElements.size() == 1 ? resolvedElements.get(0) : null;
- final PsiElement[] targetElements = GotoDeclarationAction.findTargetElementsNoVS(myProject, editor, offset, false);
+ final PsiElement[] targetElements = GotoDeclarationAction.findTargetElementsNoVS(project, editor, offset, false);
final PsiElement elementAtPointer = file.findElementAt(TargetElementUtilBase.adjustOffset(file, editor.getDocument(), offset));
if (targetElements != null) {
diff --git a/platform/lang-impl/src/com/intellij/execution/RunContentExecutor.java b/platform/lang-impl/src/com/intellij/execution/RunContentExecutor.java
index d16c385..214906e 100644
--- a/platform/lang-impl/src/com/intellij/execution/RunContentExecutor.java
+++ b/platform/lang-impl/src/com/intellij/execution/RunContentExecutor.java
@@ -105,7 +105,7 @@
final JComponent consolePanel = createConsolePanel(console, actions);
RunContentDescriptor descriptor = new RunContentDescriptor(console, myProcess, consolePanel, myTitle);
- Disposer.register(this, descriptor);
+ Disposer.register(console, descriptor);
actions.add(new RerunAction(consolePanel));
actions.add(new StopAction());
@@ -117,6 +117,7 @@
activateToolWindow();
}
+ Disposer.register(this, console);
return console;
}
diff --git a/platform/lang-impl/src/com/intellij/execution/console/ConsoleExecuteAction.java b/platform/lang-impl/src/com/intellij/execution/console/ConsoleExecuteAction.java
index f1cf748..5826e6d 100644
--- a/platform/lang-impl/src/com/intellij/execution/console/ConsoleExecuteAction.java
+++ b/platform/lang-impl/src/com/intellij/execution/console/ConsoleExecuteAction.java
@@ -17,6 +17,7 @@
import com.intellij.codeInsight.lookup.Lookup;
import com.intellij.codeInsight.lookup.LookupManager;
+import com.intellij.codeInsight.lookup.impl.LookupImpl;
import com.intellij.execution.ui.ConsoleViewContentType;
import com.intellij.icons.AllIcons;
import com.intellij.openapi.actionSystem.AnActionEvent;
@@ -76,7 +77,8 @@
if (enabled) {
Lookup lookup = LookupManager.getActiveLookup(editor);
// we should check getCurrentItem() also - fast typing could produce outdated lookup, such lookup reports isCompletion() true
- enabled = lookup == null || !lookup.isCompletion() || lookup.getCurrentItem() == null;
+ enabled = lookup == null || !lookup.isCompletion() || lookup.getCurrentItem() == null ||
+ (lookup instanceof LookupImpl && ((LookupImpl)lookup).getFocusDegree() == LookupImpl.FocusDegree.UNFOCUSED);
}
e.getPresentation().setEnabled(enabled);
diff --git a/platform/lang-impl/src/com/intellij/execution/impl/ConsoleViewImpl.java b/platform/lang-impl/src/com/intellij/execution/impl/ConsoleViewImpl.java
index 0550e75..db4dc44 100644
--- a/platform/lang-impl/src/com/intellij/execution/impl/ConsoleViewImpl.java
+++ b/platform/lang-impl/src/com/intellij/execution/impl/ConsoleViewImpl.java
@@ -712,7 +712,7 @@
}
try {
myInDocumentUpdate = true;
- String[] strings = addedText.split("\\r");
+ String[] strings = addedText.split("\\r", -1); // limit must be any negative number to avoid discarding of trailing empty strings
for (int i = 0; i < strings.length - 1; i++) {
document.insertString(document.getTextLength(), strings[i]);
int lastLine = document.getLineCount() - 1;
diff --git a/platform/lang-impl/src/com/intellij/find/impl/FindDialog.java b/platform/lang-impl/src/com/intellij/find/impl/FindDialog.java
index 3cf6c74..7d6c811 100644
--- a/platform/lang-impl/src/com/intellij/find/impl/FindDialog.java
+++ b/platform/lang-impl/src/com/intellij/find/impl/FindDialog.java
@@ -69,6 +69,7 @@
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.PropertyKey;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
@@ -486,9 +487,9 @@
topOptionsPanel.setLayout(new GridLayout(1, 2, UIUtil.DEFAULT_HGAP, 0));
topOptionsPanel.add(createFindOptionsPanel());
optionsPanel.add(topOptionsPanel, gbConstraints);
-
+
JPanel resultsOptionPanel = null;
-
+
if (myModel.isMultipleFiles()) {
optionsPanel.add(createGlobalScopePanel(), gbConstraints);
gbConstraints.weightx = 1;
@@ -674,11 +675,12 @@
}
findSettings.setWholeWordsOnly(myModel.isWholeWordsOnly());
- findSettings.setInStringLiteralsOnly(myModel.isInStringLiteralsOnly());
- findSettings.setInCommentsOnly(myModel.isInCommentsOnly());
- findSettings.setExceptComments(myModel.isExceptComments());
- findSettings.setExceptStringLiterals(myModel.isExceptStringLiterals());
- findSettings.setExceptCommentsAndLiterals(myModel.isExceptCommentsAndStringLiterals());
+ boolean saveContextBetweenRestarts = false;
+ findSettings.setInStringLiteralsOnly(saveContextBetweenRestarts && myModel.isInStringLiteralsOnly());
+ findSettings.setInCommentsOnly(saveContextBetweenRestarts && myModel.isInCommentsOnly());
+ findSettings.setExceptComments(saveContextBetweenRestarts && myModel.isExceptComments());
+ findSettings.setExceptStringLiterals(saveContextBetweenRestarts && myModel.isExceptStringLiterals());
+ findSettings.setExceptCommentsAndLiterals(saveContextBetweenRestarts && myModel.isExceptCommentsAndStringLiterals());
findSettings.setRegularExpressions(myModel.isRegularExpressions());
if (!myModel.isMultipleFiles()){
@@ -826,11 +828,12 @@
findOptionsPanel.add(regExPanel);
- mySearchContext = new ComboBox(new Object[] {FindBundle.message("find.context.anywhere.scope.label"),
- FindBundle.message("find.context.in.comments.scope.label"), FindBundle.message("find.context.in.literals.scope.label"),
- FindBundle.message("find.context.except.comments.scope.label"),
- FindBundle.message("find.context.except.literals.scope.label"),
- FindBundle.message("find.context.except.comments.and.literals.scope.label")});
+ mySearchContext = new ComboBox(new Object[] { getPresentableName(FindModel.SearchContext.ANY),
+ getPresentableName(FindModel.SearchContext.IN_COMMENTS),
+ getPresentableName(FindModel.SearchContext.IN_STRING_LITERALS),
+ getPresentableName(FindModel.SearchContext.EXCEPT_COMMENTS),
+ getPresentableName(FindModel.SearchContext.EXCEPT_STRING_LITERALS),
+ getPresentableName(FindModel.SearchContext.EXCEPT_COMMENTS_AND_STRING_LITERALS)});
mySearchContext.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@@ -873,6 +876,24 @@
return findOptionsPanel;
}
+ public static String getPresentableName(@NotNull FindModel.SearchContext searchContext) {
+ @PropertyKey(resourceBundle = "messages.FindBundle") String messageKey = null;
+ if (searchContext == FindModel.SearchContext.ANY) {
+ messageKey = "find.context.anywhere.scope.label";
+ } else if (searchContext == FindModel.SearchContext.EXCEPT_COMMENTS) {
+ messageKey = "find.context.except.comments.scope.label";
+ } else if (searchContext == FindModel.SearchContext.EXCEPT_STRING_LITERALS) {
+ messageKey = "find.context.except.literals.scope.label";
+ } else if (searchContext == FindModel.SearchContext.EXCEPT_COMMENTS_AND_STRING_LITERALS) {
+ messageKey = "find.context.except.comments.and.literals.scope.label";
+ } else if (searchContext == FindModel.SearchContext.IN_COMMENTS) {
+ messageKey = "find.context.in.comments.scope.label";
+ } else if (searchContext == FindModel.SearchContext.IN_STRING_LITERALS) {
+ messageKey = "find.context.in.literals.scope.label";
+ }
+ return messageKey != null ? FindBundle.message(messageKey) : searchContext.toString();
+ }
+
private void setupRegExpSetting() {
updateFileTypeForEditorComponent(myInputComboBox);
if (myReplaceComboBox != null) updateFileTypeForEditorComponent(myReplaceComboBox);
diff --git a/platform/lang-impl/src/com/intellij/find/impl/FindInProjectUtil.java b/platform/lang-impl/src/com/intellij/find/impl/FindInProjectUtil.java
index d22071e..28732ff 100644
--- a/platform/lang-impl/src/com/intellij/find/impl/FindInProjectUtil.java
+++ b/platform/lang-impl/src/com/intellij/find/impl/FindInProjectUtil.java
@@ -298,11 +298,17 @@
presentation.setUsagesString("files");
}
else {
- presentation.setTabText(FindBundle.message("find.usage.view.tab.text", stringToFind));
- presentation.setToolwindowTitle(FindBundle.message("find.usage.view.toolwindow.title", stringToFind, scope));
+ FindModel.SearchContext searchContext = findModel.getSearchContext();
+ String contextText = "";
+ if (searchContext != FindModel.SearchContext.ANY) {
+ contextText = FindBundle.message("find.context.presentation.scope.label", FindDialog.getPresentableName(searchContext));
+ }
+ presentation.setTabText(FindBundle.message("find.usage.view.tab.text", stringToFind, contextText));
+ presentation.setToolwindowTitle(FindBundle.message("find.usage.view.toolwindow.title", stringToFind, scope, contextText));
presentation.setUsagesString(FindBundle.message("find.usage.view.usages.text", stringToFind));
presentation.setUsagesWord(FindBundle.message("occurrence"));
presentation.setCodeUsagesString(FindBundle.message("found.occurrences"));
+ presentation.setContextText(contextText);
}
presentation.setOpenInNewTab(toOpenInNewTab);
presentation.setCodeUsages(false);
diff --git a/platform/lang-impl/src/com/intellij/ide/actions/ExternalJavaDocAction.java b/platform/lang-impl/src/com/intellij/ide/actions/ExternalJavaDocAction.java
index 50525bc..850dc38 100644
--- a/platform/lang-impl/src/com/intellij/ide/actions/ExternalJavaDocAction.java
+++ b/platform/lang-impl/src/com/intellij/ide/actions/ExternalJavaDocAction.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,11 +35,13 @@
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiReference;
import com.intellij.util.ArrayUtil;
+import gnu.trove.THashSet;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.awt.*;
-import java.util.HashSet;
import java.util.List;
+import java.util.Set;
public class ExternalJavaDocAction extends AnAction {
@@ -90,8 +92,8 @@
}
}
- public static void showExternalJavadoc(List<String> urls, Component component) {
- final HashSet<String> set = new HashSet<String>(urls);
+ public static void showExternalJavadoc(@NotNull List<String> urls, Component component) {
+ Set<String> set = new THashSet<String>(urls);
if (set.size() > 1) {
JBPopupFactory.getInstance().createListPopup(new BaseListPopupStep<String>("Choose external documentation root", ArrayUtil.toStringArray(set)) {
@Override
diff --git a/platform/lang-impl/src/com/intellij/openapi/fileEditor/impl/text/TextEditorPsiDataProvider.java b/platform/lang-impl/src/com/intellij/openapi/fileEditor/impl/text/TextEditorPsiDataProvider.java
index 7400e98..db696ef 100644
--- a/platform/lang-impl/src/com/intellij/openapi/fileEditor/impl/text/TextEditorPsiDataProvider.java
+++ b/platform/lang-impl/src/com/intellij/openapi/fileEditor/impl/text/TextEditorPsiDataProvider.java
@@ -22,6 +22,7 @@
import com.intellij.injected.editor.EditorWindow;
import com.intellij.injected.editor.InjectedCaret;
import com.intellij.lang.Language;
+import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.editor.Caret;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.ex.EditorEx;
@@ -114,7 +115,7 @@
if (IDE_VIEW.is(dataId)) {
final PsiFile psiFile = project == null ? null : PsiManager.getInstance(project).findFile(file);
final PsiDirectory psiDirectory = psiFile != null ? psiFile.getParent() : null;
- if (psiDirectory != null && psiDirectory.isPhysical()) {
+ if (psiDirectory != null && (psiDirectory.isPhysical() || ApplicationManager.getApplication().isUnitTestMode())) {
return new IdeView() {
@Override
diff --git a/platform/lang-impl/src/com/intellij/openapi/util/SwitchBootJdkAction.java b/platform/lang-impl/src/com/intellij/openapi/util/SwitchBootJdkAction.java
new file mode 100644
index 0000000..52d50ee
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/openapi/util/SwitchBootJdkAction.java
@@ -0,0 +1,290 @@
+/*
+ * Copyright 2000-2015 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.openapi.util;
+
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.Presentation;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.application.ApplicationNamesInfo;
+import com.intellij.openapi.application.PathManager;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.project.DumbAware;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.ComboBox;
+import com.intellij.openapi.ui.DialogWrapper;
+import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.ui.ListCellRendererWrapper;
+import com.intellij.ui.components.JBLabel;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.io.*;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @author denis
+ */
+public class SwitchBootJdkAction extends AnAction implements DumbAware {
+
+ @NonNls private static final Logger LOG = Logger.getInstance("#com.intellij.ide.actions.SwitchBootJdkAction");
+ @NonNls private static final String productJdkConfigFileName = ApplicationNamesInfo.getInstance().getScriptName() + ".jdk";
+ @NonNls private static final File productJdkConfigFile = new File(PathManager.getConfigPath(), productJdkConfigFileName);
+ @NonNls private static final File customJdkFile = new File(PathManager.getHomePath() + File.separator + "jre" + File.separator + "jdk");
+
+ @Override
+ public void update(AnActionEvent e) {
+ Presentation presentation = e.getPresentation();
+ if (!SystemInfo.isMac || !customJdkFile.exists()) {
+ presentation.setEnabledAndVisible(false);
+ return;
+ }
+ e.getPresentation().setText("Switch Boot JDK");
+ }
+
+ public static List<JdkBundleDescriptor> getBundlesFromFile(@NotNull File fileWithBundles) {
+ InputStream stream = null;
+ InputStreamReader inputStream;
+ BufferedReader bufferedReader;
+
+ List<JdkBundleDescriptor> list = new ArrayList<JdkBundleDescriptor>();
+
+
+ try {
+ stream = new FileInputStream(fileWithBundles);
+ inputStream = new InputStreamReader(stream, Charset.forName("UTF-8"));
+ bufferedReader = new BufferedReader(inputStream);
+
+ String line;
+
+ while ((line = bufferedReader.readLine()) != null) {
+ File file = new File(line);
+ if (file.exists()) {
+ list.add(new JdkBundleDescriptor(file, file.getName()));
+ }
+ }
+
+ } catch (IllegalStateException e) {
+ // The device builders can throw IllegalStateExceptions if
+ // build gets called before everything is properly setup
+ LOG.error(e);
+ } catch (Exception e) {
+ LOG.error("Error reading JDK bundles", e);
+ } finally {
+ if (stream != null) {
+ try {
+ stream.close();
+ } catch (IOException ignore) {}
+ }
+ }
+ return list;
+ }
+
+ @Override
+ public void actionPerformed(AnActionEvent event) {
+
+ if (!productJdkConfigFile.exists()) {
+ try {
+ if (!productJdkConfigFile.createNewFile()){
+ LOG.error("Could not create " + productJdkConfigFileName + " productJdkConfigFile");
+ return;
+ }
+ }
+ catch (IOException e) {
+ LOG.error(e);
+ return;
+ }
+ }
+
+ SwitchBootJdkDialog dialog = new SwitchBootJdkDialog(null, getBundlesFromFile(productJdkConfigFile));
+ if (dialog.showAndGet()) {
+ File selectedJdkBundleFile = dialog.getSelectedFile();
+ FileWriter fooWriter = null;
+ try {
+ fooWriter = new FileWriter(productJdkConfigFile, false);
+ fooWriter.write(selectedJdkBundleFile.getAbsolutePath());
+ }
+ catch (IOException e) {
+ LOG.error(e);
+ }
+ finally {
+ try {
+ if (fooWriter != null) {
+ fooWriter.close();
+ }
+ }
+ catch (IOException e) {
+ LOG.error(e);
+ }
+ }
+ ApplicationManager.getApplication().restart();
+ }
+ }
+
+ private static class JdkBundleDescriptor {
+ private File bundleAsFile;
+ private String visualRepresentation;
+
+ public JdkBundleDescriptor(File bundleAsFile, String visualRepresentation) {
+ this.bundleAsFile = bundleAsFile;
+ this.visualRepresentation = visualRepresentation;
+ }
+
+ public File getBundleAsFile() {
+ return bundleAsFile;
+ }
+
+ public String getVisualRepresentation() {
+ return visualRepresentation;
+ }
+ }
+
+ private static class SwitchBootJdkDialog extends DialogWrapper {
+
+ @NotNull private final ComboBox myComboBox;
+
+ protected SwitchBootJdkDialog(@Nullable Project project, List<JdkBundleDescriptor> jdkBundlesList) {
+ super(project, false);
+
+ final ArrayList<JdkBundleDescriptor> pathsList = JdkUtil.findJdkPaths();
+ if (!jdkBundlesList.isEmpty()) {
+ pathsList.add(0, jdkBundlesList.get(0));
+ }
+
+ myComboBox = new ComboBox();
+
+ DefaultComboBoxModel model = new DefaultComboBoxModel();
+
+ for (JdkBundleDescriptor jdkBundlePath : pathsList) {
+ if (!jdkBundlesList.isEmpty() && FileUtil.filesEqual(jdkBundlePath.getBundleAsFile(),jdkBundlesList.get(0).getBundleAsFile())) {
+ continue;
+ }
+ model.addElement(jdkBundlePath);
+ }
+
+ myComboBox.setModel(model);
+ myComboBox.setRenderer(new ListCellRendererWrapper() {
+ @Override
+ public void customize(JList list, Object value, int index, boolean selected, boolean hasFocus) {
+ JdkBundleDescriptor jdkBundleDescriptor = ((JdkBundleDescriptor)value);
+ setText(jdkBundleDescriptor.getVisualRepresentation());
+ }
+ });
+
+ setTitle("Switch IDE Boot JDK");
+ init();
+ }
+
+ @Nullable
+ @Override
+ protected JComponent createNorthPanel() {
+ return new JBLabel("Select Boot JDK");
+ }
+
+ @Nullable
+ @Override
+ protected JComponent createCenterPanel() {
+ return myComboBox;
+ }
+
+ @Nullable
+ @Override
+ public JComponent getPreferredFocusedComponent() {
+ return myComboBox;
+ }
+
+ public File getSelectedFile() {
+ return ((JdkBundleDescriptor)myComboBox.getSelectedItem()).bundleAsFile;
+ }
+ }
+
+ private static final String STANDARD_JDK_LOCATION_ON_MAC_OS_X = "/Library/Java/JavaVirtualMachines/";
+ private static final String STANDARD_JDK_6_LOCATION_ON_MAC_OS_X = "/System/Library/Java/JavaVirtualMachines/";
+
+ private static class JdkUtil {
+ private static ArrayList <JdkBundleDescriptor> findJdkPaths () {
+ ArrayList<JdkBundleDescriptor> jdkPathsList = new ArrayList<JdkBundleDescriptor>();
+ if (!SystemInfo.isMac) return jdkPathsList;
+
+
+ if (customJdkFile.exists()) {
+ jdkPathsList.add(new JdkBundleDescriptor(customJdkFile, "JDK bundled with IDE"));
+ }
+
+ jdkPathsList.addAll(jdkBundlesFromLocation(STANDARD_JDK_6_LOCATION_ON_MAC_OS_X, "1.6.0"));
+ jdkPathsList.addAll(jdkBundlesFromLocation(STANDARD_JDK_LOCATION_ON_MAC_OS_X, "jdk1.8.0_(\\d*).jdk"));
+
+ return jdkPathsList;
+ }
+
+ private static ArrayList<JdkBundleDescriptor> jdkBundlesFromLocation(String jdkLocationOnMacOsX, String filter) {
+
+ ArrayList<JdkBundleDescriptor> localJdkPathsList = new ArrayList<JdkBundleDescriptor>();
+
+ File standardJdkLocationOnMacFile = new File(jdkLocationOnMacOsX);
+
+ if (!standardJdkLocationOnMacFile.exists()) {
+ LOG.info("Location does not exists: " + jdkLocationOnMacOsX);
+ return localJdkPathsList;
+ }
+
+ File[] filesInStandardJdkLocation = standardJdkLocationOnMacFile.listFiles();
+
+ int latestUpdateNumber = 0;
+ JdkBundleDescriptor latestBundle = null;
+
+ String regex = filter;
+
+ Pattern p = Pattern.compile(regex);
+
+ for (File possibleJdkBundle : filesInStandardJdkLocation) {
+ // todo add some logic to verify the bundle
+
+ Matcher m = p.matcher(possibleJdkBundle.getName());
+
+
+ while(m.find()) {
+ try {
+ if (m.groupCount() > 0) {
+ int updateNumber = Integer.parseInt(m.group(1));
+ if (latestUpdateNumber < updateNumber) {
+ latestBundle = new JdkBundleDescriptor(possibleJdkBundle, possibleJdkBundle.getName());
+ }
+ } else {
+ latestBundle = new JdkBundleDescriptor(possibleJdkBundle, possibleJdkBundle.getName());
+ }
+ } catch (NumberFormatException nfe) {
+ LOG.error("Fail parsing update number");
+ }
+ }
+
+ }
+
+ if (latestBundle != null) {
+ localJdkPathsList.add(latestBundle);
+ }
+
+ return localJdkPathsList;
+ }
+ }
+
+}
diff --git a/platform/lang-impl/src/com/intellij/openapi/vfs/encoding/FileEncodingConfigurableProvider.java b/platform/lang-impl/src/com/intellij/openapi/vfs/encoding/FileEncodingConfigurableProvider.java
index 86fb891..f628c2e 100644
--- a/platform/lang-impl/src/com/intellij/openapi/vfs/encoding/FileEncodingConfigurableProvider.java
+++ b/platform/lang-impl/src/com/intellij/openapi/vfs/encoding/FileEncodingConfigurableProvider.java
@@ -18,7 +18,6 @@
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.ConfigurableProvider;
import com.intellij.openapi.project.Project;
-import com.intellij.util.PlatformUtils;
/**
* @author Sergey.Malenkov
@@ -32,7 +31,7 @@
@Override
public boolean canCreateConfigurable() {
- return !PlatformUtils.isRubyMine();
+ return true;
}
@Override
diff --git a/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedLanguageManagerImpl.java b/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedLanguageManagerImpl.java
index cf7fbe7..5d08789 100644
--- a/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedLanguageManagerImpl.java
+++ b/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedLanguageManagerImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,7 +18,6 @@
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
import com.intellij.codeInsight.daemon.impl.DaemonProgressIndicator;
-import com.intellij.concurrency.Job;
import com.intellij.concurrency.JobLauncher;
import com.intellij.injected.editor.DocumentWindow;
import com.intellij.injected.editor.DocumentWindowImpl;
@@ -180,12 +179,12 @@
}
}
else {
- JobLauncher.getInstance().submitToJobThread(Job.DEFAULT_PRIORITY, new Runnable() {
+ JobLauncher.getInstance().submitToJobThread(new Runnable() {
@Override
public void run() {
ApplicationManagerEx.getApplicationEx().tryRunReadAction(commitInjectionsRunnable);
}
- });
+ }, null);
}
}
diff --git a/platform/lang-impl/src/com/intellij/ui/popup/util/DetailViewImpl.java b/platform/lang-impl/src/com/intellij/ui/popup/util/DetailViewImpl.java
index 28b2a4a..f5081c4 100644
--- a/platform/lang-impl/src/com/intellij/ui/popup/util/DetailViewImpl.java
+++ b/platform/lang-impl/src/com/intellij/ui/popup/util/DetailViewImpl.java
@@ -21,6 +21,7 @@
import com.intellij.openapi.editor.ex.EditorEx;
import com.intellij.openapi.editor.highlighter.EditorHighlighter;
import com.intellij.openapi.editor.highlighter.EditorHighlighterFactory;
+import com.intellij.openapi.editor.impl.softwrap.SoftWrapAppliancePlaces;
import com.intellij.openapi.editor.markup.HighlighterLayer;
import com.intellij.openapi.editor.markup.RangeHighlighter;
import com.intellij.openapi.editor.markup.TextAttributes;
@@ -153,6 +154,7 @@
getEditor().getSettings().setLineNumbersShown(true);
getEditor().getSettings().setFoldingOutlineShown(false);
((EditorEx)getEditor()).getFoldingModel().setFoldingEnabled(false);
+ ((EditorEx)getEditor()).setSoftWrapAppliancePlace(SoftWrapAppliancePlaces.VCS_DIFF); // temporary hack, fixed properly in master branch
add(getEditor().getComponent(), BorderLayout.CENTER);
}
diff --git a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java
index 118a318..7e33529 100644
--- a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java
+++ b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java
@@ -343,6 +343,8 @@
@Override
public void run() {
+ mySerializationManagerEx.flushNameStorage();
+
if (lastModCount == myLocalModCount) {
flushAllIndices(lastModCount);
}
@@ -700,9 +702,6 @@
}
}
- if (!HeavyProcessLatch.INSTANCE.isRunning() && modCount == myLocalModCount) { // do not interfere with 'main' jobs
- mySerializationManagerEx.flushNameStorage();
- }
ContentHashesSupport.flushContentHashes();
}
@@ -1739,13 +1738,25 @@
if (currentFC != null && currentFC.getUserData(ourPhysicalContentKey) == null) {
currentFC.putUserData(ourPhysicalContentKey, Boolean.TRUE);
}
+
// important: no hard referencing currentFC to avoid OOME, the methods introduced for this purpose!
+ // important: update is called out of try since possible indexer extension is HANDLED as single file fail / restart indexing policy
final Computable<Boolean> update = index.update(inputId, currentFC);
- scheduleUpdate(indexId,
- createUpdateComputableWithBufferingDisabled(update),
- createIndexedStampUpdateRunnable(indexId, file, currentFC != null)
- );
+ try {
+ scheduleUpdate(indexId,
+ createUpdateComputableWithBufferingDisabled(update),
+ createIndexedStampUpdateRunnable(indexId, file, currentFC != null)
+ );
+ } catch (RuntimeException exception) {
+ Throwable causeToRebuildIndex = getCauseToRebuildIndex(exception);
+ if (causeToRebuildIndex != null) {
+ LOG.error("Exception in update single index:" + exception);
+ requestRebuild(indexId, exception);
+ return;
+ }
+ throw exception;
+ }
}
static final Key<Boolean> ourPhysicalContentKey = Key.create("physical.content.flag");
diff --git a/platform/lang-impl/src/com/intellij/util/indexing/IndexingStamp.java b/platform/lang-impl/src/com/intellij/util/indexing/IndexingStamp.java
index b7f1480..f340c3d 100644
--- a/platform/lang-impl/src/com/intellij/util/indexing/IndexingStamp.java
+++ b/platform/lang-impl/src/com/intellij/util/indexing/IndexingStamp.java
@@ -61,7 +61,7 @@
private static final long UNINDEXED_STAMP = -1L; // we don't store trivial "absent" state
private static final long INDEX_DATA_OUTDATED_STAMP = -2L;
- private static final int VERSION = 13;
+ private static final int VERSION = 14;
private static final ConcurrentMap<ID<?, ?>, Long> ourIndexIdToCreationStamp = ContainerUtil.newConcurrentMap();
static final int INVALID_FILE_ID = 0;
private static volatile long ourLastStamp; // ensure any file index stamp increases
@@ -89,8 +89,9 @@
});
assert os != null;
try {
- os.writeInt(version);
- os.writeInt(VERSION);
+ DataInputOutputUtil.writeINT(os, version);
+ DataInputOutputUtil.writeINT(os, VERSION);
+ DataInputOutputUtil.writeTIME(os, FSRecords.getCreationTimestamp());
}
finally {
ourIndexIdToCreationStamp.clear();
@@ -106,9 +107,14 @@
ourLastStamp = Math.max(ourLastStamp, versionFile.lastModified());
final DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(versionFile)));
try {
- final int savedIndexVersion = in.readInt();
- final int commonVersion = in.readInt();
- return savedIndexVersion != currentIndexVersion || commonVersion != VERSION;
+ final int savedIndexVersion = DataInputOutputUtil.readINT(in);
+ final int commonVersion = DataInputOutputUtil.readINT(in);
+ final long vfsCreationStamp = DataInputOutputUtil.readTIME(in);
+ return savedIndexVersion != currentIndexVersion ||
+ commonVersion != VERSION ||
+ vfsCreationStamp != FSRecords.getCreationTimestamp()
+ ;
+
}
finally {
in.close();
@@ -160,7 +166,7 @@
}
/**
- * The class is meant to be accessed from synchronized block only
+ * The class is meant to be accessed from synchronized block only
*/
private static class Timestamps {
private static final FileAttribute PERSISTENCE = new FileAttribute("__index_stamps__", 2, false);
diff --git a/platform/lang-impl/src/com/intellij/util/indexing/MapReduceIndex.java b/platform/lang-impl/src/com/intellij/util/indexing/MapReduceIndex.java
index 6317b37..87ee926 100644
--- a/platform/lang-impl/src/com/intellij/util/indexing/MapReduceIndex.java
+++ b/platform/lang-impl/src/com/intellij/util/indexing/MapReduceIndex.java
@@ -19,6 +19,7 @@
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.fileEditor.FileDocumentManager;
+import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.util.*;
import com.intellij.openapi.util.io.BufferExposingByteArrayOutputStream;
@@ -536,9 +537,10 @@
});
//noinspection ThrowableResultOfMethodCallIgnored
- if (exRef.get() != null) {
- LOG.info(exRef.get());
- FileBasedIndex.getInstance().requestRebuild(myIndexId);
+ StorageException nestedException = exRef.get();
+ if (nestedException != null) {
+ LOG.info("Exception during updateWithMap:" + nestedException);
+ FileBasedIndex.getInstance().requestRebuild(myIndexId, nestedException);
return Boolean.FALSE;
}
return Boolean.TRUE;
@@ -599,17 +601,17 @@
// psi backed index should use existing psi to build index value (FileContentImpl.getPsiFileForPsiDependentIndex())
// so we should use different bytes to calculate hash(Id)
Integer previouslyCalculatedUncommittedHashId = content.getUserData(ourSavedUncommittedHashIdKey);
-
+
if (previouslyCalculatedUncommittedHashId == null) {
Document document = FileDocumentManager.getInstance().getCachedDocument(content.getFile());
-
+
if (document != null) { // if document is not committed
PsiDocumentManager psiDocumentManager = PsiDocumentManager.getInstance(content.getProject());
-
+
if (psiDocumentManager.isUncommited(document)) {
PsiFile file = psiDocumentManager.getCachedPsiFile(document);
Charset charset = ((FileContentImpl)content).getCharset();
-
+
if (file != null) {
previouslyCalculatedUncommittedHashId = ContentHashesSupport
.calcContentHashIdWithFileType(file.getText().getBytes(charset), charset,
@@ -621,7 +623,7 @@
}
if (previouslyCalculatedUncommittedHashId != null) return previouslyCalculatedUncommittedHashId;
}
-
+
Integer previouslyCalculatedContentHashId = content.getUserData(ourSavedContentHashIdKey);
if (previouslyCalculatedContentHashId == null) {
byte[] hash = content instanceof FileContentImpl ? ((FileContentImpl)content).getHash():null;
@@ -744,21 +746,18 @@
try {
ValueContainerImpl.ourDebugIndexInfo.set(myIndexId);
updateData.iterateRemovedOrUpdatedKeys(inputId, myRemoveStaleKeyOperation);
- }
- catch (Exception e) {
- throw new StorageException(e);
- } finally {
- ValueContainerImpl.ourDebugIndexInfo.set(null);
- }
-
- updateData.iterateAddedKeys(inputId, myAddedKeyProcessor);
-
- try {
+ updateData.iterateAddedKeys(inputId, myAddedKeyProcessor);
updateData.save(inputId);
}
- catch (IOException e) {
+ catch (ProcessCanceledException pce) {
+ throw pce; // extra care
+ }
+ catch (Throwable e) { // e.g. IOException, AssertionError
throw new StorageException(e);
}
+ finally {
+ ValueContainerImpl.ourDebugIndexInfo.set(null);
+ }
}
finally {
getWriteLock().unlock();
diff --git a/platform/lang-impl/testSources/com/intellij/codeInsight/editorActions/SimpleIndentingBackspaceHandlerTest.java b/platform/lang-impl/testSources/com/intellij/codeInsight/editorActions/SimpleIndentingBackspaceHandlerTest.java
index 3be54fa..9c62a2f 100644
--- a/platform/lang-impl/testSources/com/intellij/codeInsight/editorActions/SimpleIndentingBackspaceHandlerTest.java
+++ b/platform/lang-impl/testSources/com/intellij/codeInsight/editorActions/SimpleIndentingBackspaceHandlerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,6 +17,9 @@
import com.intellij.codeInsight.CodeInsightSettings;
import com.intellij.openapi.actionSystem.IdeActions;
+import com.intellij.psi.codeStyle.CodeStyleSettings;
+import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
+import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
import com.intellij.testFramework.LightPlatformCodeInsightTestCase;
public class SimpleIndentingBackspaceHandlerTest extends LightPlatformCodeInsightTestCase {
@@ -29,6 +32,22 @@
doTest("line1\n<caret>line2",
"line1<caret>line2");
}
+
+ public void testDeletingTabWhenIndentSizeIsSmaller() {
+ CodeStyleSettings settings = new CodeStyleSettings();
+ CommonCodeStyleSettings.IndentOptions indentOptions = settings.getIndentOptions();
+ assertNotNull(indentOptions);
+ indentOptions.INDENT_SIZE = 2;
+ indentOptions.TAB_SIZE = 4;
+ CodeStyleSettingsManager.getInstance(getProject()).setTemporarySettings(settings);
+ try {
+ doTest("\t<caret>text",
+ " <caret>text");
+ }
+ finally {
+ CodeStyleSettingsManager.getInstance().dropTemporarySettings();
+ }
+ }
private void doTest(String before, String after) {
SmartBackspaceMode savedMode = CodeInsightSettings.getInstance().getBackspaceMode();
diff --git a/platform/platform-api/src/com/intellij/execution/configurations/GeneralCommandLine.java b/platform/platform-api/src/com/intellij/execution/configurations/GeneralCommandLine.java
index f4dbdf2..97f1a10 100644
--- a/platform/platform-api/src/com/intellij/execution/configurations/GeneralCommandLine.java
+++ b/platform/platform-api/src/com/intellij/execution/configurations/GeneralCommandLine.java
@@ -165,12 +165,12 @@
}
/**
- * @return Environment, that will be passed to the process if isPassParentEnvironment() == true
+ * @return unmodifiable map of the parent environment, that will be passed to the process if isPassParentEnvironment() == true
*/
@NotNull
public Map<String, String> getParentEnvironment() {
- return Collections.unmodifiableMap(PlatformUtils.isAppCode() ? System.getenv() // Temporarily fix for OC-8606
- : EnvironmentUtil.getEnvironmentMap());
+ return PlatformUtils.isAppCode() ? System.getenv() // Temporarily fix for OC-8606
+ : EnvironmentUtil.getEnvironmentMap();
}
public void addParameters(final String... parameters) {
diff --git a/platform/platform-api/src/com/intellij/ide/browsers/BrowserLauncherAppless.java b/platform/platform-api/src/com/intellij/ide/browsers/BrowserLauncherAppless.java
index 2385d00..c7f3989 100644
--- a/platform/platform-api/src/com/intellij/ide/browsers/BrowserLauncherAppless.java
+++ b/platform/platform-api/src/com/intellij/ide/browsers/BrowserLauncherAppless.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -137,10 +137,6 @@
private void openOrBrowse(@NotNull String url, boolean browse, @Nullable Project project) {
url = url.trim();
- if (url.startsWith("jar:")) {
- return;
- }
-
URI uri;
if (BrowserUtil.isAbsoluteURL(url)) {
uri = VfsUtil.toUri(url);
diff --git a/platform/platform-api/src/com/intellij/ui/CheckBoxList.java b/platform/platform-api/src/com/intellij/ui/CheckBoxList.java
index 810c4c9..783dd5f 100644
--- a/platform/platform-api/src/com/intellij/ui/CheckBoxList.java
+++ b/platform/platform-api/src/com/intellij/ui/CheckBoxList.java
@@ -179,29 +179,66 @@
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
JCheckBox checkbox = (JCheckBox)value;
- if (!UIUtil.isUnderNimbusLookAndFeel()) {
- checkbox.setBackground(getBackground(isSelected, checkbox));
- checkbox.setForeground(getForeground(isSelected, checkbox));
+
+ Color textColor = getForeground(isSelected);
+ Color backgroundColor = getBackground(isSelected);
+ Font font = getFont();
+
+ boolean shouldAdjustColors = !UIUtil.isUnderNimbusLookAndFeel();
+
+ if (shouldAdjustColors) {
+ checkbox.setBackground(backgroundColor);
+ checkbox.setForeground(textColor);
}
+
checkbox.setEnabled(isEnabled());
- checkbox.setFont(getFont(checkbox));
+ checkbox.setFont(font);
checkbox.setFocusPainted(false);
- checkbox.setBorderPainted(true);
- checkbox.setBorder(isSelected ? mySelectedBorder : myBorder);
+
+ String auxText = getSecondaryText(index);
+
+ JComponent rootComponent;
+ if (auxText != null) {
+ JPanel panel = new JPanel(new BorderLayout());
+
+ checkbox.setBorderPainted(false);
+ panel.add(checkbox, BorderLayout.LINE_START);
+
+ JLabel infoLabel = new JLabel(auxText, SwingConstants.RIGHT);
+ infoLabel.setBorder(new EmptyBorder(0, 0, 0, checkbox.getInsets().left));
+ infoLabel.setFont(font);
+ panel.add(infoLabel, BorderLayout.CENTER);
+
+ if (shouldAdjustColors) {
+ panel.setBackground(backgroundColor);
+ infoLabel.setForeground(isSelected ? textColor : JBColor.GRAY);
+ infoLabel.setBackground(backgroundColor);
+ }
+
+ rootComponent = panel;
+ }
+ else {
+ checkbox.setBorderPainted(true);
+ rootComponent = checkbox;
+ }
+
+ rootComponent.setBorder(isSelected ? mySelectedBorder : myBorder);
+
adjustRendering(checkbox, isSelected, cellHasFocus);
- return checkbox;
+ return rootComponent;
}
}
- protected Font getFont(final JCheckBox checkbox) {
- return getFont();
+ @Nullable
+ protected String getSecondaryText(int index) {
+ return null;
}
- protected Color getBackground(final boolean isSelected, final JCheckBox checkbox) {
+ protected Color getBackground(final boolean isSelected) {
return isSelected ? getSelectionBackground() : getBackground();
}
- protected Color getForeground(final boolean isSelected, final JCheckBox checkbox) {
+ protected Color getForeground(final boolean isSelected) {
return isSelected ? getSelectionForeground() : getForeground();
}
}
diff --git a/platform/platform-api/src/com/intellij/ui/treeStructure/treetable/TreeTableCellRenderer.java b/platform/platform-api/src/com/intellij/ui/treeStructure/treetable/TreeTableCellRenderer.java
index 19e1259..1bd5f1d 100644
--- a/platform/platform-api/src/com/intellij/ui/treeStructure/treetable/TreeTableCellRenderer.java
+++ b/platform/platform-api/src/com/intellij/ui/treeStructure/treetable/TreeTableCellRenderer.java
@@ -41,14 +41,15 @@
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
int modelRow = table.convertRowIndexToModel(row);
+ final boolean lineHasFocus = table.hasFocus();
if (myTreeCellRenderer != null)
myTree.setCellRenderer(myTreeCellRenderer);
if (isSelected){
- myTree.setBackground(table.getSelectionBackground());
+ myTree.setBackground(lineHasFocus ? table.getSelectionBackground() : UIUtil.getTreeUnfocusedSelectionBackground());
myTree.setForeground(table.getSelectionForeground());
}
- else{
+ else {
myTree.setBackground(table.getBackground());
myTree.setForeground(table.getForeground());
}
@@ -60,7 +61,7 @@
final Object treeObject = myTree.getPathForRow(modelRow).getLastPathComponent();
boolean leaf = myTree.getModel().isLeaf(treeObject);
final boolean expanded = myTree.isExpanded(modelRow);
- Component component = myTree.getCellRenderer().getTreeCellRendererComponent(myTree, treeObject, isSelected, expanded, leaf, modelRow, hasFocus);
+ Component component = myTree.getCellRenderer().getTreeCellRendererComponent(myTree, treeObject, isSelected, expanded, leaf, modelRow, lineHasFocus);
if (component instanceof JComponent) {
table.setToolTipText(((JComponent)component).getToolTipText());
}
diff --git a/platform/platform-api/src/com/intellij/util/ui/tree/TreeUtil.java b/platform/platform-api/src/com/intellij/util/ui/tree/TreeUtil.java
index 6b56e11..5b55374 100644
--- a/platform/platform-api/src/com/intellij/util/ui/tree/TreeUtil.java
+++ b/platform/platform-api/src/com/intellij/util/ui/tree/TreeUtil.java
@@ -1007,4 +1007,14 @@
}
return -(low + 1); // key not found
}
+
+ @NotNull
+ public static Comparator<TreePath> getDisplayOrderComparator(@NotNull final JTree tree) {
+ return new Comparator<TreePath>() {
+ @Override
+ public int compare(TreePath path1, TreePath path2) {
+ return tree.getRowForPath(path1) - tree.getRowForPath(path2);
+ }
+ };
+ }
}
diff --git a/platform/platform-impl/src/com/intellij/concurrency/JobLauncherImpl.java b/platform/platform-impl/src/com/intellij/concurrency/JobLauncherImpl.java
index ef88f15..db3d101 100644
--- a/platform/platform-impl/src/com/intellij/concurrency/JobLauncherImpl.java
+++ b/platform/platform-impl/src/com/intellij/concurrency/JobLauncherImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
*/
package com.intellij.concurrency;
-import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ex.ApplicationManagerEx;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.progress.ProgressIndicator;
@@ -79,51 +78,15 @@
private static final ForkJoinPool pool = new ForkJoinPool(JobSchedulerImpl.CORES_COUNT, FACTORY, null, false);
static final int CORES_FORK_THRESHOLD = 1;
- private static <T> boolean invokeConcurrentlyForAll(@NotNull final List<T> things,
- boolean runInReadAction,
- @NotNull final Processor<? super T> thingProcessor,
- @NotNull ProgressIndicator wrapper) throws ProcessCanceledException {
- ApplierCompleter applier = new ApplierCompleter(null, runInReadAction, wrapper, things, thingProcessor, 0, things.size(), null);
- try {
- pool.invoke(applier);
- if (applier.throwable != null) throw applier.throwable;
- }
- catch (ApplierCompleter.ComputationAbortedException e) {
- return false;
- }
- catch (ProcessCanceledException e) {
- // task1.processor returns false and the task cancels the indicator
- // then task2 calls checkCancel() and get here
- return false;
- }
- catch (RuntimeException e) {
- throw e;
- }
- catch (Error e) {
- throw e;
- }
- catch (Throwable e) {
- throw new RuntimeException(e);
- }
- assert applier.isDone();
- return applier.completeTaskWhichFailToAcquireReadAction();
- }
-
@Override
- public <T> boolean invokeConcurrentlyUnderProgress(@NotNull List<? extends T>things,
- ProgressIndicator progress,
- boolean failFastOnAcquireReadAction,
- @NotNull final Processor<T> thingProcessor) throws ProcessCanceledException {
- return invokeConcurrentlyUnderProgress(things, progress, ApplicationManager.getApplication().isReadAccessAllowed(),
- failFastOnAcquireReadAction, thingProcessor);
- }
-
- @Override
- public <T> boolean invokeConcurrentlyUnderProgress(@NotNull final List<? extends T> things,
+ public <T> boolean invokeConcurrentlyUnderProgress(@NotNull final List<T> things,
ProgressIndicator progress,
boolean runInReadAction,
boolean failFastOnAcquireReadAction,
- @NotNull final Processor<T> thingProcessor) throws ProcessCanceledException {
+ @NotNull final Processor<? super T> thingProcessor) throws ProcessCanceledException {
+ //if (runInReadAction && ApplicationManager.getApplication().isWriteAccessAllowed()) {
+ // throw new RuntimeException("Must not run invokeConcurrentlyUnderProgress() from under write action because of imminent deadlock");
+ //}
if (things.isEmpty()) return true;
// supply our own indicator even if we haven't given one - to support cancellation
final ProgressIndicator wrapper = progress == null ? new AbstractProgressIndicatorBase() : new SensitiveProgressWrapper(progress);
@@ -157,22 +120,46 @@
return result.get();
}
- return invokeConcurrentlyForAll(things, runInReadAction, thingProcessor, wrapper);
+ ApplierCompleter<T> applier = new ApplierCompleter<T>(null, runInReadAction, wrapper, things, thingProcessor, 0, things.size(), null);
+ try {
+ pool.invoke(applier);
+ if (applier.throwable != null) throw applier.throwable;
+ }
+ catch (ApplierCompleter.ComputationAbortedException e) {
+ return false;
+ }
+ catch (ProcessCanceledException e) {
+ // task1.processor returns false and the task cancels the indicator
+ // then task2 calls checkCancel() and get here
+ return false;
+ }
+ catch (RuntimeException e) {
+ throw e;
+ }
+ catch (Error e) {
+ throw e;
+ }
+ catch (Throwable e) {
+ throw new RuntimeException(e);
+ }
+ assert applier.isDone();
+ return applier.completeTaskWhichFailToAcquireReadAction();
}
// This implementation is not really async
+
@NotNull
@Override
- public <T> AsyncFuture<Boolean> invokeConcurrentlyUnderProgressAsync(@NotNull List<? extends T> things,
- ProgressIndicator progress,
- boolean failFastOnAcquireReadAction,
- @NotNull Processor<T> thingProcessor) {
+ public <T> AsyncFuture<Boolean> invokeConcurrentlyUnderProgressAsync(@NotNull List<T> things,
+ ProgressIndicator progress,
+ boolean failFastOnAcquireReadAction,
+ @NotNull Processor<? super T> thingProcessor) {
return AsyncUtil.wrapBoolean(invokeConcurrentlyUnderProgress(things, progress, failFastOnAcquireReadAction, thingProcessor));
}
@NotNull
@Override
- public Job<Void> submitToJobThread(int priority, @NotNull final Runnable action, final Consumer<Future> onDoneCallback) {
+ public Job<Void> submitToJobThread(@NotNull final Runnable action, final Consumer<Future> onDoneCallback) {
VoidForkJoinTask task = new VoidForkJoinTask(action, onDoneCallback);
pool.submit(task);
return task;
@@ -182,7 +169,7 @@
private final Runnable myAction;
private final Consumer<Future> myOnDoneCallback;
- public VoidForkJoinTask(@NotNull Runnable action, @Nullable Consumer<Future> onDoneCallback) {
+ private VoidForkJoinTask(@NotNull Runnable action, @Nullable Consumer<Future> onDoneCallback) {
myAction = action;
myOnDoneCallback = onDoneCallback;
}
diff --git a/platform/platform-impl/src/com/intellij/errorreport/itn/ITNProxy.java b/platform/platform-impl/src/com/intellij/errorreport/itn/ITNProxy.java
index 160c6b5..eefe2b9 100644
--- a/platform/platform-impl/src/com/intellij/errorreport/itn/ITNProxy.java
+++ b/platform/platform-impl/src/com/intellij/errorreport/itn/ITNProxy.java
@@ -32,6 +32,7 @@
import com.intellij.openapi.progress.Task;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.updateSettings.impl.UpdateSettings;
+import com.intellij.openapi.util.BuildNumber;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.Consumer;
@@ -170,6 +171,14 @@
params.put("app.build.date.release", format(appInfo.getMajorReleaseBuildDate()));
params.put("app.compilation.timestamp", IdeaLogger.getOurCompilationTimestamp());
+ BuildNumber build = appInfo.getBuild();
+ String buildNumberWithAllDetails = build.asStringWithAllDetails();
+ params.put("app.product.code", build.getProductCode());
+ if (StringUtil.startsWith(buildNumberWithAllDetails, build.getProductCode() + "-")) {
+ buildNumberWithAllDetails = buildNumberWithAllDetails.substring(build.getProductCode().length() + 1);
+ }
+ params.put("app.build.number", buildNumberWithAllDetails);
+
UpdateSettings updateSettings = UpdateSettings.getInstance();
params.put("update.channel.status", updateSettings.getSelectedChannelStatus().getCode());
params.put("update.ignored.builds", StringUtil.join(updateSettings.getIgnoredBuildNumbers(), ","));
diff --git a/platform/platform-impl/src/com/intellij/ide/SystemHealthMonitor.java b/platform/platform-impl/src/com/intellij/ide/SystemHealthMonitor.java
index 6801094..60b5e96 100644
--- a/platform/platform-impl/src/com/intellij/ide/SystemHealthMonitor.java
+++ b/platform/platform-impl/src/com/intellij/ide/SystemHealthMonitor.java
@@ -28,7 +28,9 @@
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.ui.popup.Balloon;
import com.intellij.openapi.ui.popup.JBPopupFactory;
-import com.intellij.openapi.util.*;
+import com.intellij.openapi.util.Computable;
+import com.intellij.openapi.util.Ref;
+import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.wm.WindowManager;
import com.intellij.ui.HyperlinkAdapter;
@@ -117,8 +119,6 @@
});
}
- private static final int ourMaxNumberOfTimesToObserveZeroSpace = 2;
-
private static void startDiskSpaceMonitoring() {
if (SystemProperties.getBooleanProperty("idea.no.system.path.space.monitoring", false)) {
return;
@@ -143,8 +143,8 @@
// file.getUsableSpace() can fail and return 0 e.g. after MacOSX restart or awakening from sleep
// so several times try to recalculate usable space on receiving 0 to be sure
long fileUsableSpace = file.getUsableSpace();
- for(int i = 0; fileUsableSpace == 0 && i < ourMaxNumberOfTimesToObserveZeroSpace; ++i) {
- Thread.sleep(5000);
+ while(fileUsableSpace == 0) {
+ Thread.sleep(5000); // hopefully we will not hummer disk too much
fileUsableSpace = file.getUsableSpace();
}
diff --git a/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacroManager.java b/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacroManager.java
index 29d5671..388c225 100644
--- a/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacroManager.java
+++ b/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacroManager.java
@@ -399,11 +399,12 @@
public void messageEdt(PlaybackContext context, String text, Type type) {
if (type == Type.message || type == Type.error) {
+ StatusBar statusBar = frame.getStatusBar();
if (context != null) {
- frame.getStatusBar().setInfo("Line " + context.getCurrentLine() + ": " + text);
+ if (statusBar != null) statusBar.setInfo("Line " + context.getCurrentLine() + ": " + text);
}
else {
- frame.getStatusBar().setInfo(text);
+ if (statusBar != null) statusBar.setInfo(text);
}
}
}
@@ -414,7 +415,8 @@
runner.run()
.doWhenDone(new Runnable() {
public void run() {
- frame.getStatusBar().setInfo("Script execution finished");
+ StatusBar statusBar = frame.getStatusBar();
+ statusBar.setInfo("Script execution finished");
}
})
.doWhenProcessed(new Runnable() {
diff --git a/platform/platform-impl/src/com/intellij/ide/actions/CopyAction.java b/platform/platform-impl/src/com/intellij/ide/actions/CopyAction.java
index 3a76106..f447d70 100644
--- a/platform/platform-impl/src/com/intellij/ide/actions/CopyAction.java
+++ b/platform/platform-impl/src/com/intellij/ide/actions/CopyAction.java
@@ -1,5 +1,5 @@
/*
-* Copyright 2000-2009 JetBrains s.r.o.
+* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,11 @@
import com.intellij.openapi.project.DumbAware;
public class CopyAction extends AnAction implements DumbAware {
+
+ public CopyAction() {
+ setEnabledInModalContext(true);
+ }
+
public void actionPerformed(AnActionEvent e) {
DataContext dataContext = e.getDataContext();
CopyProvider provider = PlatformDataKeys.COPY_PROVIDER.getData(dataContext);
diff --git a/platform/platform-impl/src/com/intellij/ide/customize/PluginGroups.java b/platform/platform-impl/src/com/intellij/ide/customize/PluginGroups.java
index 63f34be..e380bca 100644
--- a/platform/platform-impl/src/com/intellij/ide/customize/PluginGroups.java
+++ b/platform/platform-impl/src/com/intellij/ide/customize/PluginGroups.java
@@ -204,7 +204,7 @@
}
protected static void addVimPlugin(Map<String, String> featuredPlugins) {
- featuredPlugins.put("IdeaVIM", "Editor:Emulates Vim editor:" + IDEA_VIM_PLUGIN_ID);
+ featuredPlugins.put("IdeaVim", "Editor:Emulates Vim editor:" + IDEA_VIM_PLUGIN_ID);
}
protected static void addLuaPlugin(Map<String, String> featuredPlugins) {
diff --git a/platform/platform-impl/src/com/intellij/ide/plugins/PluginManagerConfigurable.java b/platform/platform-impl/src/com/intellij/ide/plugins/PluginManagerConfigurable.java
index 95024f3..82c2220 100644
--- a/platform/platform-impl/src/com/intellij/ide/plugins/PluginManagerConfigurable.java
+++ b/platform/platform-impl/src/com/intellij/ide/plugins/PluginManagerConfigurable.java
@@ -52,7 +52,7 @@
@Override
public JComponent getPreferredFocusedComponent() {
- return myPluginManagerMain.getPluginTable();
+ return myPluginManagerMain == null ? null : myPluginManagerMain.getPluginTable();
}
@Override
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java
index 3c7026e..b5519de 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java
@@ -2329,6 +2329,7 @@
g.setColor(defaultBackground);
g.fillRect(clip.x, clip.y, clip.width, clip.height);
}
+ Color prevBackColor = null;
int lineHeight = getLineHeight();
@@ -2337,9 +2338,11 @@
Point position = new Point(0, visibleLine * lineHeight);
CharSequence prefixText = myPrefixText == null ? null : new CharArrayCharSequence(myPrefixText);
if (clipStartVisualPos.line == 0 && prefixText != null) {
- position.x = drawBackground(g, myPrefixAttributes.getBackgroundColor(), prefixText, 0, prefixText.length(), position,
+ Color backColor = myPrefixAttributes.getBackgroundColor();
+ position.x = drawBackground(g, backColor, prefixText, 0, prefixText.length(), position,
myPrefixAttributes.getFontType(),
defaultBackground, clip);
+ prevBackColor = backColor;
}
if (clipStartPosition.line >= myDocument.getLineCount() || clipStartPosition.line < 0) {
@@ -2391,6 +2394,7 @@
if (color != null) {
drawBackground(g, color, softWrap.getIndentInPixels(), position, defaultBackground, clip);
+ prevBackColor = color;
}
position.x = softWrap.getIndentInPixels();
}
@@ -2409,8 +2413,9 @@
if (hEnd >= lEnd) {
FoldRegion collapsedFolderAt = myFoldingModel.getCollapsedRegionAtOffset(start);
if (collapsedFolderAt == null) {
- position.x = drawSoftWrapAwareBackground(g, backColor, text, start, lEnd - lIterator.getSeparatorLength(), position, fontType,
- defaultBackground, clip, softWrapsToSkip, caretRowPainted);
+ position.x = drawSoftWrapAwareBackground(g, backColor, prevBackColor, text, start, lEnd - lIterator.getSeparatorLength(),
+ position, fontType, defaultBackground, clip, softWrapsToSkip, caretRowPainted);
+ prevBackColor = backColor;
paintAfterLineEndBackgroundSegments(g, iterationState, position, defaultBackground, lineHeight);
@@ -2440,12 +2445,13 @@
softWrap = mySoftWrapModel.getSoftWrap(collapsedFolderAt.getStartOffset());
if (softWrap != null) {
position.x = drawSoftWrapAwareBackground(
- g, backColor, text, collapsedFolderAt.getStartOffset(), collapsedFolderAt.getStartOffset(), position, fontType,
+ g, backColor, prevBackColor, text, collapsedFolderAt.getStartOffset(), collapsedFolderAt.getStartOffset(), position, fontType,
defaultBackground, clip, softWrapsToSkip, caretRowPainted
);
}
CharSequence chars = collapsedFolderAt.getPlaceholderText();
position.x = drawBackground(g, backColor, chars, 0, chars.length(), position, fontType, defaultBackground, clip);
+ prevBackColor = backColor;
}
lIterator.advance();
@@ -2456,23 +2462,26 @@
softWrap = mySoftWrapModel.getSoftWrap(collapsedFolderAt.getStartOffset());
if (softWrap != null) {
position.x = drawSoftWrapAwareBackground(
- g, backColor, text, collapsedFolderAt.getStartOffset(), collapsedFolderAt.getStartOffset(), position, fontType,
+ g, backColor, prevBackColor, text, collapsedFolderAt.getStartOffset(), collapsedFolderAt.getStartOffset(), position, fontType,
defaultBackground, clip, softWrapsToSkip, caretRowPainted
);
}
CharSequence chars = collapsedFolderAt.getPlaceholderText();
position.x = drawBackground(g, backColor, chars, 0, chars.length(), position, fontType, defaultBackground, clip);
+ prevBackColor = backColor;
}
else if (hEnd > lEnd - lIterator.getSeparatorLength()) {
position.x = drawSoftWrapAwareBackground(
- g, backColor, text, start, lEnd - lIterator.getSeparatorLength(), position, fontType,
+ g, backColor, prevBackColor, text, start, lEnd - lIterator.getSeparatorLength(), position, fontType,
defaultBackground, clip, softWrapsToSkip, caretRowPainted
);
+ prevBackColor = backColor;
}
else {
position.x = drawSoftWrapAwareBackground(
- g, backColor, text, start, hEnd, position, fontType, defaultBackground, clip, softWrapsToSkip, caretRowPainted
+ g, backColor, prevBackColor, text, start, hEnd, position, fontType, defaultBackground, clip, softWrapsToSkip, caretRowPainted
);
+ prevBackColor = backColor;
}
iterationState.advance();
@@ -2541,7 +2550,8 @@
}
private int drawSoftWrapAwareBackground(@NotNull Graphics g,
- Color backColor,
+ @Nullable Color backColor,
+ @Nullable Color prevBackColor,
@NotNull CharSequence text,
int start,
int end,
@@ -2569,7 +2579,7 @@
position.x = drawBackground(g, backColor, text, startToUse, softWrapStart, position, fontType, defaultBackground, clip);
}
boolean drawCustomBackgroundAtSoftWrapVirtualSpace =
- !Comparing.equal(backColor, defaultBackground) && (softWrapStart > start || Comparing.equal(myLastBackgroundColor, backColor));
+ !Comparing.equal(backColor, defaultBackground) && (softWrapStart > start || Comparing.equal(prevBackColor, backColor));
drawSoftWrap(
g, softWrap, position, fontType, backColor, drawCustomBackgroundAtSoftWrapVirtualSpace, defaultBackground, clip, caretRowPainted
);
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/SoftWrapModelImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/SoftWrapModelImpl.java
index e234be4..91ff15d 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/SoftWrapModelImpl.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/SoftWrapModelImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -637,6 +637,7 @@
myApplianceManager.release();
myStorage.removeAll();
myDeferredFoldRegions.clear();
+ myEditor.removePropertyChangeListener(this);
}
public void recalculate() {
diff --git a/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.java
index ce4e368..f2927e5 100644
--- a/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.java
+++ b/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.java
@@ -1001,7 +1001,7 @@
List<FileType> notExternalizableFileTypes = new ArrayList<FileType>();
for (FileType type : mySchemesManager.getAllSchemes()) {
- if (!(type instanceof AbstractFileType)) {
+ if (!(type instanceof AbstractFileType) || myDefaultTypes.contains(type)) {
notExternalizableFileTypes.add(type);
}
}
@@ -1317,6 +1317,7 @@
if (typeName != null && !typeName.equals(fileType.getName())) {
Trinity<String, String, Boolean> trinity = myUnresolvedRemovedMappings.get(matcher);
myRemovedMappings.put(matcher, Pair.create(fileType, trinity != null && trinity.third));
+ myUnresolvedMappings.remove(matcher);
}
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeKeyEventDispatcher.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeKeyEventDispatcher.java
index c8212fe..0ccfa47 100644
--- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeKeyEventDispatcher.java
+++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeKeyEventDispatcher.java
@@ -53,6 +53,7 @@
import com.intellij.openapi.wm.impl.IdeGlassPaneEx;
import com.intellij.ui.ColoredListCellRenderer;
import com.intellij.ui.ComponentWithMnemonics;
+import com.intellij.ui.KeyStrokeAdapter;
import com.intellij.ui.SimpleTextAttributes;
import com.intellij.ui.components.JBOptionButton;
import com.intellij.ui.popup.list.ListPopupImpl;
@@ -339,7 +340,10 @@
return false;
}
- KeyStroke originalKeyStroke=KeyStroke.getKeyStrokeForEvent(e);
+ KeyStroke originalKeyStroke = KeyStrokeAdapter.getDefaultKeyStroke(e);
+ if (originalKeyStroke == null) {
+ return false;
+ }
KeyStroke keyStroke=getKeyStrokeWithoutMouseModifiers(originalKeyStroke);
updateCurrentContext(myContext.getFoundComponent(), new KeyboardShortcut(myFirstKeyStroke, keyStroke), myContext.isModalContext());
@@ -406,7 +410,10 @@
}
}
- KeyStroke originalKeyStroke=KeyStroke.getKeyStrokeForEvent(e);
+ KeyStroke originalKeyStroke = KeyStrokeAdapter.getDefaultKeyStroke(e);
+ if (originalKeyStroke == null) {
+ return false;
+ }
KeyStroke keyStroke=getKeyStrokeWithoutMouseModifiers(originalKeyStroke);
if (myKeyGestureProcessor.processInitState()) {
diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ShortcutTextField.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ShortcutTextField.java
index 700a27a..19dfd08 100644
--- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ShortcutTextField.java
+++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ShortcutTextField.java
@@ -23,6 +23,7 @@
package com.intellij.openapi.keymap.impl.ui;
import com.intellij.openapi.util.registry.Registry;
+import com.intellij.ui.KeyStrokeAdapter;
import javax.swing.*;
import java.awt.event.KeyEvent;
@@ -47,8 +48,7 @@
){
return;
}
-
- setKeyStroke(KeyStroke.getKeyStroke(keyCode, e.getModifiers()));
+ setKeyStroke(KeyStrokeAdapter.getDefaultKeyStroke(e));
}
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/options/SchemesManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/options/SchemesManagerImpl.java
index e885101..af8be53 100644
--- a/platform/platform-impl/src/com/intellij/openapi/options/SchemesManagerImpl.java
+++ b/platform/platform-impl/src/com/intellij/openapi/options/SchemesManagerImpl.java
@@ -503,20 +503,6 @@
}
List<Throwable> errors = null;
- VirtualFile dir = getVirtualDir();
- if (!hasSchemes) {
- myFilesToDelete.clear();
- if (dir != null && dir.exists()) {
- try {
- StorageUtil.deleteFile(this, dir);
- }
- catch (Throwable e) {
- errors = new SmartList<Throwable>();
- errors.add(e);
- }
- }
- return;
- }
for (E scheme : schemesToSave) {
try {
@@ -530,8 +516,42 @@
}
}
+ VirtualFile dir = getVirtualDir();
errors = deleteFiles(dir, errors);
+ if (!hasSchemes && dir != null) {
+ LOG.info("No schemes to save, directory " + dir.getName() + " will be removed");
+
+ AccessToken token = ApplicationManager.getApplication().acquireWriteActionLock(DocumentRunnable.IgnoreDocumentRunnable.class);
+ try {
+ boolean remove = true;
+ for (VirtualFile file : dir.getChildren()) {
+ if (StringUtilRt.endsWithIgnoreCase(file.getNameSequence(), mySchemeExtension)) {
+ LOG.info("Directory " + dir.getName() + " cannot be removed - scheme " + file.getName() + " exists");
+ remove = false;
+ break;
+ }
+ }
+
+ if (remove) {
+ LOG.info("Remove schemes directory " + dir.getName());
+ try {
+ StorageUtil.deleteFile(this, dir);
+ myDir = null;
+ }
+ catch (Throwable e) {
+ if (errors == null) {
+ errors = new SmartList<Throwable>();
+ }
+ errors.add(e);
+ }
+ }
+ }
+ finally {
+ token.finish();
+ }
+ }
+
CompoundRuntimeException.doThrow(errors);
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateRunner.java b/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateRunner.java
index 535e071..37bb27e 100644
--- a/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateRunner.java
+++ b/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateRunner.java
@@ -91,6 +91,8 @@
}
}
+ private static final int FILE_SIZE_TO_SHOW_THRESHOLD = 500 * 1024;
+
public static void processFiles(final ProgressIndicator indicator,
boolean processInReadAction,
Collection<VirtualFile> files,
@@ -104,7 +106,7 @@
// need set here to handle queue.pushbacks after checkCancelled() in order
// not to count the same file several times
final Set<VirtualFile> processed = new THashSet<VirtualFile>();
- private boolean fileNameWasShownAfterRestart;
+ private boolean fileNameWasShown;
@Override
public void consume(VirtualFile virtualFile) {
@@ -112,12 +114,12 @@
synchronized (processed) {
boolean added = processed.add(virtualFile);
indicator.setFraction(processed.size() / total);
- if (!added) {
+ if (!added || (virtualFile.isValid() && virtualFile.getLength() > FILE_SIZE_TO_SHOW_THRESHOLD)) {
indicator.setText2(virtualFile.getPresentableUrl());
- fileNameWasShownAfterRestart = true;
- } else if (fileNameWasShownAfterRestart) {
+ fileNameWasShown = true;
+ } else if (fileNameWasShown) {
indicator.setText2("");
- fileNameWasShownAfterRestart = false;
+ fileNameWasShown = false;
}
}
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectImpl.java b/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectImpl.java
index bc18e70..827e423 100644
--- a/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectImpl.java
+++ b/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectImpl.java
@@ -340,7 +340,7 @@
}
}
catch (Throwable e) {
- LOG.error("Unable to store project name");
+ LOG.error("Unable to store project name", e);
}
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/VfsImplUtil.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/VfsImplUtil.java
index 77825b1..bdd2295 100644
--- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/VfsImplUtil.java
+++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/VfsImplUtil.java
@@ -17,7 +17,6 @@
import com.intellij.openapi.application.Application;
import com.intellij.openapi.application.ApplicationManager;
-import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.io.FileUtil;
@@ -199,7 +198,6 @@
checkSubscription();
ArchiveHandler handler;
- boolean refresh = false;
synchronized (ourLock) {
Pair<ArchiveFileSystem, ArchiveHandler> record = ourHandlers.get(localPath);
@@ -219,21 +217,10 @@
handlers.add(finalRootPath);
}
});
- refresh = true;
}
handler = record.second;
}
- if (refresh) {
- final File file = handler.getFile();
- ApplicationManager.getApplication().invokeLater(new Runnable() {
- @Override
- public void run() {
- LocalFileSystem.getInstance().refreshAndFindFileByIoFile(file);
- }
- }, ModalityState.defaultModalityState());
- }
-
@SuppressWarnings("unchecked") T t = (T)handler;
return t;
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/FSRecords.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/FSRecords.java
index ad50174..20a688a 100644
--- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/FSRecords.java
+++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/FSRecords.java
@@ -223,11 +223,12 @@
final File basePath = basePath();
basePath.mkdirs();
- final File namesFile = new File(basePath, "names.dat");
- final File attributesFile = new File(basePath, "attrib.dat");
- final File contentsFile = new File(basePath, "content.dat");
- final File contentsHashesFile = new File(basePath, "contentHashes.dat");
- final File recordsFile = new File(basePath, "records.dat");
+ String ext = System.getProperty("idea.vfs.files.extension", ".dat");
+ final File namesFile = new File(basePath, "names" + ext);
+ final File attributesFile = new File(basePath, "attrib" + ext);
+ final File contentsFile = new File(basePath, "content" + ext);
+ final File contentsHashesFile = new File(basePath, "contentHashes" + ext);
+ final File recordsFile = new File(basePath, "records" + ext);
if (!namesFile.exists()) {
invalidateIndex();
diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ProjectWindowAction.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ProjectWindowAction.java
index 7941484..0384892 100644
--- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ProjectWindowAction.java
+++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ProjectWindowAction.java
@@ -15,9 +15,11 @@
*/
package com.intellij.openapi.wm.impl;
+import com.intellij.openapi.actionSystem.ActionPlaces;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.ToggleAction;
+import com.intellij.openapi.actionSystem.impl.ActionMenuItem;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
@@ -113,9 +115,14 @@
@Override
public void setSelected(@Nullable AnActionEvent e, boolean selected) {
- if (!selected) {
+
+ if (e == null) return;
+ boolean macMainMenu = SystemInfo.isMac && ActionPlaces.isMainMenuOrActionSearch(e.getPlace());
+
+ if (!selected && !macMainMenu) {
return;
}
+
final Project project = findProject();
if (project == null) {
return;
@@ -123,7 +130,7 @@
final JFrame projectFrame = WindowManager.getInstance().getFrame(project);
final int frameState = projectFrame.getExtendedState();
- if (SystemInfo.isMac && (projectFrame.getExtendedState() & Frame.ICONIFIED) != 0) {
+ if (macMainMenu && !(e.getInputEvent().getSource() instanceof ActionMenuItem) && (projectFrame.getExtendedState() & Frame.ICONIFIED) != 0) {
// On Mac minimized window should not be restored this way
return;
}
diff --git a/platform/platform-impl/src/com/intellij/remote/RemoteCredentialsHolder.java b/platform/platform-impl/src/com/intellij/remote/RemoteCredentialsHolder.java
index f3de565..d936d0d 100644
--- a/platform/platform-impl/src/com/intellij/remote/RemoteCredentialsHolder.java
+++ b/platform/platform-impl/src/com/intellij/remote/RemoteCredentialsHolder.java
@@ -264,27 +264,27 @@
RemoteCredentialsHolder holder = (RemoteCredentialsHolder)o;
- if (myAnonymous != holder.myAnonymous) return false;
if (myPort != holder.myPort) return false;
- if (myStorePassphrase != holder.myStorePassphrase) return false;
- if (myStorePassword != holder.myStorePassword) return false;
+ if (myAnonymous != holder.myAnonymous) return false;
if (myUseKeyPair != holder.myUseKeyPair) return false;
- if (!myHost.equals(holder.myHost)) return false;
- if (myKnownHostsFile != null ? !myKnownHostsFile.equals(holder.myKnownHostsFile) : holder.myKnownHostsFile != null) return false;
- if (myPassphrase != null ? !myPassphrase.equals(holder.myPassphrase) : holder.myPassphrase != null) return false;
+ if (myStorePassword != holder.myStorePassword) return false;
+ if (myStorePassphrase != holder.myStorePassphrase) return false;
+ if (myHost != null ? !myHost.equals(holder.myHost) : holder.myHost != null) return false;
+ if (myUserName != null ? !myUserName.equals(holder.myUserName) : holder.myUserName != null) return false;
if (myPassword != null ? !myPassword.equals(holder.myPassword) : holder.myPassword != null) return false;
if (myPrivateKeyFile != null ? !myPrivateKeyFile.equals(holder.myPrivateKeyFile) : holder.myPrivateKeyFile != null) return false;
- if (!myUserName.equals(holder.myUserName)) return false;
+ if (myKnownHostsFile != null ? !myKnownHostsFile.equals(holder.myKnownHostsFile) : holder.myKnownHostsFile != null) return false;
+ if (myPassphrase != null ? !myPassphrase.equals(holder.myPassphrase) : holder.myPassphrase != null) return false;
return true;
}
@Override
public int hashCode() {
- int result = myHost.hashCode();
+ int result = myHost != null ? myHost.hashCode() : 0;
result = 31 * result + myPort;
result = 31 * result + (myAnonymous ? 1 : 0);
- result = 31 * result + myUserName.hashCode();
+ result = 31 * result + (myUserName != null ? myUserName.hashCode() : 0);
result = 31 * result + (myPassword != null ? myPassword.hashCode() : 0);
result = 31 * result + (myUseKeyPair ? 1 : 0);
result = 31 * result + (myPrivateKeyFile != null ? myPrivateKeyFile.hashCode() : 0);
diff --git a/platform/platform-impl/src/com/intellij/ui/EditorTextField.java b/platform/platform-impl/src/com/intellij/ui/EditorTextField.java
index 4cdc5f5..0317fea 100644
--- a/platform/platform-impl/src/com/intellij/ui/EditorTextField.java
+++ b/platform/platform-impl/src/com/intellij/ui/EditorTextField.java
@@ -594,7 +594,7 @@
public void setEnabled(boolean enabled) {
if (isEnabled() != enabled) {
super.setEnabled(enabled);
- myIsViewer = !enabled;
+ setViewerEnabled(enabled);
EditorEx editor = myEditor;
if (editor == null) {
return;
@@ -605,6 +605,10 @@
}
}
+ protected void setViewerEnabled(boolean enabled) {
+ myIsViewer = !enabled;
+ }
+
@Override
public Color getBackground() {
Color color = getBackgroundColor(isEnabled(), EditorColorsUtil.getGlobalOrDefaultColorScheme());
diff --git a/platform/platform-impl/src/com/intellij/ui/KeyStrokeAdapter.java b/platform/platform-impl/src/com/intellij/ui/KeyStrokeAdapter.java
new file mode 100644
index 0000000..f093167
--- /dev/null
+++ b/platform/platform-impl/src/com/intellij/ui/KeyStrokeAdapter.java
@@ -0,0 +1,152 @@
+/*
+ * Copyright 2000-2015 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.ui;
+
+import com.intellij.openapi.util.SystemInfo;
+import com.intellij.openapi.util.registry.Registry;
+
+import javax.swing.*;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.lang.reflect.Method;
+
+/**
+ * @author Sergey.Malenkov
+ */
+public class KeyStrokeAdapter implements KeyListener {
+ @Override
+ public void keyTyped(KeyEvent event) {
+ keyTyped(event, getKeyStroke(event, false));
+ }
+
+ protected boolean keyTyped(KeyStroke stroke) {
+ return false;
+ }
+
+ private void keyTyped(KeyEvent event, KeyStroke stroke) {
+ if (stroke != null && keyTyped(stroke)) {
+ event.consume();
+ }
+ }
+
+ @Override
+ public void keyPressed(KeyEvent event) {
+ keyPressed(event, getKeyStroke(event, true));
+ keyPressed(event, getKeyStroke(event, false));
+ }
+
+ protected boolean keyPressed(KeyStroke stroke) {
+ return false;
+ }
+
+ private void keyPressed(KeyEvent event, KeyStroke stroke) {
+ if (stroke != null && keyPressed(stroke)) {
+ event.consume();
+ }
+ }
+
+ @Override
+ public void keyReleased(KeyEvent event) {
+ keyReleased(event, getKeyStroke(event, true));
+ keyReleased(event, getKeyStroke(event, false));
+ }
+
+ protected boolean keyReleased(KeyStroke stroke) {
+ return false;
+ }
+
+ private void keyReleased(KeyEvent event, KeyStroke stroke) {
+ if (stroke != null && keyReleased(stroke)) {
+ event.consume();
+ }
+ }
+
+ /**
+ * @param event the specified key event to process
+ * @return a key stroke or {@code null} if it is not applicable
+ * @see KeyStroke#getKeyStrokeForEvent(KeyEvent)
+ */
+ public static KeyStroke getDefaultKeyStroke(KeyEvent event) {
+ if (event == null || event.isConsumed()) return null;
+ // On Windows and Mac it is preferable to use normal key code here
+ boolean extendedKeyCodeFirst = !SystemInfo.isWindows && !SystemInfo.isMac && event.getModifiers() == 0;
+ KeyStroke stroke = getKeyStroke(event, extendedKeyCodeFirst);
+ return stroke != null ? stroke : getKeyStroke(event, !extendedKeyCodeFirst);
+ }
+
+ /**
+ * @param event the specified key event to process
+ * @param extended {@code true} if extended key code should be used
+ * @return a key stroke or {@code null} if it is not applicable
+ * @see JComponent#processKeyBindings(KeyEvent, boolean)
+ */
+ public static KeyStroke getKeyStroke(KeyEvent event, boolean extended) {
+ if (event != null && !event.isConsumed()) {
+ int id = event.getID();
+ if (id == KeyEvent.KEY_TYPED) {
+ return extended ? null : getKeyStroke(event.getKeyChar());
+ }
+ boolean released = id == KeyEvent.KEY_RELEASED;
+ if (released || id == KeyEvent.KEY_PRESSED) {
+ int code = event.getKeyCode();
+ if (extended) {
+ if (Registry.is("actionSystem.extendedKeyCode.disabled")) {
+ return null;
+ }
+ code = getExtendedKeyCode(event);
+ if (code == event.getKeyCode()) {
+ return null;
+ }
+ }
+ return getKeyStroke(code, event.getModifiers(), released);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @param ch the specified key character
+ * @return a key stroke or {@code null} if {@code ch} is undefined
+ */
+ private static KeyStroke getKeyStroke(char ch) {
+ return KeyEvent.CHAR_UNDEFINED == ch ? null : KeyStroke.getKeyStroke(ch);
+ }
+
+ /**
+ * @param code the numeric code for a keyboard key
+ * @param modifiers the modifier mask from the event
+ * @param released {@code true} if the key stroke should represent a key release
+ * @return a key stroke or {@code null} if {@code code} is undefined
+ */
+ private static KeyStroke getKeyStroke(int code, int modifiers, boolean released) {
+ return KeyEvent.VK_UNDEFINED == code ? null : KeyStroke.getKeyStroke(code, modifiers, released);
+ }
+
+ // TODO: HACK because of Java7 required:
+ // replace later with event.getExtendedKeyCode()
+ private static int getExtendedKeyCode(KeyEvent event) {
+ try {
+ Method method = KeyEvent.class.getMethod("getExtendedKeyCode");
+ if (!method.isAccessible()) {
+ method.setAccessible(true);
+ }
+ return (Integer)method.invoke(event);
+ }
+ catch (Exception exception) {
+ return event.getKeyCode();
+ }
+ }
+}
diff --git a/platform/platform-impl/src/com/intellij/util/ui/SwingHelper.java b/platform/platform-impl/src/com/intellij/util/ui/SwingHelper.java
index a32625a..86c119b 100644
--- a/platform/platform-impl/src/com/intellij/util/ui/SwingHelper.java
+++ b/platform/platform-impl/src/com/intellij/util/ui/SwingHelper.java
@@ -25,10 +25,7 @@
import com.intellij.openapi.fileChooser.FileChooserFactory;
import com.intellij.openapi.ide.CopyPasteManager;
import com.intellij.openapi.project.Project;
-import com.intellij.openapi.ui.ComponentWithBrowseButton;
-import com.intellij.openapi.ui.DialogWrapper;
-import com.intellij.openapi.ui.TextComponentAccessor;
-import com.intellij.openapi.ui.TextFieldWithBrowseButton;
+import com.intellij.openapi.ui.*;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.HyperlinkLabel;
@@ -50,6 +47,7 @@
import java.awt.*;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.Transferable;
+import java.awt.event.ActionListener;
import java.util.Collection;
import java.util.List;
import java.util.Set;
@@ -197,7 +195,7 @@
rootPane.revalidate();
rootPane.repaint();
- LOG.info("DialogWrapper '" + dialogWrapper.getTitle() + "' has been resized (added width: " + dw + ", added height: " + dh + ")");
+ LOG.info("DialogWrapper '" + dialogWrapper.getTitle() + "' has been re-sized (added width: " + dw + ", added height: " + dh + ")");
}
public static <T> void updateItems(@NotNull JComboBox comboBox,
@@ -275,7 +273,8 @@
textFieldWithHistory.addPopupMenuListener(new PopupMenuListener() {
@Override
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
- setHistory(textFieldWithHistory, historyProvider.produce(), true);
+ List<String> history = historyProvider.produce();
+ setHistory(textFieldWithHistory, ContainerUtil.notNullize(history), true);
// one-time initialization
textFieldWithHistory.removePopupMenuListener(this);
}
@@ -405,7 +404,7 @@
return hyperlink;
}
- public static void setPreferredWidth(@NotNull JComponent component, int width) {
+ public static void setPreferredWidth(@NotNull Component component, int width) {
Dimension preferredSize = component.getPreferredSize();
preferredSize.width = width;
component.setPreferredSize(preferredSize);
@@ -566,6 +565,19 @@
return textFieldWithHistoryWithBrowseButton;
}
+ @NotNull
+ public static <C extends JComponent> ComponentWithBrowseButton<C> wrapWithInfoButton(@NotNull final C component,
+ @NotNull String infoButtonTooltip,
+ @NotNull ActionListener listener) {
+ ComponentWithBrowseButton<C> comp = new ComponentWithBrowseButton<C>(component, listener);
+ FixedSizeButton uiHelpButton = comp.getButton();
+ uiHelpButton.setToolTipText(infoButtonTooltip);
+ uiHelpButton.setIcon(UIUtil.getBalloonInformationIcon());
+ uiHelpButton.setHorizontalAlignment(SwingConstants.CENTER);
+ uiHelpButton.setVerticalAlignment(SwingConstants.CENTER);
+ return comp;
+ }
+
private static class CopyLinkAction extends AnAction {
private final String myUrl;
diff --git a/platform/platform-resources-en/src/fileTemplates/internal/Html5.html.ft b/platform/platform-resources-en/src/fileTemplates/internal/Html5.html.ft
index 19a0fbd..3fb197e 100644
--- a/platform/platform-resources-en/src/fileTemplates/internal/Html5.html.ft
+++ b/platform/platform-resources-en/src/fileTemplates/internal/Html5.html.ft
@@ -1,6 +1,6 @@
<!DOCTYPE html>
-<html>
-<head lang="en">
+<html lang="en">
+<head>
<meta charset="UTF-8">
<title></title>
</head>
diff --git a/platform/platform-resources-en/src/messages/ActionsBundle.properties b/platform/platform-resources-en/src/messages/ActionsBundle.properties
index c0448fa..eedec8f 100644
--- a/platform/platform-resources-en/src/messages/ActionsBundle.properties
+++ b/platform/platform-resources-en/src/messages/ActionsBundle.properties
@@ -1383,6 +1383,7 @@
group.ToolbarNewElement.text=Toolbar New Element Group
action.NewElementToolbarAction.text=Create New File
action.ShowRegistry.text=Registry...
+action.SwitchBootJdk.text=Switch IDE boot JDK...
action.UiDebugger.text=UI Debugger...
action.ExportTestResults.text=Export Test Results...
action.ExportTestResults.description=Export test results to the file
diff --git a/platform/platform-resources-en/src/messages/FindBundle.properties b/platform/platform-resources-en/src/messages/FindBundle.properties
index cd107a4..0d1765c 100644
--- a/platform/platform-resources-en/src/messages/FindBundle.properties
+++ b/platform/platform-resources-en/src/messages/FindBundle.properties
@@ -70,13 +70,14 @@
find.replace.with.label=Replace &with:
find.filter.file.name.group=File name filter
find.filter.file.mask.checkbox=File m&ask(s)
-find.context.combo.label=Conte&xt:
+find.context.combo.label=Conte&xt:\u0020
find.context.anywhere.scope.label=anywhere
find.context.in.comments.scope.label=in comments
find.context.in.literals.scope.label=in string literals
find.context.except.literals.scope.label=except string literals
find.context.except.comments.scope.label=except comments
find.context.except.comments.and.literals.scope.label=except comments and string literals
+find.context.presentation.scope.label=\u0020({0})
find.directory.not.found.error=Directory \"{0}\" is not found
find.invalid.regular.expression.error=Bad pattern \"{0}\": {1}
@@ -116,8 +117,8 @@
find.replace.invalid.replacement.string.title=Replace Error
find.highlight.no.more.highlights.found=No more highlights found
find.scope.all.project.classes=All Project Classes
-find.usage.view.tab.text=Occurrences of ''{0}''
-find.usage.view.toolwindow.title=Occurrences of ''{0}'' in {1}
+find.usage.view.tab.text=Occurrences of ''{0}''{1}
+find.usage.view.toolwindow.title=Occurrences of ''{0}'' in {1}{2}
find.usage.view.usages.text=occurrences of ''{0}''
diff --git a/platform/platform-resources-en/src/messages/UsageView.properties b/platform/platform-resources-en/src/messages/UsageView.properties
index a65327e..a08929e 100644
--- a/platform/platform-resources-en/src/messages/UsageView.properties
+++ b/platform/platform-resources-en/src/messages/UsageView.properties
@@ -20,8 +20,8 @@
dialog.rerun.search=Would you like to rerun the search now?
action.next.occurrence=Next Occurrence
action.previous.occurrence=Previous Occurrence
-progress.searching.for.in=Searching for {0} in {1}...
-dialog.no.usages.found.in=No {0} found in {1}
+progress.searching.for.in=Searching for {0} in {1}{2}...
+dialog.no.usages.found.in=No {0} found in {1}{2}
dialog.title.information=Information
dialog.button.ok=OK
node.invalid=INVALID
diff --git a/platform/platform-resources/src/META-INF/PlatformExtensions.xml b/platform/platform-resources/src/META-INF/PlatformExtensions.xml
index dcc548e..8028429 100644
--- a/platform/platform-resources/src/META-INF/PlatformExtensions.xml
+++ b/platform/platform-resources/src/META-INF/PlatformExtensions.xml
@@ -301,6 +301,7 @@
<projectConfigurable groupId="language" groupWeight="110" instance="com.intellij.javaee.ExternalResourceConfigurable" key="display.name.edit.external.resource"
bundle="messages.XmlBundle" id="preferences.externalResources">
+ <configurable instance="com.intellij.javaee.DefaultSchemasConfigurable" displayName="Default XML Schemas" id="xml.defaultSchemas"/>
<configurable instance="com.intellij.javaee.XMLCatalogConfigurable" displayName="XML Catalog" id="xml.catalog"/>
</projectConfigurable>
diff --git a/platform/platform-resources/src/brokenPlugins.txt b/platform/platform-resources/src/brokenPlugins.txt
index 5a0745e..77ec59d 100644
--- a/platform/platform-resources/src/brokenPlugins.txt
+++ b/platform/platform-resources/src/brokenPlugins.txt
@@ -1,12 +1,12 @@
// This file contains list of broken plugins.
// Each line contains plugin ID and list of versions that are broken.
// If plugin name or version contains a space you can quote it like in command line.
-NodeJS 141.288 141.506 141.2 140.2045 140.1669 140.642 139.173 139.105 139.496 139.1 139.8 138.2196 138.2254 138.1684 138.1744 138.1879 138.2051 138.1367 138.1495 138.1189 138.1145 138.937 138.1013 138.921 138.447 138.172 138.317 138.21 138.35 138.96 138.85 136.1205 134.1276 134.1163 134.1145 134.1081 134.1039 134.985 134.680 134.31 134.307 134.262 134.198 134.125 136.1141
+NodeJS 141.1108 141.614 141.712 141.288 141.506 141.2 140.2045 140.1669 140.642 139.173 139.105 139.496 139.1 139.8 138.2196 138.2254 138.1684 138.1744 138.1879 138.2051 138.1367 138.1495 138.1189 138.1145 138.937 138.1013 138.921 138.447 138.172 138.317 138.21 138.35 138.96 138.85 136.1205 134.1276 134.1163 134.1145 134.1081 134.1039 134.985 134.680 134.31 134.307 134.262 134.198 134.125 136.1141
com.jetbrains.php 139.732 139.659 139.496 139.173 139.105 138.2502 138.2000.2262 138.1751 138.1806 138.1505 138.1161 138.826 136.1768 136.1672 134.1456 133.982 133.679 133.51 133.326 131.98 131.374 131.332 131.235 131.205 130.1639 130.1481 130.1176 129.91 129.814 129.672 129.362 127.67 127.100 126.334 123.66 122.875 121.62 121.390 121.215 121.12
com.jetbrains.lang.ejs 131.17 131.12
com.jetbrains.twig 133.51 130.1639
org.jetbrains.plugins.ruby 7.1.0.20150304 7.0.0.20150216 7.0.0.20150204 7.0.0.20141010 7.0.0.20140915 7.0.0.20140901 7.0.0.20140807 6.0.0.20140207 6.5.2.20140512 7.0.0.20140704 7.0.0.20140707 7.0.0.20140724
-Pythonid 3.1 4.0.25 4.0.26
+Pythonid "4.1 141.4 EAP" 3.1 4.0.25 4.0.26
Karma 140.2109 138.1684 138.1879 138.317 138.21 134.1163 134.1039 134.686 134.31
org.intellij.scala 1.2.67.3.EAP 1.3.2-14.1 1.3.3-14.1 1.0.93.10.EAP 1.0.93.4.EAP 1.0.93.9.EAP 1.0.58 1.0.16 1.0.14 1.0.13 0.42.28 0.42.23 0.40.20 0.40.18 0.40.16 0.32.593 0.32.562 0.32.558 0.32.550 0.32.520 0.32.512
org.jetbrains.kannotator 0.2.420
diff --git a/platform/platform-resources/src/checkedPlugins.txt b/platform/platform-resources/src/checkedPlugins.txt
index 0d954d9..f5fb4b5 100644
--- a/platform/platform-resources/src/checkedPlugins.txt
+++ b/platform/platform-resources/src/checkedPlugins.txt
@@ -2,6 +2,7 @@
org.jetbrains.kotlin
org.jetbrains.plugins.ruby
com.jetbrains.php
+Pythonid
org.intellij.clojure
NodeJS
com.jetbrains.lang.ejs
diff --git a/platform/platform-resources/src/idea/PlatformActions.xml b/platform/platform-resources/src/idea/PlatformActions.xml
index 2a2871a..b0310df 100644
--- a/platform/platform-resources/src/idea/PlatformActions.xml
+++ b/platform/platform-resources/src/idea/PlatformActions.xml
@@ -604,6 +604,7 @@
<group id="MaintenanceGroup">
<action id="ShowRegistry" class="com.intellij.openapi.util.registry.ShowRegistryAction"/>
+ <action id="SwitchBootJdk" class="com.intellij.openapi.util.SwitchBootJdkAction"/>
<action id="UiDebugger" class="com.intellij.ui.debugger.ShowUiDebuggerAction"/>
</group>
diff --git a/platform/platform-tests/platform-tests.iml b/platform/platform-tests/platform-tests.iml
index ad0fefc..d77e2fb 100644
--- a/platform/platform-tests/platform-tests.iml
+++ b/platform/platform-tests/platform-tests.iml
@@ -26,5 +26,6 @@
<orderEntry type="library" name="http-client" level="project" />
<orderEntry type="module" module-name="jps-model-impl" scope="TEST" />
<orderEntry type="library" name="gson" level="project" />
+ <orderEntry type="module" module-name="testFramework-java" scope="TEST" />
</component>
</module>
\ No newline at end of file
diff --git a/platform/platform-tests/testSrc/com/intellij/concurrency/JobUtilTest.java b/platform/platform-tests/testSrc/com/intellij/concurrency/JobUtilTest.java
index 2961f8f..de04b96 100644
--- a/platform/platform-tests/testSrc/com/intellij/concurrency/JobUtilTest.java
+++ b/platform/platform-tests/testSrc/com/intellij/concurrency/JobUtilTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,6 +31,8 @@
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
@@ -302,7 +304,7 @@
public void testSaturation() throws InterruptedException {
final CountDownLatch latch = new CountDownLatch(1);
for (int i=0; i<100; i++) {
- JobLauncher.getInstance().submitToJobThread(0, new Runnable() {
+ JobLauncher.getInstance().submitToJobThread(new Runnable() {
@Override
public void run() {
try {
@@ -312,14 +314,14 @@
throw new RuntimeException(e);
}
}
- });
+ }, null);
}
- JobLauncher.getInstance().submitToJobThread(0, new Runnable() {
+ JobLauncher.getInstance().submitToJobThread(new Runnable() {
@Override
public void run() {
latch.countDown();
}
- });
+ }, null);
try {
boolean scheduled = latch.await(3, TimeUnit.SECONDS);
@@ -353,4 +355,33 @@
assertFalse(result);
}
}
+
+ public void testTasksRunEvenWhenReadActionIsHardToGet() throws ExecutionException, InterruptedException {
+ final Processor<String> processor = new Processor<String>() {
+ @Override
+ public boolean process(String s) {
+ busySleep(1);
+ return true;
+ }
+ };
+ for (int i=0; i<1/*00*/; i++) {
+ final ProgressIndicator indicator = new EmptyProgressIndicator();
+ Future<?> future = ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
+ @Override
+ public void run() {
+ JobLauncher.getInstance().invokeConcurrentlyUnderProgress(Collections.nCopies(10000, ""), indicator, true, false, processor);
+ assertFalse(indicator.isCanceled());
+ }
+ });
+ for (int k=0; k<10000; k++) {
+ ApplicationManager.getApplication().runWriteAction(new Runnable() {
+ @Override
+ public void run() {
+ busySleep(1);
+ }
+ });
+ }
+ future.get();
+ }
+ }
}
diff --git a/platform/platform-tests/testSrc/com/intellij/execution/GeneralCommandLineTest.java b/platform/platform-tests/testSrc/com/intellij/execution/GeneralCommandLineTest.java
index 64d82f7..9c550db 100644
--- a/platform/platform-tests/testSrc/com/intellij/execution/GeneralCommandLineTest.java
+++ b/platform/platform-tests/testSrc/com/intellij/execution/GeneralCommandLineTest.java
@@ -17,15 +17,18 @@
import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.execution.util.ExecUtil;
+import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
-import com.intellij.util.Function;
+import com.intellij.util.ArrayUtil;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.*;
@@ -36,6 +39,23 @@
import static org.junit.Assume.assumeTrue;
public class GeneralCommandLineTest {
+
+ private static final String[] ARGUMENTS = {
+ "with space",
+ "\"quoted\"",
+ "\"quoted with spaces\"",
+ "",
+ " ",
+ "param 1",
+ "\"",
+ "quote\"inside",
+ "space \"and \"quotes\" inside",
+ "\"space \"and \"quotes\" inside\"",
+ "param2",
+ "trailing slash\\",
+ // "two trailing slashes\\\\" /* doesn't work on Windows*/
+ };
+
@Test
public void printCommandLine() {
GeneralCommandLine commandLine = new GeneralCommandLine();
@@ -89,8 +109,9 @@
File dir = FileUtil.createTempDirectory("path with spaces 'and quotes' и юникодом ", ".tmp");
try {
GeneralCommandLine commandLine = makeJavaCommand(ParamPassingTest.class, dir);
+ commandLine.addParameter("test");
String output = execAndGetOutput(commandLine, null);
- assertEquals("=====\n=====\n", StringUtil.convertLineSeparators(output));
+ assertEquals("test\n", StringUtil.convertLineSeparators(output));
}
finally {
FileUtil.delete(dir);
@@ -98,20 +119,62 @@
}
@Test
- public void argumentsPassing() throws Exception {
- String[] parameters = {
- "with space", "\"quoted\"", "\"quoted with spaces\"", "", " ", "param 1", "\"", "param2", "trailing slash\\"
- };
-
+ public void testPassingArgumentsToJavaApp() throws Exception {
GeneralCommandLine commandLine = makeJavaCommand(ParamPassingTest.class, null);
- commandLine.addParameters(parameters);
+ String[] args = ArrayUtil.mergeArrays(ARGUMENTS, "&<>()@^|", "\"&<>()@^|\"");
+ commandLine.addParameters(args);
String output = execAndGetOutput(commandLine, null);
- assertEquals("=====\n" + StringUtil.join(parameters, new Function<String, String>() {
- @Override
- public String fun(String s) {
- return ParamPassingTest.format(s);
- }
- }, "\n") + "\n=====\n", StringUtil.convertLineSeparators(output));
+ assertParamPassingTestOutput(output, args);
+ }
+
+ @Test
+ public void testPassingArgumentsToJavaAppThroughWinShell() throws Exception {
+ assumeTrue(SystemInfo.isWindows);
+ // passing "^" argument doesn't work for cmd.exe
+ String[] args = ARGUMENTS;
+ GeneralCommandLine commandLine = makeJavaCommand(ParamPassingTest.class, null);
+ String oldExePath = commandLine.getExePath();
+ commandLine.setExePath("cmd.exe");
+ // the test will fails if "call" is omitted
+ commandLine.getParametersList().prependAll("/D", "/C", "call", oldExePath);
+ commandLine.addParameters(args);
+ String output = execAndGetOutput(commandLine, null);
+ assertParamPassingTestOutput(output, args);
+ }
+
+ @Test
+ public void testPassingArgumentsToJavaAppThroughCmdScriptAndWinShell() throws Exception {
+ assumeTrue(SystemInfo.isWindows);
+ // passing "^" argument doesn't work for cmd.exe
+ String[] args = ARGUMENTS;
+ File cmdScript = createCmdFileLaunchingJavaApp();
+ GeneralCommandLine commandLine = new GeneralCommandLine();
+ commandLine.setExePath("cmd.exe");
+ // the test will fails if "call" is omitted
+ commandLine.addParameters("/D", "/C", "call", cmdScript.getAbsolutePath());
+ commandLine.addParameters(args);
+ String output = execAndGetOutput(commandLine, null);
+ assertParamPassingTestOutput(output, args);
+ }
+
+ @NotNull
+ private File createCmdFileLaunchingJavaApp() throws Exception {
+ File cmdScript = FileUtil.createTempFile(new File(PathManager.getTempPath(), "My Program Files" /* path with spaces */),
+ "my-script", ".cmd", true, true);
+ GeneralCommandLine commandLine = makeJavaCommand(ParamPassingTest.class, null);
+ FileUtil.writeToFile(cmdScript, "@" + commandLine.getCommandLineString() + " %*");
+ if (!cmdScript.setExecutable(true, true)) {
+ throw new ExecutionException("Failed to make temp file executable: " + cmdScript);
+ }
+ return cmdScript;
+ }
+
+ private static void assertParamPassingTestOutput(@NotNull String actualOutput, @NotNull String... expectedOutputParameters) {
+ String content = StringUtil.join(expectedOutputParameters, "\n");
+ if (expectedOutputParameters.length > 0) {
+ content += "\n";
+ }
+ assertEquals(content, StringUtil.convertLineSeparators(actualOutput));
}
@Test
@@ -250,11 +313,19 @@
private static String execAndGetOutput(GeneralCommandLine commandLine, @Nullable String encoding) throws Exception {
Process process = commandLine.createProcess();
- byte[] bytes = FileUtil.loadBytes(process.getInputStream());
- String output = encoding != null ? new String(bytes, encoding) : new String(bytes);
+ String stdOut = loadTextFromStream(process.getInputStream(), encoding);
+ String stdErr = loadTextFromStream(process.getErrorStream(), encoding);
int result = process.waitFor();
- assertEquals("Command:\n" + commandLine.getCommandLineString() + "\nOutput:\n" + output, 0, result);
- return output;
+ assertEquals("Command:\n" + commandLine.getCommandLineString()
+ + "\nStandard output:\n" + stdOut
+ + "\nStandard error:\n" + stdErr,
+ 0, result);
+ return stdOut;
+ }
+
+ private static String loadTextFromStream(@NotNull InputStream stream, @Nullable String encoding) throws IOException {
+ byte[] bytes = FileUtil.loadBytes(stream);
+ return encoding != null ? new String(bytes, encoding) : new String(bytes);
}
private GeneralCommandLine makeJavaCommand(Class<?> testClass, @Nullable File copyTo) throws IOException, URISyntaxException {
diff --git a/platform/platform-tests/testSrc/com/intellij/execution/ParamPassingTest.java b/platform/platform-tests/testSrc/com/intellij/execution/ParamPassingTest.java
index a6fd26f..45c2832 100644
--- a/platform/platform-tests/testSrc/com/intellij/execution/ParamPassingTest.java
+++ b/platform/platform-tests/testSrc/com/intellij/execution/ParamPassingTest.java
@@ -17,14 +17,8 @@
public class ParamPassingTest {
public static void main(String[] args) {
- System.out.println("=====");
for (String arg : args) {
- System.out.println(format(arg));
+ System.out.println(arg);
}
- System.out.println("=====");
- }
-
- public static String format(String arg) {
- return String.valueOf(arg.hashCode());
}
}
diff --git a/platform/platform-tests/testSrc/com/intellij/execution/impl/ConsoleViewImplTest.java b/platform/platform-tests/testSrc/com/intellij/execution/impl/ConsoleViewImplTest.java
index b61fe0f..cf57f74 100644
--- a/platform/platform-tests/testSrc/com/intellij/execution/impl/ConsoleViewImplTest.java
+++ b/platform/platform-tests/testSrc/com/intellij/execution/impl/ConsoleViewImplTest.java
@@ -17,10 +17,14 @@
import com.intellij.execution.process.ProcessHandler;
import com.intellij.execution.ui.ConsoleViewContentType;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.actionSystem.EditorActionManager;
+import com.intellij.openapi.editor.actionSystem.TypedAction;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Disposer;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.testFramework.LightPlatformTestCase;
+import com.intellij.testFramework.TestDataProvider;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -45,6 +49,28 @@
}
}
+ public void testTypingAfterMultipleCR() throws Exception {
+ final EditorActionManager actionManager = EditorActionManager.getInstance();
+ final TypedAction typedAction = actionManager.getTypedAction();
+ final TestDataProvider dataContext = new TestDataProvider(getProject());
+
+ final ConsoleViewImpl console = createConsole();
+ final Editor editor = console.getEditor();
+ try {
+ console.print("System output\n", ConsoleViewContentType.SYSTEM_OUTPUT);
+ console.print("\r\r\r\r\r\r\r", ConsoleViewContentType.NORMAL_OUTPUT);
+ console.flushDeferredText();
+
+ typedAction.actionPerformed(editor, '1', dataContext);
+ typedAction.actionPerformed(editor, '2', dataContext);
+
+ assertEquals("System output\n12", editor.getDocument().getText());
+ }
+ finally {
+ Disposer.dispose(console);
+ }
+ }
+
@NotNull
private static ConsoleViewImpl createConsole() {
Project project = getProject();
diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/impl/FileTypesTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/impl/FileTypesTest.java
index f309b63..4d8c43b 100644
--- a/platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/impl/FileTypesTest.java
+++ b/platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/impl/FileTypesTest.java
@@ -15,6 +15,7 @@
*/
package com.intellij.openapi.fileTypes.impl;
+import com.intellij.ide.highlighter.ArchiveFileType;
import com.intellij.ide.highlighter.ModuleFileType;
import com.intellij.ide.highlighter.ProjectFileType;
import com.intellij.ide.highlighter.custom.SyntaxTable;
@@ -37,6 +38,7 @@
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.*;
import com.intellij.psi.impl.PsiManagerEx;
+import com.intellij.testFramework.IdeaTestCase;
import com.intellij.testFramework.PlatformTestCase;
import com.intellij.testFramework.PlatformTestUtil;
import com.intellij.util.PatternUtil;
@@ -55,12 +57,14 @@
import java.util.Set;
import java.util.regex.Pattern;
+@SuppressWarnings("ConstantConditions")
public class FileTypesTest extends PlatformTestCase {
private FileTypeManagerImpl myFileTypeManager;
private String myOldIgnoredFilesList;
+ @SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors")
public FileTypesTest() {
- initPlatformLangPrefix();
+ IdeaTestCase.initPlatformPrefix();
}
@Override
@@ -347,7 +351,7 @@
}
private static void log(String message) {
- //System.out.println(message);
+ System.out.println(message);
}
private void ensureRedetected(VirtualFile vFile, Set<VirtualFile> detectorCalled) {
@@ -379,6 +383,9 @@
assertEquals(perlFileType, myFileTypeManager.getFileTypeByFileName("foo.cgi"));
myFileTypeManager.removeAssociatedExtension(perlFileType, "*.cgi");
+ myFileTypeManager.clearForTests();
+ myFileTypeManager.initStandardFileTypes();
+ myFileTypeManager.initComponent();
}
public void testRenamedPropertiesToUnknownAndBack() throws Exception {
@@ -481,4 +488,40 @@
Extensions.getRootArea().getExtensionPoint(FileTypeFactory.FILE_TYPE_FACTORY_EP).unregisterExtension(factory);
}
}
+
+ // IDEA-139409 Persistent message "File type recognized: File extension *.vm was reassigned to VTL"
+ public void testReassign() throws Exception {
+ Element element = JDOMUtil.loadDocument(
+ "<component name=\"FileTypeManager\" version=\"13\">\n" +
+ " <extensionMap>\n" +
+ " <mapping ext=\"zip\" type=\"Velocity Template files\" />\n" +
+ " </extensionMap>\n" +
+ "</component>").getRootElement();
+
+ myFileTypeManager.loadState(element);
+ myFileTypeManager.initComponent();
+ Map<FileNameMatcher, Pair<FileType, Boolean>> mappings = myFileTypeManager.getRemovedMappings();
+ assertEquals(1, mappings.size());
+ assertEquals(ArchiveFileType.INSTANCE, mappings.values().iterator().next().first);
+ mappings.clear();
+ assertEquals(ArchiveFileType.INSTANCE, myFileTypeManager.getFileTypeByExtension("zip"));
+ Element map = myFileTypeManager.getState().getChild("extensionMap");
+ if (map != null) {
+ fail(JDOMUtil.writeElement(map));
+ }
+ }
+
+ public void testDefaultFileType() throws Exception {
+ FileType idl = myFileTypeManager.findFileTypeByName("IDL");
+ myFileTypeManager.associatePattern(idl, "*.xxx");
+ Element element = myFileTypeManager.getState();
+ log(JDOMUtil.writeElement(element));
+ myFileTypeManager.removeAssociatedExtension(idl, "xxx");
+ myFileTypeManager.clearForTests();
+ myFileTypeManager.initStandardFileTypes();
+ myFileTypeManager.loadState(element);
+ myFileTypeManager.initComponent();
+ FileType extensions = myFileTypeManager.getFileTypeByExtension("xxx");
+ assertEquals("IDL", extensions.getName());
+ }
}
diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerTest.java
index 98da1ad..1959b1b 100644
--- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerTest.java
+++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
*/
package com.intellij.openapi.vfs.impl;
-import com.intellij.concurrency.Job;
import com.intellij.concurrency.JobLauncher;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.ApplicationManager;
@@ -701,7 +700,7 @@
private static void stressRead(@NotNull final VirtualFilePointer pointer) {
for (int i = 0; i < 10; i++) {
- JobLauncher.getInstance().submitToJobThread(Job.DEFAULT_PRIORITY, new Runnable() {
+ JobLauncher.getInstance().submitToJobThread(new Runnable() {
@Override
public void run() {
ApplicationManager.getApplication().runReadAction(new Runnable() {
diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/JarFileSystemTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/JarFileSystemTest.java
index 6ab1ac9..47cf79b 100644
--- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/JarFileSystemTest.java
+++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/JarFileSystemTest.java
@@ -39,7 +39,7 @@
import com.intellij.refactoring.rename.PsiElementRenameHandler;
import com.intellij.refactoring.rename.RenameHandler;
import com.intellij.refactoring.rename.RenameHandlerRegistry;
-import com.intellij.testFramework.PlatformLangTestCase;
+import com.intellij.testFramework.PlatformTestCase;
import com.intellij.testFramework.PlatformTestUtil;
import com.intellij.testFramework.PsiTestUtil;
import org.jetbrains.annotations.NotNull;
@@ -52,7 +52,7 @@
import static com.intellij.testFramework.PlatformTestUtil.assertPathsEqual;
-public class JarFileSystemTest extends PlatformLangTestCase {
+public class JarFileSystemTest extends PlatformTestCase {
public void testFindFile() throws IOException {
String rtJarPath = PlatformTestUtil.getRtJarPath();
diff --git a/platform/projectModel-api/src/com/intellij/lang/PerFileMappingsBase.java b/platform/projectModel-api/src/com/intellij/lang/PerFileMappingsBase.java
index 11e50c9..d6a1930 100644
--- a/platform/projectModel-api/src/com/intellij/lang/PerFileMappingsBase.java
+++ b/platform/projectModel-api/src/com/intellij/lang/PerFileMappingsBase.java
@@ -234,6 +234,7 @@
dialectMap.put(key, dialect);
}
}
+ myMappings.clear();
final List<Element> files = state.getChildren("file");
for (Element fileElement : files) {
final String url = fileElement.getAttributeValue("url");
diff --git a/platform/projectModel-api/src/com/intellij/openapi/roots/OrderEnumerator.java b/platform/projectModel-api/src/com/intellij/openapi/roots/OrderEnumerator.java
index 60d8b59..c77efa1 100644
--- a/platform/projectModel-api/src/com/intellij/openapi/roots/OrderEnumerator.java
+++ b/platform/projectModel-api/src/com/intellij/openapi/roots/OrderEnumerator.java
@@ -25,8 +25,6 @@
import com.intellij.util.Processor;
import org.jetbrains.annotations.NotNull;
-import java.util.Collection;
-
/**
* Interface for convenient processing dependencies of a module or a project. Allows to process {@link OrderEntry}s and collect classes
* and source roots.<p>
@@ -82,7 +80,7 @@
}
public VirtualFile[] getAllLibrariesAndSdkClassesRoots() {
- return withoutModuleSourceEntries().recursively().exportedOnly().classes().usingCache().getRoots();
+ return withoutModuleSourceEntries().withoutDepModules().recursively().exportedOnly().classes().usingCache().getRoots();
}
public VirtualFile[] getAllSourceRoots() {
diff --git a/platform/projectModel-impl/src/com/intellij/openapi/components/impl/stores/DirectoryStorageData.java b/platform/projectModel-impl/src/com/intellij/openapi/components/impl/stores/DirectoryStorageData.java
index 5e33632..d325fa1 100644
--- a/platform/projectModel-impl/src/com/intellij/openapi/components/impl/stores/DirectoryStorageData.java
+++ b/platform/projectModel-impl/src/com/intellij/openapi/components/impl/stores/DirectoryStorageData.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,11 +28,9 @@
import gnu.trove.THashMap;
import gnu.trove.TObjectObjectProcedure;
import org.jdom.Element;
-import org.jdom.JDOMException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -82,7 +80,12 @@
}
try {
- Element element = JDOMUtil.loadDocument(file.contentsToByteArray()).getRootElement();
+ if (file.getLength() == 0) {
+ LOG.warn("Ignore empty file " + file.getPath());
+ continue;
+ }
+
+ Element element = JDOMUtil.load(file.getInputStream());
String name = StorageData.getComponentNameIfValid(element);
if (name == null) {
continue;
@@ -106,11 +109,8 @@
}
setState(name, file.getName(), state);
}
- catch (IOException e) {
- LOG.info("Unable to load state", e);
- }
- catch (JDOMException e) {
- LOG.info("Unable to load state", e);
+ catch (Throwable e) {
+ LOG.warn("Unable to load state", e);
}
}
}
diff --git a/platform/projectModel-impl/src/com/intellij/openapi/module/impl/ModuleManagerImpl.java b/platform/projectModel-impl/src/com/intellij/openapi/module/impl/ModuleManagerImpl.java
index fd3dd9d..c92b284 100644
--- a/platform/projectModel-impl/src/com/intellij/openapi/module/impl/ModuleManagerImpl.java
+++ b/platform/projectModel-impl/src/com/intellij/openapi/module/impl/ModuleManagerImpl.java
@@ -778,9 +778,9 @@
private void initModule(ModuleEx module) {
String path = module.getModuleFilePath();
+ module.init();
myModulesCache = null;
myPathToModule.put(path, module);
- module.init();
}
@Override
diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/MockPrinter.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/MockPrinter.java
index 3896d0c..0217984 100644
--- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/MockPrinter.java
+++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/MockPrinter.java
@@ -29,6 +29,18 @@
protected final StringBuilder myStdErr = new StringBuilder();
protected final StringBuilder myStdSys = new StringBuilder();
+ /**
+ * Creates printer and prints printable on it.
+ * @param printable printable to print on this printer
+ * @return printer filled with printable output
+ */
+ @NotNull
+ public static MockPrinter fillPrinter(@NotNull Printable printable) {
+ MockPrinter printer = new MockPrinter();
+ printable.printOn(printer);
+ return printer;
+ }
+
public MockPrinter() {
this(true);
}
diff --git a/platform/testFramework/src/com/intellij/testFramework/CompositeException.java b/platform/testFramework/src/com/intellij/testFramework/CompositeException.java
index 59e73bf..c2f261e 100644
--- a/platform/testFramework/src/com/intellij/testFramework/CompositeException.java
+++ b/platform/testFramework/src/com/intellij/testFramework/CompositeException.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -130,7 +130,8 @@
sb.append(line);
line = exceptionProcessor.fun(exception);
- if (!line.endsWith("\n")) line += '\n';
+ if (line == null) line = "null\n";
+ else if (!line.endsWith("\n")) line += '\n';
stringProcessor.process(line);
sb.append(line);
}
diff --git a/platform/testFramework/src/com/intellij/testFramework/TestActionEvent.java b/platform/testFramework/src/com/intellij/testFramework/TestActionEvent.java
index 23dc823..cccb77a 100644
--- a/platform/testFramework/src/com/intellij/testFramework/TestActionEvent.java
+++ b/platform/testFramework/src/com/intellij/testFramework/TestActionEvent.java
@@ -37,6 +37,10 @@
super(null, DataManager.getInstance().getDataContext(), "", presentation, ActionManager.getInstance(), 0);
}
+ public TestActionEvent(DataContext context) {
+ super(null, context, "", new Presentation(), ActionManager.getInstance(), 0);
+ }
+
public TestActionEvent() {
super(null, DataManager.getInstance().getDataContext(), "", new Presentation(), ActionManager.getInstance(), 0);
}
diff --git a/platform/testFramework/src/com/intellij/testFramework/TestDataProvider.java b/platform/testFramework/src/com/intellij/testFramework/TestDataProvider.java
index 1ed87bb..e9d9d50 100644
--- a/platform/testFramework/src/com/intellij/testFramework/TestDataProvider.java
+++ b/platform/testFramework/src/com/intellij/testFramework/TestDataProvider.java
@@ -16,6 +16,7 @@
package com.intellij.testFramework;
import com.intellij.openapi.actionSystem.CommonDataKeys;
+import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.DataProvider;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.editor.Editor;
@@ -32,7 +33,7 @@
/**
* @author peter
*/
-public class TestDataProvider implements DataProvider {
+public class TestDataProvider implements DataProvider, DataContext {
private final Project myProject;
public TestDataProvider(@NotNull Project project) {
diff --git a/platform/usageView/src/com/intellij/usages/UsageViewPresentation.java b/platform/usageView/src/com/intellij/usages/UsageViewPresentation.java
index 5c0100e..962411a 100644
--- a/platform/usageView/src/com/intellij/usages/UsageViewPresentation.java
+++ b/platform/usageView/src/com/intellij/usages/UsageViewPresentation.java
@@ -29,6 +29,7 @@
public class UsageViewPresentation {
private String myTabText;
private String myScopeText = ""; // Default value. to be overwritten in most cases.
+ private String myContextText = "";
private String myUsagesString;
private String myTargetsNodeText = UsageViewBundle.message("node.targets"); // Default value. to be overwritten in most cases.
private String myNonCodeUsagesString = UsageViewBundle.message("node.non.code.usages");
@@ -66,6 +67,14 @@
myScopeText = scopeText;
}
+ public @NotNull String getContextText() {
+ return myContextText;
+ }
+
+ public void setContextText(@NotNull String contextText) {
+ myContextText = contextText;
+ }
+
public boolean isShowReadOnlyStatusAsRed() {
return myShowReadOnlyStatusAsRed;
}
diff --git a/platform/usageView/src/com/intellij/usages/impl/SearchForUsagesRunnable.java b/platform/usageView/src/com/intellij/usages/impl/SearchForUsagesRunnable.java
index a7e5223..00a7097 100644
--- a/platform/usageView/src/com/intellij/usages/impl/SearchForUsagesRunnable.java
+++ b/platform/usageView/src/com/intellij/usages/impl/SearchForUsagesRunnable.java
@@ -417,7 +417,9 @@
final List<Action> notFoundActions = myProcessPresentation.getNotFoundActions();
final String message = UsageViewBundle.message("dialog.no.usages.found.in",
StringUtil.decapitalize(myPresentation.getUsagesString()),
- myPresentation.getScopeText());
+ myPresentation.getScopeText(),
+ myPresentation.getContextText()
+ );
if (notFoundActions.isEmpty()) {
List<String> lines = new ArrayList<String>();
diff --git a/platform/usageView/src/com/intellij/usages/impl/UsageViewManagerImpl.java b/platform/usageView/src/com/intellij/usages/impl/UsageViewManagerImpl.java
index 455718c..e0a98ec 100644
--- a/platform/usageView/src/com/intellij/usages/impl/UsageViewManagerImpl.java
+++ b/platform/usageView/src/com/intellij/usages/impl/UsageViewManagerImpl.java
@@ -188,7 +188,7 @@
public static String getProgressTitle(@NotNull UsageViewPresentation presentation) {
final String scopeText = presentation.getScopeText();
String usagesString = StringUtil.capitalize(presentation.getUsagesString());
- return UsageViewBundle.message("progress.searching.for.in", usagesString, scopeText);
+ return UsageViewBundle.message("progress.searching.for.in", usagesString, scopeText, presentation.getContextText());
}
void showToolWindow(boolean activateWindow) {
diff --git a/platform/util-rt/src/com/intellij/openapi/util/io/FileUtilRt.java b/platform/util-rt/src/com/intellij/openapi/util/io/FileUtilRt.java
index 3ccf997..b5ab483 100644
--- a/platform/util-rt/src/com/intellij/openapi/util/io/FileUtilRt.java
+++ b/platform/util-rt/src/com/intellij/openapi/util/io/FileUtilRt.java
@@ -77,8 +77,10 @@
private static Method ourFilesDeleteIfExistsMethod;
private static Method ourFilesWalkMethod;
private static Method ourFileToPathMethod;
+ private static Method ourPathToFileMethod;
private static Object ourDeletionVisitor;
private static Class ourNoSuchFileExceptionClass;
+ private static Class ourAccessDeniedExceptionClass;
static {
boolean initSuccess = false;
@@ -87,8 +89,10 @@
final Class<?> visitorClass = Class.forName("java.nio.file.FileVisitor");
final Class<?> filesClass = Class.forName("java.nio.file.Files");
ourNoSuchFileExceptionClass = Class.forName("java.nio.file.NoSuchFileException");
+ ourAccessDeniedExceptionClass = Class.forName("java.nio.file.AccessDeniedException");
ourFileToPathMethod = Class.forName("java.io.File").getMethod("toPath");
+ ourPathToFileMethod = pathClass.getMethod("toFile");
ourFilesWalkMethod = filesClass.getMethod("walkFileTree", pathClass, visitorClass);
ourFilesDeleteIfExistsMethod = filesClass.getMethod("deleteIfExists", pathClass);
final Class<?> fileVisitResultClass = Class.forName("java.nio.file.FileVisitResult");
@@ -121,9 +125,25 @@
return Boolean.TRUE;
}
catch (InvocationTargetException e) {
- if (!(e.getCause() instanceof IOException)) {
+ final Throwable cause = e.getCause();
+ if (!(cause instanceof IOException)) {
return Boolean.FALSE;
}
+ if (ourAccessDeniedExceptionClass.isInstance(cause)) {
+ // file is read-only: fallback to standard java.io API
+ try {
+ final File file = (File)ourPathToFileMethod.invoke(fileObject);
+ if (file == null) {
+ return Boolean.FALSE;
+ }
+ if (file.delete() || !file.exists()) {
+ return Boolean.TRUE;
+ }
+ }
+ catch (Throwable ignored) {
+ return Boolean.FALSE;
+ }
+ }
}
catch (IllegalAccessException e) {
return Boolean.FALSE;
diff --git a/platform/util-rt/src/com/intellij/openapi/util/text/StringUtilRt.java b/platform/util-rt/src/com/intellij/openapi/util/text/StringUtilRt.java
index 5806b4b..f371a38 100644
--- a/platform/util-rt/src/com/intellij/openapi/util/text/StringUtilRt.java
+++ b/platform/util-rt/src/com/intellij/openapi/util/text/StringUtilRt.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,7 +35,7 @@
@NotNull
@Contract(pure = true)
- public static String toUpperCase(@NotNull String s) {
+ public static CharSequence toUpperCase(@NotNull CharSequence s) {
StringBuilder answer = null;
for (int i = 0; i < s.length(); i++) {
@@ -43,7 +43,7 @@
char upcased = toUpperCase(c);
if (answer == null && upcased != c) {
answer = new StringBuilder(s.length());
- answer.append(s.substring(0, i));
+ answer.append(s.subSequence(0, i));
}
if (answer != null) {
@@ -51,7 +51,7 @@
}
}
- return answer == null ? s : answer.toString();
+ return answer == null ? s : answer;
}
@Contract(pure = true)
diff --git a/platform/util/resources/misc/registry.properties b/platform/util/resources/misc/registry.properties
index e979fad..da35dd9 100644
--- a/platform/util/resources/misc/registry.properties
+++ b/platform/util/resources/misc/registry.properties
@@ -40,6 +40,7 @@
actionSystem.mouseGesturesEnabled=true
actionSystem.assertFocusAccessFromEdt=true
actionSystem.enableAbbreviations=true
+actionSystem.extendedKeyCode.disabled=false
ide.firstStartup=true
ide.debugMode=false
@@ -183,6 +184,7 @@
debugger.batch.evaluation=false
debugger.compiling.evaluator=true
debugger.watches.in.variables=false
+debugger.auto.fetch.icons=true
analyze.exceptions.on.the.fly=false
analyze.exceptions.on.the.fly.description=Automatically analyze clipboard on frame activation,\
@@ -207,7 +209,7 @@
compiler.process.preload=true
compiler.process.preload.description=After build finishes, the IDE will pre-load and leave waiting in memory the build process for the next compilation. This will save time for process start and project model loading (may be noticeable for big projects).\
-
+
compiler.process.debug.port=-1
compiler.automake.trigger.delay=300
@@ -540,7 +542,7 @@
check.power.supply.for.mbp=false
check.power.supply.for.mbp.description=Check for discrete video card and power supply on MBPs
-removable.welcome.screen.projects=true
+removable.welcome.screen.projects=false
removable.welcomesreen.projects.description=Allows removing recent projects from welcome screen with mouse
ide.find.show.preview=true
ide.remove.help.button.from.dialogs=false
@@ -568,4 +570,6 @@
rubymine.rails.console.use.spring=false
custom.folding.max.lookup.depth=50
-custom.folding.max.lookup.depth.description=Max lookup depth for custom folding comments in a PSI tree.
\ No newline at end of file
+custom.folding.max.lookup.depth.description=Max lookup depth for custom folding comments in a PSI tree.
+
+force.default.lcd.rendering.settings=false
diff --git a/platform/util/src/com/intellij/Patches.java b/platform/util/src/com/intellij/Patches.java
index cb1c9c0..daea52a 100644
--- a/platform/util/src/com/intellij/Patches.java
+++ b/platform/util/src/com/intellij/Patches.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -108,4 +108,10 @@
* fixed in JDK8
*/
public static final boolean JDK_BUG_ID_7103570 = true;
+
+ /**
+ * Support default methods in JDI
+ * See <a href="https://bugs.openjdk.java.net/browse/JDK-8042123">JDK-8042123</a>
+ */
+ public static final boolean JDK_BUG_ID_8042123 = !SystemInfo.isJavaVersionAtLeast("1.8.0_40");
}
diff --git a/platform/util/src/com/intellij/openapi/util/text/StringUtil.java b/platform/util/src/com/intellij/openapi/util/text/StringUtil.java
index 93f7166..cbca0a3 100644
--- a/platform/util/src/com/intellij/openapi/util/text/StringUtil.java
+++ b/platform/util/src/com/intellij/openapi/util/text/StringUtil.java
@@ -565,7 +565,7 @@
buffer.append("\\").append(ch);
}
else if (!isPrintableUnicode(ch)) {
- String hexCode = StringUtilRt.toUpperCase(Integer.toHexString(ch));
+ CharSequence hexCode = StringUtilRt.toUpperCase(Integer.toHexString(ch));
buffer.append("\\u");
int paddingCount = 4 - hexCode.length();
while (paddingCount-- > 0) {
@@ -824,7 +824,7 @@
@Contract(pure = true)
public static String capitalize(@NotNull String s) {
if (s.isEmpty()) return s;
- if (s.length() == 1) return StringUtilRt.toUpperCase(s);
+ if (s.length() == 1) return StringUtilRt.toUpperCase(s).toString();
// Optimization
if (Character.isUpperCase(s.charAt(0))) return s;
@@ -2967,7 +2967,7 @@
@NotNull
@Contract(pure = true)
public static String toUpperCase(@NotNull String a) {
- return StringUtilRt.toUpperCase(a);
+ return StringUtilRt.toUpperCase(a).toString();
}
@Contract(pure = true)
diff --git a/platform/util/src/com/intellij/ui/mac/foundation/Foundation.java b/platform/util/src/com/intellij/ui/mac/foundation/Foundation.java
index f4ad998..bcbf741 100644
--- a/platform/util/src/com/intellij/ui/mac/foundation/Foundation.java
+++ b/platform/util/src/com/intellij/ui/mac/foundation/Foundation.java
@@ -188,7 +188,9 @@
public static String getEncodingName(long nsStringEncoding) {
long cfEncoding = myFoundationLibrary.CFStringConvertNSStringEncodingToEncoding(nsStringEncoding);
ID pointer = myFoundationLibrary.CFStringConvertEncodingToIANACharSetName(cfEncoding);
- return toStringViaUTF8(pointer);
+ String name = toStringViaUTF8(pointer);
+ if ("macintosh".equals(name)) name = "MacRoman"; // JDK8 does not recognize IANA's "macintosh" alias
+ return name;
}
public static long getEncodingCode(@Nullable String encodingName) {
diff --git a/platform/util/src/com/intellij/util/FontUtil.java b/platform/util/src/com/intellij/util/FontUtil.java
index f9505b0..12a05b7 100644
--- a/platform/util/src/com/intellij/util/FontUtil.java
+++ b/platform/util/src/com/intellij/util/FontUtil.java
@@ -22,7 +22,16 @@
public class FontUtil {
@NotNull
public static String rightArrow(@NotNull Font font) {
- char rightArrow = '\u2192';
- return font.canDisplay(rightArrow) ? String.valueOf(rightArrow) : "->";
+ return canDisplay(font, '\u2192', "->");
+ }
+
+ @NotNull
+ public static String upArrow(@NotNull Font font, @NotNull String defaultValue) {
+ return canDisplay(font, '\u2191', defaultValue);
+ }
+
+ @NotNull
+ public static String canDisplay(@NotNull Font font, char value, @NotNull String defaultValue) {
+ return font.canDisplay(value) ? String.valueOf(value) : defaultValue;
}
}
diff --git a/platform/util/src/com/intellij/util/PathMappingSettings.java b/platform/util/src/com/intellij/util/PathMappingSettings.java
index 09c5b49..9fd9f2c 100644
--- a/platform/util/src/com/intellij/util/PathMappingSettings.java
+++ b/platform/util/src/com/intellij/util/PathMappingSettings.java
@@ -15,6 +15,7 @@
*/
package com.intellij.util;
+import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
@@ -33,6 +34,7 @@
* @author traff
*/
public class PathMappingSettings implements Cloneable {
+
@NotNull
private List<PathMapping> myPathMappings;
diff --git a/platform/util/src/com/intellij/util/SmartList.java b/platform/util/src/com/intellij/util/SmartList.java
index 775b63e..21bcd49 100644
--- a/platform/util/src/com/intellij/util/SmartList.java
+++ b/platform/util/src/com/intellij/util/SmartList.java
@@ -27,7 +27,7 @@
* in which cases it would not allocate array at all.
*/
@SuppressWarnings({"unchecked"})
-public class SmartList<E> extends AbstractList<E> {
+public class SmartList<E> extends AbstractList<E> implements RandomAccess {
private int mySize = 0;
private Object myElem = null; // null if mySize==0, (E)elem if mySize==1, Object[] if mySize>=2
diff --git a/platform/util/src/com/intellij/util/containers/ConcurrentRefHashMap.java b/platform/util/src/com/intellij/util/containers/ConcurrentRefHashMap.java
index 40d399f..6131b2dc 100644
--- a/platform/util/src/com/intellij/util/containers/ConcurrentRefHashMap.java
+++ b/platform/util/src/com/intellij/util/containers/ConcurrentRefHashMap.java
@@ -24,6 +24,7 @@
import gnu.trove.TObjectHashingStrategy;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.TestOnly;
import java.lang.ref.ReferenceQueue;
@@ -68,6 +69,14 @@
}
};
+ private KeyReference<K, V> createKeyReference(@Nullable K key, @NotNull V value) {
+ if (key == null) {
+ //noinspection unchecked
+ return NULL_KEY;
+ }
+ return createKeyReference(key, value, myHashingStrategy);
+ }
+
// returns true if some keys were processed
boolean processQueue() {
KeyReference<K, V> wk;
@@ -204,7 +213,7 @@
@Override
public V put(K key, @NotNull V value) {
processQueue();
- KeyReference<K, V> weakKey = key == null ? NULL_KEY : createKeyReference(key, value, myHashingStrategy);
+ KeyReference<K, V> weakKey = createKeyReference(key, value);
return myMap.put(weakKey, value);
}
@@ -368,27 +377,27 @@
}
@Override
- public V putIfAbsent(@NotNull final K key, @NotNull V value) {
+ public V putIfAbsent(@Nullable final K key, @NotNull V value) {
processQueue();
- return myMap.putIfAbsent(createKeyReference(key, value, myHashingStrategy), value);
+ return myMap.putIfAbsent(createKeyReference(key, value), value);
}
@Override
- public boolean remove(@NotNull final Object key, @NotNull Object value) {
+ public boolean remove(@Nullable final Object key, @NotNull Object value) {
processQueue();
- return myMap.remove(createKeyReference((K)key, (V)value, myHashingStrategy), value);
+ return myMap.remove(createKeyReference((K)key, (V)value), value);
}
@Override
- public boolean replace(@NotNull final K key, @NotNull final V oldValue, @NotNull final V newValue) {
+ public boolean replace(@Nullable final K key, @NotNull final V oldValue, @NotNull final V newValue) {
processQueue();
- return myMap.replace(createKeyReference(key, oldValue, myHashingStrategy), oldValue, newValue);
+ return myMap.replace(createKeyReference(key, oldValue), oldValue, newValue);
}
@Override
- public V replace(@NotNull final K key, @NotNull final V value) {
+ public V replace(@Nullable final K key, @NotNull final V value) {
processQueue();
- return myMap.replace(createKeyReference(key, value, myHashingStrategy), value);
+ return myMap.replace(createKeyReference(key, value), value);
}
// MAKE SURE IT CONSISTENT WITH com.intellij.util.containers.ConcurrentHashMap
diff --git a/platform/util/src/com/intellij/util/containers/ContainerUtil.java b/platform/util/src/com/intellij/util/containers/ContainerUtil.java
index 4dc29c0..db5b979 100644
--- a/platform/util/src/com/intellij/util/containers/ContainerUtil.java
+++ b/platform/util/src/com/intellij/util/containers/ContainerUtil.java
@@ -215,6 +215,22 @@
}
@NotNull
+ @Contract(pure = true)
+ public static <T> List<T> newUnmodifiableList(List<? extends T> originalList) {
+ int size = originalList.size();
+ if (size == 0) {
+ return emptyList();
+ }
+ else if (size == 1) {
+ return Collections.singletonList(originalList.get(0));
+ }
+ else {
+ return Collections.unmodifiableList(newArrayList(originalList));
+ }
+ }
+
+
+ @NotNull
@Contract(pure=true)
public static <T> List<T> newSmartList() {
return new SmartList<T>();
diff --git a/platform/util/src/com/intellij/util/diff/DiffTree.java b/platform/util/src/com/intellij/util/diff/DiffTree.java
index 73c908b..b0e7eae 100644
--- a/platform/util/src/com/intellij/util/diff/DiffTree.java
+++ b/platform/util/src/com/intellij/util/diff/DiffTree.java
@@ -16,7 +16,6 @@
package com.intellij.util.diff;
import com.intellij.openapi.util.Ref;
-import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.ThreeState;
import org.jetbrains.annotations.NotNull;
@@ -48,7 +47,7 @@
@NotNull ShallowNodeComparator<OT, NT> comparator,
@NotNull DiffTreeChangeBuilder<OT, NT> consumer) {
final DiffTree<OT, NT> tree = new DiffTree<OT, NT>(oldTree, newTree, comparator);
- tree.build(oldTree.getRoot(), newTree.getRoot(), 0, consumer);
+ tree.build(oldTree.getRoot(), newTree.getRoot(), 0, Integer.MAX_VALUE, consumer);
}
private enum CompareResult {
@@ -81,7 +80,9 @@
};
@NotNull
- private CompareResult build(@NotNull OT oldN, @NotNull NT newN, int level, @NotNull DiffTreeChangeBuilder<OT, NT> consumer) {
+ private CompareResult build(@NotNull OT oldN, @NotNull NT newN, int level, int maxLevel, @NotNull DiffTreeChangeBuilder<OT, NT> consumer) {
+ if (level == maxLevel) return CompareResult.NOT_EQUAL; // too deep, abort
+
OT oldNode = myOldTree.prepareForGetChildren(oldN);
NT newNode = myNewTree.prepareForGetChildren(newN);
@@ -116,15 +117,14 @@
final ShallowNodeComparator<OT, NT> comparator = myComparator;
int minSize = Math.min(oldChildrenSize, newChildrenSize);
- int suffixLength = match(oldChildren, oldChildrenSize - 1, newChildren, newChildrenSize - 1, level, -1, minSize);
- // for equal size old and new children we have to compare one element less because it was already checked in (unsuccessful) suffix match
- int maxPrefixLength = minSize - suffixLength - (oldChildrenSize == newChildrenSize && suffixLength < minSize ? 1 : 0);
- int prefixLength = match(oldChildren, 0, newChildren, 0, level, 1, maxPrefixLength);
+ int newMaxLevel = Math.min(maxLevel, level+4); // try not to descend recursively too deep
+ int suffixLength = match(oldChildren, oldChildrenSize - 1, newChildren, newChildrenSize - 1, level, -1, minSize, newMaxLevel);
+ int prefixLength = oldChildrenSize == 1 && newChildrenSize == 1 ? 0 : match(oldChildren, 0, newChildren, 0, level, 1, minSize-suffixLength, newMaxLevel);
if (oldChildrenSize == newChildrenSize && suffixLength + prefixLength == oldChildrenSize) {
result = CompareResult.EQUAL;
}
- else if (consumer == emptyConsumer()) {
+ else if (consumer == emptyConsumer()){
result = CompareResult.NOT_EQUAL;
}
else {
@@ -141,7 +141,7 @@
CompareResult c11 = looksEqual(comparator, oldChild1, newChild1);
if (c11 == CompareResult.EQUAL || c11 == CompareResult.DRILL_DOWN_NEEDED) {
if (c11 == CompareResult.DRILL_DOWN_NEEDED) {
- build(oldChild1, newChild1, level + 1, consumer);
+ build(oldChild1, newChild1, level + 1, maxLevel, consumer);
}
oldIndex--;
newIndex--;
@@ -225,7 +225,7 @@
CompareResult c = oldFirstChild == null || newFirstChild == null ? CompareResult.NOT_EQUAL : looksEqual(comparator, oldFirstChild, newFirstChild);
if (c == CompareResult.EQUAL || c == CompareResult.TYPE_ONLY || c == CompareResult.DRILL_DOWN_NEEDED) {
if (c == CompareResult.DRILL_DOWN_NEEDED) {
- build(oldFirstChild, newFirstChild, level + 1, consumer);
+ build(oldFirstChild, newFirstChild, level + 1, maxLevel, consumer);
}
else {
consumer.nodeReplaced(oldFirstChild, newFirstChild);
@@ -254,7 +254,8 @@
int newIndex,
int level,
int step, // 1 if we go from the start to the end; -1 if we go from the end to the start
- int maxLength) {
+ int maxLength,
+ int maxLevel) {
int delta = 0;
while (delta != maxLength*step) {
OT oldChild = oldChildren[oldIndex + delta];
@@ -263,11 +264,7 @@
CompareResult c11 = looksEqual(myComparator, oldChild, newChild);
if (c11 == CompareResult.DRILL_DOWN_NEEDED) {
- CharSequence oldText = myOldTree.toString(oldChild);
- CharSequence newText = myNewTree.toString(newChild);
- c11 = StringUtil.equals(oldText, newText)
- ? build(oldChild, newChild, level + 1, DiffTree.<OT, NT>emptyConsumer())
- : CompareResult.NOT_EQUAL;
+ c11 = build(oldChild, newChild, level + 1, maxLevel, DiffTree.<OT, NT>emptyConsumer());
}
assert c11 != CompareResult.DRILL_DOWN_NEEDED;
if (c11 != CompareResult.EQUAL) {
diff --git a/platform/util/src/com/intellij/util/diff/FlyweightCapableTreeStructure.java b/platform/util/src/com/intellij/util/diff/FlyweightCapableTreeStructure.java
index df5da69..bf49f53 100644
--- a/platform/util/src/com/intellij/util/diff/FlyweightCapableTreeStructure.java
+++ b/platform/util/src/com/intellij/util/diff/FlyweightCapableTreeStructure.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2015 JetBrains s.r.o.
+ * Copyright 2000-2009 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,7 +36,4 @@
int getChildren(@NotNull T parent, @NotNull Ref<T[]> into);
void disposeChildren(T[] nodes, int count);
-
- @NotNull
- CharSequence toString(@NotNull T node);
}
diff --git a/platform/util/src/com/intellij/util/lang/JarMemoryLoader.java b/platform/util/src/com/intellij/util/lang/JarMemoryLoader.java
index 03b41cd0..6bf83d3 100644
--- a/platform/util/src/com/intellij/util/lang/JarMemoryLoader.java
+++ b/platform/util/src/com/intellij/util/lang/JarMemoryLoader.java
@@ -24,6 +24,7 @@
import java.io.File;
import java.io.IOException;
import java.net.URL;
+import java.util.Collections;
import java.util.Enumeration;
import java.util.Map;
import java.util.zip.ZipEntry;
@@ -36,7 +37,7 @@
public class JarMemoryLoader {
public static final String SIZE_ENTRY = "META-INF/jb/$$size$$";
- private final Map<String, Resource> myResources = new THashMap<String, Resource>();
+ private final Map<String, Resource> myResources = Collections.synchronizedMap(new THashMap<String, Resource>());
private JarMemoryLoader() { }
diff --git a/platform/util/src/com/intellij/util/ui/UIUtil.java b/platform/util/src/com/intellij/util/ui/UIUtil.java
index c24d4b3..998dc2a 100644
--- a/platform/util/src/com/intellij/util/ui/UIUtil.java
+++ b/platform/util/src/com/intellij/util/ui/UIUtil.java
@@ -705,7 +705,7 @@
private static final Map<Class, Ref<Method>> ourDefaultIconMethodsCache = new ConcurrentHashMap<Class, Ref<Method>>();
public static int getCheckBoxTextHorizontalOffset(@NotNull JCheckBox cb) {
- // logic copied from javax.swing.plaf.basic.BasicRadioButtonUI.paint
+ // logic copied from javax.swing.plaf.basic.BasicRadioButtonUI.paint
ButtonUI ui = cb.getUI();
String text = cb.getText();
@@ -1631,22 +1631,28 @@
boolean toolWindow,
boolean drawTopLine,
boolean drawBottomLine) {
- g.setColor(getPanelBackground());
- g.fillRect(x, 0, width, height);
-
- ((Graphics2D)g).setPaint(getGradientPaint(0, 0, new Color(0, 0, 0, 5), 0, height, new Color(0, 0, 0, 20)));
- g.fillRect(x, 0, width, height);
-
- g.setColor(new Color(0, 0, 0, toolWindow ? 90 : 50));
- if (drawTopLine) g.drawLine(x, 0, width, 0);
- if (drawBottomLine) g.drawLine(x, height - 1, width, height - 1);
-
- g.setColor(isUnderDarcula() ? Gray._255.withAlpha(30) : new Color(255, 255, 255, 100));
- g.drawLine(x, drawTopLine ? 1 : 0, width, drawTopLine ? 1 : 0);
-
- if (active) {
- g.setColor(new Color(100, 150, 230, toolWindow ? 50 : 30));
+ height++;
+ GraphicsConfig config = GraphicsUtil.disableAAPainting(g);
+ try {
+ g.setColor(getPanelBackground());
g.fillRect(x, 0, width, height);
+
+ ((Graphics2D)g).setPaint(getGradientPaint(0, 0, new Color(0, 0, 0, 5), 0, height, new Color(0, 0, 0, 20)));
+ g.fillRect(x, 0, width, height);
+
+ g.setColor(new Color(0, 0, 0, toolWindow ? 90 : 50));
+ if (drawTopLine) g.drawLine(x, 0, width, 0);
+ if (drawBottomLine) g.drawLine(x, height - (isRetina() ? 1 : 2), width, height - (isRetina() ? 1 : 2));
+
+ g.setColor(isUnderDarcula() ? Gray._255.withAlpha(30) : new Color(255, 255, 255, 100));
+ g.drawLine(x, drawTopLine ? 1 : 0, width, drawTopLine ? 1 : 0);
+
+ if (active) {
+ g.setColor(new Color(100, 150, 230, toolWindow ? 50 : 30));
+ g.fillRect(x, 0, width, height);
+ }
+ } finally {
+ config.restore();
}
}
@@ -2970,9 +2976,9 @@
public static void setNotOpaqueRecursively(@NotNull Component component) {
if (!isUnderAquaLookAndFeel()) return;
- if (component.getBackground().equals(getPanelBackground())
- || component instanceof JScrollPane
- || component instanceof JViewport
+ if (component.getBackground().equals(getPanelBackground())
+ || component instanceof JScrollPane
+ || component instanceof JViewport
|| component instanceof JLayeredPane) {
if (component instanceof JComponent) {
((JComponent)component).setOpaque(false);
@@ -3281,6 +3287,11 @@
return FontUtil.rightArrow(getLabelFont());
}
+ @NotNull
+ public static String upArrow(@NotNull String defaultValue) {
+ return FontUtil.upArrow(getLabelFont(), defaultValue);
+ }
+
public static EmptyBorder getTextAlignBorder(@NotNull JToggleButton alignSource) {
ButtonUI ui = alignSource.getUI();
int leftGap = alignSource.getIconTextGap();
diff --git a/platform/util/src/com/intellij/util/ui/tree/WideSelectionTreeUI.java b/platform/util/src/com/intellij/util/ui/tree/WideSelectionTreeUI.java
index 93cdf6a..e2e1f74 100644
--- a/platform/util/src/com/intellij/util/ui/tree/WideSelectionTreeUI.java
+++ b/platform/util/src/com/intellij/util/ui/tree/WideSelectionTreeUI.java
@@ -38,6 +38,7 @@
*/
public class WideSelectionTreeUI extends BasicTreeUI {
public static final String TREE_TABLE_TREE_KEY = "TreeTableTree";
+ public static final String NO_SELECTION_PAINTING_DARK = "NO_SELECTION_PAINTING_DARK";
@NonNls public static final String SOURCE_LIST_CLIENT_PROPERTY = "mac.ui.source.list";
@NonNls public static final String STRIPED_CLIENT_PROPERTY = "mac.ui.striped";
@@ -361,7 +362,8 @@
}
}
else {
- if (selected && (UIUtil.isUnderAquaBasedLookAndFeel() || UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF())) {
+ if (selected && (UIUtil.isUnderAquaBasedLookAndFeel() || UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF())
+ && ! Boolean.TRUE.equals(tree.getClientProperty(NO_SELECTION_PAINTING_DARK))) {
Color bg = UIUtil.getTreeSelectionBackground(tree.hasFocus() || Boolean.TRUE.equals(tree.getClientProperty(TREE_TABLE_TREE_KEY)));
if (myWideSelectionCondition.value(row)) {
diff --git a/platform/util/testSrc/com/intellij/util/diff/DiffTreeTest.java b/platform/util/testSrc/com/intellij/util/diff/DiffTreeTest.java
index f3e5a1f..ca1fc7a 100644
--- a/platform/util/testSrc/com/intellij/util/diff/DiffTreeTest.java
+++ b/platform/util/testSrc/com/intellij/util/diff/DiffTreeTest.java
@@ -92,12 +92,6 @@
@Override
public void disposeChildren(final Node[] nodes, final int count) {
}
-
- @NotNull
- @Override
- public CharSequence toString(@NotNull Node node) {
- return node.toString();
- }
}
private static class NodeComparator implements ShallowNodeComparator<Node, Node> {
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/CodeSmellDetector.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/CodeSmellDetector.java
index d9c0837..163e827 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/CodeSmellDetector.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/CodeSmellDetector.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,10 +16,11 @@
package com.intellij.openapi.vcs;
import com.intellij.codeInsight.CodeSmellInfo;
-import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.project.Project;
-import com.intellij.openapi.components.ServiceManager;
+import com.intellij.openapi.vfs.VirtualFile;
+import org.jetbrains.annotations.NotNull;
import java.util.List;
@@ -36,10 +37,11 @@
*
* @param files the files to analyze.
* @return the list of problems found during the analysis.
- * @throws com.intellij.openapi.progress.ProcessCanceledException if the analysis was cancelled by the user.
+ * @throws ProcessCanceledException if the analysis was cancelled by the user.
* @since 5.1
*/
- public abstract List<CodeSmellInfo> findCodeSmells(List<VirtualFile> files) throws ProcessCanceledException;
+ @NotNull
+ public abstract List<CodeSmellInfo> findCodeSmells(@NotNull List<VirtualFile> files) throws ProcessCanceledException;
/**
* Shows the specified list of problems found during pre-checkin code analysis in a Messages pane.
@@ -47,6 +49,6 @@
* @param smells the problems to show.
* @since 5.1
*/
- public abstract void showCodeSmellErrors(final List<CodeSmellInfo> smells);
+ public abstract void showCodeSmellErrors(@NotNull List<CodeSmellInfo> smells);
}
\ No newline at end of file
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AnnotateRevisionAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AnnotateRevisionAction.java
index f87aad0..fc31cf2 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AnnotateRevisionAction.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AnnotateRevisionAction.java
@@ -1,6 +1,7 @@
package com.intellij.openapi.vcs.actions;
import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.localVcs.UpToDateLineNumberProvider;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.vcs.AbstractVcs;
@@ -61,9 +62,17 @@
VcsFileRevision revision = getFileRevision(e);
if (revision == null) return null;
+ final FileType currentFileType = myAnnotation.getFile().getFileType();
FilePath filePath =
(revision instanceof VcsFileRevisionEx ? ((VcsFileRevisionEx)revision).getPath() : new FilePathImpl(myAnnotation.getFile()));
- return new VcsVirtualFile(filePath.getPath(), revision, VcsFileSystem.getInstance());
+ return new VcsVirtualFile(filePath.getPath(), revision, VcsFileSystem.getInstance()) {
+ @NotNull
+ @Override
+ public FileType getFileType() {
+ FileType type = super.getFileType();
+ return type.isBinary() ? currentFileType : type;
+ }
+ };
}
@Nullable
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesBrowserNode.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesBrowserNode.java
index b7a4221..e443d5a 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesBrowserNode.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesBrowserNode.java
@@ -84,9 +84,9 @@
}
public static ChangesBrowserNode create(final Project project, @NotNull Object userObject) {
- /*if (userObject instanceof Change) {
- return new ChangesBrowserChangeNode(project, (Change) userObject);
- }*/
+ if (userObject instanceof Change) {
+ return new ChangesBrowserChangeNode(project, (Change) userObject, null);
+ }
if (userObject instanceof VirtualFile) {
return new ChangesBrowserFileNode(project, (VirtualFile) userObject);
}
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesBrowserNodeCopyProvider.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesBrowserNodeCopyProvider.java
new file mode 100644
index 0000000..6ac8935
--- /dev/null
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesBrowserNodeCopyProvider.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2000-2015 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.openapi.vcs.changes.ui;
+
+import com.intellij.ide.CopyProvider;
+import com.intellij.openapi.actionSystem.DataContext;
+import com.intellij.openapi.ide.CopyPasteManager;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.util.Function;
+import com.intellij.util.ObjectUtils;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.ui.tree.TreeUtil;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import javax.swing.tree.TreePath;
+import java.awt.datatransfer.StringSelection;
+import java.util.Arrays;
+import java.util.List;
+
+class ChangesBrowserNodeCopyProvider implements CopyProvider {
+
+ @NotNull private final JTree myTree;
+
+ ChangesBrowserNodeCopyProvider(@NotNull JTree tree) {
+ myTree = tree;
+ }
+
+ public boolean isCopyEnabled(@NotNull DataContext dataContext) {
+ return myTree.getSelectionPaths() != null;
+ }
+
+ public boolean isCopyVisible(@NotNull DataContext dataContext) {
+ return true;
+ }
+
+ public void performCopy(@NotNull DataContext dataContext) {
+ List<TreePath> paths = ContainerUtil.sorted(Arrays.asList(ObjectUtils.assertNotNull(myTree.getSelectionPaths())),
+ TreeUtil.getDisplayOrderComparator(myTree));
+ CopyPasteManager.getInstance().setContents(new StringSelection(StringUtil.join(paths, new Function<TreePath, String>() {
+ @Override
+ public String fun(TreePath path) {
+ Object node = path.getLastPathComponent();
+ if (node instanceof ChangesBrowserNode) {
+ return ((ChangesBrowserNode)node).getTextPresentation();
+ }
+ else {
+ return node.toString();
+ }
+ }
+ }, "\n")));
+ }
+}
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesListView.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesListView.java
index 4131e42..623289a 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesListView.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesListView.java
@@ -31,7 +31,6 @@
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.PopupHandler;
import com.intellij.ui.SmartExpander;
-import com.intellij.ui.TreeCopyProvider;
import com.intellij.ui.TreeSpeedSearch;
import com.intellij.ui.awt.RelativePoint;
import com.intellij.ui.awt.RelativeRectangle;
@@ -89,7 +88,7 @@
new TreeSpeedSearch(this, new NodeToTextConvertor());
SmartExpander.installOn(this);
- myCopyProvider = new TreeCopyProvider(this);
+ myCopyProvider = new ChangesBrowserNodeCopyProvider(this);
new TreeLinkMouseListener(new ChangesBrowserNodeRenderer(myProject, false, false)).installOn(this);
myNodeRenderer = new ChangesBrowserNodeRenderer(project, false, true);
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesTreeList.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesTreeList.java
index d4308a0..fbcbc2f 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesTreeList.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesTreeList.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,11 +16,13 @@
package com.intellij.openapi.vcs.changes.ui;
import com.intellij.icons.AllIcons;
+import com.intellij.ide.CopyProvider;
import com.intellij.ide.util.PropertiesComponent;
import com.intellij.ide.util.treeView.TreeState;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diff.DiffBundle;
+import com.intellij.openapi.ide.CopyPasteManager;
import com.intellij.openapi.keymap.KeymapManager;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
@@ -45,6 +47,7 @@
import com.intellij.ui.treeStructure.Tree;
import com.intellij.ui.treeStructure.actions.CollapseAllAction;
import com.intellij.ui.treeStructure.actions.ExpandAllAction;
+import com.intellij.util.Function;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.Convertor;
import com.intellij.util.ui.UIUtil;
@@ -65,6 +68,7 @@
import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.*;
import java.awt.*;
+import java.awt.datatransfer.StringSelection;
import java.awt.event.*;
import java.util.*;
import java.util.List;
@@ -96,6 +100,8 @@
private final Runnable myInclusionListener;
@Nullable private ChangeNodeDecorator myChangeDecorator;
private Runnable myGenericSelectionListener;
+ @NotNull private final CopyProvider myTreeCopyProvider;
+ @NotNull private final ChangesBrowserNodeListCopyProvider myListCopyProvider;
public ChangesTreeList(final Project project, Collection<T> initiallyIncluded, final boolean showCheckboxes,
final boolean highlightProblems, @Nullable final Runnable inclusionListener, @Nullable final ChangeNodeDecorator decorator) {
@@ -226,6 +232,9 @@
String emptyText = StringUtil.capitalize(DiffBundle.message("diff.count.differences.status.text", 0));
setEmptyText(emptyText);
+
+ myTreeCopyProvider = new ChangesBrowserNodeCopyProvider(myTree);
+ myListCopyProvider = new ChangesBrowserNodeListCopyProvider(myProject, myList);
}
public void setEmptyText(@NotNull String emptyText) {
@@ -968,6 +977,9 @@
@Override
public void calcData(DataKey key, DataSink sink) {
+ if (PlatformDataKeys.COPY_PROVIDER == key) {
+ sink.put(PlatformDataKeys.COPY_PROVIDER, myShowFlatten ? myListCopyProvider : myTreeCopyProvider);
+ }
}
private class MyTree extends Tree implements TypeSafeDataProvider {
@@ -1045,4 +1057,36 @@
ChangesTreeList.this.calcData(key, sink);
}
}
+
+ private static class ChangesBrowserNodeListCopyProvider implements CopyProvider {
+
+ @NotNull private final Project myProject;
+ @NotNull private final JList myList;
+
+ ChangesBrowserNodeListCopyProvider(@NotNull Project project, @NotNull JList list) {
+ myProject = project;
+ myList = list;
+ }
+
+ @Override
+ public void performCopy(@NotNull DataContext dataContext) {
+ CopyPasteManager.getInstance().setContents(new StringSelection(StringUtil.join(myList.getSelectedValues(),
+ new Function<Object, String>() {
+ @Override
+ public String fun(Object object) {
+ return ChangesBrowserNode.create(myProject, object).getTextPresentation();
+ }
+ }, "\n")));
+ }
+
+ @Override
+ public boolean isCopyEnabled(@NotNull DataContext dataContext) {
+ return !myList.isSelectionEmpty();
+ }
+
+ @Override
+ public boolean isCopyVisible(@NotNull DataContext dataContext) {
+ return true;
+ }
+ }
}
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/CodeSmellDetectorImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/CodeSmellDetectorImpl.java
index 194a5b8..6cb0766 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/CodeSmellDetectorImpl.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/CodeSmellDetectorImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,7 @@
import com.intellij.openapi.progress.Task;
import com.intellij.openapi.progress.util.AbstractProgressIndicatorExBase;
import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.vcs.AbstractVcsHelper;
import com.intellij.openapi.vcs.CodeSmellDetector;
@@ -53,14 +54,13 @@
public class CodeSmellDetectorImpl extends CodeSmellDetector {
private final Project myProject;
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.vcs.impl.CodeSmellDetectorImpl");
- private Exception myException;
public CodeSmellDetectorImpl(final Project project) {
myProject = project;
}
@Override
- public void showCodeSmellErrors(final List<CodeSmellInfo> smellList) {
+ public void showCodeSmellErrors(@NotNull final List<CodeSmellInfo> smellList) {
Collections.sort(smellList, new Comparator<CodeSmellInfo>() {
@Override
public int compare(final CodeSmellInfo o1, final CodeSmellInfo o2) {
@@ -104,13 +104,15 @@
}
-
+ @NotNull
@Override
- public List<CodeSmellInfo> findCodeSmells(final List<VirtualFile> filesToCheck) throws ProcessCanceledException {
+ public List<CodeSmellInfo> findCodeSmells(@NotNull final List<VirtualFile> filesToCheck) throws ProcessCanceledException {
+ ApplicationManager.getApplication().assertIsDispatchThread();
final List<CodeSmellInfo> result = new ArrayList<CodeSmellInfo>();
PsiDocumentManager.getInstance(myProject).commitAllDocuments();
if (ApplicationManager.getApplication().isWriteAccessAllowed()) throw new RuntimeException("Must not run under write action");
+ final Ref<Exception> exception = Ref.create();
ProgressManager.getInstance().run(new Task.Modal(myProject, VcsBundle.message("checking.code.smells.progress.title"), true) {
@Override
public void run(@NotNull ProgressIndicator progress) {
@@ -127,16 +129,17 @@
}
}
catch (ProcessCanceledException e) {
- throw e;
+ exception.set(e);
}
catch (Exception e) {
LOG.error(e);
- myException = e;
+ exception.set(e);
}
}
});
- if (myException != null) {
- Rethrow.reThrowRuntime(myException);
+ if (!exception.isNull()) {
+ Exception t = exception.get();
+ Rethrow.reThrowRuntime(t);
}
return result;
@@ -144,11 +147,11 @@
@NotNull
private List<CodeSmellInfo> findCodeSmells(@NotNull final VirtualFile file, @NotNull final ProgressIndicator progress) {
- final List<CodeSmellInfo> result = new ArrayList<CodeSmellInfo>();
+ final List<CodeSmellInfo> result = Collections.synchronizedList(new ArrayList<CodeSmellInfo>());
final DaemonCodeAnalyzerImpl codeAnalyzer = (DaemonCodeAnalyzerImpl)DaemonCodeAnalyzer.getInstance(myProject);
- final DaemonProgressIndicator daemonIndicator = new DaemonProgressIndicator();
- ((ProgressIndicatorEx)progress).addStateDelegate(new AbstractProgressIndicatorExBase(){
+ final ProgressIndicator daemonIndicator = new DaemonProgressIndicator();
+ ((ProgressIndicatorEx)progress).addStateDelegate(new AbstractProgressIndicatorExBase() {
@Override
public void cancel() {
super.cancel();
@@ -162,13 +165,12 @@
@Override
public void run() {
final PsiFile psiFile = PsiManager.getInstance(myProject).findFile(file);
- if (psiFile != null) {
- final Document document = FileDocumentManager.getInstance().getDocument(file);
- if (document != null) {
- List<HighlightInfo> infos = codeAnalyzer.runMainPasses(psiFile, document, daemonIndicator);
- collectErrorsAndWarnings(infos, result, document);
- }
+ final Document document = FileDocumentManager.getInstance().getDocument(file);
+ if (psiFile == null || document == null) {
+ return;
}
+ List<HighlightInfo> infos = codeAnalyzer.runMainPasses(psiFile, document, daemonIndicator);
+ convertErrorsAndWarnings(infos, result, document);
}
});
}
@@ -177,10 +179,9 @@
return result;
}
- private void collectErrorsAndWarnings(final Collection<HighlightInfo> highlights,
- final List<CodeSmellInfo> result,
- final Document document) {
- if (highlights == null) return;
+ private void convertErrorsAndWarnings(@NotNull Collection<HighlightInfo> highlights,
+ @NotNull List<CodeSmellInfo> result,
+ @NotNull Document document) {
for (HighlightInfo highlightInfo : highlights) {
final HighlightSeverity severity = highlightInfo.getSeverity();
if (SeverityRegistrar.getSeverityRegistrar(myProject).compare(severity, HighlightSeverity.WARNING) >= 0) {
@@ -190,7 +191,7 @@
}
}
- private static String getDescription(final HighlightInfo highlightInfo) {
+ private static String getDescription(@NotNull HighlightInfo highlightInfo) {
final String description = highlightInfo.getDescription();
final HighlightInfoType type = highlightInfo.type;
if (type instanceof HighlightInfoType.HighlightInfoTypeSeverityByKey) {
diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/UserNameRegex.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/UserNameRegex.java
index f3a2fe4..b044b91 100644
--- a/platform/vcs-log/impl/src/com/intellij/vcs/log/UserNameRegex.java
+++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/UserNameRegex.java
@@ -15,6 +15,7 @@
*/
package com.intellij.vcs.log;
+import com.intellij.openapi.util.SystemInfo;
import com.intellij.util.Function;
public class UserNameRegex implements Function<String, String> {
@@ -24,6 +25,9 @@
@Override
public String fun(String s) {
+ if (SystemInfo.isMac) {
+ return "^" + s + ".*";// tmp fix for mac
+ }
return "^" +
s +
"( <.*>)?$|^<" +
diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/VcsLogUiImpl.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/VcsLogUiImpl.java
index dbdd398..8dfc100 100644
--- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/VcsLogUiImpl.java
+++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/VcsLogUiImpl.java
@@ -75,21 +75,9 @@
public void setVisiblePack(@NotNull VisiblePack pack) {
ApplicationManager.getApplication().assertIsDispatchThread();
- PermanentGraph<Integer> previousPermGraph = myVisiblePack.getPermanentGraph();
- VcsLogGraphTable.Selection previousSelection = getTable().getSelection();
+ boolean permGraphChanged = myVisiblePack.getPermanentGraph() != pack.getPermanentGraph();
myVisiblePack = pack;
- boolean permGraphChanged = previousPermGraph != myVisiblePack.getPermanentGraph();
-
- GraphTableModel currentModel = getModel();
- if (currentModel == null) {
- getTable().setModel(new GraphTableModel(myVisiblePack, myLogDataHolder, this));
- }
- else {
- currentModel.setVisiblePack(myVisiblePack);
- previousSelection.restore(myVisiblePack.getVisibleGraph(), true);
- }
- getTable().setPaintBusy(false);
myMainFrame.updateDataPack(myVisiblePack);
setLongEdgeVisibility(myUiProperties.areLongEdgesVisible());
diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java
index 948bc6a..e7fd92f 100644
--- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java
+++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java
@@ -18,6 +18,7 @@
import com.intellij.icons.AllIcons;
import com.intellij.ide.CopyProvider;
import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.ide.CopyPasteManager;
import com.intellij.openapi.util.Couple;
import com.intellij.openapi.util.Pair;
@@ -70,6 +71,7 @@
import static com.intellij.vcs.log.printer.idea.PrintParameters.HEIGHT_CELL;
public class VcsLogGraphTable extends JBTable implements TypeSafeDataProvider, CopyProvider {
+ private static final Logger LOG = Logger.getInstance(VcsLogGraphTable.class);
public static final int ROOT_INDICATOR_COLORED_WIDTH = 8;
public static final int ROOT_INDICATOR_WHITE_WIDTH = 5;
@@ -81,7 +83,6 @@
@NotNull private final VcsLogUiImpl myUI;
private final VcsLogDataHolder myLogDataHolder;
- private final GraphCommitCellRender myGraphCommitCellRender;
private final MyDummyTableCellEditor myDummyEditor = new MyDummyTableCellEditor();
@NotNull private final TableCellRenderer myDummyRenderer = new DefaultTableCellRenderer();
private final TableModelListener myColumnSizeInitializer = new TableModelListener() {
@@ -104,18 +105,13 @@
}
});
- @NotNull private VisiblePack myDataPack;
-
public VcsLogGraphTable(@NotNull VcsLogUiImpl UI, @NotNull final VcsLogDataHolder logDataHolder, @NotNull VisiblePack initialDataPack) {
super();
myUI = UI;
myLogDataHolder = logDataHolder;
- myDataPack = initialDataPack;
- myGraphCommitCellRender =
- new GraphCommitCellRender(myUI.getColorManager(), logDataHolder, myGraphCellPainter, myDataPack.getVisibleGraph(), this);
setDefaultRenderer(VirtualFile.class, new RootCellRenderer(myUI));
- setDefaultRenderer(GraphCommitCell.class, myGraphCommitCellRender);
+ setDefaultRenderer(GraphCommitCell.class, new GraphCommitCellRender(myUI.getColorManager(), logDataHolder, myGraphCellPainter, this));
setDefaultRenderer(String.class, new StringCellRenderer());
setRowHeight(HEIGHT_CELL);
@@ -133,6 +129,15 @@
PopupHandler.installPopupHandler(this, VcsLogUiImpl.POPUP_ACTION_GROUP, VcsLogUiImpl.VCS_LOG_TABLE_PLACE);
TableScrollingUtil.installActions(this, false);
+
+ setModel(new GraphTableModel(initialDataPack, myLogDataHolder, myUI));
+ }
+
+ public void updateDataPack(@NotNull VisiblePack visiblePack) {
+ VcsLogGraphTable.Selection previousSelection = getSelection();
+ getGraphTableModel().setVisiblePack(visiblePack);
+ previousSelection.restore(visiblePack.getVisibleGraph(), true);
+ setPaintBusy(false);
}
@Override
@@ -300,11 +305,6 @@
return true;
}
- public void updateDataPack(@NotNull VisiblePack dataPack) {
- myDataPack = dataPack;
- myGraphCommitCellRender.updateVisibleGraph(dataPack.getVisibleGraph());
- }
-
public void addHighlighter(@NotNull VcsLogHighlighter highlighter) {
myHighlighters.add(highlighter);
}
@@ -332,9 +332,16 @@
}
private VcsLogHighlighter.VcsCommitStyle getStyle(int row, int column, String text, boolean hasFocus, final boolean selected) {
- final RowInfo<Integer> rowInfo = myDataPack.getVisibleGraph().getRowInfo(row);
-
Component dummyRendererComponent = myDummyRenderer.getTableCellRendererComponent(this, text, selected, hasFocus, row, column);
+
+ VisibleGraph<Integer> visibleGraph = getVisibleGraph();
+ if (row < 0 || row >= visibleGraph.getVisibleCommitCount()) {
+ LOG.error("Visible graph has " + visibleGraph.getVisibleCommitCount() + " commits, yet we want row " + row);
+ return VcsCommitStyleFactory.createStyle(dummyRendererComponent.getForeground(), dummyRendererComponent.getBackground());
+ }
+
+ final RowInfo<Integer> rowInfo = visibleGraph.getRowInfo(row);
+
VcsLogHighlighter.VcsCommitStyle defaultStyle = VcsCommitStyleFactory
.createStyle(rowInfo.getRowType() == RowType.UNMATCHED ? JBColor.GRAY : dummyRendererComponent.getForeground(),
dummyRendererComponent.getBackground());
@@ -407,7 +414,7 @@
// since fireTableDataChanged clears selection we restore it here
if (previousSelection != null) {
- previousSelection.restore(myDataPack.getVisibleGraph(), answer == null || answer.getCommitToJump() != null);
+ previousSelection.restore(getVisibleGraph(), answer == null || answer.getCommitToJump() != null);
}
}
@@ -421,7 +428,7 @@
setCursor(answer.getCursorToSet());
}
if (answer.getCommitToJump() != null) {
- Integer row = myDataPack.getVisibleGraph().getVisibleRowIndex(answer.getCommitToJump());
+ Integer row = getGraphTableModel().getVisiblePack().getVisibleGraph().getVisibleRowIndex(answer.getCommitToJump());
if (row != null && row >= 0) {
jumpToRow(row);
}
@@ -429,6 +436,7 @@
}
}
+ @NotNull
private GraphTableModel getGraphTableModel() {
return (GraphTableModel)getModel();
}
@@ -438,7 +446,7 @@
return new Selection(this);
}
- public static class Selection {
+ private static class Selection {
@NotNull private final VcsLogGraphTable myTable;
@NotNull private final TIntHashSet mySelectedCommits;
@Nullable private final Integer myVisibleSelectedCommit;
@@ -452,7 +460,7 @@
Couple<Integer> visibleRows = TableScrollingUtil.getVisibleRows(myTable);
myScrollToTop = visibleRows.first - 1 == 0;
- VisibleGraph<Integer> graph = myTable.myDataPack.getVisibleGraph();
+ VisibleGraph<Integer> graph = myTable.getVisibleGraph();
mySelectedCommits = new TIntHashSet();
@@ -500,7 +508,8 @@
if (scrollToSelection) {
if (myScrollToTop) {
scrollToRow(0, 0);
- } else if (toSelectAndScroll.second != null) {
+ }
+ else if (toSelectAndScroll.second != null) {
assert myDelta != null;
scrollToRow(toSelectAndScroll.second, myDelta);
}
@@ -602,12 +611,12 @@
return;
}
Point point = calcPoint4Graph(e.getPoint());
- Collection<? extends PrintElement> printElements = myDataPack.getVisibleGraph().getRowInfo(row).getPrintElements();
+ Collection<? extends PrintElement> printElements = getVisibleGraph().getRowInfo(row).getPrintElements();
PrintElement printElement = myGraphCellPainter.mouseOver(printElements, point.x, point.y);
Selection previousSelection = getSelection();
GraphAnswer<Integer> answer =
- myDataPack.getVisibleGraph().getActionController().performAction(new GraphAction.GraphActionImpl(printElement, actionType));
+ getVisibleGraph().getActionController().performAction(new GraphAction.GraphActionImpl(printElement, actionType));
handleAnswer(answer, actionType == GraphAction.Type.MOUSE_CLICK && printElement != null, previousSelection);
}
@@ -635,6 +644,11 @@
}
@NotNull
+ public VisibleGraph<Integer> getVisibleGraph() {
+ return getGraphTableModel().getVisiblePack().getVisibleGraph();
+ }
+
+ @NotNull
private Point calcPoint4Graph(@NotNull Point clickPoint) {
return new Point(clickPoint.x - getXOffset(), PositionUtil.getYInsideRow(clickPoint));
}
@@ -801,7 +815,7 @@
return false;
}
Point point = calcPoint4Graph(e.getPoint());
- Collection<? extends PrintElement> printElements = myDataPack.getVisibleGraph().getRowInfo(row).getPrintElements();
+ Collection<? extends PrintElement> printElements = getVisibleGraph().getRowInfo(row).getPrintElements();
PrintElement printElement = myGraphCellPainter.mouseOver(printElements, point.x, point.y);
return printElement == null;
}
diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/GraphCommitCellRender.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/GraphCommitCellRender.java
index c277cfb..5fc645b 100644
--- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/GraphCommitCellRender.java
+++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/GraphCommitCellRender.java
@@ -10,7 +10,6 @@
import com.intellij.vcs.log.VcsRef;
import com.intellij.vcs.log.data.VcsLogDataHolder;
import com.intellij.vcs.log.graph.PrintElement;
-import com.intellij.vcs.log.graph.VisibleGraph;
import com.intellij.vcs.log.printer.idea.GraphCellPainter;
import com.intellij.vcs.log.printer.idea.PrintParameters;
import com.intellij.vcs.log.ui.VcsLogColorManager;
@@ -36,27 +35,20 @@
@NotNull private final RefPainter myRefPainter;
@NotNull private final IssueLinkRenderer myIssueLinkRenderer;
- @NotNull private VisibleGraph<Integer> myVisibleGraph;
@Nullable private PaintInfo myGraphImage;
@Nullable private Collection<VcsRef> myRefs;
public GraphCommitCellRender(@NotNull VcsLogColorManager colorManager,
@NotNull VcsLogDataHolder dataHolder,
@NotNull GraphCellPainter painter,
- @NotNull VisibleGraph<Integer> graph,
@NotNull VcsLogGraphTable table) {
myDataHolder = dataHolder;
myPainter = painter;
- myVisibleGraph = graph;
myGraphTable = table;
myRefPainter = new RefPainter(colorManager, false);
myIssueLinkRenderer = new IssueLinkRenderer(dataHolder.getProject(), this);
}
- public void updateVisibleGraph(@NotNull VisibleGraph<Integer> visibleGraph) {
- myVisibleGraph = visibleGraph;
- }
-
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
@@ -105,7 +97,7 @@
@Nullable
private PaintInfo getGraphImage(int row) {
- Collection<? extends PrintElement> printElements = myVisibleGraph.getRowInfo(row).getPrintElements();
+ Collection<? extends PrintElement> printElements = myGraphTable.getVisibleGraph().getRowInfo(row).getPrintElements();
int maxIndex = 0;
for (PrintElement printElement : printElements) {
maxIndex = Math.max(maxIndex, printElement.getPositionInCurrentRow());
diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/tables/GraphTableModel.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/tables/GraphTableModel.java
index 476bab6..4a1984f 100644
--- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/tables/GraphTableModel.java
+++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/tables/GraphTableModel.java
@@ -249,4 +249,8 @@
myMoreRequested = false;
fireTableDataChanged();
}
+
+ public VisiblePack getVisiblePack() {
+ return myDataPack;
+ }
}
diff --git a/platform/xdebugger-api/src/com/intellij/xdebugger/breakpoints/XBreakpointType.java b/platform/xdebugger-api/src/com/intellij/xdebugger/breakpoints/XBreakpointType.java
index 4f9ff38..65ccdb1 100644
--- a/platform/xdebugger-api/src/com/intellij/xdebugger/breakpoints/XBreakpointType.java
+++ b/platform/xdebugger-api/src/com/intellij/xdebugger/breakpoints/XBreakpointType.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,6 +31,7 @@
import javax.swing.*;
import java.util.Collections;
import java.util.Comparator;
+import java.util.EnumSet;
import java.util.List;
/**
@@ -83,6 +84,12 @@
return mySuspendThreadSupported;
}
+ public enum StandardPanels {SUSPEND_POLICY, ACTIONS, DEPENDENCY}
+
+ public EnumSet<StandardPanels> getVisibleStandardPanels() {
+ return EnumSet.allOf(StandardPanels.class);
+ }
+
@NotNull
public final String getId() {
return myId;
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XBreakpointActionsPanel.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XBreakpointActionsPanel.java
index de4d45f..4edcb9b 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XBreakpointActionsPanel.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XBreakpointActionsPanel.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -131,4 +131,8 @@
public void dispose() {
}
+
+ public void hide() {
+ myContentPane.setVisible(false);
+ }
}
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XLightBreakpointPropertiesPanel.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XLightBreakpointPropertiesPanel.java
index 4e91c27..52913d5 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XLightBreakpointPropertiesPanel.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XLightBreakpointPropertiesPanel.java
@@ -108,18 +108,34 @@
public XLightBreakpointPropertiesPanel(Project project, XBreakpointManager breakpointManager, B breakpoint, boolean showAllOptions) {
myBreakpoint = breakpoint;
myShowAllOptions = showAllOptions;
- XBreakpointType<B, ?> breakpointType = XBreakpointUtil.getType(breakpoint);
+ final XBreakpointType<B, ?> breakpointType = XBreakpointUtil.getType(breakpoint);
- mySuspendPolicyPanel.init(project, breakpointManager, breakpoint);
- mySuspendPolicyPanel.setDelegate(this);
+ if (breakpointType.getVisibleStandardPanels().contains(XBreakpointType.StandardPanels.SUSPEND_POLICY)) {
+ mySuspendPolicyPanel.init(project, breakpointManager, breakpoint);
+ mySuspendPolicyPanel.setDelegate(this);
+ mySubPanels.add(mySuspendPolicyPanel);
+ }
+ else {
+ mySuspendPolicyPanel.hide();
+ }
- mySubPanels.add(mySuspendPolicyPanel);
- myMasterBreakpointPanel.init(project, breakpointManager, breakpoint);
- mySubPanels.add(myMasterBreakpointPanel);
+ if (breakpointType.getVisibleStandardPanels().contains(XBreakpointType.StandardPanels.DEPENDENCY)) {
+ myMasterBreakpointPanel.init(project, breakpointManager, breakpoint);
+ mySubPanels.add(myMasterBreakpointPanel);
+ }
+ else {
+ myMasterBreakpointPanel.hide();
+ }
+
XDebuggerEditorsProvider debuggerEditorsProvider = breakpointType.getEditorsProvider(breakpoint, project);
- myActionsPanel.init(project, breakpointManager, breakpoint, debuggerEditorsProvider);
- mySubPanels.add(myActionsPanel);
+ if (breakpointType.getVisibleStandardPanels().contains(XBreakpointType.StandardPanels.ACTIONS)) {
+ myActionsPanel.init(project, breakpointManager, breakpoint, debuggerEditorsProvider);
+ mySubPanels.add(myActionsPanel);
+ }
+ else {
+ myActionsPanel.hide();
+ }
myCustomPanels = new ArrayList<XBreakpointCustomPropertiesPanel<B>>();
if (debuggerEditorsProvider != null) {
@@ -180,11 +196,11 @@
myMainPanel.addFocusListener(new FocusAdapter() {
@Override
public void focusGained(FocusEvent event) {
- JComponent compToFocus;
+ JComponent compToFocus = null;
if (myConditionComboBox != null && myConditionComboBox.getComboBox().isEnabled()) {
compToFocus = myConditionComboBox.getEditorComponent();
}
- else {
+ else if (breakpointType.getVisibleStandardPanels().contains(XBreakpointType.StandardPanels.ACTIONS)) {
compToFocus = myActionsPanel.getDefaultFocusComponent();
}
if (compToFocus != null) {
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XMasterBreakpointPanel.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XMasterBreakpointPanel.java
index 4e41620..b2e3bab 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XMasterBreakpointPanel.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XMasterBreakpointPanel.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -106,6 +106,12 @@
}
public void setDetailView(DetailView detailView) {
- myMasterBreakpointChooser.setDetailView(detailView);
+ if (myMasterBreakpointChooser != null) {
+ myMasterBreakpointChooser.setDetailView(detailView);
+ }
+ }
+
+ public void hide() {
+ myContentPane.setVisible(false);
}
}
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XSuspendPolicyPanel.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XSuspendPolicyPanel.java
index b3dcd13..c659aed 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XSuspendPolicyPanel.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/XSuspendPolicyPanel.java
@@ -138,6 +138,10 @@
return false;
}
+ public void hide() {
+ myContentPane.setVisible(false);
+ }
+
@Override
void loadProperties() {
SuspendPolicy suspendPolicy = myBreakpoint.getSuspendPolicy();
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/frame/XVariablesView.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/frame/XVariablesView.java
index 16a1ce5..4b5a5f8 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/frame/XVariablesView.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/frame/XVariablesView.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -68,11 +68,22 @@
}
@Override
- protected void clear() {
- XDebuggerTree tree = getTree();
+ public void dispose() {
+ clearInlineData(getTree());
+ super.dispose();
+ }
+
+ private static void clearInlineData(XDebuggerTree tree) {
tree.getProject().putUserData(DEBUG_VARIABLES, null);
tree.getProject().putUserData(DEBUG_VARIABLES_TIMESTAMPS, null);
+ tree.updateEditor();
+ }
+
+ @Override
+ protected void clear() {
+ XDebuggerTree tree = getTree();
tree.setSourcePosition(null);
+ clearInlineData(tree);
XDebuggerTreeNode node;
XDebugSession session = getSession(getPanel());
diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/ThrowableInstanceNeverThrownInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/ThrowableInstanceNeverThrownInspection.java
index 3604e3f..c435e8a 100644
--- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/ThrowableInstanceNeverThrownInspection.java
+++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/ThrowableInstanceNeverThrownInspection.java
@@ -80,68 +80,33 @@
@Override
public void visitNewExpression(PsiNewExpression expression) {
super.visitNewExpression(expression);
- if (!TypeUtils.expressionHasTypeOrSubtype(expression,
- CommonClassNames.JAVA_LANG_THROWABLE)) {
+ if (!TypeUtils.expressionHasTypeOrSubtype(expression, CommonClassNames.JAVA_LANG_THROWABLE)) {
return;
}
final PsiElement parent = getParent(expression.getParent());
- if (parent instanceof PsiThrowStatement ||
- parent instanceof PsiReturnStatement) {
+ if (canBeThrown(parent)) {
return;
}
- if (PsiTreeUtil.getParentOfType(parent, PsiCallExpression.class) !=
- null) {
+ if (PsiTreeUtil.getParentOfType(parent, PsiCallExpression.class) != null) {
return;
}
- final PsiElement typedParent =
- PsiTreeUtil.getParentOfType(expression,
- PsiAssignmentExpression.class,
- PsiVariable.class);
- final PsiLocalVariable variable;
- if (typedParent instanceof PsiAssignmentExpression) {
- final PsiAssignmentExpression assignmentExpression =
- (PsiAssignmentExpression)typedParent;
- final PsiExpression rhs = assignmentExpression.getRExpression();
- if (!PsiTreeUtil.isAncestor(rhs, expression, false)) {
- return;
- }
- final PsiExpression lhs = assignmentExpression.getLExpression();
- if (!(lhs instanceof PsiReferenceExpression)) {
- return;
- }
- final PsiReferenceExpression referenceExpression =
- (PsiReferenceExpression)lhs;
- final PsiElement target = referenceExpression.resolve();
- if (!(target instanceof PsiLocalVariable)) {
- return;
- }
- variable = (PsiLocalVariable)target;
+ final PsiElement typedParent = PsiTreeUtil.getParentOfType(expression, PsiAssignmentExpression.class, PsiVariable.class);
+ final PsiElement variable = ThrowableResultOfMethodCallIgnoredInspection.getVariable(typedParent, expression);
+ if (typedParent != null && variable == null) {
+ return;
}
- else if (typedParent instanceof PsiVariable) {
- if (!(typedParent instanceof PsiLocalVariable)) {
- return;
- }
- variable = (PsiLocalVariable)typedParent;
- }
- else {
- variable = null;
- }
- if (variable != null) {
- final Query<PsiReference> query =
- ReferencesSearch.search(variable,
- variable.getUseScope());
+ if (variable instanceof PsiLocalVariable) {
+ final Query<PsiReference> query = ReferencesSearch.search(variable, variable.getUseScope());
for (PsiReference reference : query) {
final PsiElement usage = reference.getElement();
PsiElement usageParent = usage.getParent();
while (usageParent instanceof PsiParenthesizedExpression) {
usageParent = usageParent.getParent();
}
- if (usageParent instanceof PsiThrowStatement ||
- usageParent instanceof PsiReturnStatement) {
+ if (canBeThrown(usageParent)) {
return;
}
- if (PsiTreeUtil.getParentOfType(usageParent,
- PsiCallExpression.class) != null) {
+ if (PsiTreeUtil.getParentOfType(usageParent, PsiCallExpression.class) != null) {
return;
}
}
@@ -149,6 +114,12 @@
registerError(expression, expression);
}
+ private static boolean canBeThrown(PsiElement parent) {
+ return parent instanceof PsiThrowStatement ||
+ parent instanceof PsiReturnStatement ||
+ parent instanceof PsiLambdaExpression;
+ }
+
public static PsiElement getParent(PsiElement element) {
PsiElement parent = element;
while (parent instanceof PsiParenthesizedExpression ||
@@ -171,12 +142,9 @@
if (!(grandParent instanceof PsiMethodCallExpression)) {
return null;
}
- final PsiMethodCallExpression methodCallExpression =
- (PsiMethodCallExpression)grandParent;
- final PsiReferenceExpression methodExpression =
- methodCallExpression.getMethodExpression();
- @NonNls final String methodName =
- methodExpression.getReferenceName();
+ final PsiMethodCallExpression methodCallExpression = (PsiMethodCallExpression)grandParent;
+ final PsiReferenceExpression methodExpression = methodCallExpression.getMethodExpression();
+ @NonNls final String methodName = methodExpression.getReferenceName();
if (!"initCause".equals(methodName)) {
return null;
}
@@ -185,13 +153,11 @@
if (method == null) {
return null;
}
- final PsiParameterList parameterList =
- method.getParameterList();
+ final PsiParameterList parameterList = method.getParameterList();
if (parameterList.getParametersCount() != 1) {
return null;
}
- final PsiParameter[] parameters =
- parameterList.getParameters();
+ final PsiParameter[] parameters = parameterList.getParameters();
final PsiType type = parameters[0].getType();
if (!type.equalsToText(CommonClassNames.JAVA_LANG_THROWABLE)) {
return null;
diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/ThrowableResultOfMethodCallIgnoredInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/ThrowableResultOfMethodCallIgnoredInspection.java
index 080a6e5..b3984cf 100644
--- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/ThrowableResultOfMethodCallIgnoredInspection.java
+++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/ThrowableResultOfMethodCallIgnoredInspection.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2008-2014 Bas Leijdekkers
+ * Copyright 2008-2015 Bas Leijdekkers
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,8 +18,8 @@
import com.intellij.psi.*;
import com.intellij.psi.search.searches.ReferencesSearch;
import com.intellij.psi.util.InheritanceUtil;
+import com.intellij.psi.util.PropertyUtil;
import com.intellij.psi.util.PsiTreeUtil;
-import com.intellij.psi.util.PsiUtil;
import com.intellij.util.Query;
import com.siyeh.InspectionGadgetsBundle;
import com.siyeh.ig.BaseInspection;
@@ -27,8 +27,7 @@
import com.siyeh.ig.psiutils.TypeUtils;
import org.jetbrains.annotations.NotNull;
-public class ThrowableResultOfMethodCallIgnoredInspection
- extends BaseInspection {
+public class ThrowableResultOfMethodCallIgnoredInspection extends BaseInspection {
@Override
@NotNull
@@ -64,23 +63,19 @@
while (parent instanceof PsiParenthesizedExpression || parent instanceof PsiTypeCastExpression) {
parent = parent.getParent();
}
- if (parent instanceof PsiReturnStatement ||
- parent instanceof PsiThrowStatement ||
- parent instanceof PsiExpressionList) {
+ if (canBeThrown(parent)) {
return;
}
- if (!TypeUtils.expressionHasTypeOrSubtype(expression,
- CommonClassNames.JAVA_LANG_THROWABLE)) {
+ if (!TypeUtils.expressionHasTypeOrSubtype(expression, CommonClassNames.JAVA_LANG_THROWABLE)) {
return;
}
final PsiMethod method = expression.resolveMethod();
- if (method == null) {
+ if (method == null || PropertyUtil.isSimpleGetter(method)) {
return;
}
if (!method.hasModifierProperty(PsiModifier.STATIC)) {
final PsiClass containingClass = method.getContainingClass();
- if (InheritanceUtil.isInheritor(containingClass,
- CommonClassNames.JAVA_LANG_THROWABLE)) {
+ if (InheritanceUtil.isInheritor(containingClass, CommonClassNames.JAVA_LANG_THROWABLE)) {
return;
}
}
@@ -91,53 +86,55 @@
return;
}
- final PsiLocalVariable variable;
- if (parent instanceof PsiAssignmentExpression) {
- final PsiAssignmentExpression assignmentExpression =
- (PsiAssignmentExpression)parent;
- final PsiExpression rhs = assignmentExpression.getRExpression();
- if (!PsiTreeUtil.isAncestor(rhs, expression, false)) {
- return;
- }
- final PsiExpression lhs = assignmentExpression.getLExpression();
- if (!(lhs instanceof PsiReferenceExpression)) {
- return;
- }
- final PsiReferenceExpression referenceExpression =
- (PsiReferenceExpression)lhs;
- final PsiElement target = referenceExpression.resolve();
- if (!(target instanceof PsiLocalVariable)) {
- return;
- }
- variable = (PsiLocalVariable)target;
+ final PsiElement var = getVariable(parent, expression);
+ if (var == null) {
+ return;
}
- else if (parent instanceof PsiVariable) {
- if (!(parent instanceof PsiLocalVariable)) {
- return;
- }
- variable = (PsiLocalVariable)parent;
- }
- else {
- variable = null;
- }
- if (variable != null) {
- final Query<PsiReference> query =
- ReferencesSearch.search(variable,
- variable.getUseScope());
+
+ if (var instanceof PsiLocalVariable) {
+ final Query<PsiReference> query = ReferencesSearch.search(var, var.getUseScope());
for (PsiReference reference : query) {
final PsiElement usage = reference.getElement();
PsiElement usageParent = usage.getParent();
while (usageParent instanceof PsiParenthesizedExpression) {
usageParent = usageParent.getParent();
}
- if (usageParent instanceof PsiThrowStatement ||
- usageParent instanceof PsiReturnStatement ||
- usageParent instanceof PsiExpressionList) {
+ if (canBeThrown(usageParent)) {
return;
}
}
}
registerMethodCallError(expression);
}
+
+ private static boolean canBeThrown(PsiElement parent) {
+ return parent instanceof PsiReturnStatement ||
+ parent instanceof PsiThrowStatement ||
+ parent instanceof PsiExpressionList ||
+ parent instanceof PsiLambdaExpression;
+ }
+ }
+
+ protected static PsiElement getVariable(PsiElement parent, PsiElement expression) {
+ if (parent instanceof PsiAssignmentExpression) {
+ final PsiAssignmentExpression assignmentExpression = (PsiAssignmentExpression)parent;
+ final PsiExpression rhs = assignmentExpression.getRExpression();
+ if (!PsiTreeUtil.isAncestor(rhs, expression, false)) {
+ return null;
+ }
+ final PsiExpression lhs = assignmentExpression.getLExpression();
+ if (!(lhs instanceof PsiReferenceExpression)) {
+ return null;
+ }
+ final PsiReferenceExpression referenceExpression = (PsiReferenceExpression)lhs;
+ final PsiElement target = referenceExpression.resolve();
+ if (!(target instanceof PsiLocalVariable)) {
+ return null;
+ }
+ return target;
+ }
+ else {
+ return parent;
+ }
}
}
\ No newline at end of file
diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/AbstractMethodOverridesAbstractMethodInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/AbstractMethodOverridesAbstractMethodInspection.java
index 1ab7036..137374f 100644
--- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/AbstractMethodOverridesAbstractMethodInspection.java
+++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/AbstractMethodOverridesAbstractMethodInspection.java
@@ -115,22 +115,28 @@
if (!method.hasModifierProperty(PsiModifier.ABSTRACT) && !containingClass.isInterface()) {
return;
}
+ boolean overrideDefault = false;
+ boolean accept = false;
final PsiMethod[] superMethods = method.findSuperMethods();
for (final PsiMethod superMethod : superMethods) {
+ overrideDefault |= superMethod.hasModifierProperty(PsiModifier.DEFAULT);
if (!isAbstract(superMethod)) {
continue;
}
- if (!methodsHaveSameReturnTypes(method, superMethod) || !haveSameExceptionSignatures(method, superMethod)) {
- continue;
+ if (overrideDefault) {
+ return;
}
+ accept |= methodsHaveSameReturnTypes(method, superMethod) && haveSameExceptionSignatures(method, superMethod);
+
if (ignoreJavaDoc && !haveSameJavaDoc(method, superMethod)) {
return;
}
if (ignoreAnnotations && !methodsHaveSameAnnotations(method, superMethod)) {
return;
}
+ }
+ if (accept && !overrideDefault) {
registerMethodError(method);
- return;
}
}
diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/throwable_instance_never_thrown/ThrowableInstanceNeverThrown.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/throwable_instance_never_thrown/ThrowableInstanceNeverThrown.java
index f87fa95..711776a 100644
--- a/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/throwable_instance_never_thrown/ThrowableInstanceNeverThrown.java
+++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/throwable_instance_never_thrown/ThrowableInstanceNeverThrown.java
@@ -44,3 +44,16 @@
void methodCall(IOException e){}
}
+
+interface I {
+ Exception get();
+}
+
+class L {
+ {
+ I i = () -> new RuntimeException();
+
+ final RuntimeException exception = new RuntimeException();
+ I i2 = () -> exception;
+ }
+}
\ No newline at end of file
diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/throwable_result_of_method_call_ignored/A.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/throwable_result_of_method_call_ignored/A.java
deleted file mode 100644
index ee413b9..0000000
--- a/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/throwable_result_of_method_call_ignored/A.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.siyeh.igtest.bugs.throwable_result_of_method_call_ignored;
-
-
-
-public class A {
- public static void test() {
- try {
- <warning descr="Result of 'firstNonNull()' not thrown">firstNonNull</warning>(new Throwable(), null);
- }
- catch (Exception e) {
- throw new RuntimeException(firstNonNull(e.getCause(), e));
- }
- }
-
- public static <T> T firstNonNull(T first, T second) {
- return first != null ? first : second;
- }
-
- void m() {
- throw (RuntimeException) b();
- }
-
- public Exception b() {
- return new RuntimeException();
- }
-}
diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/throwable_result_of_method_call_ignored/ThrowableResultOfMethodCallIgnored.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/throwable_result_of_method_call_ignored/ThrowableResultOfMethodCallIgnored.java
new file mode 100644
index 0000000..bfb4d3f
--- /dev/null
+++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/throwable_result_of_method_call_ignored/ThrowableResultOfMethodCallIgnored.java
@@ -0,0 +1,54 @@
+package com.siyeh.igtest.bugs.throwable_result_of_method_call_ignored;
+
+
+class ThrowableResultOfMethodCallIgnored {
+ public static void test() {
+ try {
+ <warning descr="Result of 'firstNonNull()' not thrown">firstNonNull</warning>(new Throwable(), null);
+ }
+ catch (Exception e) {
+ throw new RuntimeException(firstNonNull(e.getCause(), e));
+ }
+ }
+
+ public static <T> T firstNonNull(T first, T second) {
+ return first != null ? first : second;
+ }
+
+ void m() {
+ throw (RuntimeException) b();
+ }
+
+ public Exception b() {
+ return new RuntimeException();
+ }
+}
+class ResWrap {
+ private String payload;
+ private Throwable error;
+
+ public Throwable getError() {
+ return error;
+ }
+ public ResWrap service() {
+ final ResWrap result = new ResWrap();
+ if (result.getError() == null) {
+ //rememberResult(result.payload);
+ }
+ return result;
+ }
+}
+
+interface I {
+ Exception get();
+}
+
+class LambdaReturn {
+ {
+ I i = () -> createException("foo");
+ }
+
+ private RuntimeException createException(String message) {
+ return new RuntimeException(message);
+ }
+}
\ No newline at end of file
diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/inheritance/abstract_method_overrides_abstract_method/AbstractMethodOverridesAbstractMethod.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/inheritance/abstract_method_overrides_abstract_method/AbstractMethodOverridesAbstractMethod.java
index 5cb023a..2823bd7 100644
--- a/plugins/InspectionGadgets/test/com/siyeh/igtest/inheritance/abstract_method_overrides_abstract_method/AbstractMethodOverridesAbstractMethod.java
+++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/inheritance/abstract_method_overrides_abstract_method/AbstractMethodOverridesAbstractMethod.java
@@ -62,6 +62,23 @@
}
class Java8DefaultMethods {
+
+ interface A {
+ String method();
+ }
+
+ interface B {
+ default String method() {
+ return null;
+ }
+ }
+
+ //without override would inherit abstract & default - red code
+ interface C extends A, B {
+ @Override
+ String method();
+ }
+
interface Super
{
default void method()
diff --git a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/bugs/ThrowableResultOfMethodCallIgnoredInspectionTest.java b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/bugs/ThrowableResultOfMethodCallIgnoredInspectionTest.java
index adeb8ae..5520f75 100644
--- a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/bugs/ThrowableResultOfMethodCallIgnoredInspectionTest.java
+++ b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/bugs/ThrowableResultOfMethodCallIgnoredInspectionTest.java
@@ -1,12 +1,11 @@
package com.siyeh.ig.bugs;
import com.intellij.codeInspection.InspectionProfileEntry;
-import com.siyeh.ig.IGInspectionTestCase;
import com.siyeh.ig.LightInspectionTestCase;
public class ThrowableResultOfMethodCallIgnoredInspectionTest extends LightInspectionTestCase {
- public void testA() throws Exception {
+ public void testThrowableResultOfMethodCallIgnored() throws Exception {
doTest();
}
diff --git a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/inheritance/AbstractMethodOverridesAbstractMethodInspectionTest.java b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/inheritance/AbstractMethodOverridesAbstractMethodInspectionTest.java
index 5e6ed0b..753c2f7 100644
--- a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/inheritance/AbstractMethodOverridesAbstractMethodInspectionTest.java
+++ b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/inheritance/AbstractMethodOverridesAbstractMethodInspectionTest.java
@@ -1,5 +1,9 @@
package com.siyeh.ig.inheritance;
+import com.intellij.openapi.projectRoots.Sdk;
+import com.intellij.openapi.roots.LanguageLevelProjectExtension;
+import com.intellij.pom.java.LanguageLevel;
+import com.intellij.testFramework.IdeaTestUtil;
import com.siyeh.ig.IGInspectionTestCase;
public class AbstractMethodOverridesAbstractMethodInspectionTest extends IGInspectionTestCase {
@@ -10,4 +14,11 @@
tool.ignoreJavaDoc = true;
doTest("com/siyeh/igtest/inheritance/abstract_method_overrides_abstract_method", tool);
}
+
+ @Override
+ protected Sdk getTestProjectSdk() {
+ Sdk sdk = IdeaTestUtil.getMockJdk17();
+ LanguageLevelProjectExtension.getInstance(getProject()).setLanguageLevel(LanguageLevel.HIGHEST);
+ return sdk;
+ }
}
diff --git a/plugins/git4idea/src/git4idea/actions/GitMergeAction.java b/plugins/git4idea/src/git4idea/actions/GitMergeAction.java
index 6a730ea..5015c6b 100644
--- a/plugins/git4idea/src/git4idea/actions/GitMergeAction.java
+++ b/plugins/git4idea/src/git4idea/actions/GitMergeAction.java
@@ -86,6 +86,7 @@
new GitLocalChangesWouldBeOverwrittenDetector(selectedRoot, MERGE);
final GitUntrackedFilesOverwrittenByOperationDetector untrackedFilesDetector =
new GitUntrackedFilesOverwrittenByOperationDetector(selectedRoot);
+ final GitSimpleEventDetector mergeConflict = new GitSimpleEventDetector(GitSimpleEventDetector.Event.MERGE_CONFLICT);
AccessToken token = DvcsUtil.workingTreeChangeStarted(project);
try {
@@ -95,6 +96,7 @@
GitLineHandler handler = handlerProvider.compute();
handler.addLineListener(localChangesDetector);
handler.addLineListener(untrackedFilesDetector);
+ handler.addLineListener(mergeConflict);
return handler;
}
});
@@ -107,7 +109,8 @@
return;
}
final GitRevisionNumber currentRev = new GitRevisionNumber(revision);
- handleResult(result, project, localChangesDetector, untrackedFilesDetector, repository, currentRev, affectedRoots, beforeLabel);
+ handleResult(result, project, mergeConflict, localChangesDetector, untrackedFilesDetector,
+ repository, currentRev, affectedRoots, beforeLabel);
}
finally {
DvcsUtil.workingTreeChangeFinished(project, token);
@@ -117,12 +120,18 @@
}.queue();
}
- private void handleResult(GitCommandResult result, Project project, GitLocalChangesWouldBeOverwrittenDetector localChangesDetector,
- GitUntrackedFilesOverwrittenByOperationDetector untrackedFilesDetector, GitRepository repository,
- GitRevisionNumber currentRev, Set<VirtualFile> affectedRoots, Label beforeLabel) {
+ private void handleResult(GitCommandResult result,
+ Project project,
+ GitSimpleEventDetector mergeConflictDetector,
+ GitLocalChangesWouldBeOverwrittenDetector localChangesDetector,
+ GitUntrackedFilesOverwrittenByOperationDetector untrackedFilesDetector,
+ GitRepository repository,
+ GitRevisionNumber currentRev,
+ Set<VirtualFile> affectedRoots,
+ Label beforeLabel) {
GitRepositoryManager repositoryManager = GitUtil.getRepositoryManager(project);
VirtualFile root = repository.getRoot();
- if (result.success()) {
+ if (result.success() || mergeConflictDetector.hasHappened()) {
VfsUtil.markDirtyAndRefresh(false, true, false, root);
List<VcsException> exceptions = new ArrayList<VcsException>();
GitMergeUtil.showUpdates(this, project, exceptions, root, currentRev, beforeLabel, getActionName(), ActionInfo.UPDATE);
diff --git a/plugins/git4idea/src/git4idea/actions/GitRepositoryAction.java b/plugins/git4idea/src/git4idea/actions/GitRepositoryAction.java
index 50ba95a..68d5aba 100644
--- a/plugins/git4idea/src/git4idea/actions/GitRepositoryAction.java
+++ b/plugins/git4idea/src/git4idea/actions/GitRepositoryAction.java
@@ -15,6 +15,7 @@
*/
package git4idea.actions;
+import com.intellij.dvcs.repo.Repository;
import com.intellij.openapi.actionSystem.ActionPlaces;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
@@ -114,19 +115,18 @@
if (files != null) {
for (VirtualFile file : files) {
GitRepositoryManager manager = GitUtil.getRepositoryManager(project);
- if (manager == null) {
- return false;
- }
- final GitRepository repositoryForFile = manager.getRepositoryForFile(file);
- if (repositoryForFile != null && repositoryForFile.getState() == GitRepository.State.REBASING) {
- return true;
- }
+ if (isRebasing(manager.getRepositoryForFile(file))) return true;
}
}
+ if (isRebasing(GitBranchUtil.getCurrentRepository(project))) return true;
}
return false;
}
+ private static boolean isRebasing(@Nullable GitRepository repository) {
+ return repository != null && repository.getState() == Repository.State.REBASING;
+ }
+
/**
* Get git roots for the project. The method shows dialogs in the case when roots cannot be retrieved, so it should be called
* from the event dispatch thread.
diff --git a/plugins/git4idea/src/git4idea/branch/GitBranchUtil.java b/plugins/git4idea/src/git4idea/branch/GitBranchUtil.java
index ceddd8fc..e5cbd84 100644
--- a/plugins/git4idea/src/git4idea/branch/GitBranchUtil.java
+++ b/plugins/git4idea/src/git4idea/branch/GitBranchUtil.java
@@ -271,7 +271,7 @@
if (state == GitRepository.State.DETACHED) {
String currentRevision = repository.getCurrentRevision();
assert currentRevision != null : "Current revision can't be null in DETACHED state, only on the fresh repository.";
- return currentRevision.substring(0, 7);
+ return DvcsUtil.getShortHash(currentRevision);
}
String prefix = "";
diff --git a/plugins/git4idea/src/git4idea/history/GitLogRecord.java b/plugins/git4idea/src/git4idea/history/GitLogRecord.java
index a985796..0512bde 100644
--- a/plugins/git4idea/src/git4idea/history/GitLogRecord.java
+++ b/plugins/git4idea/src/git4idea/history/GitLogRecord.java
@@ -17,6 +17,7 @@
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.FilePath;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.changes.Change;
@@ -171,13 +172,24 @@
if ((startParentheses == -1) || (endParentheses == -1)) return Collections.emptyList();
String refs = decoration.substring(startParentheses + 1, endParentheses);
String[] names = refs.split(", ");
- return ContainerUtil.map(names, new Function<String, String>() {
- @Override
- public String fun(String item) {
- int colon = item.indexOf(':');
- return shortBuffer(colon > 0 ? item.substring(colon + 1).trim() : item);
+ List<String> result = ContainerUtil.newArrayList();
+ for (String item : names) {
+ final String POINTER = " -> "; // HEAD -> refs/heads/master in Git 2.4.3+
+ if (item.contains(POINTER)) {
+ List<String> parts = StringUtil.split(item, POINTER);
+ result.addAll(ContainerUtil.map(parts, new Function<String, String>() {
+ @Override
+ public String fun(String s) {
+ return shortBuffer(s.trim());
+ }
+ }));
}
- });
+ else {
+ int colon = item.indexOf(':'); // tags have the "tag:" prefix.
+ result.add(shortBuffer(colon > 0 ? item.substring(colon + 1).trim() : item));
+ }
+ }
+ return result;
}
private static String shortBuffer(String raw) {
diff --git a/plugins/git4idea/src/git4idea/rebase/GitRebaseEditor.java b/plugins/git4idea/src/git4idea/rebase/GitRebaseEditor.java
index fc66de87c..9416b5a 100644
--- a/plugins/git4idea/src/git4idea/rebase/GitRebaseEditor.java
+++ b/plugins/git4idea/src/git4idea/rebase/GitRebaseEditor.java
@@ -265,7 +265,8 @@
@Override
public void exchangeRows(int oldIndex, int newIndex) {
- Collections.swap(myEntries, oldIndex, newIndex);
+ GitRebaseEntry movingElement = myEntries.remove(oldIndex);
+ myEntries.add(newIndex, movingElement);
fireTableRowsUpdated(Math.min(oldIndex, newIndex), Math.max(oldIndex, newIndex));
}
diff --git a/plugins/git4idea/src/git4idea/repo/GitRepositoryImpl.java b/plugins/git4idea/src/git4idea/repo/GitRepositoryImpl.java
index b6e0573..89041ee 100644
--- a/plugins/git4idea/src/git4idea/repo/GitRepositoryImpl.java
+++ b/plugins/git4idea/src/git4idea/repo/GitRepositoryImpl.java
@@ -17,6 +17,7 @@
import com.intellij.dvcs.repo.RepositoryImpl;
import com.intellij.openapi.Disposable;
+import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.vcs.AbstractVcs;
@@ -206,12 +207,19 @@
}
// previous info can be null before the first update
- private static void notifyListeners(@NotNull GitRepository repository, @Nullable GitRepoInfo previousInfo, @NotNull GitRepoInfo info) {
+ private static void notifyListeners(@NotNull final GitRepository repository, @Nullable GitRepoInfo previousInfo, @NotNull GitRepoInfo info) {
if (Disposer.isDisposed(repository.getProject())) {
return;
}
if (!info.equals(previousInfo)) {
- repository.getProject().getMessageBus().syncPublisher(GIT_REPO_CHANGE).repositoryChanged(repository);
+ ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
+ public void run() {
+ Project project = repository.getProject();
+ if (!project.isDisposed()) {
+ project.getMessageBus().syncPublisher(GIT_REPO_CHANGE).repositoryChanged(repository);
+ }
+ }
+ });
}
}
diff --git a/plugins/git4idea/src/git4idea/ui/branch/GitBranchWidget.java b/plugins/git4idea/src/git4idea/ui/branch/GitBranchWidget.java
index 4ce4b0e..629f83d 100644
--- a/plugins/git4idea/src/git4idea/ui/branch/GitBranchWidget.java
+++ b/plugins/git4idea/src/git4idea/ui/branch/GitBranchWidget.java
@@ -54,6 +54,7 @@
project.getMessageBus().connect().subscribe(GitRepository.GIT_REPO_CHANGE, this);
mySettings = GitVcsSettings.getInstance(project);
myMaxString = "Git: Rebasing master";
+ updateLater();
}
@Override
@@ -93,6 +94,10 @@
@Override
public void repositoryChanged(@NotNull GitRepository repository) {
LOG.debug("repository changed");
+ updateLater();
+ }
+
+ private void updateLater() {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
diff --git a/plugins/git4idea/tests/git4idea/history/GitLogParserTest.java b/plugins/git4idea/tests/git4idea/history/GitLogParserTest.java
index d7ddaeb..0f81c3a 100644
--- a/plugins/git4idea/tests/git4idea/history/GitLogParserTest.java
+++ b/plugins/git4idea/tests/git4idea/history/GitLogParserTest.java
@@ -39,11 +39,12 @@
public static final GitLogOption[] GIT_LOG_OPTIONS =
new GitLogOption[]{HASH, COMMIT_TIME, AUTHOR_NAME, AUTHOR_TIME, AUTHOR_EMAIL, COMMITTER_NAME,
- COMMITTER_EMAIL, SUBJECT, BODY, PARENTS, PARENTS, RAW_BODY
+ COMMITTER_EMAIL, SUBJECT, BODY, PARENTS, PARENTS, RAW_BODY, REF_NAMES
};
private VirtualFile myRoot;
private GitLogParser myParser;
private GitTestLogRecord myRecord;
+ private static boolean myNewRefsFormat;
private static final GitTestLogRecord RECORD1 = new GitTestLogRecord(ContainerUtil.<GitTestLogRecordInfo, Object>immutableMapBuilder()
.put(GitTestLogRecordInfo.HASH, "2c815939f45fbcfda9583f84b14fe9d393ada790")
@@ -66,6 +67,7 @@
GitTestChange.added("readme.txt"),
GitTestChange.modified("src/CClass.java"),
GitTestChange.deleted("src/ChildAClass.java")})
+ .put(GitTestLogRecordInfo.REFS, Arrays.asList("HEAD", "refs/heads/master"))
.build());
private static final GitTestLogRecord RECORD2 = new GitTestLogRecord(ContainerUtil.<GitTestLogRecordInfo, Object>immutableMapBuilder()
@@ -83,7 +85,7 @@
.build());
private static final GitTestLogRecord RECORD3 = new GitTestLogRecord(ContainerUtil.<GitTestLogRecordInfo, Object>immutableMapBuilder()
- .put(GitTestLogRecordInfo.HASH, "c916c63b89d8fa81ebf23cc5cbcdb75e115623c7")
+ .put(GitTestLogRecordInfo.HASH, "c916c63b89d8fa81ebf23cc5cbcdb75e115623c7")
.put(GitTestLogRecordInfo.AUTHOR_TIME, new Date(1317027817L * 1000))
.put(GitTestLogRecordInfo.AUTHOR_NAME, "John Doe")
.put(GitTestLogRecordInfo.AUTHOR_EMAIL, "John.Doe@example.com")
@@ -94,6 +96,7 @@
.put(GitTestLogRecordInfo.BODY, "Small description")
.put(GitTestLogRecordInfo.PARENTS, new String[] { "7c1298fd1f93df414ce0d87128532f819de2cbd4" })
.put(GitTestLogRecordInfo.CHANGES, new GitTestChange[] { GitTestChange.modified("src/CClass.java") })
+ .put(GitTestLogRecordInfo.REFS, Arrays.asList("refs/heads/sly->name", "refs/remotes/origin/master", "refs/tags/v1.0"))
.build());
public static final List<GitTestLogRecord> ALL_RECORDS = Arrays.asList(RECORD1, RECORD2, RECORD3);
@@ -102,6 +105,7 @@
super.setUp();
myRoot = myProjectRoot;
myRecord = RECORD1; // for single record tests
+ myNewRefsFormat = false;
}
public void testparseAllWithoutNameStatus() throws VcsException {
@@ -165,6 +169,16 @@
doTestCustomCommitMessage("Subject \u0001of the \u0001# weird message", "Subject of the # weird message");
}
+ public void test_old_refs_format() throws VcsException {
+ myNewRefsFormat = false;
+ doTestAllRecords(NONE);
+ }
+
+ public void test_new_refs_format() throws VcsException {
+ myNewRefsFormat = true;
+ doTestAllRecords(STATUS);
+ }
+
private void doTestCustomCommitMessage(@NotNull String subject, @NotNull String expectedSubject) {
Map<GitTestLogRecordInfo, Object> data = ContainerUtil.newHashMap(myRecord.myData);
data.put(GitTestLogRecordInfo.SUBJECT, subject);
@@ -223,6 +237,8 @@
assertSameElements(actual.getParentsHashes(), expected.getParents());
+ assertSameElements(actual.getRefs(), expected.getRefs());
+
if (option == NAME) {
assertPaths(actual.getFilePaths(myRoot), expected.paths());
} else if (option == STATUS) {
@@ -301,6 +317,7 @@
SUBJECT,
BODY,
PARENTS,
+ REFS,
CHANGES
}
@@ -352,6 +369,36 @@
return (String[])myData.get(GitTestLogRecordInfo.PARENTS);
}
+ @NotNull
+ public Collection<String> getRefs() {
+ return ContainerUtil.notNullize((List<String>)myData.get(GitTestLogRecordInfo.REFS));
+ }
+
+ public String getRefsForOutput() {
+ Collection<String> refs = getRefs();
+ if (refs.isEmpty()) {
+ return "";
+ }
+ if (myNewRefsFormat) {
+ Collection<String> newRefs = ContainerUtil.newArrayList();
+ boolean headRefMet = false;
+ for (String ref : refs) {
+ if (ref.equals("HEAD")) {
+ headRefMet = true;
+ }
+ else if (headRefMet) {
+ newRefs.add("HEAD -> " + ref);
+ headRefMet = false;
+ }
+ else {
+ newRefs.add(ref);
+ }
+ }
+ refs = newRefs;
+ }
+ return "(" + StringUtil.join(refs, ", ") + ")";
+ }
+
public GitTestChange[] getChanges() {
return (GitTestChange[])myData.get(GitTestLogRecordInfo.CHANGES);
}
@@ -461,7 +508,7 @@
case PARENTS:
return parentsAsString();
case REF_NAMES:
- break;
+ return getRefsForOutput();
case SHORT_REF_LOG_SELECTOR:
break;
}
diff --git a/plugins/google-app-engine/source/com/intellij/appengine/actions/AppEngineUploader.java b/plugins/google-app-engine/source/com/intellij/appengine/actions/AppEngineUploader.java
index 4d5dcae..6458a17 100644
--- a/plugins/google-app-engine/source/com/intellij/appengine/actions/AppEngineUploader.java
+++ b/plugins/google-app-engine/source/com/intellij/appengine/actions/AppEngineUploader.java
@@ -208,8 +208,8 @@
else {
programParameters.add("--email=" + myAuthData.getEmail());
programParameters.add("--passin");
+ programParameters.add("--no_cookies");
}
- programParameters.add("--no_cookies");
programParameters.add("update");
programParameters.add(FileUtil.toSystemDependentName(myArtifact.getOutputPath()));
diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/action/GradleExecuteTaskAction.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/action/GradleExecuteTaskAction.java
index 78b2122..dae73a0 100644
--- a/plugins/gradle/src/org/jetbrains/plugins/gradle/action/GradleExecuteTaskAction.java
+++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/action/GradleExecuteTaskAction.java
@@ -20,6 +20,7 @@
import com.intellij.execution.executors.DefaultRunExecutor;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
+import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.externalSystem.action.ExternalSystemAction;
import com.intellij.openapi.externalSystem.action.ExternalSystemActionUtil;
import com.intellij.openapi.externalSystem.model.ExternalSystemDataKeys;
@@ -63,6 +64,17 @@
return GradleConstants.SYSTEM_ID.equals(getSystemId(e));
}
+ protected boolean isEnabled(AnActionEvent e) {
+ return true;
+ }
+
+ @Override
+ public void update(@NotNull AnActionEvent e) {
+ Presentation p = e.getPresentation();
+ p.setVisible(isVisible(e));
+ p.setEnabled(isEnabled(e));
+ }
+
@Override
public void actionPerformed(@NotNull final AnActionEvent e) {
final Project project = e.getRequiredData(CommonDataKeys.PROJECT);
diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/BaseGradleProjectResolverExtension.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/BaseGradleProjectResolverExtension.java
index 87740cf..7498663 100644
--- a/plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/BaseGradleProjectResolverExtension.java
+++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/BaseGradleProjectResolverExtension.java
@@ -63,6 +63,7 @@
import org.jetbrains.plugins.gradle.util.GradleBundle;
import org.jetbrains.plugins.gradle.util.GradleConstants;
import org.jetbrains.plugins.gradle.util.GradleUtil;
+import org.slf4j.impl.Log4jLoggerFactory;
import java.io.File;
import java.io.FilenameFilter;
@@ -375,7 +376,7 @@
@Override
public Set<Class> getExtraProjectModelClasses() {
Set<Class> result = ContainerUtil.<Class>set(GradleBuild.class, ExternalProject.class, ModuleExtendedModel.class);
- if (!resolverCtx.isPreviewMode()) {
+ if (!ExternalSystemApiUtil.isInProcessMode(GradleConstants.SYSTEM_ID) || !resolverCtx.isPreviewMode()) {
result.add(BuildScriptClasspathModel.class);
}
return result;
@@ -500,6 +501,8 @@
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(EmptyModuleType.class));
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(ProjectImportAction.class));
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(Init.class));
+ ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(org.slf4j.Logger.class));
+ ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(Log4jLoggerFactory.class));
for (String entry : additionalEntries) {
classPath.add(entry);
}
diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/wizard/GradleModuleWizardStep.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/wizard/GradleModuleWizardStep.java
index e3a2e98..bcd9bbc 100644
--- a/plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/wizard/GradleModuleWizardStep.java
+++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/wizard/GradleModuleWizardStep.java
@@ -356,7 +356,7 @@
protected EditorEx createEditor() {
final EditorEx editor = super.createEditor();
editor.setHorizontalScrollbarVisible(true);
- editor.setCaretEnabled(true);
+ editor.setCaretEnabled(isEnabled());
editor.getScrollPane().setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
editor.setEmbeddedIntoDialogWrapper(myEmbeddedIntoDialogWrapper);
editor.setBorder(UIUtil.getTextFieldBorder());
@@ -365,6 +365,11 @@
editor.getSettings().setUseSoftWraps(myUseSoftWraps);
return editor;
}
+
+ @Override
+ protected void setViewerEnabled(boolean enabled) {
+ // do not reset com.intellij.ui.EditorTextField.myIsViewer field
+ }
}
private static void setTestIfEmpty(@NotNull JTextField field, @Nullable String text) {
diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/wizard/GradleProjectImportBuilder.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/wizard/GradleProjectImportBuilder.java
index 1dc0368..6083383 100644
--- a/plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/wizard/GradleProjectImportBuilder.java
+++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/wizard/GradleProjectImportBuilder.java
@@ -73,7 +73,7 @@
final ImportFromGradleControl importFromGradleControl = getControl(context.getProject());
importFromGradleControl.setLinkedProjectPath(pathToUse);
final Pair<String, Sdk> sdkPair = ExternalSystemJdkUtil.getAvailableJdk(context.getProject());
- if (sdkPair != null) {
+ if (sdkPair != null && !ExternalSystemJdkUtil.USE_INTERNAL_JAVA.equals(sdkPair.first)) {
importFromGradleControl.getProjectSettings().setGradleJvm(sdkPair.first);
}
}
diff --git a/plugins/gradle/tooling-extension-api/src/org/jetbrains/plugins/gradle/model/ModuleExtendedModel.java b/plugins/gradle/tooling-extension-api/src/org/jetbrains/plugins/gradle/model/ModuleExtendedModel.java
index 998fb8a..54b088b 100644
--- a/plugins/gradle/tooling-extension-api/src/org/jetbrains/plugins/gradle/model/ModuleExtendedModel.java
+++ b/plugins/gradle/tooling-extension-api/src/org/jetbrains/plugins/gradle/model/ModuleExtendedModel.java
@@ -16,6 +16,7 @@
package org.jetbrains.plugins.gradle.model;
import org.gradle.tooling.model.DomainObjectSet;
+import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.io.Serializable;
@@ -86,4 +87,12 @@
* @return a mapping between the name of a configuration and the files associated with it.
*/
Map<String, Set<File>> getArtifactsByConfiguration();
+
+ /**
+ * Java source compatibility for the module. It may be {@code null}.
+ *
+ * @return the Java source compatibility for the module, or {@code null} if none was found.
+ */
+ @Nullable
+ String getJavaSourceCompatibility();
}
diff --git a/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/builder/ModuleExtendedModelBuilderImpl.java b/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/builder/ModuleExtendedModelBuilderImpl.java
index 06dc8aa..f440e03 100644
--- a/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/builder/ModuleExtendedModelBuilderImpl.java
+++ b/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/builder/ModuleExtendedModelBuilderImpl.java
@@ -23,6 +23,7 @@
import org.gradle.api.tasks.SourceSetContainer;
import org.gradle.api.tasks.SourceSetOutput;
import org.gradle.api.tasks.bundling.Jar;
+import org.gradle.api.tasks.compile.JavaCompile;
import org.gradle.api.tasks.testing.Test;
import org.gradle.plugins.ide.idea.IdeaPlugin;
import org.gradle.plugins.ide.idea.model.IdeaModel;
@@ -65,7 +66,17 @@
final String moduleVersion = project.getVersion().toString();
final File buildDir = project.getBuildDir();
- final ModuleExtendedModelImpl moduleVersionModel = new ModuleExtendedModelImpl(moduleName, moduleGroup, moduleVersion, buildDir);
+ String javaSourceCompatibility = null;
+ for (Task task : project.getTasks()) {
+ if (task instanceof JavaCompile) {
+ JavaCompile javaCompile = (JavaCompile)task;
+ javaSourceCompatibility = javaCompile.getSourceCompatibility();
+ if(task.getName().equals("compileJava")) break;
+ }
+ }
+
+ final ModuleExtendedModelImpl moduleVersionModel =
+ new ModuleExtendedModelImpl(moduleName, moduleGroup, moduleVersion, buildDir, javaSourceCompatibility);
final List<File> artifacts = new ArrayList<File>();
for (Task task : project.getTasks()) {
diff --git a/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/internal/ModuleExtendedModelImpl.java b/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/internal/ModuleExtendedModelImpl.java
index 7f2e9c6..71e4c88 100644
--- a/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/internal/ModuleExtendedModelImpl.java
+++ b/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/internal/ModuleExtendedModelImpl.java
@@ -17,6 +17,7 @@
import org.gradle.tooling.model.DomainObjectSet;
import org.gradle.tooling.model.internal.ImmutableDomainObjectSet;
+import org.jetbrains.annotations.Nullable;
import org.jetbrains.plugins.gradle.model.ExtIdeaCompilerOutput;
import org.jetbrains.plugins.gradle.model.ExtIdeaContentRoot;
import org.jetbrains.plugins.gradle.model.ModuleExtendedModel;
@@ -36,16 +37,18 @@
private final String myGroup;
private final String myVersion;
private final File myBuildDir;
+ private final String myJavaSourceCompatibility;
private List<File> myArtifacts;
private Set<ExtIdeaContentRoot> myContentRoots;
private ExtIdeaCompilerOutput myCompilerOutput;
private Map<String, Set<File>> myArtifactsByConfiguration;
- public ModuleExtendedModelImpl(String name, String group, String version, File buildDir) {
+ public ModuleExtendedModelImpl(String name, String group, String version, File buildDir, String javaSourceCompatibility) {
myName = name;
myGroup = group;
myVersion = version;
myBuildDir = buildDir;
+ myJavaSourceCompatibility = javaSourceCompatibility;
myArtifacts = Collections.emptyList();
myContentRoots = Collections.emptySet();
}
@@ -105,4 +108,10 @@
public Map<String, Set<File>> getArtifactsByConfiguration() {
return myArtifactsByConfiguration == null ? Collections.<String, Set<File>>emptyMap() : myArtifactsByConfiguration;
}
+
+ @Nullable
+ @Override
+ public String getJavaSourceCompatibility() {
+ return myJavaSourceCompatibility;
+ }
}
diff --git a/plugins/gradle/tooling-extension-impl/testData/testJavaExtendedModel/build.gradle b/plugins/gradle/tooling-extension-impl/testData/testJavaExtendedModel/build.gradle
new file mode 100644
index 0000000..4cffe4f
--- /dev/null
+++ b/plugins/gradle/tooling-extension-impl/testData/testJavaExtendedModel/build.gradle
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//noinspection GrPackage
+
+project("defaultJavaModule") {
+ apply plugin: "java"
+}
+
+project("javaModule") {
+ apply plugin: "java"
+
+ compileJava {
+ sourceCompatibility '1.6'
+ }
+
+ compileTestJava {
+ sourceCompatibility '1.7'
+ }
+
+ task myCompileJava(type: JavaCompile) {
+ sourceCompatibility '1.8'
+ }
+}
+
+
+
+
diff --git a/plugins/gradle/tooling-extension-impl/testData/testJavaExtendedModel/settings.gradle b/plugins/gradle/tooling-extension-impl/testData/testJavaExtendedModel/settings.gradle
new file mode 100644
index 0000000..699411b
--- /dev/null
+++ b/plugins/gradle/tooling-extension-impl/testData/testJavaExtendedModel/settings.gradle
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//noinspection GrPackage
+
+include 'defaultJavaModule'
+include 'javaModule'
\ No newline at end of file
diff --git a/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/ModuleExtendedModelBuilderImplTest.java b/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/ModuleExtendedModelBuilderImplTest.java
index c8e604c..75dea49 100644
--- a/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/ModuleExtendedModelBuilderImplTest.java
+++ b/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/ModuleExtendedModelBuilderImplTest.java
@@ -28,10 +28,7 @@
import org.junit.Test;
import java.io.File;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
import static org.junit.Assert.*;
@@ -141,6 +138,24 @@
assertEquals(modulesSize, models.size());
}
+ @Test
+ public void testJavaExtendedModel() throws Exception {
+ final Map<String, ModuleExtendedModel> modulesMap = getModulesMap(ModuleExtendedModel.class);
+ assertEquals(3, modulesMap.size());
+
+ final ModuleExtendedModel rootModule = modulesMap.get(":");
+ assertNotNull(rootModule);
+ assertNull(rootModule.getJavaSourceCompatibility());
+
+ final ModuleExtendedModel defaultJavaModule = modulesMap.get(":defaultJavaModule");
+ assertNotNull(defaultJavaModule);
+ assertNotNull(defaultJavaModule.getJavaSourceCompatibility());
+
+ final ModuleExtendedModel javaModule = modulesMap.get(":javaModule");
+ assertNotNull(javaModule);
+ assertEquals("1.6", javaModule.getJavaSourceCompatibility());
+ }
+
private void fillDirectories(final ModuleExtendedModel model,
List<String> sourceDirectories, List<String> resourceDirectories,
List<String> testDirectories, List<String> resourceTestDirectories,
diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/annotator/GrReferenceHighlighterFactory.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/annotator/GrReferenceHighlighterFactory.java
index ad10112..f6dc6f2 100644
--- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/annotator/GrReferenceHighlighterFactory.java
+++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/annotator/GrReferenceHighlighterFactory.java
@@ -23,6 +23,8 @@
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiFile;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.plugins.groovy.extensions.GroovyScriptTypeDetector;
+import org.jetbrains.plugins.groovy.lang.psi.GroovyFile;
import org.jetbrains.plugins.groovy.lang.psi.GroovyFileBase;
import org.jetbrains.plugins.groovy.util.GrFileIndexUtil;
@@ -37,7 +39,20 @@
@Override
public TextEditorHighlightingPass createHighlightingPass(@NotNull PsiFile file, @NotNull Editor editor) {
- if (!GrFileIndexUtil.isGroovySourceFile(file)) return null;
+ if (!isSpecificScriptFile(file) && !GrFileIndexUtil.isGroovySourceFile(file)) return null;
return new GrReferenceHighlighter(editor.getDocument(), (GroovyFileBase)file);
}
+
+ private static boolean isSpecificScriptFile(@NotNull PsiFile file) {
+ if (!(file instanceof GroovyFile)) return false;
+ if (!((GroovyFile)file).isScript()) return false;
+
+ for (GroovyScriptTypeDetector detector : GroovyScriptTypeDetector.EP_NAME.getExtensions()) {
+ if (detector.isSpecificScriptFile((GroovyFile)file)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
}
diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/parser/GroovyParserDefinition.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/parser/GroovyParserDefinition.java
index dc152b0..f03a650 100644
--- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/parser/GroovyParserDefinition.java
+++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/parser/GroovyParserDefinition.java
@@ -26,10 +26,12 @@
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.TokenType;
+import com.intellij.psi.impl.source.tree.TreeUtil;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.tree.IFileElementType;
import com.intellij.psi.tree.IStubFileElementType;
import com.intellij.psi.tree.TokenSet;
+import com.intellij.util.ArrayUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.groovy.GroovyLanguage;
import org.jetbrains.plugins.groovy.lang.groovydoc.lexer.GroovyDocTokenTypes;
@@ -39,11 +41,16 @@
import org.jetbrains.plugins.groovy.lang.psi.impl.GroovyFileImpl;
import org.jetbrains.plugins.groovy.lang.psi.stubs.elements.GrStubFileElementType;
+import static org.jetbrains.plugins.groovy.lang.parser.GroovyElementTypes.*;
+
/**
* @author ilyas
*/
public class GroovyParserDefinition implements ParserDefinition {
public static final IStubFileElementType GROOVY_FILE = new GrStubFileElementType(GroovyLanguage.INSTANCE);
+ private static final IElementType[] STRINGS = new IElementType[]{
+ GSTRING, REGEX, GSTRING_INJECTION, GroovyTokenTypes.mREGEX_LITERAL, GroovyTokenTypes.mDOLLAR_SLASH_REGEX_LITERAL
+ };
@Override
@NotNull
@@ -98,24 +105,20 @@
if (rType == GroovyTokenTypes.kIMPORT && lType != TokenType.WHITE_SPACE) {
return SpaceRequirements.MUST_LINE_BREAK;
}
- else if (lType == GroovyElementTypes.MODIFIERS && rType == GroovyElementTypes.MODIFIERS) {
+ else if (lType == MODIFIERS && rType == MODIFIERS) {
return SpaceRequirements.MUST;
}
if (lType == GroovyTokenTypes.mSEMI || lType == GroovyTokenTypes.mSL_COMMENT) {
return SpaceRequirements.MUST_LINE_BREAK;
- }
+ }
if (lType == GroovyTokenTypes.mNLS || lType == GroovyDocTokenTypes.mGDOC_COMMENT_START) {
return SpaceRequirements.MAY;
}
if (lType == GroovyTokenTypes.mGT) return SpaceRequirements.MUST;
if (rType == GroovyTokenTypes.mLT) return SpaceRequirements.MUST;
- final IElementType parentType = left.getTreeParent().getElementType();
- if (parentType == GroovyElementTypes.GSTRING ||
- parentType == GroovyElementTypes.REGEX ||
- parentType == GroovyElementTypes.GSTRING_INJECTION ||
- parentType == GroovyTokenTypes.mREGEX_LITERAL ||
- parentType == GroovyTokenTypes.mDOLLAR_SLASH_REGEX_LITERAL) {
+ final ASTNode parent = TreeUtil.findCommonParent(left, right);
+ if (parent == null || ArrayUtil.contains(parent.getElementType(), STRINGS)) {
return SpaceRequirements.MUST_NOT;
}
diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/patterns/GroovyElementPattern.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/patterns/GroovyElementPattern.java
index 6fcc743..999261f 100644
--- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/patterns/GroovyElementPattern.java
+++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/patterns/GroovyElementPattern.java
@@ -19,6 +19,7 @@
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiMethod;
import com.intellij.util.ProcessingContext;
+import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.groovy.lang.lexer.GroovyTokenTypes;
import org.jetbrains.plugins.groovy.lang.psi.GrReferenceElement;
@@ -38,6 +39,8 @@
@Override
public Self methodCallParameter(final int index, final ElementPattern<? extends PsiMethod> methodPattern) {
+ final PsiNamePatternCondition nameCondition = ContainerUtil.findInstance(methodPattern.getCondition().getConditions(), PsiNamePatternCondition.class);
+
return with(new PatternCondition<T>("methodCallParameter") {
@Override
public boolean accepts(@NotNull final T literal, final ProcessingContext context) {
@@ -59,15 +62,6 @@
if (expression instanceof GrReferenceElement) {
final GrReferenceElement ref = (GrReferenceElement)expression;
- PsiNamePatternCondition nameCondition = null;
-
- for (PatternCondition<?> condition : methodPattern.getCondition().getConditions()) {
- if (condition instanceof PsiNamePatternCondition) {
- nameCondition = (PsiNamePatternCondition)condition;
- break;
- }
- }
-
if (nameCondition != null && "withName".equals(nameCondition.getDebugMethodName())) {
final String methodName = ref.getReferenceName();
//noinspection unchecked
diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/introduceParameter/GrIntroduceParameterTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/introduceParameter/GrIntroduceParameterTest.groovy
index 550c5a1..0974fda 100644
--- a/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/introduceParameter/GrIntroduceParameterTest.groovy
+++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/introduceParameter/GrIntroduceParameterTest.groovy
@@ -390,4 +390,18 @@
foo(5)
''')
}
+
+ void testIntroduceFromInjection() {
+ doTest(IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_NONE, false, false, null, false ,'''\
+def foo() {
+ def bar = "bar"
+ println "$<selection>bar</selection>"
+}
+''', '''\
+def foo(String anObject) {
+ def bar = "bar"
+ println "${anObject}"
+}
+''')
+ }
}
diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryImpl.java b/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryImpl.java
index 94860b9..47a2a76 100644
--- a/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryImpl.java
+++ b/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryImpl.java
@@ -18,6 +18,7 @@
import com.intellij.dvcs.repo.RepositoryImpl;
import com.intellij.openapi.Disposable;
+import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Disposer;
@@ -196,7 +197,7 @@
HgRepoInfo currentInfo = readRepoInfo();
// update only if something changed!!! if update every time - new log will be refreshed every time, too.
// Then blinking and do not work properly;
- Project project = getProject();
+ final Project project = getProject();
if (!project.isDisposed() && !currentInfo.equals(myInfo)) {
myInfo = currentInfo;
HgCommandResult branchCommandResult = new HgBranchesCommand(project, getRoot()).collectBranches();
@@ -207,9 +208,14 @@
else {
myOpenedBranches = HgBranchesCommand.collectNames(branchCommandResult);
}
- if (!project.isDisposed()) {
- project.getMessageBus().syncPublisher(HgVcs.STATUS_TOPIC).update(project, getRoot());
- }
+
+ ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
+ public void run() {
+ if (!project.isDisposed()) {
+ project.getMessageBus().syncPublisher(HgVcs.STATUS_TOPIC).update(project, getRoot());
+ }
+ }
+ });
}
}
diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/status/ui/HgStatusWidget.java b/plugins/hg4idea/src/org/zmlx/hg4idea/status/ui/HgStatusWidget.java
index 4c86105..e323fb3 100644
--- a/plugins/hg4idea/src/org/zmlx/hg4idea/status/ui/HgStatusWidget.java
+++ b/plugins/hg4idea/src/org/zmlx/hg4idea/status/ui/HgStatusWidget.java
@@ -136,6 +136,10 @@
@Override
public void update(final Project project, @Nullable VirtualFile root) {
+ updateLater();
+ }
+
+ private void updateLater() {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
@@ -173,6 +177,7 @@
busConnection.subscribe(HgVcs.STATUS_TOPIC, this);
DvcsUtil.installStatusBarWidget(myProject, this);
+ updateLater();
}
public void deactivate() {
diff --git a/plugins/maven/maven-server-api/src/org/jetbrains/idea/maven/server/MavenServerEmbedder.java b/plugins/maven/maven-server-api/src/org/jetbrains/idea/maven/server/MavenServerEmbedder.java
index 6b3db15..ab8e310 100644
--- a/plugins/maven/maven-server-api/src/org/jetbrains/idea/maven/server/MavenServerEmbedder.java
+++ b/plugins/maven/maven-server-api/src/org/jetbrains/idea/maven/server/MavenServerEmbedder.java
@@ -26,6 +26,8 @@
import java.util.List;
public interface MavenServerEmbedder extends Remote {
+ String MAVEN_EMBEDDER_VERSION = "idea.maven.embedder.version";
+
void customize(@Nullable MavenWorkspaceMap workspaceMap,
boolean failOnUnresolvedDependency,
@NotNull MavenServerConsole console,
diff --git a/plugins/maven/maven3-server-common/src/org/jetbrains/idea/maven/server/Maven3ServerEmbedder.java b/plugins/maven/maven3-server-common/src/org/jetbrains/idea/maven/server/Maven3ServerEmbedder.java
index c483c25..2a1e7be 100644
--- a/plugins/maven/maven3-server-common/src/org/jetbrains/idea/maven/server/Maven3ServerEmbedder.java
+++ b/plugins/maven/maven3-server-common/src/org/jetbrains/idea/maven/server/Maven3ServerEmbedder.java
@@ -19,6 +19,7 @@
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.maven.execution.MavenExecutionRequest;
+import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.rmi.RemoteException;
@@ -32,11 +33,17 @@
public abstract class Maven3ServerEmbedder extends MavenRemoteObject implements MavenServerEmbedder {
public final static boolean USE_MVN2_COMPATIBLE_DEPENDENCY_RESOLVING = System.getProperty("idea.maven3.use.compat.resolver") != null;
+ private final static String MAVEN_VERSION = System.getProperty(MAVEN_EMBEDDER_VERSION);
public Maven3ServerEmbedder(MavenServerSettings settings) {
initLog4J(settings);
}
+ @Nullable
+ public String getMavenVersion() {
+ return MAVEN_VERSION;
+ }
+
@SuppressWarnings({"unchecked"})
public abstract <T> T getComponent(Class<T> clazz, String roleHint);
diff --git a/plugins/maven/maven30-server-impl/src/org/jetbrains/idea/maven/server/Maven30ServerEmbedderImpl.java b/plugins/maven/maven30-server-impl/src/org/jetbrains/idea/maven/server/Maven30ServerEmbedderImpl.java
index 6921383..91d2abc 100644
--- a/plugins/maven/maven30-server-impl/src/org/jetbrains/idea/maven/server/Maven30ServerEmbedderImpl.java
+++ b/plugins/maven/maven30-server-impl/src/org/jetbrains/idea/maven/server/Maven30ServerEmbedderImpl.java
@@ -72,11 +72,7 @@
import org.jetbrains.idea.maven.server.embedder.MavenExecutionResult;
import org.sonatype.aether.RepositorySystemSession;
import org.sonatype.aether.graph.Dependency;
-import org.sonatype.aether.impl.internal.DefaultArtifactResolver;
-import org.sonatype.aether.impl.internal.DefaultRepositorySystem;
import org.sonatype.aether.repository.LocalRepositoryManager;
-import org.sonatype.aether.resolution.ArtifactRequest;
-import org.sonatype.aether.resolution.ArtifactResult;
import org.sonatype.aether.util.DefaultRepositorySystemSession;
import org.sonatype.aether.util.graph.PreorderNodeListGenerator;
@@ -874,54 +870,20 @@
}
private Artifact resolve(@NotNull final Artifact artifact, @NotNull final List<ArtifactRepository> repos)
- throws
- ArtifactResolutionException,
- ArtifactNotFoundException,
- RemoteException,
- org.sonatype.aether.resolution.ArtifactResolutionException {
+ throws ArtifactResolutionException, ArtifactNotFoundException {
- if (USE_MVN2_COMPATIBLE_DEPENDENCY_RESOLVING) {
- MavenExecutionRequest request = new DefaultMavenExecutionRequest();
- request.setRemoteRepositories(repos);
- try {
- getComponent(MavenExecutionRequestPopulator.class).populateFromSettings(request, myMavenSettings);
- getComponent(MavenExecutionRequestPopulator.class).populateDefaults(request);
- }
- catch (MavenExecutionRequestPopulationException e) {
- throw new RuntimeException(e);
- }
-
- getComponent(ArtifactResolver.class).resolve(artifact, request.getRemoteRepositories(), myLocalRepository);
- return artifact;
+ MavenExecutionRequest request = new DefaultMavenExecutionRequest();
+ request.setRemoteRepositories(repos);
+ try {
+ getComponent(MavenExecutionRequestPopulator.class).populateFromSettings(request, myMavenSettings);
+ getComponent(MavenExecutionRequestPopulator.class).populateDefaults(request);
}
- else {
- final MavenExecutionRequest request =
- createRequest(null, Collections.<String>emptyList(), Collections.<String>emptyList(), Collections.<String>emptyList());
- for (ArtifactRepository artifactRepository : repos) {
- request.addRemoteRepository(artifactRepository);
- }
-
- DefaultMaven maven = (DefaultMaven)getComponent(Maven.class);
- RepositorySystemSession repositorySystemSession = maven.newRepositorySession(request);
-
- final org.sonatype.aether.impl.ArtifactResolver artifactResolver = getComponent(org.sonatype.aether.impl.ArtifactResolver.class);
- final org.sonatype.aether.spi.log.Logger logger = new MyLogger();
-
- if (artifactResolver instanceof DefaultArtifactResolver) {
- ((DefaultArtifactResolver)artifactResolver).setLogger(logger);
- }
-
- final org.sonatype.aether.RepositorySystem repositorySystem = getComponent(org.sonatype.aether.RepositorySystem.class);
- if (repositorySystem instanceof DefaultRepositorySystem) {
- ((DefaultRepositorySystem)repositorySystem).setLogger(logger);
- }
-
- final ArtifactResult artifactResult = repositorySystem.resolveArtifact(
- repositorySystemSession, new ArtifactRequest(RepositoryUtils.toArtifact(artifact),
- RepositoryUtils.toRepos(request.getRemoteRepositories()), null));
-
- return RepositoryUtils.toArtifact(artifactResult.getArtifact());
+ catch (MavenExecutionRequestPopulationException e) {
+ throw new RuntimeException(e);
}
+
+ getComponent(ArtifactResolver.class).resolve(artifact, request.getRemoteRepositories(), myLocalRepository);
+ return artifact;
}
private List<ArtifactRepository> convertRepositories(List<MavenRemoteRepository> repositories) throws RemoteException {
diff --git a/plugins/maven/maven32-server-impl/src/org/jetbrains/idea/maven/server/Maven32ServerEmbedderImpl.java b/plugins/maven/maven32-server-impl/src/org/jetbrains/idea/maven/server/Maven32ServerEmbedderImpl.java
index 3693527..484e838 100644
--- a/plugins/maven/maven32-server-impl/src/org/jetbrains/idea/maven/server/Maven32ServerEmbedderImpl.java
+++ b/plugins/maven/maven32-server-impl/src/org/jetbrains/idea/maven/server/Maven32ServerEmbedderImpl.java
@@ -17,6 +17,7 @@
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.ReflectionUtil;
import com.intellij.util.SystemProperties;
import gnu.trove.THashMap;
@@ -905,7 +906,10 @@
RemoteException,
org.eclipse.aether.resolution.ArtifactResolutionException {
- if (USE_MVN2_COMPATIBLE_DEPENDENCY_RESOLVING) {
+ final String mavenVersion = getMavenVersion();
+ // org.eclipse.aether.RepositorySystem.newResolutionRepositories() method doesn't exist in aether-api-0.9.0.M2.jar used before maven 3.2.5
+ // see https://youtrack.jetbrains.com/issue/IDEA-140208 for details
+ if (USE_MVN2_COMPATIBLE_DEPENDENCY_RESOLVING || StringUtil.compareVersionNumbers(mavenVersion, "3.2.5") < 0) {
MavenExecutionRequest request = new DefaultMavenExecutionRequest();
request.setRemoteRepositories(repos);
try {
diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/server/MavenServerManager.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/server/MavenServerManager.java
index f418f77..db84f73 100644
--- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/server/MavenServerManager.java
+++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/server/MavenServerManager.java
@@ -288,6 +288,7 @@
}
final String currentMavenVersion = forceMaven2 ? "2.2.1" : getCurrentMavenVersion();
+ params.getVMParametersList().addProperty(MavenServerEmbedder.MAVEN_EMBEDDER_VERSION, currentMavenVersion);
String version = JdkUtil.getJdkMainAttribute(jdk, Attributes.Name.IMPLEMENTATION_VERSION);
if (StringUtil.compareVersionNumbers(currentMavenVersion, "3.3.1") >= 0
&& StringUtil.compareVersionNumbers(version, "1.7") < 0) {
diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/execution/MavenClasspathsAndSearchScopesTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/execution/MavenClasspathsAndSearchScopesTest.java
index 75b6e83..974afc8 100644
--- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/execution/MavenClasspathsAndSearchScopesTest.java
+++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/execution/MavenClasspathsAndSearchScopesTest.java
@@ -21,11 +21,9 @@
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.module.impl.scopes.LibraryRuntimeClasspathScope;
import com.intellij.openapi.module.impl.scopes.ModuleWithDependenciesScope;
-import com.intellij.openapi.roots.CompilerModuleExtension;
-import com.intellij.openapi.roots.ModuleRootModificationUtil;
-import com.intellij.openapi.roots.OrderEnumerator;
-import com.intellij.openapi.roots.ProjectRootManager;
+import com.intellij.openapi.roots.*;
import com.intellij.openapi.roots.impl.LibraryScopeCache;
+import com.intellij.openapi.roots.libraries.LibraryTablesRegistrar;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.LocalFileSystem;
@@ -34,6 +32,7 @@
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.testFramework.PsiTestUtil;
+import com.intellij.util.ArrayUtil;
import com.intellij.util.PathsList;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.maven.MavenImportingTestCase;
@@ -158,6 +157,44 @@
getProjectPath() + "/m4/target/classes");
}
+ public void testDoNotIncludeTargetDirectoriesOfModuleDependenciesToLibraryClassesRoots() throws Exception {
+ VirtualFile m = createModulePom("m", "<groupId>test</groupId>" +
+ "<artifactId>m</artifactId>" +
+ "<version>1</version>" +
+ "<dependencies>" +
+ " <dependency>" +
+ " <groupId>test</groupId>" +
+ " <artifactId>dep</artifactId>" +
+ " <version>1</version>" +
+ " </dependency>" +
+ "</dependencies>");
+
+ VirtualFile dep = createModulePom("dep", "<groupId>test</groupId>" +
+ "<artifactId>dep</artifactId>" +
+ "<version>1</version>" +
+ "<dependencies>" +
+ " <dependency>" +
+ " <groupId>junit</groupId>" +
+ " <artifactId>junit</artifactId>" +
+ " <version>4.0</version>" +
+ " </dependency>" +
+ "</dependencies>");
+
+ importProjects(m, dep);
+ assertModules("m", "dep");
+
+ assertModuleModuleDeps("m", "dep");
+
+ setupJdkForModules("m", "dep");
+
+ createOutputDirectories();
+ Module module = getModule("m");
+ VirtualFile[] jdkRoots = ModuleRootManager.getInstance(module).getSdk().getRootProvider().getFiles(OrderRootType.CLASSES);
+ VirtualFile[] junitRoots = LibraryTablesRegistrar.getInstance().getLibraryTable(myProject).getLibraryByName("Maven: junit:junit:4.0")
+ .getFiles(OrderRootType.CLASSES);
+ assertOrderedEquals(OrderEnumerator.orderEntries(module).getAllLibrariesAndSdkClassesRoots(), ArrayUtil.mergeArrays(jdkRoots, junitRoots));
+ }
+
public void testDoNotIncludeTestClassesWhenConfiguringModuleDependenciesForProductionCode() throws Exception {
VirtualFile m1 = createModulePom("m1", "<groupId>test</groupId>" +
"<artifactId>m1</artifactId>" +
diff --git a/plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/JiraRepository.java b/plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/JiraRepository.java
index ec0e612..80b16b7 100644
--- a/plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/JiraRepository.java
+++ b/plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/JiraRepository.java
@@ -365,10 +365,12 @@
@Override
public void setUrl(String url) {
+ // Compare only normalized URLs
+ final String oldUrl = getUrl();
+ super.setUrl(url);
// reset remote API version, only if server URL was changed
- if (!getUrl().equals(url)) {
+ if (!getUrl().equals(oldUrl)) {
myApiVersion = null;
- super.setUrl(url);
}
}
diff --git a/plugins/tasks/tasks-core/src/com/intellij/tasks/fogbugz/FogBugzRepository.java b/plugins/tasks/tasks-core/src/com/intellij/tasks/fogbugz/FogBugzRepository.java
index 2d2ce58..0d71999 100644
--- a/plugins/tasks/tasks-core/src/com/intellij/tasks/fogbugz/FogBugzRepository.java
+++ b/plugins/tasks/tasks-core/src/com/intellij/tasks/fogbugz/FogBugzRepository.java
@@ -16,6 +16,8 @@
package com.intellij.tasks.fogbugz;
import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.PasswordUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.tasks.*;
import com.intellij.tasks.impl.BaseRepository;
@@ -24,7 +26,6 @@
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.xmlb.annotations.Tag;
import icons.TasksIcons;
-import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.PostMethod;
import org.jdom.Document;
import org.jdom.Element;
@@ -44,9 +45,9 @@
*/
@Tag("FogBugz")
public class FogBugzRepository extends BaseRepositoryImpl {
-
private static final Logger LOG = Logger.getInstance("#com.intellij.tasks.fogbugz.FogBugzRepository");
- private transient String token;
+
+ private String myToken;
public FogBugzRepository(TaskRepositoryType type) {
super(type);
@@ -55,6 +56,12 @@
private FogBugzRepository(FogBugzRepository other) {
super(other);
+ myToken = other.myToken;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ return super.equals(o) && Comparing.equal(myToken, ((FogBugzRepository)o).myToken);
}
@SuppressWarnings({"UnusedDeclaration"})
@@ -66,21 +73,25 @@
return getCases(StringUtil.notNullize(query));
}
+ @SuppressWarnings("unchecked")
private Task[] getCases(String q) throws Exception {
- HttpClient client = login(getLoginMethod());
+ loginIfNeeded();
PostMethod method = new PostMethod(getUrl() + "/api.asp");
- method.addParameter("token", token);
+ method.addParameter("token", myToken);
method.addParameter("cmd", "search");
method.addParameter("q", q);
method.addParameter("cols", "sTitle,fOpen,dtOpened,dtLastUpdated,ixCategory");
- int status = client.executeMethod(method);
+ int status = getHttpClient().executeMethod(method);
if (status != 200) {
throw new Exception("Error listing cases: " + method.getStatusLine());
}
Document document = new SAXBuilder(false).build(method.getResponseBodyAsStream()).getDocument();
- XPath path = XPath.newInstance("/response/cases/case");
+ List<Element> errorNodes = XPath.newInstance("/response/error").selectNodes(document);
+ if (!errorNodes.isEmpty()) {
+ throw new Exception("Error listing cases: " + errorNodes.get(0).getText());
+ }
final XPath commentPath = XPath.newInstance("events/event");
- @SuppressWarnings("unchecked") final List<Element> nodes = (List<Element>)path.selectNodes(document);
+ final List<Element> nodes = (List<Element>)XPath.newInstance("/response/cases/case").selectNodes(document);
final List<Task> tasks = ContainerUtil.mapNotNull(nodes, new NotNullFunction<Element, Task>() {
@NotNull
@Override
@@ -238,9 +249,15 @@
return new FogBugzRepository(this);
}
- private HttpClient login(PostMethod method) throws Exception {
- HttpClient client = getHttpClient();
- int status = client.executeMethod(method);
+ private void loginIfNeeded() throws Exception {
+ if (StringUtil.isEmpty(myToken)) {
+ login(getLoginMethod());
+ }
+ }
+
+ private void login(@NotNull PostMethod method) throws Exception {
+ LOG.debug("Requesting new token");
+ int status = getHttpClient().executeMethod(method);
if (status != 200) {
throw new Exception("Error logging in: " + method.getStatusLine());
}
@@ -251,10 +268,10 @@
Element error = (Element)XPath.newInstance("/response/error").selectSingleNode(document);
throw new Exception(error == null ? "Error logging in" : error.getText());
}
- token = result.getTextTrim();
- return client;
+ myToken = result.getTextTrim();
}
+ @NotNull
private PostMethod getLoginMethod() {
PostMethod method = new PostMethod(getUrl() + "/api.asp");
method.addParameter("cmd", "logon");
@@ -263,13 +280,37 @@
return method;
}
+ @NotNull
+ private PostMethod getLogoutMethod() throws Exception {
+ PostMethod method = new PostMethod(getUrl() + "/api.asp");
+ method.addParameter("cmd", "logoff");
+ assert myToken != null;
+ method.addParameter("token", myToken);
+ return method;
+ }
+
@Nullable
@Override
public CancellableConnection createCancellableConnection() {
- return new HttpTestConnection<PostMethod>(getLoginMethod()) {
+ return new CancellableConnection() {
+ PostMethod myMethod;
+
@Override
- protected void doTest(PostMethod method) throws Exception {
- login(method);
+ protected void doTest() throws Exception {
+ if (StringUtil.isNotEmpty(myToken)) {
+ myMethod = getLogoutMethod();
+ LOG.debug("Revoking previously used token");
+ getHttpClient().executeMethod(myMethod);
+ }
+ myMethod = getLoginMethod();
+ login(myMethod);
+ }
+
+ @Override
+ public void cancel() {
+ if (myMethod != null) {
+ myMethod.abort();
+ }
}
};
}
@@ -289,4 +330,20 @@
return "{id} (e.g. 2344245), {summary}";
}
+ @Tag("token")
+ @NotNull
+ public String getEncodedToken() {
+ // The same approach as used for passwords in BaseRepository
+ return PasswordUtil.encodePassword(myToken);
+ }
+
+ @SuppressWarnings("unused")
+ public void setEncodedToken(@Nullable String token) {
+ try {
+ myToken = PasswordUtil.decodePassword(token);
+ }
+ catch (NumberFormatException ignored) {
+ }
+ }
+
}
diff --git a/plugins/tasks/tasks-core/src/com/intellij/tasks/trello/TrelloTask.java b/plugins/tasks/tasks-core/src/com/intellij/tasks/trello/TrelloTask.java
index 57a28c0..7f36ddd 100644
--- a/plugins/tasks/tasks-core/src/com/intellij/tasks/trello/TrelloTask.java
+++ b/plugins/tasks/tasks-core/src/com/intellij/tasks/trello/TrelloTask.java
@@ -120,4 +120,10 @@
public TaskRepository getRepository() {
return myRepository;
}
+
+ @NotNull
+ @Override
+ public String getNumber() {
+ return myCard.getIdShort();
+ }
}
diff --git a/plugins/tasks/tasks-core/src/com/intellij/tasks/trello/model/TrelloCard.java b/plugins/tasks/tasks-core/src/com/intellij/tasks/trello/model/TrelloCard.java
index 668ab36..137c82a 100644
--- a/plugins/tasks/tasks-core/src/com/intellij/tasks/trello/model/TrelloCard.java
+++ b/plugins/tasks/tasks-core/src/com/intellij/tasks/trello/model/TrelloCard.java
@@ -36,9 +36,9 @@
@SuppressWarnings("UnusedDeclaration")
public class TrelloCard extends TrelloModel {
- public static final String REQUIRED_FIELDS = "closed,desc,idMembers,idBoard,idList,labels,name,url,dateLastActivity";
+ public static final String REQUIRED_FIELDS = "closed,desc,idMembers,idBoard,idList,idShort,labels,name,url,dateLastActivity";
- private String idBoard, idList;
+ private String idBoard, idList, idShort;
private List<String> idMembers;
private String name;
@SerializedName("desc")
@@ -78,6 +78,11 @@
}
@NotNull
+ public String getIdShort() {
+ return idShort;
+ }
+
+ @NotNull
public List<String> getIdMembers() {
return idMembers;
}
diff --git a/plugins/tasks/tasks-tests/test/com/intellij/tasks/integration/live/TrelloIntegrationTest.java b/plugins/tasks/tasks-tests/test/com/intellij/tasks/integration/live/TrelloIntegrationTest.java
index d9150d3..8ad9d30 100644
--- a/plugins/tasks/tasks-tests/test/com/intellij/tasks/integration/live/TrelloIntegrationTest.java
+++ b/plugins/tasks/tasks-tests/test/com/intellij/tasks/integration/live/TrelloIntegrationTest.java
@@ -33,6 +33,7 @@
private static final String CARD_1_1_1_NAME = "Card 1-1-1";
private static final String CARD_1_1_1_ID = "53c416d8b4bd36fb078446e5";
+ private static final String CARD_1_1_1_NUMBER = "1";
// Labels and colors
private static final String LABELS_AND_COLORS_BOARD_NAME = "Labels and Colors";
@@ -217,6 +218,14 @@
assertEquals(BACKLOG_LIST_ID, card.getIdList());
}
+ // IDEA-139903
+ public void testCardBoardLocalNumber() throws Exception {
+ final TrelloCard card = myRepository.fetchCardById(CARD_1_1_1_ID);
+ assertNotNull(card);
+ assertEquals(CARD_1_1_1_ID, card.getId());
+ assertEquals(CARD_1_1_1_NUMBER, new TrelloTask(card, myRepository).getNumber());
+ }
+
static void assertObjectsNamed(@NotNull String message, @NotNull Collection<? extends TrelloModel> objects, @NotNull String... names) {
assertEquals(message, ContainerUtil.newHashSet(names), ContainerUtil.map2Set(objects, new Function<TrelloModel, String>() {
@Override
diff --git a/python/build/paths.nsi b/python/build/paths.nsi
index 6baf096..3f8b0a4 100644
--- a/python/build/paths.nsi
+++ b/python/build/paths.nsi
@@ -1,6 +1,6 @@
; Installer images
-!define IMAGES_LOCATION ${COMMUNITY_DIR}\python\build\resources
-;!define LICENSE_FILE ${BASE_DIR}\python\license\PyCharm_Preview_License
-!define PRODUCT_PROPERTIES_FILE ${BASE_DIR}\out\pycharmCE\layout\bin\idea.properties
+!define IMAGES_LOCATION "${COMMUNITY_DIR}\python\build\resources"
+;!define LICENSE_FILE "${BASE_DIR}\python\license\PyCharm_Preview_License"
+!define PRODUCT_PROPERTIES_FILE "${BASE_DIR}\out\pycharmCE\layout\bin\idea.properties"
!define PRODUCT_VM_OPTIONS_NAME pycharm*.exe.vmoptions
-!define PRODUCT_VM_OPTIONS_FILE ${BASE_DIR}\out\pycharmCE\win\bin\${PRODUCT_VM_OPTIONS_NAME}
+!define PRODUCT_VM_OPTIONS_FILE "${BASE_DIR}\out\pycharmCE\win\bin\${PRODUCT_VM_OPTIONS_NAME}"
diff --git a/python/build/python_plugin_build.gant b/python/build/python_plugin_build.gant
index 94aa1e2..ffcd69f 100644
--- a/python/build/python_plugin_build.gant
+++ b/python/build/python_plugin_build.gant
@@ -176,8 +176,8 @@
ant.loadfile(property: "appInfo", srcFile: "${pluginHome}/resources/idea/PyCharmCoreApplicationInfo.xml") {
}
- major = ("${appInfo}" =~ /major\s*=\s*\"([^"])\"/)[0][1]
- minor = ("${appInfo}" =~ /minor\s*=\s*\"([^"])\"/)[0][1]
+ major = ("${appInfo}" =~ /major\s*=\s*\"([^"]*)\"/)[0][1]
+ minor = ("${appInfo}" =~ /minor\s*=\s*\"([^"]*)\"/)[0][1]
ant.replaceregexp(file: "${classesDir}/META-INF/plugin.xml",
diff --git a/python/build/resources/logo.bmp b/python/build/resources/logo.bmp
index 64ce813..5a5b9a0 100644
--- a/python/build/resources/logo.bmp
+++ b/python/build/resources/logo.bmp
Binary files differ
diff --git a/python/edu/build/paths.nsi b/python/edu/build/paths.nsi
index d854929..a75d47c 100644
--- a/python/edu/build/paths.nsi
+++ b/python/edu/build/paths.nsi
@@ -1,6 +1,6 @@
; Installer images
-!define IMAGES_LOCATION ${COMMUNITY_DIR}\python\edu\build\resources
-;!define LICENSE_FILE ${BASE_DIR}\python\license\PyCharm_Preview_License
-!define PRODUCT_PROPERTIES_FILE ${BASE_DIR}\out\pycharmEDU\layout\bin\idea.properties
+!define IMAGES_LOCATION "${COMMUNITY_DIR}\python\edu\build\resources"
+;!define LICENSE_FILE "${BASE_DIR}\python\license\PyCharm_Preview_License"
+!define PRODUCT_PROPERTIES_FILE "${BASE_DIR}\out\pycharmEDU\layout\bin\idea.properties"
!define PRODUCT_VM_OPTIONS_NAME pycharm.exe.vmoptions
-!define PRODUCT_VM_OPTIONS_FILE ${BASE_DIR}\out\pycharmEDU\win\bin\${PRODUCT_VM_OPTIONS_NAME}
+!define PRODUCT_VM_OPTIONS_FILE "${BASE_DIR}\out\pycharmEDU\win\bin\${PRODUCT_VM_OPTIONS_NAME}"
diff --git a/python/helpers/profiler/load_pstat.py b/python/helpers/profiler/load_pstat.py
index 24f68b6..53e9556 100644
--- a/python/helpers/profiler/load_pstat.py
+++ b/python/helpers/profiler/load_pstat.py
@@ -1,10 +1,11 @@
import sys
import pstats
+from prof_util import statsToResponse
from _prof_imports import TSerialization
from _prof_imports import TJSONProtocol
-from _prof_imports import ProfilerResponse, Stats, FuncStat, Function
+from _prof_imports import ProfilerResponse
from _prof_imports import IS_PY3K
@@ -14,42 +15,9 @@
stats = pstats.Stats(file_name)
- m = ProfilerResponse()
- m.id = 0
- ystats = Stats()
- ystats.func_stats = []
- m.ystats = ystats
+ m = ProfilerResponse(id=0)
- for func, stat in stats.stats.items():
- path, line, func_name = func
- cc, nc, tt, ct, callers = stat
- func = Function()
- func_stat = FuncStat()
- func.func_stat = func_stat
- ystats.func_stats.append(func)
-
- func_stat.file = path
- func_stat.line = line
- func_stat.func_name = func_name
- func_stat.calls_count = nc
- func_stat.total_time = ct
- func_stat.own_time = tt
-
- func.callers = []
- for f, s in callers.items():
- caller_stat = FuncStat()
- func.callers.append(caller_stat)
- path, line, func_name = f
- cc, nc, tt, ct = s
- caller_stat.file = path
- caller_stat.line = line
- caller_stat.func_name = func_name
- caller_stat.calls_count = cc
- caller_stat.total_time = ct
- caller_stat.own_time = tt
-
-
- m.validate()
+ statsToResponse(stats.stats, m)
data = TSerialization.serialize(m, TJSONProtocol.TJSONProtocolFactory())
diff --git a/python/helpers/profiler/prof_util.py b/python/helpers/profiler/prof_util.py
index 66e2e21..b4e7143 100644
--- a/python/helpers/profiler/prof_util.py
+++ b/python/helpers/profiler/prof_util.py
@@ -2,6 +2,8 @@
import threading
import os
+import tempfile
+from _prof_imports import Stats, FuncStat, Function
class ProfDaemonThread(threading.Thread):
def __init__(self):
@@ -15,7 +17,12 @@
def OnRun(self):
pass
-def generate_snapshot_filepath(basepath):
+def generate_snapshot_filepath(basepath, local_temp_dir=False):
+ if basepath is None:
+ basepath = 'snapshot'
+ if local_temp_dir:
+ basepath = os.path.join(tempfile.gettempdir(), os.path.basename(basepath.replace('\\', '/')))
+
n = 0
path = basepath + '.pstat'
while os.path.exists(path):
@@ -24,3 +31,39 @@
return path
+def statsToResponse(stats, m):
+ ystats = Stats()
+ ystats.func_stats = []
+ m.ystats = ystats
+
+ for func, stat in stats.items():
+ path, line, func_name = func
+ cc, nc, tt, ct, callers = stat
+ func = Function()
+ func_stat = FuncStat()
+ func.func_stat = func_stat
+ ystats.func_stats.append(func)
+
+ func_stat.file = path
+ func_stat.line = line
+ func_stat.func_name = func_name
+ func_stat.calls_count = nc
+ func_stat.total_time = ct
+ func_stat.own_time = tt
+
+ func.callers = []
+ for f, s in callers.items():
+ caller_stat = FuncStat()
+ func.callers.append(caller_stat)
+ path, line, func_name = f
+ cc, nc, tt, ct = s
+ caller_stat.file = path
+ caller_stat.line = line
+ caller_stat.func_name = func_name
+ caller_stat.calls_count = cc
+ caller_stat.total_time = ct
+ caller_stat.own_time = tt
+
+
+ m.validate()
+
diff --git a/python/helpers/profiler/run_profiler.py b/python/helpers/profiler/run_profiler.py
index 9aa66c9..1b01dea 100644
--- a/python/helpers/profiler/run_profiler.py
+++ b/python/helpers/profiler/run_profiler.py
@@ -9,11 +9,12 @@
from prof_io import ProfWriter, ProfReader
from pydevd_utils import save_main_module
import pydev_imports
-from prof_util import generate_snapshot_filepath
+from prof_util import generate_snapshot_filepath, statsToResponse
from _prof_imports import ProfilerResponse
base_snapshot_path = os.getenv('PYCHARM_SNAPSHOT_PATH')
+remote_run = bool(os.getenv('PYCHARM_REMOTE_RUN', ''))
def StartClient(host, port):
""" connects to a host/port """
@@ -66,7 +67,7 @@
def process(self, message):
if hasattr(message, 'save_snapshot'):
- self.save_snapshot(message.id, generate_snapshot_filepath(message.save_snapshot.filepath))
+ self.save_snapshot(message.id, generate_snapshot_filepath(message.save_snapshot.filepath, remote_run), remote_run)
else:
raise AssertionError("Unknown request %s" % dir(message))
@@ -80,10 +81,11 @@
self.start_profiling()
- pydev_imports.execfile(file, globals, globals) # execute the script
-
- self.stop_profiling()
- self.save_snapshot(0, generate_snapshot_filepath(base_snapshot_path))
+ try:
+ pydev_imports.execfile(file, globals, globals) # execute the script
+ finally:
+ self.stop_profiling()
+ self.save_snapshot(0, generate_snapshot_filepath(base_snapshot_path, remote_run), remote_run)
def start_profiling(self):
self.profiling_backend.enable()
@@ -92,7 +94,8 @@
self.profiling_backend.disable()
def get_snapshot(self):
- return self.profiling_backend.getstats()
+ self.profiling_backend.create_stats()
+ return self.profiling_backend.stats
def dump_snapshot(self, filename):
dir = os.path.dirname(filename)
@@ -102,15 +105,19 @@
self.profiling_backend.dump_stats(filename)
return filename
- def save_snapshot(self, id, filename):
+ def save_snapshot(self, id, filename, send_stat=False):
self.stop_profiling()
- filename = self.dump_snapshot(filename)
+ if filename is not None:
+ filename = self.dump_snapshot(filename)
+ print('Snapshot saved to %s' % filename)
- m = ProfilerResponse(id=id, snapshot_filepath=filename)
+ if not send_stat:
+ response = ProfilerResponse(id=id, snapshot_filepath=filename)
+ else:
+ response = ProfilerResponse(id=id)
+ statsToResponse(self.get_snapshot(), response)
- print('Snapshot saved to %s' % filename)
-
- self.writer.addCommand(m)
+ self.writer.addCommand(response)
self.start_profiling()
@@ -133,4 +140,7 @@
traceback.print_exc()
sys.exit(1)
+ # add file path to sys.path
+ sys.path.insert(0, os.path.split(file)[0])
+
profiler.run(file)
diff --git a/python/helpers/profiler/yappi_profiler.py b/python/helpers/profiler/yappi_profiler.py
index c1024c4..2be2d2f 100644
--- a/python/helpers/profiler/yappi_profiler.py
+++ b/python/helpers/profiler/yappi_profiler.py
@@ -24,8 +24,7 @@
self.stats = yappi.convert2pstats(yappi.get_func_stats()).stats
def getstats(self):
- if self.stats is None:
- self.create_stats()
+ self.create_stats()
return self.stats
diff --git a/python/helpers/pycharm/_bdd_utils.py b/python/helpers/pycharm/_bdd_utils.py
index 4d41161..2bfa1be 100644
--- a/python/helpers/pycharm/_bdd_utils.py
+++ b/python/helpers/pycharm/_bdd_utils.py
@@ -8,9 +8,8 @@
import os
import time
import abc
-import sys
import tcmessages
-
+from utils import VersionAgnosticUtils
__author__ = 'Ilya.Kazakevich'
@@ -226,48 +225,4 @@
"""
Implement it! It should launch tests using your BDD. Use "self._" functions to report results.
"""
- pass
-
-
-class VersionAgnosticUtils(object):
- """
- "six" emulator: this class fabrics appropriate tool to use regardless python version.
- Use it to write code that works both on py2 and py3
- """
-
- @staticmethod
- def __new__(cls, *more):
- """
- Fabrics Py2 or Py3 instance based on py version
- """
- real_class = _Py3KUtils if sys.version_info >= (3, 0) else _Py2Utils
- return super(cls, real_class).__new__(real_class, *more)
-
- def to_unicode(self, obj):
- """
-
- :param obj: string to convert to unicode
- :return: unicode string
- """
-
- raise NotImplementedError()
-
-
-
-class _Py2Utils(VersionAgnosticUtils):
- """
- Util for Py2
- """
- def to_unicode(self, obj):
- if isinstance(obj, unicode):
- return obj
- return unicode(obj.decode("utf-8"))
-
-
-
-class _Py3KUtils(VersionAgnosticUtils):
- """
- Util for Py3
- """
- def to_unicode(self, obj):
- return str(obj)
\ No newline at end of file
+ pass
\ No newline at end of file
diff --git a/python/helpers/pycharm/behave_runner.py b/python/helpers/pycharm/behave_runner.py
index 7072e47..ea656d8 100644
--- a/python/helpers/pycharm/behave_runner.py
+++ b/python/helpers/pycharm/behave_runner.py
@@ -21,7 +21,7 @@
import _bdd_utils
from distutils import version
from behave import __version__ as behave_version
-
+from utils import VersionAgnosticUtils
_MAX_STEPS_SEARCH_FEATURES = 5000 # Do not look for features in folder that has more that this number of children
_FEATURES_FOLDER = 'features' # "features" folder name.
@@ -136,7 +136,7 @@
:param element feature/suite/step
"""
element.location.file = element.location.filename # To preserve _bdd_utils contract
- utils = _bdd_utils.VersionAgnosticUtils()
+ utils = VersionAgnosticUtils()
if isinstance(element, Step):
# Process step
step_name = u"{0} {1}".format(utils.to_unicode(element.keyword), utils.to_unicode(element.name))
diff --git a/python/helpers/pycharm/django_manage_commands_provider/__init__.py b/python/helpers/pycharm/django_manage_commands_provider/__init__.py
new file mode 100644
index 0000000..a5f9f02
--- /dev/null
+++ b/python/helpers/pycharm/django_manage_commands_provider/__init__.py
@@ -0,0 +1 @@
+__author__ = 'Ilya.Kazakevich'
diff --git a/python/helpers/pycharm/django_manage_commands_provider/_parser/_argparse.py b/python/helpers/pycharm/django_manage_commands_provider/_parser/_argparse.py
index b5bceee..0d7f211 100644
--- a/python/helpers/pycharm/django_manage_commands_provider/_parser/_argparse.py
+++ b/python/helpers/pycharm/django_manage_commands_provider/_parser/_argparse.py
@@ -4,7 +4,7 @@
"""
from argparse import Action, _StoreTrueAction, _StoreFalseAction
-from _parser import _utils
+from django_manage_commands_provider._parser import _utils
__author__ = 'Ilya.Kazakevich'
diff --git a/python/helpers/pycharm/django_manage_commands_provider/_parser/_optparse.py b/python/helpers/pycharm/django_manage_commands_provider/_parser/_optparse.py
index 31ffcc5..c05bc8f 100644
--- a/python/helpers/pycharm/django_manage_commands_provider/_parser/_optparse.py
+++ b/python/helpers/pycharm/django_manage_commands_provider/_parser/_optparse.py
@@ -3,7 +3,7 @@
Fetches arguments from optparse-based Django (< 1.8)
"""
__author__ = 'Ilya.Kazakevich'
-from _parser import _utils
+from django_manage_commands_provider._parser import _utils
# noinspection PyUnusedLocal
@@ -20,7 +20,7 @@
:type parser optparse.OptionParser
:type command django.core.management.base.BaseCommand
"""
- dumper.set_arguments(command.args)
+ dumper.set_arguments(str(command.args)) # args should be string, but in some buggy cases it is not
# TODO: support subcommands
for opt in command.option_list:
num_of_args = int(opt.nargs) if opt.nargs else 0
diff --git a/python/helpers/pycharm/django_manage_commands_provider/_parser/parser.py b/python/helpers/pycharm/django_manage_commands_provider/_parser/parser.py
index c11ac39..4eb26f8 100644
--- a/python/helpers/pycharm/django_manage_commands_provider/_parser/parser.py
+++ b/python/helpers/pycharm/django_manage_commands_provider/_parser/parser.py
@@ -6,7 +6,8 @@
from django.core.exceptions import ImproperlyConfigured
from django.core.management import ManagementUtility, get_commands, BaseCommand
-from _parser import _optparse, _argparse
+from django_manage_commands_provider._parser import _optparse, _argparse
+from utils import VersionAgnosticUtils
__author__ = 'Ilya.Kazakevich'
@@ -23,8 +24,8 @@
for command_name in get_commands().keys():
try:
command = utility.fetch_command(command_name)
- except ImproperlyConfigured:
- continue # TODO: Log somehow
+ except Exception:
+ continue # TODO: Log somehow. Probably print to output?
assert isinstance(command, BaseCommand)
@@ -34,7 +35,7 @@
except AttributeError:
pass
dumper.start_command(command_name=command_name,
- command_help_text=str(command.usage("").replace("%prog", command_name)))
+ command_help_text=VersionAgnosticUtils().to_unicode(command.usage("")).replace("%prog", command_name))
module_to_use = _argparse if use_argparse else _optparse # Choose appropriate module: argparse, optparse
module_to_use.process_command(dumper, command, command.create_parser("", command_name))
dumper.close_command()
diff --git a/python/helpers/pycharm/django_manage_commands_provider/_xml.py b/python/helpers/pycharm/django_manage_commands_provider/_xml.py
index c2cebfb..1baba30 100644
--- a/python/helpers/pycharm/django_manage_commands_provider/_xml.py
+++ b/python/helpers/pycharm/django_manage_commands_provider/_xml.py
@@ -24,6 +24,7 @@
"""
from xml.dom import minidom
from xml.dom.minidom import Element
+from utils import VersionAgnosticUtils
__author__ = 'Ilya.Kazakevich'
@@ -91,7 +92,7 @@
:type command_args_text str
"""
assert bool(self.__command_element), "Not in a a command"
- self.__command_element.setAttribute("args", command_args_text)
+ self.__command_element.setAttribute("args", VersionAgnosticUtils().to_unicode(command_args_text))
def add_command_option(self, long_opt_names, short_opt_names, help_text, argument_info):
"""
@@ -152,4 +153,5 @@
:return: current commands as XML as described in package
:rtype str
"""
- return self.__document.toprettyxml()
+ document = self.__document.toxml(encoding="utf-8")
+ return VersionAgnosticUtils().to_unicode(document.decode("utf-8") if isinstance(document, bytes) else document)
diff --git a/python/helpers/pycharm/django_manage_commands_provider/provider.py b/python/helpers/pycharm/manage_tasks_provider.py
similarity index 82%
rename from python/helpers/pycharm/django_manage_commands_provider/provider.py
rename to python/helpers/pycharm/manage_tasks_provider.py
index 8f8d3d8..78b3126 100644
--- a/python/helpers/pycharm/django_manage_commands_provider/provider.py
+++ b/python/helpers/pycharm/manage_tasks_provider.py
@@ -9,8 +9,8 @@
import django
-from _parser import parser
-import _xml
+from django_manage_commands_provider._parser import parser
+from django_manage_commands_provider import _xml
__author__ = 'Ilya.Kazakevich'
diff --git a/python/helpers/pycharm/pytest_teamcity.py b/python/helpers/pycharm/pytest_teamcity.py
index 2eaa15c..8860257 100644
--- a/python/helpers/pycharm/pytest_teamcity.py
+++ b/python/helpers/pycharm/pytest_teamcity.py
@@ -80,6 +80,7 @@
messages.testIgnored(name)
elif report.failed:
messages.testFailed(name, details=report.longrepr)
+ messages.testFinished(name) # We need to mark it finished even if it failed to display it at parent node
elif report.when == "call":
messages.testFinished(name)
diff --git a/python/helpers/pycharm/pytestrunner.py b/python/helpers/pycharm/pytestrunner.py
index 0725e2f..6b2bdd6 100644
--- a/python/helpers/pycharm/pytestrunner.py
+++ b/python/helpers/pycharm/pytestrunner.py
@@ -20,10 +20,13 @@
from _pytest.core import PluginManager
return PluginManager(load=True)
+# "-s" is always required: no test output provided otherwise
+args = sys.argv[1:]
+args.append("-s") if "-s" not in args else None
+
if has_pytest:
_preinit = []
def main():
- args = sys.argv[1:]
_pluginmanager = get_plugin_manager()
hook = _pluginmanager.hook
try:
@@ -38,7 +41,6 @@
else:
def main():
- args = sys.argv[1:]
config = py.test.config
try:
config.parse(args)
diff --git a/python/helpers/pycharm/utils.py b/python/helpers/pycharm/utils.py
new file mode 100644
index 0000000..5bb4322
--- /dev/null
+++ b/python/helpers/pycharm/utils.py
@@ -0,0 +1,45 @@
+__author__ = 'Ilya.Kazakevich'
+import sys
+
+class VersionAgnosticUtils(object):
+ """
+ "six" emulator: this class fabrics appropriate tool to use regardless python version.
+ Use it to write code that works both on py2 and py3. # TODO: Use Six instead
+ """
+
+ @staticmethod
+ def __new__(cls, *more):
+ """
+ Fabrics Py2 or Py3 instance based on py version
+ """
+ real_class = _Py3KUtils if sys.version_info >= (3, 0) else _Py2Utils
+ return super(cls, real_class).__new__(real_class, *more)
+
+ def to_unicode(self, obj):
+ """
+
+ :param obj: string to convert to unicode
+ :return: unicode string
+ """
+
+ raise NotImplementedError()
+
+
+
+class _Py2Utils(VersionAgnosticUtils):
+ """
+ Util for Py2
+ """
+ def to_unicode(self, obj):
+ if isinstance(obj, unicode):
+ return obj
+ return unicode(obj.decode("utf-8"))
+
+
+
+class _Py3KUtils(VersionAgnosticUtils):
+ """
+ Util for Py3
+ """
+ def to_unicode(self, obj):
+ return str(obj)
\ No newline at end of file
diff --git a/python/helpers/pycharm/utrunner.py b/python/helpers/pycharm/utrunner.py
index 3ae5cd2..d0450c2 100644
--- a/python/helpers/pycharm/utrunner.py
+++ b/python/helpers/pycharm/utrunner.py
@@ -1,10 +1,11 @@
import sys
import imp
import os
+import fnmatch
helpers_dir = os.getenv("PYCHARM_HELPERS_DIR", sys.path[0])
if sys.path[0] != helpers_dir:
- sys.path.insert(0, helpers_dir)
+ sys.path.insert(0, helpers_dir)
from tcunittest import TeamcityTestRunner
from nose_helper import TestLoader, ContextSuite
@@ -44,16 +45,19 @@
def walkModules(modulesAndPattern, dirname, names):
modules = modulesAndPattern[0]
pattern = modulesAndPattern[1]
- prog_list = [re.compile(pat.strip()) for pat in pattern.split(',')]
+ # fnmatch converts glob to regexp
+ prog_list = [re.compile(fnmatch.translate(pat.strip())) for pat in pattern.split(',')]
for name in names:
for prog in prog_list:
if name.endswith(".py") and prog.match(name):
modules.append(loadSource(os.path.join(dirname, name)))
-def loadModulesFromFolderRec(folder, pattern = "test.*"):
+# For default pattern see https://docs.python.org/2/library/unittest.html#test-discovery
+def loadModulesFromFolderRec(folder, pattern = "test*.py"):
modules = []
if PYTHON_VERSION_MAJOR == 3:
- prog_list = [re.compile(pat.strip()) for pat in pattern.split(',')]
+ # fnmatch converts glob to regexp
+ prog_list = [re.compile(fnmatch.translate(pat.strip())) for pat in pattern.split(',')]
for root, dirs, files in os.walk(folder):
for name in files:
for prog in prog_list:
@@ -101,7 +105,7 @@
a = arg.split("::")
if len(a) == 1:
# From module or folder
- a_splitted = a[0].split(";")
+ a_splitted = a[0].split("_args_separator_") # ";" can't be used with bash, so we use "_args_separator_"
if len(a_splitted) != 1:
# means we have pattern to match against
if a_splitted[0].endswith(os.path.sep):
@@ -128,7 +132,7 @@
all.addTests(testLoader.loadTestsFromTestCase(getattr(module, a[1])))
else:
all.addTests(testLoader.loadTestsFromTestClass(getattr(module, a[1])),
- getattr(module, a[1]))
+ getattr(module, a[1]))
else:
# From method in class or from function
debug("/ from method " + a[2] + " in testcase " + a[1] + " in " + a[0])
diff --git a/python/helpers/pydev/pydev_run_in_console.py b/python/helpers/pydev/pydev_run_in_console.py
index 4224dd1..9d5ac3b 100644
--- a/python/helpers/pydev/pydev_run_in_console.py
+++ b/python/helpers/pydev/pydev_run_in_console.py
@@ -23,6 +23,7 @@
if locals is None:
locals = globals
+ sys.path.insert(0, os.path.split(file)[0])
print('Running %s'%file)
pydev_imports.execfile(file, globals, locals) # execute the script
diff --git a/python/helpers/pydev/pydevd.py b/python/helpers/pydev/pydevd.py
index dca2adb..dd69fff 100644
--- a/python/helpers/pydev/pydevd.py
+++ b/python/helpers/pydev/pydevd.py
@@ -263,35 +263,35 @@
pyDb.output_checker = self
def OnRun(self):
- if self.dontTraceMe:
+ if self.dontTraceMe:
- disable_tracing = True
-
- if pydevd_vm_type.GetVmType() == pydevd_vm_type.PydevdVmType.JYTHON and sys.hexversion <= 0x020201f0:
- # don't run untraced threads if we're in jython 2.2.1 or lower
- # jython bug: if we start a thread and another thread changes the tracing facility
- # it affects other threads (it's not set only for the thread but globally)
- # Bug: http://sourceforge.net/tracker/index.php?func=detail&aid=1870039&group_id=12867&atid=112867
- disable_tracing = False
-
- if disable_tracing:
- pydevd_tracing.SetTrace(None) # no debugging on this thread
-
- while not self.killReceived:
- if not self.pyDb.haveAliveThreads() and self.pyDb.writer.empty() \
- and not has_data_to_redirect():
- try:
- pydev_log.debug("No alive threads, finishing debug session")
- self.pyDb.FinishDebuggingSession()
- killAllPydevThreads()
- except:
- traceback.print_exc()
+ disable_tracing = True
- self.killReceived = True
+ if pydevd_vm_type.GetVmType() == pydevd_vm_type.PydevdVmType.JYTHON and sys.hexversion <= 0x020201f0:
+ # don't run untraced threads if we're in jython 2.2.1 or lower
+ # jython bug: if we start a thread and another thread changes the tracing facility
+ # it affects other threads (it's not set only for the thread but globally)
+ # Bug: http://sourceforge.net/tracker/index.php?func=detail&aid=1870039&group_id=12867&atid=112867
+ disable_tracing = False
- self.pyDb.checkOutputRedirect()
+ if disable_tracing:
+ pydevd_tracing.SetTrace(None) # no debugging on this thread
- time.sleep(0.3)
+ while not self.killReceived:
+ time.sleep(0.3)
+ if not self.pyDb.haveAliveThreads() and self.pyDb.writer.empty() \
+ and not has_data_to_redirect():
+ try:
+ pydev_log.debug("No alive threads, finishing debug session")
+ self.pyDb.FinishDebuggingSession()
+ killAllPydevThreads()
+ except:
+ traceback.print_exc()
+
+ self.killReceived = True
+
+ self.pyDb.checkOutputRedirect()
+
def doKillPydevThread(self):
self.killReceived = True
diff --git a/python/helpers/python-skeletons/numpy/core/multiarray.py b/python/helpers/python-skeletons/numpy/core/multiarray.py
index f7f106a..0195bb1 100644
--- a/python/helpers/python-skeletons/numpy/core/multiarray.py
+++ b/python/helpers/python-skeletons/numpy/core/multiarray.py
@@ -131,7 +131,7 @@
def __rmul__(self, y): # real signature unknown; restored from __doc__
"""
- x.__rmul__(y) <==> x*y
+ x.__rmul__(y) <==> y*x
Returns
-------
@@ -159,6 +159,16 @@
"""
pass
+ def __radd__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__radd__(y) <==> y+x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
def __copy__(self, order=None): # real signature unknown; restored from __doc__
"""
a.__copy__([order])
@@ -179,7 +189,6 @@
"""
pass
-
def __div__(self, y): # real signature unknown; restored from __doc__
"""
x.__div__(y) <==> x/y
@@ -190,6 +199,215 @@
"""
pass
+ def __rdiv__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__rdiv__(y) <==> y/x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __truediv__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__truediv__(y) <==> x/y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __rtruediv__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__rtruediv__(y) <==> y/x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __floordiv__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__floordiv__(y) <==> x//y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __rfloordiv__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__rfloordiv__(y) <==> y//x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __mod__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__mod__(y) <==> x%y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __rmod__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__rmod__(y) <==> y%x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __lshift__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__lshift__(y) <==> x<<y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __rlshift__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__rlshift__(y) <==> y<<x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __rshift__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__rshift__(y) <==> x>>y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __rrshift__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__rrshift__(y) <==> y>>x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __and__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__and__(y) <==> x&y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __rand__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__rand__(y) <==> y&x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __or__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__or__(y) <==> x|y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __ror__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__ror__(y) <==> y|x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __xor__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__xor__(y) <==> x^y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __rxor__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__rxor__(y) <==> y^x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __ge__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__ge__(y) <==> x>=y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __rge__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__rge__(y) <==> y>=x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __eq__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__eq__(y) <==> x==y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __req__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__req__(y) <==> y==x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
def __sub__(self, y): # real signature unknown; restored from __doc__
"""
@@ -199,4 +417,374 @@
-------
out : ndarray
"""
+ pass
+
+ def __rsub__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__rsub__(y) <==> y-x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __lt__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__lt__(y) <==> x<y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __rlt__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__rlt__(y) <==> y<x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __le__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__le__(y) <==> x<=y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __rle__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__rle__(y) <==> y<=x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __gt__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__gt__(y) <==> x>y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __rgt__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__rgt__(y) <==> y>x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __ne__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__ne__(y) <==> x!=y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __rne__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__rne__(y) <==> y!=x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __iadd__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__iadd__(y) <==> x+=y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __riadd__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__riadd__(y) <==> y+=x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __isub__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__isub__(y) <==> x-=y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __risub__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__risub__(y) <==> y-=x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __imul__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__imul__(y) <==> x*=y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __rimul__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__rimul__(y) <==> y*=x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __idiv__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__idiv__(y) <==> x/=y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __ridiv__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__ridiv__(y) <==> y/=x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __itruediv__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__itruediv__(y) <==> x/y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __ritruediv__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__ritruediv__(y) <==> y/x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __ifloordiv__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__ifloordiv__(y) <==> x//y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __rifloordiv__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__rifloordiv__(y) <==> y//x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __imod__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__imod__(y) <==> x%=y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __rimod__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__rimod__(y) <==> y%=x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __ipow__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__ipow__(y) <==> x**=y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __ripow__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__ripow__(y) <==> y**=x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __ilshift__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__ilshift__(y) <==> x<<=y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __rilshift__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__rilshift__(y) <==> y<<=x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __irshift__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__irshift__(y) <==> x>>=y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __rirshift__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__rirshift__(y) <==> y>>=x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __iand__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__iand__(y) <==> x&=y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __riand__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__riand__(y) <==> y&=x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __ior__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__ior__(y) <==> x|=y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __rior__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__rior__(y) <==> y|=x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __ixor__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__ixor__(y) <==> x^=y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __rixor__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__rixor__(y) <==> y^=x
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __pow__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__pow__(y) <==> x**y
+
+ Returns
+ -------
+ out : ndarray
+ """
+ pass
+
+ def __divmod__(self, y): # real signature unknown; restored from __doc__
+ """
+ x.__divmod__(y) <==> x%y
+
+ Returns
+ -------
+ out : ndarray
+ """
pass
\ No newline at end of file
diff --git a/python/helpers/tools/packages b/python/helpers/tools/packages
new file mode 100644
index 0000000..484ee855
--- /dev/null
+++ b/python/helpers/tools/packages
@@ -0,0 +1,4757 @@
+runcommands django-runcommands
+mongorunner django-mongorunner
+report_builder django-report-builder
+sampler reservoir-sampling-cli
+forceadminlanguage django-forceadminlanguage
+generic_follow django-generic-follow
+simpledate simple-date
+generic_positions django-generic-positions
+entropy WallpaperEntropy
+nmea noaadata-py
+scrapyd_api python-scrapyd-api
+_dummy_thread future
+aliases django-aliases
+relationships django-relationships
+exampleproject django-undermythumb
+infinite_memcached django-infinite-memcached
+cachetree django-cachetree
+calculate latimes-calculate
+swingleism swingleism4
+perfect404 django-perfect404
+jiracards jira-cards
+view_shortcuts django-view-shortcuts
+caktus_theme caktus-sphinx-theme
+periodicals django-periodicals
+admin_permissions django-admin-permissions
+clipboard pyclip
+datanommer datanommer.models
+spacq SpanishAcquisition
+dropboxchooser_field django-dropboxchooser-field
+popolo mysociety-django-popolo
+sysext SysExtension
+alphabetic alphabetic-simple
+spoolgore django-spoolgore
+event_calendar django-event-calendar
+ostinato python-ostinato
+printedQr_ printedQr
+simpleproto afn
+plumbum cloudwatch-to-graphite
+versionedcache django-versionedcache
+bitbucketsync BitbucketSyncPlugin
+slipstream slipstream-client
+figo python-figo
+aurora django-aurora
+privateviews django-private-views
+accelerator wsgi-accelerator
+phial Phial-Toolset
+askbot askbot-tuan
+connecto mpiodrive
+yandex_money yandex-money-sdk
+test_combi combi
+jack JACK-Client
+jslex_scripts jslex
+eventable bigsignal
+em EmPy
+statsy django-statsy
+tagging django-tagging
+lmh_core lmh
+tickets pytickets
+simpleVideo csumb205-multimedia
+bootstrap_span django-bootstrap-span
+scholar GoogleScholar
+osm_field django-osm-field
+xmlmapping django-xmlmapping
+voyeur aws-voyeur
+commons MonkeyCommons
+cookieless django-cookieless
+spinn_machine SpiNNMachine
+classy_mail django-classy-mail
+geocode_pagenames localwiki-geocode-pagenames
+pyjswidgets pyjx-html5
+delegate django-delegate
+affect django-affect
+satchmo_utils Satchmo
+orcid orcid-python
+botlib replybot
+aopythonexamples AOPython
+schunk SchunkMotionProtocol
+bottlehaml bottle-haml
+tinyfss TinyFastSS
+quilt python-quilt
+scribbler django-scribbler
+vudo vudo.skinsetup
+commondata commondata.be
+opencongress python-opencongress
+logical_rules django-logical-rules
+exclusivebooleanfield django-exclusivebooleanfield
+model_filters django-model-filters
+filternaut django-filternaut
+rusty rusty-web-framework
+admin_extended_ru django-extended-admin-ru
+aspen_tornado_renderer aspen-tornado
+me2 me2-supervisor
+djorm_hstore djorm-ext-hstore
+specs PySO8601
+duashttp django-unity-asset-server-http-client
+djsixpack django-sixpack
+librtkclient afn
+rest_framework djangorestframework
+preferences django-preferences
+gameprog gameprog.theme
+nodebow django-nodebow
+appsettings django-appsettings
+workflow broadwick
+remplacer django-remplacer
+swingtix swingtix-bookkeeper
+adminplus django-adminplus
+bipolar bipolar-client
+image_scraper ImageScraper
+lazycache django-lazycache
+session_activity django-session-activity
+new newer
+pympi pympi-ling
+qisys qibuild
+metadata lemon-metadata
+genie2 nflx-genie-client
+mws python-amazon-mws
+djorm_pgbytea djorm-ext-pgbytea
+geoio python-geoio
+reporter Auto_Python_2014
+generic_mail django-generic-mail
+wsrequest django-websocket-request
+ifnav_templatetag django-ifnav-templatetag
+phply tk.phpautodoc
+debug_toolbar_memcache django-debug-toolbar-memcache
+tornado tornado-bedframe
+easy_response django-easy-response
+swisschard swiss-chard
+imagepreview djangoimagepreview
+query_exchange django-query-exchange-fc
+routrschema routr-schema
+mobility django-mobility
+akamai_storage django-akamai-storage
+buckeyebrowser django-buckeye-corpus
+k rockpython
+usps python-usps2
+envoy envoy-beta
+qurl django-qurl
+libautobus afn
+lutefisk django-lutefisk
+demo_app lava-server-demo
+payment_slip python-paymentslip
+lacewing pylacewing
+extended_flatpages django-extended-flatpages
+smtphealth smtp-health-check
+appengine_template latimes-appengine-template
+shoogie django-shoogie
+campaign django-campaign
+awlsimhw_pyprofibus awlsim
+inlaws django-inlaws
+sparkline pysparklines
+libmodernize modernize
+HaPy HaPy-ffi
+yadtbroadcastclient yadtbroadcast-client
+e1337cms django-e1337cms
+mailgun_validation django-mailgun-validation
+fancy_admin django-fancy-admin
+sites_groups django-sites-groups
+werkzeug_debugger_runserver django-werkzeug-debugger-runserver
+RRDService rrd-service
+hipchat python-hipchat
+cocaine cocaine-tools
+forums pinax-forums
+fire_in_folders FireInFolders
+rtkit python-rtkit
+termsearch dj-termsearch
+conv video-converter
+holonet_django django-holonet
+restdoc Flask-Restdoc
+nine django-nine
+stopspam glamkit-stopspam
+noseselenium django-nose-selenium
+eiscp onkyo-eiscp
+localized_names django-localized-names
+fluenttest Fluent-Test
+tele libtele
+gbpautomation group-based-policy-automation
+dns dnspython
+spike spike_py
+djangoxslt django-xslt
+redmine python-redmine
+care django-care
+gedcom gedcompy
+nessus python-nessus-client
+separated django-separated
+djangomosql django-mosql
+docutils_html5 docutils_html5_writer
+cmsplugin_houseoverview django-estate-cms
+stylers xdebugtoolkit
+oscar django-oscar
+entity_history django-entity-history
+po2xls django-po2xls
+redditKindleLib reddit2Kindle
+django_braintree tivix-django-braintree
+stratuslab stratuslab-libcloud-drivers
+singledispatch_helpers singledispatch
+pipedrive pipedrive-py
+locksmith django-locksmith
+jupyterpip jupyter-pip
+django_cas django-cas-sso
+ruxlibparser rux
+payline django-payline
+py31compat jaraco.compat
+tinymce_images django-tinymce-images
+vanguardistas vanguardistas.buildoutsvn
+storpool storpool.spopenstack
+sitesutils django-sitesutils
+mail_factory django-mail-factory
+pieberry pieberry-library-assistant
+irc3d irc3
+movies knun_movies
+genbankdownload genbank-download
+networktables pynetworktables
+solitaire Pyntifex
+timelinejs_static django-staticfiles-timelinejs_static
+RLT TwitterDataMiner
+yutils django-yutils
+supervisorserialrestart supervisor-serialrestart
+scripting pyscripting
+cone cone.tile
+funserver django-funserver
+multifilefield django-multifilefield
+html_objects python-html-objects
+userprofiles django-userprofiles
+djangox djangox-mako
+mimemail django-mimemail
+purls django-purls
+protector django-protector
+tzf tzf.pyramid_routing
+openerpetl openerp-client-etl
+greplin scales
+flask_views paqmind.flask-views
+ometa Parsley
+preforkserver py-prefork-server
+wpmd wp-md
+functions destiny_bot
+gslib gigya-server-lib
+absolute django-absolute
+graphlab GraphLab-Create
+gunicorn_thrift ggthrift
+pyfeed feedzilla-api
+knows nose-knows
+UnRAR2 py-unrar2
+clustoec2 clusto-ec2
+WikiNotification TracWikiNotification
+github_release githubrelease
+relatedwidget django-relatedadminwidget
+enigma py-enigma
+test_characteristic characteristic
+mobile_views django-mobile-views
+env env.py
+record afn
+uritemplate google-api-python-client
+finalware django-finalware
+sqmedium sqmediumlite
+termsandconditions django-termsandconditions
+flask_api Flask-API.yandex
+securitas security-cam
+tcelery tornado-celery
+timedelta django-timedeltafield
+upip_errno micropython-upip
+less django-less
+typed typed.py
+geobricks_rest_engine GeobricksRESTEngine
+myquerybuilder MysqlSimpleQueryBuilder
+phantom_pdf_bin django-phantom-pdf
+mongotor mongotor-skd
+data_specification SpiNNaker_DataSpecification
+rpdb2 winpdb
+tkhelp_lang_de tkhelp
+fedora python-fedora
+stronghold django-stronghold
+static_precompiler django-static-precompiler
+tkthread afn
+sparql ontopy
+localdevstorage django-localdevstorage
+debug_toolbar_sqlalchemy django-debug-toolbar-sqlalchemy
+fakename py-fakename
+memento django-memento
+bulk_update django-bulk-update
+hadoop2 SAGA-Hadoop
+massmedia django-massmedia
+blazech BlazeCommandHelper
+hadoop1 SAGA-Hadoop
+authzpolicy AuthzPolicyPlugin
+pythongettext python-gettext
+bookmark_pyparser bookmark_merger
+updates django-theherk-updates
+file_modify File-Searcher
+chatovod django-chatovod
+feedback redsolutioncms.django-simple-feedback
+memcachedkeys django-memcachedkeys
+consent django-consent
+qwert django-qwert
+document_library django-document-library
+PyQt4 qt_backport
+nested_admin django-nested-admin
+fifo PyFi
+sflvault SFLvault-client-qt
+dbc dropbox-cli
+autosend afn
+crumbs django-crumbs-mixin
+gnutls python-gnutls
+kong django-kong
+operis django-operis
+dnsimple dnsimple-api
+montypy monty-python
+statserv stattr
+playhouse peewee
+cli clibuilder
+fit python-fit
+encutils cssutils
+highlights diff-highlight
+test_klout pyklout
+utkik aino-utkik
+avocado Django-Avocado
+Selenium2Library robotframework-selenium2library
+better sphinx-better-theme
+lrutils lrutilities
+modelfeedback django-modelfeedback
+testhelpers django-test-helpers
+qiniuupload qiniu_upload
+lava_scheduler_app lava-scheduler
+testautoslug django-autoslug-field
+m3rt m3core
+carton django-carton
+trebuchet le-trebuchet
+fio python-fio
+linkcheck django-linkcheck
+examplesite kiwi_project
+twitterdedupe twitter-dedupe
+macaddress django-macaddress
+organice_theme_fullpage django-organice-theme-fullpage
+libxtwrapper python-iptables
+automatic_links django-automatic-links
+responsive_admin django-responsive-admin
+email_hijacker django-email-hijacker
+timezones2 django-timezones2
+bang bangtext
+tenancy django-tenancy
+indoctrin8 indoctrinate
+atomise pieberry-library-assistant
+uiautomatorlibrary robotframework-uiautomatorlibrary
+oauthadmin django-admin-oauth2
+rest_framework_sav djangorestframework-sav
+infranil django-infranil
+moneyed py-moneyed
+cloudmesh flask_cm
+SipPhoneLibrary sipphone-automation
+pipejam django-pipejam
+tropofy_example_apps tropofy
+cmstv cm-stv
+web_performance django-webperf
+jcconv_test jcconv
+herald Cohorte-Herald
+qualitylib quality_report
+noaadata noaadata-py
+_jitviewer JitViewer
+session_csrf django-session-csrf-per-view
+arrow arrow-fatisar
+indexfile idxtools
+debug Chandler-debugPlugin
+djangohelper django-helper
+ImportParseData import-parse-to-apiOmat
+extra_sensitive_variables django-extra-sensitive-variables
+notifier django-notifier
+mean File-Searcher
+hjb pyhjb
+polymorphic_tree django-polymorphic-tree
+monolith monolith.client
+cuser django-cuser
+zabbix_segment zabbix-powerline-status
+webcamstreamer webcam-streamer
+magneto django-magneto
+hex_client HexClient
+ccsitemaps django-ccsitemaps
+subprocessio GitWeb
+passwords django-passwords
+flask_markdown flask_markdown2
+bidimensional twentytab-model-to-bidimensional
+numap papy
+extract geonode-extract
+mksbackuplib mksbackup
+floraconcierge floraconcierge-client
+celerymon django-celery-mon
+redissentry django-redissentry
+templates_i18n django-templates-i18n
+rs py-rs
+kuwo kwplayer
+RequestsLibrary robotframework-requests
+accentuation greek-accentuation
+buildutils klamar-buildutils
+content django-content-toolkit
+auslfe auslfe.formonline.content
+fixpath gaeshell
+tofu_test reahl-tofu
+reader xdebugtoolkit
+customServer JsonSocket
+barobo PyBarobo
+ro ro.bdb.cmmi
+venezuela django-venezuela
+uwsgiit uwsgiit-py
+livevalidation django-livevalidation
+pipconflictchecker pip-conflict-checker
+pydap pydap.handlers.csv
+service_agent ServiceAgent007
+djpico django-pico
+gunicorn moneta
+livereload django-livereload
+rss_widget django-rss-widget
+table_formatter bigquery
+nti nti.nose_traceback_info
+WebDAV PyDAV
+polarize django-polarize
+lazysignup django-lazysignup
+loginrequired TracLoginRequiredPlugin
+postgresql_minipg django-minipg
+upip_utarfile micropython-upip
+cornerstone cornerstone.ui.result
+imperavi django-imperavi
+logging micropython-logging
+ckeditor django-ckeditor
+bowercache bower-cache
+cms django-cms
+ws4py ws4py-ivideon
+threatmetrix django-threatmetrix
+messager phase.messager
+canjs django-canjs
+rfhub robotframework-hub
+trustpay django-trustpay
+mhashlib py-mhash
+mediahash glamkit-performance
+flask_jira Flask-JIRA-Helper
+rst2beamer rst2beamer3k
+icemac icemac.ab.locales
+organice_theme_rssk django-organice-theme-rssk
+cloudscheduler cloud-scheduler
+formadmin django-formadmin
+cpuinfo py-cpuinfo
+camxes lojbantools
+stopwatch django-stopwatch
+mountebank mountebank-python
+transdate_nounicode transdate
+rocket_engine django-rocket-engine
+playback git-playback
+launch_page django-launch-page
+sockshandler proxychecker
+spinning pyspinner
+mklib mk
+twistedsnmp TwistedSNMP-working
+neo4j neo4j-embedded
+default_contact_with_phone django-basecontact
+easy_split django-easy-split
+imapauth TracIMAPAuth
+emusic eMusic-store
+fmn fmn.web
+ipcamweb IpCamPy
+lister listoliver
+nrel_utility pynrelutility
+cepwebservice django-cepwebservice
+fcgi_aspen aspen
+gmcbs gevent-memcached-server
+OpenEdge pyodbcOpenEdge
+celerybeatredis celerybeat-redis
+il2fb il2fb-commons
+loaders python-loaders
+rsrc Resource
+listPrinter whale_listPrinter
+xix xix-utils
+flexible_ckeditor django-flexible-content-ckeditor
+readthedocs_ext readthedocs-sphinx-ext
+taggit_bootstrap django-taggit-bootstrap
+dogs first_pypi_practice
+testmaker django-testmaker
+ec2cleanlc aws_ops
+xero pyxero
+lightningmf_pk lightningmf
+libbgg py-bgg
+version_info python-version-info
+test_without_migrations django-test-without-migrations
+wpadmin django-wpadmin
+slownie python-slownie
+ad_rotator django-ad-rotator
+simple_events django-cms-simple-events
+heap django-heap
+inline_ordering django-inline-ordering
+saytime afn
+dslforms django-dslforms
+ggtracker ggtracker-client
+technic technic-solder-client
+hide_herokuapp django-hide-herokuapp
+ArchiveLibrary robotframework-archivelibrary
+chef PyChef
+deep_serializer django-deep-serializer
+suitlocale django-suit-locale
+keepify keepify-py
+txlb txLoadBalancer
+hvacd afn
+iphonepush django-iphone-push
+portlets django-portlets
+aggcat python-aggcat
+cms_saq django-cms-saq
+ptracking python-tracking
+pcommerce pcommerce.email
+ktasync_test ktasync
+classes PyRECONSTRUCT
+email_validation py_email_validation
+audiotranscode tinytag
+principals django-principals
+dj_elastictranscoder django-elastic-transcoder
+youpai py-upyun
+docker_links docker-links-python
+realestate django-estate
+imagekit_cropper django-imagekit-cropper
+ec2createapp aws_ops
+websocket websocket-client
+configfield django-configfield
+blocktrail blocktrail-sdk
+openlcb PyOpenLCB
+cgparser xdebugtoolkit
+ginger django_ginger
+bitfield django-bitfield
+versioneer mmailer
+smartystreets smartystreets.py
+blockedemails django-blockedemails
+angularjs django-angularjs
+__main__ mksbackup
+serverdownmacro TracServerDownMacro
+autobus afn
+smarttest django-smarttest
+clever_selects django-clever-selects
+demoproject django-admin-tools-stats
+latency django-latency
+multiseek django-multiseek
+treebeard django-treebeard
+usermessaged afn
+scriptures python-scriptures
+sharq_server SharQServer
+flotype FlotypeBridge
+nrel_utility_errors pynrelutility
+arangodb ArangoPy
+indexer django-indexer
+inspect_model django-inspect-model
+report_utils django-report-utils
+csg pycsg
+webperf pywebperf
+ambariclient python-ambariclient
+smartlinks glamkit-smartlinks
+snowflake pysnowflake
+aclapiclient python-aclapiclient
+d1_common dataone.common
+provinceitaliane django-provinceitaliane
+authemail django-rest-authemail
+webmod web.py-modules
+gitpy git-py
+markymark django-markymark
+test_devpi_server devpi-server
+mcman mc-man
+bigquery BigQuery-Python
+simplify simplifycommerce-sdk-python
+staticunderscorei18n django-static-underscore-i18n
+polymorphic django_polymorphic
+odesk python-odesk
+sqlalchemy_tomdb tomdb
+nisext nibabel
+gdm django-gdm
+monome pymonome
+scriptnado scriptnado-common
+doj django-jython
+inouk inouk.recipe.patch
+hashbrown django-hashbrown
+batch_session_cleanup django-batch-session-cleanup
+statistic django-statistic
+crowd CrowdTimeout
+leaflet django-leaflet
+sekh django-sekh
+django_basic_feedback_test_project django-basic-feedback
+daterange_filter django-daterange-filter
+image_cropping django-image-cropping
+wildcard wildcard.foldercontents
+treasuremap django-treasuremap
+davcontroller khard
+icecast_balancer django-icecast-balancer
+test_cookies cookies
+dot xdebugtoolkit
+marvel PyMarvel
+cloudbio cloudbiolinux
+hapi hapipy
+rayleigh rayleigh-module
+saga saga-python
+rest_framework_apidoc djangorestframework-apidoc
+whitelist pygn
+labels pylabels
+allattachments AllAttachmentsMacro
+semantria semantria_sdk
+radio django-radio
+overload p2-overload
+gtmetrix python-gtmetrix
+tornalet_info tornalet
+imagedimensions django-image-dimensions
+proctorserv proctorserv_api
+flask_frozen Frozen-Flask
+pki django-pki
+d3 django-d3
+Resources PyOracle
+vk_iframe django-vkontakte-iframe
+noselongdescription nose-long-description
+directupload django-directupload
+vkontakte_users django-vkontakte-users
+excavator env-excavator
+psicons psicons.core
+netster_szin2012 nester_szin2012
+brimstone python-brimstone
+elftools pyelftools
+fontawesome django-bootstrap-static
+debian_bundle python-debian
+testdata python-testdata
+cerberus django-cerberus
+basebwa_ta BaseBWA
+edict django-edict
+django_orphaned django-orphaned-updated
+aspen_gevent_engine aspen-gevent
+ec2autoimage aws_ops
+plato PyPlato
+zerojson pycom
+email_manager django-email-manager
+testrtkserver afn
+h rockpython
+admin_extend django-admin-extend
+gitlocation TracGitLocation
+downtime django-downtime
+postleware django-postleware
+simple_bugs django_simple_bugs
+net aircable-library-op
+downloadlib downloadduxiu
+slack pyslack
+qotd QuoteOfTheDay
+djangomako django-mako
+django_cachefly cachefly
+privatesite django-privatesite
+game_of_thrones name-of-thrones
+flask_statics Flask-Statics-Helper
+countries incuna-countries
+pushme m3-pushme
+binhex micropython-binhex
+factoracle PyOracle
+rewrite_external_links django-rewrite-external-links
+markup_deprecated django-markup-deprecated
+combinedform django-combinedforms
+sunit nose-subunit
+o2o_tagging django-o2o_tagging
+analytical django-analytical
+dmarc django-dmarc
+xmlenc pysaml2
+conf_tools ConfTools
+secure_input django-secure-input
+mwuppet python-mwuppet
+sweety python-sweety
+erroneous django-erroneous
+localdates django-localdates
+rightfax pyrightfax
+td_cms django-tailordev-cms
+exacttarget python-exacttarget
+quickunit nose-quickunit
+ecglist email-ecglist
+th_readability django_th_readability
+awebview android-webview
+fuzzysearch simple-fuzzysearch
+django_profiler django-profiler-middleware
+dh5bp django-html5-boilerplate
+aios3 aio-s3
+pyomo pyomo.extras
+package1 dmitry_test1
+protobase django-softmachine
+dbindexer django-dbindexer
+cms_lite django-cms-lite
+pygoogle pygoogle-simple
+quickedit django-quickedit
+otpt OTPTunnel
+sidebar django-sidebar
+mealmakerlib MealMaker
+agent2 openproximity-agent2
+knockout_modeler django-knockout-modeler
+cms_bootstrap3 djangocms-bootstrap3
+s3dependencies s3sourcedependencies
+bild bild.me-cli
+news2mail pygn
+batch_select django-batch-select
+stampu django-stampu
+laconicurls django-laconicurls
+test_rehab rehab
+skipreq nose-skipreq
+author django-author
+ucamprojectlight django-ucamprojectlight
+customerevents django-customerevents
+manolo django-manolo
+discovery bigquery
+run_examples pymorphous
+diydjango diy-django
+credo credo_manager
+rest_framework_recursive djangorestframework-recursive
+vows deego
+kidocare django-kidocare
+oml django-oml
+zgeo zgeo.plone.geographer
+locationbase Django-LocationBase
+upfront upfront.simplereferencefield
+lib2to3 pythoscope
+packager moz-addon-packager
+terml Parsley
+rhaptos2 rhaptos2.common
+instant_coverage django-instant-coverage
+stubout gmcquillan-mimic
+media_field django-adv-imagefield
+dynamic_preferences django-dynamic-preferences
+virtstrap virtstrap-core
+cov_core_init cov-core
+geocoder django-os-geocoder
+aplus switchboard-python
+pluggableapp DjangoPluggableApp
+bada_push python-bada-push
+beacon netbeacon
+edgar python-edgar
+cbvpatterns django-cbvpatterns
+flashcookie django-flashcookie
+inoa django-inoa
+zinnia_mollom zinnia-spam-checker-mollom
+appwebshare webshare-download-manager
+bzlib bugzillatools
+micromodels microforms
+pysmvttestapp2 pysmvt
+demail django-demail
+bootstrap_crud django-bootstrap-crud
+muranoagent murano-agent
+mutations aino-mutations
+digitemp pydigitemp
+conversejs django-conversejs
+yaak yaak.inject
+inplaceeditform django-inplaceedit-version1
+smuggler django-smuggler
+qimvn qibuild
+feedback_form django-simple-feedback-form
+pysensu gc-pysensu
+bootstrap_toolkit django-bootstrap-toolkit
+noun_project django-noun-project
+cache_toolbox django-cache-toolbox-modified
+copycat copycat-clipboard
+clip clip.py
+signrequest_client signrequest-python-client
+basis django-basis
+classytags django-classy-tags
+dicom pydicom
+rstamper django-rstamper
+jread pjtree
+parler django-parler
+epic-sample django-epic-sample
+milieu unholster.milieu
+twain pytwain
+multitail multitail-curses
+trigger TrebuchetTrigger
+et_xmfile openpyxl
+gflags_multibool python-gflags-multibool
+admin_steroids django-admin-steroids
+basil basil_django
+gitgoggles git-goggles
+website sbswebsite
+pyoauth2 py-oauth2
+hackergraph ngenix_hackergraph
+Wappalyzer python-Wappalyzer
+subdownloader subdownloaderlite
+mapistration django-mapistration
+pmp_api py3-pmp-wrapper
+categorytpl pelican-category_template
+cloudfs cloudfs_sdk
+gbpui group-based-policy-ui
+system_autopsy SystemAutopsy
+fullmarks fullmarks.tinymceplugins.asciisvg
+newticketlikethis trac-NewTicketLikeThisPlugin
+servee_uploadify django-servee-uploadify
+insertblocks django-insertblocks
+vendors django-vendors
+py26compat jaraco.compat
+keymon key-mon
+timeit micropython-timeit
+teagarden django-teagarden
+geoip python-geoip
+inspectdb django-inspectdb
+nsist pynsist
+foreman_plugins python-foreman
+revcanonical django-revcanonical
+commweb django-commweb
+deps django-dependency
+dtrace_ctypes python-dtrace
+erply_api ErplyAPI
+bugzscout bugzscout-py
+reflex Reflex-events
+associations django-associations
+servicerating django-service-rating-store
+fatbox_utils fatbox-django-utils
+smorgasbord django-smorgasbord
+cfscrape cfscrapefork
+ip pyip
+clonechecker checkmyclones
+drifter_functions package-test
+fluent_contents django-fluent-contents
+reredirects django-reredirects
+googleforms django-googleforms
+worch worch-ups
+crunchbase python-crunchbase
+datefield TracDateField
+2048 curses-2048
+conf jss-python
+bastio bastio-agent
+manifestgen manifest_generator
+irssiicon irssi-icon
+doorman django-doorman
+djangomaster django-master
+primitivegallery django-primitivegallery
+growl growlpy
+tiddlyeditor_plus tiddlywebplugins.tiddlydocs
+pkit process-kit
+switter django-switter
+yahooboss YahooBoss-Python
+matome django-matome
+jirabulkloader jira-bulk-loader
+meetup django-meetup
+kavahq kavahq-api
+xmlComparison xmlComparator
+djangolytics djangolytics-client
+simplemail python-simplemail
+extjs4 django_extjs4
+cassandra cassandra-driver
+ssi django-nginx-ssi
+moneybookers django-moneybookers
+taskplan pytaskplan
+mongoforms django-mongoforms
+templates opbasm
+Distance ish_parser
+sched micropython-sched
+wapiti libwapiti
+cms_pictures_polaroid django-cms-pictures
+ajaxmiddleware django-ajaxmiddleware
+kloutpy_util kloutpy
+google_calendar_v3 GoogleCalendarV3
+jks pyjks
+bibliograph bibliograph.parsing
+cookielaw django-cookie-law
+migratron django-migratron
+nFirstNester FirstNester
+characters greek-accentuation
+uuid_ Python_WebDAV_Library
+snakeoil django-snakeoil
+adfav django-admin-favorite
+health_check_celery3 django-health-check
+autoslug django-autoslug
+omblog obscuremetaphor-blog
+drb docker-rpm-builder
+appomatic appomaticcore
+shout pyshout
+ghplots github-plots
+djadmin2 django-admin2
+drip django-drip
+cloudfoundry python-cloudfoundry
+input_mask django-input-mask
+graceful_session_cleanup django-graceful-session-cleanup
+bugzilla python-bugzilla
+hitcount django-hitcount-headless
+tradegecko tradegecko-python
+roma django-roma
+gzip micropython-gzip
+rs_pitch_seq retrosheet-pitch-sequences
+django_wellbehaved m3-wellbehaved
+Utility JzStock
+analyze_sessions django-analyze-sessions
+ImportStackmobData import-stackmob-to-apiOmat
+mdmerge MarkdownTools
+simplesearch django-simplesearch
+deepzoom django-deepzoom
+cmsplugin_contactform django-cms-contactform
+mdx_mdGraph mdGraph
+djboreas django-boreas
+shortwave django-shortwave
+bandwidth sd-bandwidth
+printr pyprintr
+BeautifulSoupTests BeautifulSoup
+human human-datetimedelta
+hashlink django-hashlink
+bioscripts bioscripts.convert
+simplegallery django-simplegallery
+spectacles django-spectacles
+djangologdb django-logdb
+debug_error_logging django-debug-error-logging
+agile gus_client
+XSLForms XSLTools
+Asterisk py-Asterisk
+relatives django-relatives
+linotputilsgui LinOTPAdminClientGUI
+run_pymorphous pymorphous
+mkgmap mkgmap-pygments
+email_log django-email-log
+yoyo yoyo-migrations
+linked_accounts django-linked-accounts
+pptransport ppft
+djangovoice django-voice
+sesarwslib SESAR-Web-Services-Library
+vkontakte_video django-vkontakte-video
+sendsmsru django-sendsmsru
+fluidity fluidity-sm
+trac_recaptcha TracCaptcha
+tkhelp tkinter.help
+recaptcha recaptcha-client
+niteoweb niteoweb.transmogrifier.simpleusage
+wabbajack django-wabbajack
+privatetickets TracPrivateTickets
+silentorcli silentor-cli
+simpleapi django-simpleapi
+metadataclient murano-metadataclient
+functional_tests pyrocumulus
+zencoder django-zencoder
+sharrock Sharrock-Client
+simplemixins django-simple-mixins
+canclon django-canclon
+tvdb_exceptions tvdb_api
+request_profiler django-request-profiler
+captains_log python-captains-log
+arango py-arango
+crawlfrontier crawl-frontier
+zeam zeam.jsontemplate
+syncloud syncloud-app
+internalreferences pandoc-internal-references
+bps python-bps
+pyalfred python-alfred
+vdx python_vdx
+periods python-periods
+boutiqueclient Boutique
+demo_cmsplugin_zinnia cmsplugin_zinnia
+informativo django-informativo
+easyrec PyEasyrec
+mock_master django-master
+bets bets-api
+doit doit-tasks
+urlbreadcrumbs django-url-breadcrumbs
+magnumpi magnum-pi
+people django-people
+pyfarm pyfarm.core
+rer rer.portlet.er_navigation
+djview django-viewutil
+bootup django-bootup
+dummy_serial MinimalModbus
+flatten FlattenList
+manifest crepo
+email_html django-email-html
+tunirlib tunir
+tastypie_mongoengine django-tastypie-mongoengine
+include_strip_tag django-include-strip-tag
+cloudfoundryclient python-cloudfoundryclient
+tag_parser django-tag-parser
+serpente python-serpente
+pbclient pybossa-client
+seedbox SeedboxManager
+widget_list django-widget_list
+metasettings django-metasettings
+_libc micropython-libc
+taggit_machinetags django-taggit-machinetags
+melange python-melangeclient
+cratis_admin django-cratis-admin
+cms_social_facebook django-cms-social-networks
+CMCore codmacs
+ymsg ymsglib
+pjson providerjson
+django_hudson django-hudson-25
+simpleImage csumb205-multimedia
+frir sadi
+sphinxit sphinxit-fc
+latexwriter MarkdownWriter
+rtslib rtslib-fb
+dnsomatic_api DNSFlash
+flup flup6
+dna file2dna
+selectable django-selectable
+red_black_dict_mod red-black-tree-mod
+misfitapp django-misfit
+scaffolding django-scaffolding
+oauth2_provider django-oauth-toolkit
+Pydblibrary robotframework-pydblibrary
+shop_simplecategories django-shop-simplecategories
+json_field django-json-field
+hex_storage redsolutioncms.django-hex-storage
+mtvc_client mtvc-api-client
+libesedb bta
+separatedvaluesfield django-separatedvaluesfield
+keyedcache django-keyedcache
+pythonpackages pythonpackages.sendpickedversions
+i18nurls django-i18nurls
+labrad pylabrad
+docstringcoverage docstring-coverage
+analyzedir AnalyzeDirectory
+__precursor__ precursor
+qidoc qibuild
+subtranslate subtitle_translator
+pytrie PyTrie3
+book book.isbn
+alembic uliweb-alembic
+cmsplugin_plaintext cmsplugin-plaintext-djangocms3
+stickyuploads django-sticky-uploads
+autoadmin django-autoadmin
+sheets django-sheets
+zfstools zfs-tools
+quantumcore quantumcore.storages
+rest_framework_json_api drf-json-api
+pycco_resources Pycco
+antispoofing antispoofing.evaluation
+hostproof_auth django_hostproof_auth
+navigen django-navigen
+hyperadmin django-hyperadmin
+multimail django-multimail
+achilles django-achilles
+infinite_pagination django-infinite-pagination
+freeform_tests freeform
+indra indra.base
+sfd nose-sfd
+djam django-djam
+quorum automium_web
+dnt django-dnt
+pybkick_tests pybkick
+sunlight simple-sunlight
+gallery feincms-gallery
+supergeneric django-supergeneric
+djclsview django-clsview
+auto_urls django-auto-urls
+anonymizer django-anonymizer
+wax python-wax
+ecstatic django-ecstatic
+site_access django-site-access
+omgeo python-omgeo
+cpuutilization py-cpuutilization
+pilight PiPan
+bert insight-bert
+sqlite3 micropython-sqlite3
+traceroute pyip
+bigquery_client bigquery
+cc42 42qucc
+king_snake KingSnake
+gp_decorators fuzzing
+fassembler_boot opencore-fassembler_boot
+sassy_coffee django-sassy-coffee
+notifications django-notifications-hq
+dynamic_db_router django-dynamic-db-router
+modargs python-modargs
+ptrace python-ptrace
+DNS pydns
+jsontableschema json-table-schema
+dhtmlparser pyDHTMLParser
+libmgrs mgrs
+icmp pyip
+arv arv.autotest
+butler python-butler
+writingfield django-writingfield
+_pyrsistent_version pyrsistent
+hoptoad django-hoptoad
+mockito_util mockito-lwoydziak
+attr attrs
+hive_serde hive-thrift-py
+content_licenses django-content-licenses
+upip micropython-upip
+googlesearch django-googlesearch
+pytpptheme TracPyTppTheme
+favit django-favs-sc
+rockload_client rockload
+error_pages django-error-pages
+paging django-paging
+giturlparse giturlparse.py
+taxbot django_taxbot
+librtk afn
+poioapi poio-api
+edumetadata django-edumetadata
+eppy EPP
+jsonfield django-jsonfield
+propaganda django-propaganda
+sklearn scikit-learn
+skbio scikit-bio
+skcommpy scikit-commpy
+skdsdp scikit-dsdp
+skfmm scikit-fmm
+skfuzzy scikit-fuzzy
+skgpuppy scikit-gpuppy
+skimage scikit-image
+skmonaco scikit-monaco
+skmultilearn scikit-multilearn
+sknano scikit-nano
+skrf scikit-rf
+skspectra scikit-spectra
+sktensor scikit-tensor
+sktracker scikit-tracker
+skumfpack scikit-umfpack
+skxray scikit-xray
+skvideo scikit-video
+issue_db Git-Track
+mtdev python-mtdev
+appengine_utils django-appengine-utils
+cached_auth django-cached_authentication_middleware
+pyicloud pyicloud_dwoh
+abstract abstract.jwrotator
+flask_reportable_error Flask-ReportableError
+authtkt django-authtkt
+colony_adm colony
+camote camote-queue
+genericm2m django-generic-m2m
+subversionlocation TracSubversionLocation
+request django-request
+anthrax AnthraxImage
+haml PyHAML
+clearwind clearwind.arecibo
+loginurl django-loginurl
+jsonapi django-jsonapi-org
+bundesliga bundesliga-cli
+pusher pusher-rest
+corebio bioinf-utilities
+djangomaster_linter django-master-linter
+enum_custom enum34-custom
+locality django-locality
+alerts django-alerts
+telemetry django-telemetry
+pyramid_oauthprovider hapi
+django_postgres django-postgres-pebble
+tethys_compute django-tethys_compute
+readonly django-db-readonly
+neutronclient python-neutronclient
+red_black_set_mod red-black-tree-mod
+capstone capstone-windows
+urlalternatives django-urlalternatives
+alerta alerta-server
+entity_emailer django-entity-emailer
+pymongo pymongo-amplidata
+pysysinfo PyMunin
+skaero scikit-aero
+proxytypes jsonref
+htgroupeditor TracHtGroupEditorPlugin
+piquant_no_units_no_warnings piquant
+models automium_web
+dynamicLink django-dynamic-link
+abu abu.admin
+jibebuy python-jibebuy
+ip2language django-ip2language
+lextractor esther
+sqswatcher cfncluster-node
+ansibleinventorygrapher ansible-inventory-grapher
+apocell_project apocell
+nullpochaser nullpobug.chaser
+wordpress_auth django-wordpress-auth
+saml2idp django-saml2-idp
+blockdiag_sphinxhelper blockdiag
+nxt nxt-python
+pycogworks pycogworks.crypto
+shop_bac django-shop-credomatic
+autogenerate_config_docs openstack-doc-tools
+advancedcaching agtl
+viewlet django-viewlet
+assume django-assume
+contacts django-contacts
+moneyfield django-moneyfield
+littlebro django-littlebro
+_6px px
+flaskcommand flask-command
+feedmap django-feedmap
+getlocalization gl
+url_history django-url-history
+s3deploy S3D
+job_generation ros-job_generation
+reroute django-reroute
+sniffer code-sniffer
+cpanel_email_api py-cpanel-email-api
+kittenstorage django-kittenstorage
+bs4 beautifulsoup4
+saucelabs selenium-saucelabs-python
+radmin django-redis-admin
+wtfpeewee wtf-peewee
+doctor django-doctor
+chain chain-sdk
+renderit django-renderit
+robots_txt django-robots-txt
+flatblocks django-flatblocks
+rest_framework_jsonp djangorestframework-jsonp
+cobra cobrascript
+leads django-leads
+crocodile django-crocodile
+lexicon django-lexicon
+udacitydl udacity-dl
+graphine PyGraphine
+suseapi python-suseapi
+requires_io requires.io
+rshop django-rshop
+brubeckservice brubeck-service
+layers django-layers-hr
+MVGLive PyMVGLive
+varnish python-varnish
+bibulous_authorextract bibulous
+microblogging django-microblogging
+redis_sessions django-redis-sessions
+cms_fragments django-cms-fragments
+agon_ratings geonode-agon-ratings
+pydyn pypower-dynamics
+smb pysmb
+xlink django-xlink
+aspen_rocket_engine aspen-rocket
+csmash configsmash
+recurrence django-recurrence
+ipyfield django-ipyfield
+libfcg flashcachegroup
+dscan droopescan
+vem VirtualEnvManager
+workspace_tools mbed-tools
+aspy aspy.yaml
+predicate django-predicate
+coop django-coop
+rest_auth django-rest-auth
+debugmail django-debugmail
+hsaudiotag hsaudiotag3k
+ganalytics django-ganalytics
+tronweb tron
+opencache opencache-node
+netlib pathod
+manage2 python-manage2
+lru py_lru_cache
+hashphrase django-hashphrase
+TestAnalyzer team_city_test_analyzer
+project_settings django-project-settings
+content_bbcode django-content-bbcode
+swiftclient python-swiftclient
+materialize django-materialize-css
+cron_monitor django-cron-monitor
+Frontend shim
+celery_clearcache django-celery_clearcache
+organice_theme django-organice-theme
+vcstorage django-vcstorage
+flipbook django-flipbook
+primate django-primate
+posts django-posts
+logKeeper logKeeper_DH
+dateconv python-dateconv
+flask_babel Flask-Babel2
+gus gus_client
+job_generation_groovy ros-groovy-job-generation
+charitychecker django-charitychecker
+bogofilter django-bogofilter
+ftracker fantasy-tracker
+cydraplugins CydraTrac
+diu docker-image-updater
+crane docker-crane
+genericrelationview django-genericrelationview
+pushi pushi_service
+qanda django-qanda
+rest_framework_proxy django-rest-framework-proxy
+brave braveapi
+py25compat jaraco.compat
+optimus py-optimus
+nosetimelimit nose-timelimit
+stored_messages django-stored-messages
+badgr django-badgr
+PyQt5 python-qt5
+brevisurl django-brevisurl
+cykooz cykooz.djangopaste
+weasyl pyweasyl
+url_robots django-url-robots
+messagegroups django-messagegroups
+ptree django-ptree
+colorunit nose-colorxunit
+recaptcha_works django-recaptcha-works
+frontendadmin django-frontendadmin
+postman django-postman
+simtk simtk.units
+taskwarrior_inthe_am taskwarrior-inthe.am
+asn1lette rsalette
+axes django-axes
+mwlib mwlib.epub
+contentrelations django-contentrelations
+lightpack py-lightpack
+rosci_templates rosci
+sigopt sigopt-python
+eurostat eurostat_rdf
+extendedmodelresource django-tastypie-extendedmodelresource
+staff django-staff
+pyepisoder episoder
+prdg prdg.zope.permissions
+mele melebeats
+gmapify django-gmapify
+httpforgelib httpforge
+userdata sc_pylibs
+flask_routes paqmind.flask-routes
+guardian django-guardian
+commandline SAGA-Hadoop
+concepts django-concepts
+memcache_admin django-memcache-admin
+django_bootstra386view_app django-classview-bootstra386
+shell_plus django-shell-plus
+photo_upload django-webcam-photoupload
+ssify django-ssify
+cache_panel django-cache-panel
+address pyaddress
+snapper snapperbal
+cork bottle-cork
+CodernityDBPyClient CodernityDB-PyClient
+babelglade BabelGladeExtractor
+libravatar pyLibravatar
+buck buck.pprint
+testutils django-testutils
+axonchisel Ax_FuzzyTourney
+g2s django-gate2shop
+freckle_client python-freckle-client
+bot Code
+pymagic libmagic
+fidonet python-ftn
+scramble scrambled
+forecastio python-forecastio
+trello_webhooks django-trello-webhooks
+googlesitemap googlesitemap.common
+boo circus
+exportdata django-exportdata
+domainr dom
+robust_urls django-robust-i18n-urls
+ratelimit django-ratelimit2
+embedded_media django-embedded-media
+payu payup
+pypackager python-packager
+tasks tasks-py
+test_htmlgen htmlgen
+xcheck XMLCheck
+nmap python-nmap
+migrations_plus django-migrations-plus
+icons_tango django-icons-tango
+cors django-cors
+omega python-omega
+ips python-ips
+tarpipe tarpipe-python
+cms_bootstrap_templates django-cms-bootstrap-templates
+gluon web2py
+vectorformats WPServer
+realestate_cms_subscribe django-estate-cms
+trackable django-trackable
+pyntcontrib pynt-contrib
+rest_assured django-rest-assured
+colony_wsgi colony
+yify yify-sub
+bulbs django-bulbs
+comps django-comps
+djzendesk django-zendesk
+winereg bxdev
+multiforloop django-multiforloop
+cookiesessions django-cookie-sessions
+simplemodels simple-models
+pyds py_dempster_shafer
+simple_webservice django-simple-webservice
+rundeck rundeckrun
+live live_api
+smarkets smk_python_sdk
+cachalot django-cachalot
+common_templatetags django-common-templatetags
+pebble_helpers pebble-view-helpers
+twphotos twitter-photos
+test_ella_taggit ella-taggit
+sharing django-sharing
+djblog dj-blog
+django_dag django-directed-acyclic-graph
+remind_storage radicale-remind
+webnodes django-webnodes
+doitpy doit-py
+gearman_example django-gearman
+closuretree django-closuretree
+vmail django-vmail
+icinga_slack icinga-slack-webhook
+pyTunes tunes
+crawler2 proxy_crawler
+katello katello-cli
+web_hooks WebHooksDemo
+libpip2pi pip2pi
+rest_framework_gis djangorestframework-gis
+openidredis openid-redis
+extra_keywords django-extra_keywords
+fiveruns fiveruns.dash
+organizations django-organizations
+gtfsscheduleviewer transitfeed
+django_js_utils django-js-utils-nextgen
+avsubmit django-avsubmit
+captcha django-recaptcha-mozilla
+cas django-cas-client
+encodingcom encodingcom-py3
+dselector django-selector
+constraint python-constraint
+fspages django-fspages
+schedule django-scheduler
+reviews django-reviews
+bertrpc insight-bertrpc
+dpaste django-dpaste
+admin_enhancer django-admin-enhancer
+bowerlib bower.py
+pyroven django-pyroven
+genee_puppet genee-puppet-cli
+nwss nwsserver
+pickle micropython-pickle
+select2 django-select2-forms
+pushbullet pushbullet.py
+duptool_glacier_cli DupTool
+fsm_admin django-fsm-admin
+appium Appium-Python-Client
+ish_report ish_parser
+boot_bootstrap_env bootstrap_env
+snap7 python-snap7
+snot slickqa-snot
+nexus new_nexus
+widgy django-widgy
+newsletters django-newsletters
+mailboxer mailboxer-python
+agent thunderops_agent
+adminrestrict django-adminrestrict
+critic django-critic
+middleware_extras django-middleware-extras
+zenforms django-zenforms
+o rockpython
+yql yql-finance
+modelurl redsolutioncms.django-model-url
+chkcrontab_lib chkcrontab
+hubspot hubspot-contacts
+staticflatpages django-staticflatpages
+OleFileIO_PL olefile
+paxd PaxDaemonica
+eventick python-eventick
+monitoring django-monitoring-ahernp
+monetdb python-monetdb
+urlarchivefield django-urlarchivefield
+exconsole python-exconsole
+debug_template django-debug-template
+everjokeCLI everjoke
+ping pyip
+tokyo_sessions django-tokyo-sessions
+simplestatic django-simplestatic
+signpad2image python-signpad2image
+botscout django-botscout
+pins ExplorerHAT
+djcastor django-castor
+zxcvbn zxcvbn-dutch
+stepic Steganocrypto
+product Satchmo
+docutils_textile rst2textile
+DDPClient python-ddp
+django_comments django-contrib-comments
+sub_query django-sub-query
+aditam aditam.core
+devpi devpi-client
+froala_editor django-froala-editor
+rvlm rvlm.entrypoint
+smartmeter smartmeter-analyze
+spoj python_spoj
+pyjd pyjx-html5
+upip_os_path micropython-upip
+objectivejson afn
+pdfminer pdfminer3k
+representations django-representations
+preserialize django-preserialize
+data termine
+annotation typeannotations
+opaflib OPAF
+iframetoolbox django-iframetoolbox
+ncfile meteo-downloader
+bootstrap3_datetime_time django-bootstrap3-datetimepicker-timepicker
+ejson meteor-ejson
+libpathod pathod
+redis_admin django-simple-redis-admin
+filenamesearch TracFilenameSearch
+su django-switch-user
+fluent fluent-logger-pyramid
+objectdump django-objectdump
+stathatasync stathat-async
+rest_common django-rest-common
+dashgen python-graphite-dashgen
+grunted_assets django-grunted-assets
+admin_honeypot django-admin-honeypot
+rest_framework_oauth django_rest_framework_oauth
+extdirect extdirect.django
+filewatch pyfilewatch
+dojo thoreg_dojo
+aps_process django-aps-process
+nsi nsi.svgtool
+lightertheme trac-LighterTheme
+plecost_lib plecost
+ttp twitter-text-python
+canary pCanary
+example_documentation django-documentation
+Genetic Pyvolution
+nested_inlines django-nested-inlines
+iptc python-iptables
+testlink TestLink-API-Python-client
+template_analyzer django-template-analyzer
+pinata pinterest-pinata
+dev_tool vim-vint
+threadless_router rapidsms-threadless-router
+rosetta django-rosetta
+vkontakte_api django-vkontakte-api
+monitor deliver
+bibulous_test, bibulous
+sqlpaginator django-sqlpaginator
+idlexlib idlex
+wtformsparsleyjs WTForms-ParsleyJS
+csv_ccbv django-csv-ccbv
+faves django-faves
+yaml PyYAML
+broadcasts django-site-broadcasts
+djb djb.headerproxy
+recdoc RecursiveDocument
+facetools django-facetools
+gel pygel
+nonblockingloghandlerversion nonblockingloghandler
+instantly instantpl
+tailf pytailf
+sidertests Sider
+views automium_web
+adminhelp django-adminhelp
+pushover python-pushover
+markitup django-markitup
+dated_values django-dated-values
+fancy_cache django-fancy-cache
+nation python-nation
+htsql_sqlite HTSQL
+satchmo_ext Satchmo
+eurotherm3500 MinimalModbus
+SudsLibrary robotframework-sudslibrary
+backtalk django-backtalk
+oembed_works django-oembed-works
+custom_user django-custom-user
+permissions django-perms
+pychart Python-Chart
+ukpostcodeutils uk-postcode-utils
+familytree django-familytree
+hokuyo hokuyo-python-lib
+test_utilities django-test-utilities
+dojoserializer django-dojoserializer
+djangohbs django-hbs-makemessages
+printlist kevinlist
+crypto NeedForCryptography
+scraperwiki fakerwiki
+ydisk ypload
+request_id django-request-id
+icons_famfamfam django-icons-famfamfam
+hijack django-hijack
+transparencydata python-transparencydata
+last_seen django-last-seen
+dbfpy m3-dbfpy
+javascript_settings django-javascript-settings
+sortedm2m django-sortedm2m
+djbiblio django-biblio
+contextio context-io-2
+mothertongue django-mothertongue
+monitord afn
+py3kwarn2to3 py3kwarn
+yournester linester
+contrib cloudbiolinux
+py27compat jaraco.compat
+hackernews haxor
+qinspect django-queryinspect
+googlecl google_cl
+neutralityFR django-neutralityFR
+buzz buzz-python-client
+ipuin GauminIpuin
+scalyr_agent scalyr-agent-2
+pythius pythius_zsp_ver
+zpmlib zpm
+pygson pygments-json
+space tiddlywebplugins.tiddlydocs
+remote_finder django-remote-finder
+diffevolution notebooktools
+f7u12 nose-f7u12
+parsedatetime done
+factory factory_boy
+dbgettext django-dbgettext
+tapioca tapioca-wrapper
+akb48 pyakb48
+odnoklassniki_discussions django-odnoklassniki-discussions
+marconiclient python-marconiclient
+txjsonrpc txJSON-RPC
+adspanel TracAdsPanel
+grappelli_menu grappelli-side-menu
+go_gae_proxy go-proxy-client
+innodb_tablespace_info innodb-space
+cufon django-cufon
+eagle eagle-gtk
+ibidem ibidem-django-util
+service_discovery microhackaton-service-discovery-py
+punky PunkyBrowster
+goto goto-dir
+simple_seo django-simple-seo
+gae_restful_lib python-rest-client
+nameme name-me
+ghdiff ghdiff_class
+presets PBPWScraper
+stubtools django-stubtools
+embed django-embed
+music_store eMusic-store
+unfriendly django-unfriendly
+garcimore django-garcimore
+file_sharing django-file-sharing
+fahrenheit2celsius,fahrenheit2kelvin,__init__ Tempmrg
+orb orb-api
+rtkinter afn
+socialaggregator emencia-django-socialaggregator
+jquery_lightbox django-jquery-lightbox
+rbac simple-rbac
+randomslugfield django-randomslugfield
+static_compiler django-static-compiler
+imhotep penthu
+dbmessages django-dbmessages
+lucenequerybuilder lucene-querybuilder
+jwt PyJWT
+easy_news django-easy-news
+libarchive libarchive-c
+codegen templetize
+tornadows tornado-webservices
+hstore_field hstore-field-caseinsensitive
+errno micropython-errno
+routes pybald-routes
+trashcli trash-cli
+oslo_versionedobjects oslo.versionedobjects
+first first_program
+drivecasa drive-casa
+zam zam.locales
+marionettejs django-marionettejs
+test_rfc6266 rfc6266
+xm xm.portlets
+oauthtwitter oauth-python-twitter
+time_tracking_hook taskwarrior-hook-time-tracking
+data_exporter django-data-exporter
+xd XD-tool
+blink avrpython
+mailrobot django-mailrobot
+setuptools_utils dj-analytics
+waitinglist django-waitinglist
+Flickr Flickr.API
+djrichtextfield django-richtextfield
+easy_avatar django-easy-avatar
+remind_abook_storage radicale-remind
+captcha_admin django-captcha-admin
+kinopoisk kinopoiskpy
+gmzoom_tools django_gmzoom_tools
+SES pysrs
+statsdclient pysvcmetrics
+imagemodal xblock-image-modal
+naudio nose-audio
+Mozilla compare-locales
+langswitch django-langswitch
+configdir django_configdir
+carson django-carson
+wordpresspm Wordpress-Package-Manager
+draft django-draft
+nested_forms django-nested-forms
+nginx python-nginx
+djangofab django-fab
+fake_filesystem pyfakefs
+hgwebproxy django-hgwebproxy
+bits django-bits
+dynamic_machine DynamicMachine
+editor py_curses_editor
+tvdb_cache tvdb_api
+revuo django-revuo
+output_validator django-output-validator
+coop_bar apidev-coop_bar
+courier courier-py
+jsroutes pyramid-jsroutes
+djpjax django-pjax
+ledsign pyLEDSign
+tempus django-tempus
+cmds hangulize
+easy_pjax django-easy-pjax
+timerd afn
+formaldehyde django-formaldehyde
+logcatcolor logcat-color
+scbv django-scbv
+shop_braintree django-shop-braintree
+copy micropython-copy
+pytestqt pytest-qt
+generic_helpers django-generic-helpers
+class_based_auth_views django-class-based-auth-views
+jenkinsapi_tests jenkinsapi
+ResourceMutexManager ResourceMutexManagement
+ajax_model_listing django-ajax-model-listing
+tuenti python-tuenti
+transaction_signals django-transaction-signals-do-not-use
+test_ella ella
+extended_templates djaodjin-extended-templates
+distill distill_framework
+tornadoencookie tornado-encookie
+rdioapi Rdio
+closeio_api closeio
+selectable_select2 django-selectable-select2
+livefield django-livefield
+janitor django-janitor
+xls2po django-xls2po
+dynamic_initial_data django-dynamic-initial-data
+sirtrevor mezzanine-sirtrevor
+documentation django-documentation
+le_social django-le-social
+rtwilio rapidsms-twilio
+xross django-xross
+composite_field django-composite-field
+test_app django-sub-query
+trac_captcha TracCaptcha
+termstyle python-termstyle
+inviter2 django-inviter2
+locations django-locations-base
+getpass micropython-getpass
+pagedown django-pagedown
+mptt django-mptt
+fuimodules fui
+drivecli google-drive-cli
+envcfg python-envcfg
+allel scikit-allel
+talis python-rest-client
+djboss django-boss
+djangopipstarter django-pip-starter
+speakd afn
+mobiledetect pymobiledetect
+silhouette django-silhouette
+sitetree django-sitetree
+djcelery_transactions django-celery-transactions2
+mdemos mdemos.menus
+eagleeye eagleeye_te
+nrepl nrepl-python-client
+markdown_deux django-markdown-deux
+listmilestones ListMilestonesMacro
+ktsessions kt-flask-sessions
+pythonwifi python-wifi
+pysiriproxy zopyx.pysiriproxy
+luxuryadmin links-luxuryadmin
+calendar_sms django-calendar-sms
+teracy teracy-django-html5-boilerplate
+batman Bat-man
+visualphysics QProcessing
+tab_translation twentytab-tab-translation
+onesky django-onesky
+entity_event django-entity-event
+openid_cla python-openid-cla
+begin begins
+bootstrap_form_horizontal django-bootstrap-form-horizontal
+erp5 erp5.extension.sectionextender
+open_facebook django-facebook
+trace crepo
+bzETL Bugzilla-ETL
+compress el-django-compress
+oslo_i18n oslo.i18n
+sshctrl sshlauncher
+multipageforms django-multipageforms
+geobricks_geocoding GeobricksGeocoding
+ibge django-ibge
+wiringx86 Wiring-x86
+rsscloud django-rsscloud
+serializers django-serializers
+redis_queue redis-queue-pyclj
+dynamicforms django-dynamicforms
+mockito_test mockito-lwoydziak
+alm alm.solrindex
+latex django-latex
+classycode sphinx-classy-code
+simple_history django-simple-history
+mailgun mailgunapi-client
+abstract_templates django-abstract-templates
+libwparse afn
+ppjp kw_ppjp.chat
+dev_project djadmin_export
+dblite scrapy-dblite
+islykill py-islykill
+googleplaces python-google-places
+sample_project django-file-picker
+responsive_dashboard django-responsive-dashboard
+sunset django-sunset
+spp SweetPotatoPy
+kegmeter kegmeter-common
+vector_dict VectorDict
+salt salt-ssh
+event_procedures django-event-procedures
+pseudo_cms django-pseudo-cms
+mdx_asciimathml asciimathml
+detective django-detective
+nestedformsets django-nested-formsets
+zeomega zeomega.recipe.mxodbcconnect
+modgrammar modgrammar-py2
+rated django-rated
+show File-Searcher
+qisrc qibuild
+heka_raven heka-py-raven
+xorformfields django-xor-formfields
+gitorious_mrq gitorious-mrq-monitor
+pinguino_api PinguinoAPI
+zanox python-zanox-api
+datagrid django-datagrid
+difio_cctrl_python difio-cloudcontrol-python
+rosetta_inpage django-rosetta-inpage
+typogrify django-typogrify
+whatsnew django-whatsnew
+biometrics django-biometrics
+thumborize django-thumborize
+servee_tinymce django-servee-tinymce
+toadd swiss
+generate_path django-upload-path-generator
+oauthlib yos_social_sdk
+toastmessage django-toast-messages
+datacanvas pyDataCanvas
+qipkg qibuild
+tellcore tellcore-py
+autobus2 afn
+djangoChat django-ajax-chat
+extra_cbv django-extra-cbv
+modeldict django-modeldict
+black blacknwhite
+vtixy_proxy VTIXyProxy
+xmpp SPADE
+pipeline_rapydscript django-pipeline-rapydscript
+wsmeext WSME
+traxauth django-traxauth
+icons_onebit django-icons-onebit
+builtwith python-builtwith
+secretballot django-secretballot
+novaclient_secretkey novaclient-auth-secretkey
+gaendb factoryboy-gaendb
+jynester wldyd23
+contracts PyContracts
+table_prefix django-table-prefix
+ccnews django-ccnews
+maja_newsletter django-maja-newsletter
+txeasypika tx-easy-pika
+piston marcio0-django-piston
+usbtmc python-usbtmc
+ilogue readable
+pygithub3 pygithub3-intellisense
+pcapparser pcap-parser
+geo geomodel
+OpenElectrons_BMP180 OpenElectrons_IMUbreakout
+apply_linkedin python-apply-linkedin
+settings_context_processor django-settings-context-processor
+facebook_gallery django-facebook_gallery
+gridData GridDataFormats
+pgcryptoauth django-pgcryptoauth
+svnweb afn
+test_equivalence equivalence
+piquant_unit_prefs piquant
+ssl_slapper django-ssl-slapper
+app_namespace django-app-namespace-template-loader
+template_repl django-template-repl
+AthleteList CMGAathletelist
+osmp django-osmp
+yafotki django_yafotki
+verification django-verification
+seo_analyzer google-seo-analyzer
+log_register django-log-register
+hotness the-new-hotness
+jabberbot moin
+wiki django-wikiapp
+jingo_offline_compressor django-jingo-offline-compressor
+dt_tkobjects tkhelp
+datatables django-datatables
+tutum python-tutum
+parse_uri pyparseuri
+magcode magcode-core
+TopHat_Platform TopHat
+pybcs Flask-BCS
+connections django-connections
+easy_maps django-easy-maps
+cookiesession django-cookiesession
+subheadings nose-subheadings-plugin
+fluidinfo fluidinfo.py
+getty_art GettyArt
+cloudooo cloudooo.handler.pdf
+object_proxy ObjectProxy
+tornad_io SocketTornad.IO
+sqldisco sql-disco
+iqm python-iqm
+drealtime django-realtime
+skarabaeus_server_manager skarabaeus-server
+jz jz.datetime
+bbox_tiler bboxtiler
+UniversalLibrary PyUniversalLibrary
+configurations django-configurations
+glaze django-glaze
+representatives represent-representatives
+forecast sibyl
+python_prefork_test python_prefork
+jtl python-jtl
+PdbTextMateSupport PdbTextMateSupport2
+kmos python-kmos
+secwall sec-wall
+typeaheadjs django-staticfiles-typeaheadjs
+bootstrap3 django-bootstrap3
+municipios django-municipios
+pyirc pyIRCframework
+edamame django-edamame
+fcntl micropython-fcntl
+easyzone easyzone3
+xhostplus xhostplus.videojs
+pabot robotframework-pabot
+m3_ext m3-ui
+threadedcomments django-threadedcomments
+smbclient PySmbClient
+jw jw.util
+cacheds3storage django-cacheds3storage
+analyzer SeoAnalyzer
+lava_scheduler_daemon lava-scheduler
+media_utils django-media-utils
+html_node HtmlNode
+sunlightcongress django-sunlightcongress
+setup_utils pyls
+repomgmt django-repomgmt
+fretboard django-fretboard
+senex_shop django-senex-shop
+coupons django-coupons
+foxtrot foxtrot-client
+syllabify greek-accentuation
+gsmirroring gsmirror
+votesmart python-votesmart
+app_test_runner django-app-test-runner
+basic_email django-basic-email
+cram_unit CramUnit
+nanothreads FibraNet
+WebProcessingServer WPServer
+dockit django-dockit
+s list_print
+ifgy_login django-ifgy-login
+householdsim mosaik-householdsim
+mail_confirmation django-mail_confirmation
+gantt python-gantt
+flask_fas python-fedora
+jfu django-jfu
+taggit_templatetags django-taggit-templatetags
+tdt TDTPy
+paramiko paramiko-on-pypi
+stored django-stored-queryset
+closable_admin_filter django-closable_admin_filter
+unittest micropython-unittest
+admin_import django-admin-import
+por por.karma
+colorbox coop-colorbox
+usecase PyUseCase
+flipflop afn
+sparkblocks py-sparkblocks
+libfuturize future
+default_dont_cache django-default-dont-cache
+amazonproduct python-amazon-product-api
+flask_fas_openid python-fedora
+nose nose-for-sneeze
+zopyxep2011 zopyx.ep2011
+yamlfield django-yamlfield
+template_bootstrap django-template-bootstrap
+ubuntudesign ubuntudesign-asset-mapper
+metatags djlime-metatags
+celery_admin django-celery-admin
+maro django-maro
+central_message django-central-message
+assetstoolkit django-assets-toolkit
+Arduino arduino-python
+reuters python-reuters
+sphinxtheme sphinxtheme.readability
+cached_modelforms django-cached-modelforms
+django_inlines inlines
+marx marx-workflows
+libstatmonitor afn
+djenum django-enum
+propane_distribution engineer
+jquery_tablesorter django-jquery-tablesorter
+robotpy_ext robotpy-wpilib-utilities
+linkedin_json_client linkedin-api-json-client
+libbucket bucket
+monsieur django-monsieur
+pinyin redsolutioncms.django-hex-storage
+blogtools glamkit-blogtools
+commands django-commands
+fab_deploy2 red-fab-deploy2
+cities_light django-cities-light
+tkinter future
+masonry django-staticfiles-masonry
+diplomat django-diplomat
+mediorc_dns mediorc
+WAVELibrary robotframework-wavelibrary
+flask_celery Flask-Celery-Helper
+klaus django-klaus
+crumb crumb.py
+searchify django-searchify
+googlegeocoder python-googlegeocoder
+slumber slumber-fork
+djwebhooks dj-webhooks
+plugin pytest-remove-stale-bytecode
+colourlovers python-colourlovers
+nomnom django-nomnom
+profiler django-live-profiler
+Bizowie Bizowie.API
+appserver broadwick
+somadrmaa soma-workflow
+ovrsdk python-ovrsdk
+otp_twilio django-otp-twilio
+ordered_listview django-ordered-listview
+responsive django-responsive
+whiteprint Flask-Whiteprint
+make_video pymorphous
+athumb django-athumb
+bootstrap_markdown django-bootstrap-markdown-editor
+libpasteurize future
+todoist todoist-python
+adworks django-adworks
+soil django-soil
+install_component distribute-install_component
+ivi python-ivi
+elastimorphic django-elastimorphic
+geobricks_modis GeobricksMODIS
+test_garlicsim garlicsim
+cabalgata cabalgata-silla-de-montar
+tinyurl python-rest-client
+moztelemetry python_moztelemetry
+geoip_utils django-geoip-utils
+datastore datastore.objects
+formfield django-formfield
+oauth2client google-api-python-client
+ivy ivy-phylo
+zhw zhk
+parse_rest ParsePy
+ipythonpip ipython-pip
+ratelimit9 django-ratelimit9
+l10n Satchmo
+pax Djax
+edition1 edition1.twitterportletfix
+tour django-tour
+archive python-archive
+flatpages_tinymce django-flatpages-tinymce
+debug_informer django-debug-informer
+openerplib openerp-client-lib
+semetric semetric.apiclient
+subunit python-subunit
+events django-theherk-events
+pan pan-python
+nunchuck Nunchuck_pi
+uofu afn
+ddh_utils ddh_django_utils
+cache_utils django-cache-utils
+pyraml pyraml-parser
+url_images python-url-images
+mongo_auth django-mongo-auth
+pypln pypln.api
+bencode BitTorrent-bencode
+monitorircbot afn
+altauth django-altauth
+nocaptcha_recaptcha django-nocaptcha-recaptcha
+fruit SimpleExampleEgg
+thirtycli thirty-cli
+misspellings_lib misspellings
+attributes django-attributes
+wpd wpd.mmxi.countdown
+tweet-tool Tweet-Command-Line-Tool
+cmsplugin_bootstrap djangocms-bootstrap
+ipaddress backport_ipaddress
+six pi3d
+multiselectbox TracMultiSelectBoxPlugin
+httplog django-httplog
+genxmlif minixsv
+tracking django-tracking-jl
+djxml django-xml
+nessy nessy-cli
+composite_form django-composite-form
+hwinfo python-hwinfo
+nvd3 python-nvd3
+api_utils Flask-API-Utils
+damn django-amn
+specfor python-specfor
+eureka python-eureka
+bibulous, bibulous
+paymentwall paymentwall-python
+shop_bulkform django-shop-bulkform
+gemfire gemfire-rest
+usernameless django-usernameless
+unjoinify django-unjoinify
+djssoclient dj-sso-client
+photoprocessor django-photoprocessor
+debug_toolbar_extra django-debug-toolbar-extra
+iti1480a ITI1480A-linux
+sluggee django-sluggee
+simple_geo django-simple-geo
+awlsimhw_debug awlsim
+odnoklassniki_api django-odnoklassniki-api
+tip django-tip
+workflows django-workflows
+scrumtools scrum-tools
+rest python-rest
+Digenpy_ Digenpy
+cp_sqlalchemy CherryPy-SQLAlchemy
+blink1_tests blink1
+app_data django-appdata
+emarsys python-emarsys
+vkontakte vkontakte2
+djcssmin django-cssmin
+user_rofile user_profile
+pijaz pijaz-sdk
+IssueTrackerMassContainer IssueTrackerProduct
+insight django-insight
+mdx_mdSTable mdSTable
+clear_cache django-clear-cache
+pouchdb Python-PouchDB
+locationstree django-locationstree
+mongo_descriptors MongoDescriptors
+loop_print loopprint
+session_csrf_cookie django-session-csrf-cookie
+gcm python-gcm
+Mollie mollie-api-python
+smsapi python-smsapi
+bootstrap3_datetime django-bootstrap3-datetimepicker
+djeasytests ls-django-easytests
+samples oosapy
+haystack django-haystack
+dicks python-dicks
+example_sim mosaik-api
+careers mezzanine-careers
+dynect DynectDNS
+nickmab nickmab.async_util
+mollom django-mollom
+psi django-psi
+jiebarpc jieba-rpc
+PySide qt_backport
+TestWsgisvc wsgisvc
+pymysqlreplication mysql-replication
+sudokulib sudoku-solver
+spaceapi python-spaceapi
+blender26-meshio pymeshio
+pybars pybars3
+zinnia_wordpress wordpress2zinnia
+oobjlib openobject-library
+moo python-moo
+postalcodes django-postalcodes
+redis_metrics django-redis-metrics
+Selenium2Screenshots robotframework-selenium2screenshots
+OpenElectrons_L3GD20 OpenElectrons_IMUbreakout
+phpbb phpbb-python
+apikit tornado-api-kit
+boboserver bobo
+xurrency pyXurrency
+noembed py-noembed
+ebaysync django-ebaysync
+dragonpy DragonPyEmulator
+pyrand Pyntifex
+depot filedepot
+fortune fortune.py
+cacheops django-cacheops
+ucf UCFlib
+test_temp_dir temp_dir
+miracle miracle-acl
+reqlcli reql_cli
+crystalxtheme TracCrystalXTheme
+plugshop django-plugshop
+aloha_editor django-aloha-editor
+jnpr junos-eznc
+qt_create roscreate-qt-pkg
+groupcache django-groupcache
+output cashew
+dns_failover python-dns-failover
+cronlog python-crontab
+multiupload django-multiupload
+djadmin_ext django-admin-ext
+gflags python-gflags
+fake_filesystem_shutil pyfakefs
+elixir_validations sqlalchemy_elixir_validations
+secure_login django-secure-login
+pushy Django-Pushy
+veracity python-veracity
+beyondskins beyondskins.ploneday.site2009
+modelmixins django-model-mixins
+tiendateca django-tiendateca
+l list_print
+nanotubes FibraNet
+streetaddress street-address
+rdcelery_email rd-celery-email
+djlibcloud dj-libcloud
+bylaws django-bylaws
+kidotest django-kidotest
+csfd csfd-parser
+jinja2cli jinja2-cli
+sphinx_pypi_upload ATD_document
+PyGlfwCffi pyglfw-cffi
+fenixedu fenixedu_api_sdk
+pod py-pod
+donottrack django-donottrack
+nosextraceback xtraceback
+remotesupport openproximity-plugin-remotecontrol
+staticdocsplugin staticdocs-plugin
+PyGitUp git-up
+truncate trunkate
+backport_abcoll backport_collections
+sqlserver_ado django-mssql
+gearman twisted-gears
+bento kiji-bento-cluster
+templatetags django-bbs
+slick django-slick
+legal django-legal
+epo_ops python-epo-ops-client
+printlistall PrintNestedLists
+flatcontent django-flatcontent
+fbapps django-fbapps
+redisdl redis-dump-load
+redisdb django-redisdb
+kvideos django-kvideos
+health_check_celery django-health-check
+aggregates django-aggregates
+ib ib-api
+crowdsourced_fields django-crowdsourced-fields
+neolib neolib2
+oslo_context oslo.context
+opencivicdata opencivicdata-django
+test_webstar WebStar
+class_backed_field django-class-backed-field
+updict python-updict
+ddbd dynamodict
+nmd nmd.plonelinkasvideoembed
+dbDesigner django-softmachine
+nmb pysmb
+viewtracker django-viewtracker
+nma nma-python
+MoinMoin moin
+hive_service hive-thrift-py
+elementtree citelementtree
+github_apiv3 ghtix
+_ list_print
+awesome_avatar django-awesome-avatar
+i18n_helper django-i18n-helper
+firebird django-firebird
+daddy_avatar django-daddy-avatar
+oauth_provider django-oauth
+favorite django-favorite
+taxon redis-taxon
+social_poster django-social-poster
+tsort pytsort
+RandomLibrary robotframework-randomlibrary
+acoustid pyacoustid
+testimony django-testimony
+contextPy PyDCL
+appcms django-appcms
+bond python-bond
+model_urls django-model-urls
+ZSI infi.ZSI
+admin_ip_whitelist django-admin-ip-whitelist
+mbtilesmap django-mbtiles
+UploadGarmin GcpUploader
+qqweibo pyqqweibo
+aeso pyaeso
+smartcov pytest-smartcov
+giturl giturl.py
+djangobwr django-bower-app
+mail_templated django-mail-templated
+harness django-harness
+pageblocks django-pageblocks
+mpdserver python-mpd-server
+postmark_inbound python-postmark-inbound
+smsaero django-smsaero
+twittersync django-twittersync-extended
+eventnet FibraNet
+lob lob-python
+template_email django-template-email
+userena django-userena
+_gauged gauged
+pagination_bootstrap django-pagination-bootstrap
+tsearch2 django-tsearch2
+cycodegenlib cython-codegen
+ttdb django-ttdb
+robotc robotc-wrapper
+autoapi django-auto-api
+torqsubmit torque-submit
+api_mask horizon_api_mask
+fity3 python-fity3
+guestbook django-guestbook
+lot django-lot
+rqueue python-rqueue
+forms_ajaxified django-forms-ajaxified
+teamwork django-teamwork
+admin_tools django-admin-tools
+disenchained django-disenchained
+sillescope Sill-E-Scope
+colorful twentytab-colorful
+simple_rest django-simple-rest
+rdio_export python-rdio-export
+recommends django-recommends
+ntlm3 python-ntlm3
+gitlab_logging django-gitlab-logging
+firebase python-firebase
+autoroot django-autoroot
+pynessus python-nessus
+rest_framework_jwt djangorestframework-jwt
+heythere django-heythere
+pymunkoptions pymunk
+aspen_jinja2_renderer aspen-jinja2
+appconf django-appconf
+oneapi oneapi-python
+sitecustomize featurelist
+pygraph python-graph-dot
+tokenapi django-tokenapi
+bootstrap_validator Django-Bootstrap3-Validator
+maksu py-viitenumero
+kokusai_bpp Kokusai_PP_pack
+ipybell IPythonBell
+graphlab_util GraphLab-Create
+bumple bumple-downloader
+ntfs python-ntfs
+forms_builder django-forms-builder
+shareddb django-shareddb
+angular_scaffold django-angular-scaffold
+charting django-charting
+djutils sw-django-utils
+stack question-stack
+satchmo_skeleton Satchmo
+pacman python-pacman
+ember django-ember
+OE_explorerlib OpenElectrons_i2c
+requests1 requests-transition
+icons_splashyicons django-icons-splashyicons
+emailit django-emailit
+newspaper_parser ditaparser
+lilyshow lijielily
+kladr m3-kladr
+admin_multiselect django-admin-multiselect
+sql_interp done
+restful_lib python-rest-client
+xsendfile django-xsendfile
+lib2or3 2or3
+gitsearchreplace git-search-replace
+dolmen dolmen.builtins
+rethinkdb rethinkdb-py3
+superview django-superview
+vkontakte_board django-vkontakte-board
+rauthall django-rauthall
+dialogos geonode-dialogos
+templated_email django-templated-email-db
+chessproblem chessproblem.ui
+octokit octokit.py
+bvggrabber bvg-grabber
+oppia django-oppia
+cbs django-classy-settings
+hgadmin django-hgadmin
+cbv django-cbv
+sphinxserver sphinx-server
+__autoversion__ autoversion
+quickbooks quickbooks-python
+rainbowtests django-rainbowtests
+gist python-gist
+users_api django-users-api
+gfklookupwidget django-gfklookupwidget
+geobricks_processing GeobricksProcessing
+antenna sqs-antenna
+pypiclassifiers pypi-classifiers
+asciibinary AsciiBinaryConverter
+redirect_plus django-redirect-plus
+NextPlease Django-Next-Please
+pmr pmr.wfctrl
+prism logprism
+declination declination_angle
+eaternet eaternet-adapters
+puppy django-puppy-cache
+keybinder python3-keybinder
+userjs django-userjs
+rest_framework_bulk djangorestframework-bulk
+operun operun.media
+dynamic_choices django-dynamic-choices
+liblax lax
+mdx_subscript MarkdownSubscript
+custom_test_descriptor nose-customdescription
+committees django-committees
+gmapi django-gmapi
+msgpack msgpack-python
+maskurl django-maskurl
+googlecharts django-google-charts
+upaas upaas-common
+static_sitemaps django-static-sitemaps
+templatetag_sugar django-templatetag-sugar
+libraclient python-libraclient
+ssdk ssh-deploy-key
+jcache django-jcache
+backward django-backward
+gravatar_plus pelican_gravatar_plus
+stdnum python-stdnum
+sniplates django-sniplates
+wikiware python-wikiware
+urlographer django-urlographer
+ajax_loading_overlay django-ajax-loading-overlay
+log_request_id django-log-request-id
+factory_peewee factory_boy-peewee
+shorturls django-redirecturls
+mimic gmcquillan-mimic
+validator validator.py
+revolutionslider djangocms-revolutionslider
+smokealarm django-smokealarm
+geocolombia django-geocolombia
+alo django-alo-forms
+addattr djangoaddattr
+pvectorc pyrsistent
+fakeredis fakeredis-fix
+handleui cloudsafe
+groundwork django-groundwork
+android_benchmark_views_app android-benchmark-views
+json_views django-generic-json-views
+photostash photostash-client
+kestrel pykestrel
+clonevirtualenv virtualenv-clone
+pty micropython-pty
+c2 c2.manage.sharesetting
+permissions_widget django-permissions-widget
+cmsplugin_news cmsplugin-ink-news
+easymoney django-easymoney
+cms_chunks django-cms-chunks
+pyramid_rest pyramid_rest_framework
+vertica_backup vertica-swift-backup
+email_template django-email-template
+ndator django-ndator
+dynamicsiteslite django-dynamicsites-lite
+subitosms python-subitosms
+tornadopgsql tornado-pgsql
+weed python-weed
+gp gp.fileupload
+tr termrule
+djqscsv django-queryset-csv
+djedi djedi-cms
+ajaxcomments django-ajaxcomments
+init Auto_Python_2014
+clifa_launch clifa
+clipy clipy-dl
+batchapps azure-batch-apps
+zmq pyzmq-ctypes
+crest Python-Crest
+wmd django-wmd-editor
+inetutils pyip
+mpd python-mpd
+simple_settings django-simple-settings
+dmutex django-mutex-event
+validate configobj
+detention django-detention
+wiretap django-wiretap
+ddf_setup django-dynamic-fixture
+odnoklassniki_photos django-odnoklassniki-photos
+qitest qibuild
+glanceclient python-glanceclient
+wsa wsa_cli
+deployutils djaodjin-deployutils
+mailing django-mailing
+pbp pbp.buildbotenv
+tracwatchlist TracWatchlistPlugin
+overcli overc
+autoclosingqueue nonblockingloghandler
+swingtime django-swingtime
+pelix iPOPO
+helloworld TracTixSummary
+smallpress tgapp-smallpress
+Instruct File-Searcher
+currency_rates django-currency_rates
+jsonselect pyjsonselect
+setuptest django-setuptest
+mkrst_themes 2lazy2rest
+dummyplug django-dummy-plug
+live_support django-live-support
+eventtools glamkit-eventtools
+django_stupid_storage djangostupidstorage
+github_hook django-github-hook
+arc_utils ArcUtils
+webdav Python_WebDAV_Library
+fence django-fence
+test_path path.py
+gapipy gapi-python
+excel_response django-excel-response
+yamlformatter python-yaml-logger
+private_media django-private-media
+mikado mikado.oss.doctest_additions
+past future
+dirtt python-dirtt
+health_check django-health-check
+multiuploader django-multiuploader
+nosclient python-nosclient
+s3fileup django-s3fileup
+admin_utils django-admin-utils
+justcoin justcoin-sdk
+Observation ish_parser
+nani django-nani
+devenv reahl-tofu
+citations django-citations
+pdf_collate py-pdf-collate
+abo abo-generator
+ghostdown django-ghostdown
+awis python-awis
+issues django-issue-synchronisation
+wellrested python-wellrested
+imfun image-funcut
+wham django-wham
+plush plush_web
+sphinxnose sphinx-nose
+efl_utils python-efl-utils
+google_oauth django-google-oauth
+admin_keyboard_shortcuts django-admin-keyboard-shortcuts
+djsentrylogs django-sentrylogs
+advanced_redirects django-advanced-redirects
+tags brace-tags
+optparse micropython-optparse
+flask_s3 Flask-S3-gzip
+component Auto_Python_2014
+codebase codebase-api
+ajax_changelist django-ajax-changelist
+pyvotecore python-vote-core
+sphinxcontrib_phpautodoc tk.phpautodoc
+threads pylinktester
+appscale appscale-tools
+httpproxy django-http-proxy
+setuptools humblesetuptools
+dogshell dogapi
+mediastore django-mediastore
+qitoolchain qibuild
+publisher django-publisher
+pwmDriver ledDriver
+divisor divisor_g2
+kupu kupu.mashups
+robotstxt TracRobotsTxt
+iso3166 django-iso3166
+saltcloud salt-cloud
+bpython bpython-gist
+exampleapp django-galleries
+sx pisa
+miniature miniature-ironman
+myfact fanny
+dynamicForms dynamic-forms
+hamster hamster-sqlite
+action ActionServer
+mentions django-mentions
+fixtures atramhasis
+fieldlevel django-fieldlevel-permissions
+options django-qoptions
+sampleapps cocy
+proxy django-proxy
+authorize AuthorizeSauce
+newsflash TracNewsFlash
+suave django-suave
+queryplan hive-thrift-py
+guacamole pyguacamole
+qsstats django-qsstats-magic
+parsely python-parsely
+S3 s3cmd
+cratis_i18n django-cratis-i18n
+anthill anthill.exampletheme
+dj_database_url dj-config-url
+logscanlib logscan
+feaas tsuru-feaas
+frontmatter python-frontmatter
+webcache django-webcache
+icecat django-icecat
+registration_html_email django-registration-html-email
+wheeljack wheeljack-repoman
+pydataportability pydataportability.model.resource
+emoji django-emoji
+marketo pymarketo
+ga_tracking django-ga-tracking
+mailqueue django-mail-queue
+image_gallery cmsplugin-image-gallery
+tethys_datasets django-tethys_datasets
+locking_south django-locking-south
+smart_cache_control django-smartcc
+nose2gae nose2-gae
+esr python-esr
+interception py_interception
+modelqueryform django-modelqueryform
+caslib caslib.py
+rules_light django-rules-light
+tidings django-tidings
+extract_features PyOracle
+foursquare foursquare.pants.changed
+geetar django-geetar
+git_command crepo
+jsondb jsondatabase
+site_status django-site-status
+_pdbpp_path_hack pdbpp
+wialon python-wialon
+nosenumpyseterr nose-numpyseterr
+rest_framework_json_patch drf-json-patch
+more more.static
+clouddns python-clouddns
+smscoin django-smscoin
+clearcache clearcache-python
+mysql_pymysql django-mysql-pymysql
+xivo_client xivo-client-sim
+cloud_browser django-cloud-browser
+multisessionform django-multisessionform
+linfir linfir.mdtex
+italian_utils django-italian-utils
+omegacn7500 MinimalModbus
+testrecorder django-testrecorder
+linkedin python-linkedin
+uuidfield django-uuidfield
+graphiqueclient graphique-client
+numbergen param
+urli18n django-urli18n
+mass_post_office django-mass-post-office
+parse meteo-downloader
+vendapin pyvendapin
+a_test aldream_test
+simpleAudio csumb205-multimedia
+hwit hwit-edit
+test_boozelib BoozeLib
+pollngo django-pollngo
+dev cli-dev
+test_pg13 pg13
+foiidea froide-foiidea
+discover_runner django-discover-runner
+nanolog django-nanolog
+PackageInstallCheck package-install-check
+failedloginblocker django-failedloginblocker
+v vpy
+fsfield django-fsfield
+dpl1_main dj-vga-w1
+object_storage softlayer-object-storage
+globalregister GlobalRegisterPlugin
+car_wash_queueing queueing_network_system_simpy
+rest_test_data django-rest-test-data
+history django-historicalrecords
+langacore langacore.kit.i18n
+planbox python-planbox
+xmlunittest xmlunittestbetter
+colony_start colony
+magnet magnetpy
+galleries django-galleries
+autumn autumn2
+magento python-magento
+deb822 python-debian
+errortemplates django_errortemplates
+sense sense-python-client
+piquant_no_units piquant
+jsonrpclib jsonrpclib-pelix
+paho paho-mqtt
+openapp_indivo openapp_indivo_adminsite
+Evtx python-evtx
+validate_on_save django-validate-on-save
+clint clint2
+pyschema_extensions pyschema
+easy_timezones django-easy-timezones
+social_media_links django-social-media-links
+simpy simpy.io
+smsc django-fs-smsc
+make_gource pymorphous
+csc csc-utils
+dkim dkimpy
+snippet emencia-cms-snippet
+menus django-cms
+aspen_tornado_engine aspen-tornado
+dota2 pydota2
+freshly django-freshly
+rtlsdr pyrtlsdr
+responsive_design_helper django-responsive-design-helper
+debug_toolbar django-debug-toolbar
+django_twitterstream twitterbeat
+dash_py dash.py
+snapshot django-snapshot
+easy_contact_setup django-easy-contact-setup
+adminsortable django-admin-sortable
+drdump dr-dump
+htmlvalidator django-html-validator
+splunklib splunk-sdk
+alibaba alibaba-python-sdk
+fitapp django-fitbit
+fb fb.py
+plonehrm plonehrm.dutch
+described_routes DescribedRoutes
+BTL BitTorrent-bencode
+virtualenv_support virtualenv
+fk Flipkart
+bloom BloomFilter
+fm django-fm
+smartbus smartbus-client-python
+argparse gxargparse
+fassembler fassembler.configparser
+basemap basemap_Jim
+fdtsqlalchemy fdt-sqlalchemy
+sqlalchemy_tree SQLAlchemy-ORM-tree
+cloudcaster aws_ops
+iress pyress
+namecoinrpc opendig
+callback django-callback
+tornadoalf tornado-alf
+tinyschedule django-tinyschedule
+googleauth django-googleauth
+mobler django-mobler
+application_settings django-application-settings
+grizzled grizzled-python
+osinfo python_osinfo
+geogigpy geogig-py
+admin_csv django-admin-csv
+underscore django-underscore
+metwit metwit-weather
+naginator_publisher jenkins-job-builder-naginator
+cked twentytab-cked
+dudaclient dudac
+Components ish_parser
+permissions_logging PermissionsLogging
+splitjson django-split-json-widget
+update_conf_py update-conf.py
+runner SharQServer
+bitcoinrpc bitcoin-python
+filters django-filters
+uwsgi_mail django-uwsgi-mail
+adminextensions django-admin-extensions
+notificationoptout NotificationOptOutPlugin
+mach_info django-snikt
+plex_activity plex.activity.py
+primary_filters django-primary-filters
+PyGitUpAll git-up-all
+analytics_client django-analytics-client
+dajax django-dajax-ng
+ics_compare remind
+buysafe django-buysafe
+janrain janrain-python-api
+pci poplus-pci
+humboldt humboldt.cmfbibliographyat
+health_check_cache django-health-check
+datasift datasift-beta
+openidmongodb openid-mongodb
+digg_paginator django-digg-paginator
+sauce saucelabs-python
+logger crefi
+cplay cplay-ng
+good bpmaapers_ok
+admin_tools_stats django-admin-tools-stats
+djangobosssearch django-bosssearch
+yo yo-client
+misc django-misc
+gadget tiddlywebplugins.tiddlydocs
+shortuuidfield django-shortuuidfield
+shpaml_loader django-shpaml-template-loader
+yg yg.lockfile
+djhookbox django-hookbox
+WebCalendar WebOrganiser
+rest_framework_msgpack djangorestframework-msgpack
+nhk nhk-api
+cep django-cep
+queryset_client tastypie-queryset-client-p3k
+zinnia_ckeditor zinnia-wysiwyg-ckeditor
+yt yt.recipe.shell
+subtitles pysubtitles
+perfdump nose-perfdump
+metacomm AllPairs
+cache_by_user django-cache-by-user
+coinspot py-coinspot-api
+offline django-offline
+setmagic django-setmagic
+pyadmitad pyadmitad-unknown
+noselint django-nose-lint
+ssladmin django-ssl-admin
+SocketMap pysrs
+fluent_faq django-fluent-faq
+phaxio pyphaxio
+gmusicSyncRatings gmusic-rating-sync
+mps_pkg mps
+staticfiles_select2 django-staticfiles-select2
+arrayfields django-arrayfields
+gui PyRECONSTRUCT
+alphasms alphasms-client
+mimeprovider mimey3000
+oboeware oboe
+fabtastic django-fabtastic
+pwdhash pwdhash.py
+Solgema Solgema.blinks
+jaws jaws-scraper
+nchecker fetcher
+fixture sqlalchemy-fixture
+Bhtml BeautifulHTML
+crontab python-crontab
+muranodashboard murano-dashboard
+abakus django-auth-abakus
+moreforms django-moreforms
+caseinsensitivewiki TracCaseInsensitiveWiki
+settingsjs django-settingsjs
+rpi_courses RPICourses
+pandocattributes pandoc-attributes
+upip_os micropython-upip
+deliverance Deliverance.Rewrite
+tlslite SPADE
+flower flower-new
+safefile ujs-safefile
+localeurl django-localeurl
+test_duo duo
+publicnotifications PublicNotificationsPlugin
+actionviews django-actionviews
+mockldap mockldap-fork
+publish django-publish
+vyatta brocade-plugins
+scciclient python-scciclient
+rest_framework_msf django-rest-framework-multi-slug-field
+assist django-assist-ru
+paulla paulla.checkplanetdiff
+phantom_pdf django-phantom-pdf
+vtableau Pyntifex
+planemo_ext planemo
+tradein aws-trade-in
+asc python-asc
+cloudlb python-cloudlb
+qingcloud qingcloud-sdk
+djcopybook django-copybook
+pyreadline pyreadline-ais
+ase python-ase
+trakt trakt.py
+hermes django-hermes
+mmc django-mmc
+pystories django-buzz
+firstclass django-firstclass
+jsonsempai json-sempai
+pydash django-pydash-app
+makerspaces PyMakerspaces
+wlp pygn
+script test-server
+tcdb py-tcdb
+social_publisher django-social-publisher
+developer_toolkit django-developer-toolkit
+django-admin-hbs django-hbs-makemessages
+admin_customizer django-admin-customizer
+specifications django-specifications
+ajaxmessages django-ajax-messages
+hunger django-hunger
+mdx_superscript MarkdownSuperscript
+twit APA
+stackauth py-stackexchange
+unicodenazi unicode-nazi
+picker nose-picker
+singleton pysingleton
+popup_forms django-popup-forms
+favorites django-favorites
+xmppd SPADE
+allauth django-allauth
+relate pyrelate
+celex django-celex-lexicon
+narratoapi py-narrato
+djaloha apidev-djaloha
+instances django-subdomain-instances
+dockerfile_tutorial docker-tutorial
+helptext django-helptext
+mail2news pygn
+csdl csdl-unoffical
+qrcode django-qrcode
+audioadmin django-audioadmin
+irtoy pyirtoy
+ppcommon ppft
+miss media-hosts
+tranchitella tranchitella.recipe.nose
+rolodex django-rolodex
+pandocmarkdownwriter MarkdownWriter
+registration_email django-registration-email
+raisinpyramid raisin.pyramid
+hostout hostout.overridedeploy
+eventlog eventlog-writer
+pandoc pyandoc
+dfu dont-fudge-up
+codemirror django-codemirror-widget
+interact pyinteract
+dfp django-dfp
+djangomini django-mini
+jalaliLibrary robotframework-jalali
+swaps django-swaps
+gists_cli gists.cli
+dfk django-dfk
+tellive tellive-py
+tags_input django-tags-input
+PyDviGui PyDvi
+radiusauth django-radius
+admin_methods django-admin-methods
+sitemetrics django-sitemetrics
+location_picker django-location-picker
+smartextends django-smart-extends
+EasyExtJS4 django-easyextjs4
+url_redirect django-url-redirect
+epiced django-epiced
+workingenv workingenv.py
+fastly cdn-fastly
+luien luein
+needle json-delta
+sitemenu django-sitemenu
+queued_once celery-queued-once
+rest_framework_csv djangorestframework-csv
+fnordmetric pyfnordmetric
+choicesfilter twentytab-choicesfilter
+bower jack-bower
+inline_orderable django-inline-orderable
+devicetype django-devicetype-templates
+regex_field django-regex-field
+xpower django-xpower
+jquery django-staticfiles-jquery
+qshop django-qshop
+smmap kr-smmap
+forgery_py ForgeryPy
+pycassa peloton-pycassa
+shlex micropython-shlex
+wepay python-wepay
+microcollections stowaway
+states stateful-object
+contactstore django-contactstore
+database_files django-database-files
+polysquarelinter polysquare-generic-file-linter
+dumxpath dum
+restful RESTfulEf
+interactive django-interactive
+facebook_comments django-facebook-comments
+kiwi kiwi_project
+twitter_relations_history django-twitter-relations-history
+bioinfutils bioinf-utilities
+conduit django-conduit
+babylon django-babylon
+inmemorystorage dj-inmemorystorage
+djembe django-djembe
+fluidsynth pyFluidSynth
+download django-theherk-download
+blockdiagcontrib blockdiagcontrib-math
+sforce python-salesforce
+djamaluddinconv hilal
+html5css3 rst2html5-tools
+pyrrd pyrrd-fix
+celerybeatmongo celerybeat-mongo
+staticassets django-staticassets
+model_i18n django-model-i18n
+embercompressorcompiler ember-compressor-compiler
+raxmon_cli rackspace-monitoring-cli
+evasion evasion-agency
+check destiny_bot
+example_mas mosaik-api
+lit django-lit
+simple_command_launcher_column sclc
+atomdb tomdb
+test_functionality python-vote-core
+cropper django-image-cropper
+orderable django-orderable
+listloop looping_list
+report_builder_demo django-report-builder
+emailusernames django-email-as-username
+crispy_forms django-crispy-forms
+bootstrap3_datepicker django-bootstrap3-datepicker
+cpserver django-cpserver
+foreman python-foreman
+mysql_manager django-mysql-manager
+tracadvsearch TracAdvancedSearch
+objectset django-objectset
+chunked_upload django-chunked-upload
+index pandoradep
+invitable django-invitable
+salmon salmon-mail
+secdownload_storage django-secdownload-storage
+dokus pydokus
+rfxcom pyrfxcom
+requests_throttler RequestsThrottler
+73 73.unlockItems
+cloudcracker python-cloudcracker
+systray_file_watcher_app systray_file_watcher
+cronfield django-cronfield
+profiletools django-profiletools
+stackio stack.io
+BruteBuster django-brutebuster
+peerreview Django-PeerReview
+archmod archmage
+object_permission django-object-permission
+stackcollapse_hpl hprof2flamegraph
+jsignature django-jsignature
+netcash django-netcash
+awlsimhw_linuxcnc awlsim
+friendlyurls django_friendlyurls
+analog ExplorerHAT
+km gcKISSmetrics
+boundaryservice django-boundaryservice
+restlayer django-restlayer
+deprecated_fbv django-deprecated-fbv
+codecheckers pytest-codecheckers
+clean django-clean
+mongo_storage django-mongo-storage
+vtixy_payment_assist VTIXyPayment_Assist
+sws_tags django-swstags
+unweb unweb.shareit
+simple_n_grams sngrams
+rtd pyrtd
+rtf tiddlywebplugins.tiddlydocs
+check_output geturl
+ohloh_widgets OhlohWidgetsMacro
+healthgraph healthgraph-api
+rtm pyrtm
+rtl django-right-to-left
+tastypie django-tastypie
+infomedia infomedia-python
+dsns DSNS-SDK
+djorm_pgfulltext djorm-ext-pgfulltext
+gs_search_fedora_packages gnome-shell-search-fedora-packages
+naomi django-naomi
+languages_plus django-languages-plus
+south_admin django-south-admin
+hypem hypem-python
+yacaptcha django-yacaptcha
+leadbutt cloudwatch-to-graphite
+django_filters django-filter
+prpc AppState
+copyright django-copyright
+storelocator django-storelocator
+_geoip_geolite2 python-geoip-geolite2
+condor utcondor
+heka heka-py
+torexpress tornado-torexpress
+sphinxcontrib_images_lightbox2 sphinxcontrib-images
+lockdown django-lockdown
+bfs helium
+aiohs2 aio-hs2
+pyutil caldwellpy
+translation_helper android-localization-helper
+jinja2loader django-jinja2loader
+envelope django-envelope
+libgsync gsync
+nationalrail pynationalrail
+inigo inigo.ploneanalyticswrapper
+library50 CS50
+columns django-columns
+granoclient grano-client
+bisync_lib bisync
+plac_ext plac
+winreg future
+adytum Adytum-PyMonitor
+dandelion dandelion-eu
+libcloudvagrant libcloud-vagrant
+networkapiclient GloboNetworkAPI
+o18n django-o18n
+apptemplates django-apptemplates
+spi SPIlib
+mathjax MathJaxPlugin
+dsl_tools python-dsl-tools
+portland_addresses django-portland-oregon-addresses
+slicklog SlickLogHandler
+international django-international
+sqlalchemy_validations sqlalchemy_elixir_validations
+disqus django17-disqus
+toolware django-toolware
+catcher python-catcher
+restfulie sleipnir-restfulie
+continuum python-continuum
+pyle_test pyle
+apy stagecoach-apy
+pingback django-pingback
+nibbler nibbler-python
+userroles django-user-roles
+oxr oxr-client
+osx_powerline_battery osx-powerline-battery-segment
+qilinguist qibuild
+yandexmaps_widget django-ymaps-admin-widget
+django_bs_test django-beautifulsoup-test
+jsonresponse django-jsonresponse
+pyxlib pi3d
+select2light django-select2light
+openprovider openprovider.py
+bootstrap_email django-bootstrap-email
+externalfeed django-external-feed
+oslo_serialization oslo.serialization
+marektools superqelement
+serveme serve.me
+chaoflow chaoflow.testing.crawler
+ccmlib ccm
+django_schemata django-mga-schemata
+tree twentytab-tree
+ignoretests django-ignoretests
+template_shortcuts django-template-shortcuts
+room_script tiddlywebplugins.tiddlydocs
+wxtextview textmodel
+klingon django-klingon
+dbpreferences django-dbpreferences
+networktables2 pynetworktables
+ari python-ari
+plac_tk plac
+taggee django-taggee
+vint vim-vint
+layar django-layar
+custard django-custard
+s3_folder_storage django-s3-folder-storage
+dotpay django-dotpay
+singleton_models django-singleton
+dirbrowser django-dirbrowser
+setuptools_continuousintegration setuptools-ci
+movie TracMovieMacro
+guts_array guts
+exchange django_broker
+viewflow django-viewflow
+scribemonitor scribe-monitor
+wor ds-down
+pysmvttestapp pysmvt
+previewadmin twentytab-previewadmin
+checkmate checkmate-api
+flatpages_x django-flatpages-x
+awlsimhw_dummy awlsim
+ais noaadata-py
+formatter Pyntifex
+conditions django-conditions
+after_response django-after-response
+code_retreat jsox-code-retreat
+solo django-solo
+profiling django-profiler
+leveldbclient leveldb-client
+persistent_widget django-persistent-file-widget
+mt940 mt-940
+redtools pokemontools
+ebcli awsebcli
+mailbox micropython-mailbox
+datetimeutc django-datetime-utc
+pyherc herculeum
+cloudify cloudify-plugins-common
+solr solrpy
+observer django-observer
+c rockpython
+studiogdo django-studiogdo
+report_generator m3-report-generator
+mega python-mega
+rflint robotframework-lint
+mockito mockito-lwoydziak
+bandit django-email-bandit
+fiboseq Fibonacci_printer
+object_permissions django-object-permissions
+multilingual_field mongoengine-multilingual-field
+iencode iencode-ng
+jaydebeapi JayDeBeApi3
+jabilitypyup jability-pyup
+dtt pydt
+system_cmd SystemCmd
+pdb pdbpp
+django-testproject django-testproject-gito
+authorizenet django-authorizenet
+test_pem pem
+simple simpleblogging
+acted acted.projects
+pxpay django-pxpay
+ssyncer soundcloud-syncer
+browserstack_tools django-browserstack-tools
+patricia patricia-trie
+any_urlfield django-any-urlfield
+icecc python-icecc
+challonge pychallonge
+mixpanel_async mixpanel-py-async
+d1_ticket_generator dataone.ticket_generator
+weekday_field django-weekday-field
+djangoquietrunserver django-quiet-runserver
+message_pb2 trisdb-py
+tiamat django-tiamat
+balbec python-nagios-frontend
+ps ps.plone.zmi
+astrid python-astrid
+template_pages django-template-pages
+videoembed django-videoembed
+acceptance niprov
+xmlrunner unittest-xml-reporting
+curve pyinstruments
+throttleandcache django-throttleandcache
+swf simple-workflow
+simplelayout simplelayout.ui.base
+tabination django-tabination
+CIM15 PyCIM
+CIM14 PyCIM
+pf py-pf
+pile django-pile
+mcfeely django-mcfeely
+monk_tf tmonk
+firefogg python-firefogg
+cratis_cms django-cratis-cms
+stackcollapse_hprof hprof2flamegraph
+fire python-fire
+frapwings frapwings.skels
+simplesettings python-simplesettings
+sql_inspector django-sql-inspector
+convert aino-convert
+sigasync spooler
+menu_external_urls django-theherk-external-urls
+urlmagic django-urlmagic
+moderation typepadapp-moderation
+mist mist.client
+ormcache django-ormcache
+jinja2precompiler jinja2-precompiler
+hex_connection HexClient
+sputnik Booktype
+formless Nevow
+payonline django-payonline
+cached_user django-cached-user
+ftpsync pyftpsync
+loom loom_api
+coveralls python-coveralls
+dh5mbp django-html5-mobile-boilerplate
+grains django-grains
+solid solidpython
+typecheck optypecheck
+pwiz peewee
+pyarsespyder arsespyder
+mastertickets TracMasterTickets
+gmv gmvault
+sesame django-sesame
+mls mls.apiclient
+add_get_param django-add-get-parameters
+cartfreakapi django-cartfreakapi
+py24compat jaraco.compat
+tagging_translated django-tagging-translated
+bronto bronto-python
+hal_impl robotpy-hal-sim
+cython_loader cython-plugin
+mbutil umimbutil
+ripwrap django-ripwrap
+debug_toolbar_multilang django-debug-toolbar-multilang
+keytrain key-train
+statictemplate django-statictemplate
+UniversalAnalytics universal-analytics-python
+kmip PyKMIP
+rip ReSTinPeace
+echelon django-echelon
+napper Bedframe
+impersonate django-impersonate
+terminator django-terminator
+nose_plugin doctest-ignore-unicode
+libdep_service_client libdep-service-python
+troveclient python-troveclient
+tallywallet tallywallet-common
+formalizr django-formalizr
+uwsgicache django-uwsgi-cache
+emoticons django-emoticons
+iktomi iktomi.cms
+flaskskel flask-skel
+tripleo_heat_merge tripleo-heat-templates
+captools captricity-python-client
+sendgrid django-sendgrid-webhook
+saas_users django-saas-user
+galapagos galapagos-assembler
+webtest Grinder-Webtest
+globusonline globusonline-transfer-api-client
+coffeescript django-coffeescript
+test_strfrag Strfrag
+Backend shim
+geoserver gsconfig
+lightapi django-lightapi
+composition django-composition
+gdapi gdapi-python
+sliver django-sliver
+rest_framework_fine_permissions djangorestframework-fine-permissions
+tdlog td-logger
+currencies django-currencies
+libcatsite catsite
+tornadobabel Tornado-Babel
+usersettings django-usersettings2
+dockermap docker-map
+easy_formsets_bootstrap django-formsets-bootstrap3
+flows django-flows
+alert django-alert
+moment django-staticfiles-moment
+mobileapart mobileapart.django.newsletter
+user_sessions django-user-sessions
+flask_couchdb Flask-CouchDB-Schematics
+aggregate django-live-profiler
+clustoapi clusto-apiserver
+nameless nameless-minimal
+toxmatrix tox-matrix
+git_repo crepo
+ldap_email_auth django-ldap-email-auth
+pssh parallel-ssh
+hacore django-hautomation
+unixtools python-unixtools
+werewolf django-werewolf
+globus globus-provision
+configurelib mk
+adcode django-ad-code
+fourch 4ch
+wolframalpha wolframalpha-cli
+ucamlookup django-ucamlookup
+autoload_fixtures django-autoload-fixtures
+better500s django-better500s
+docviewer django-docviewer
+docker docker-py
+i2c pytronics
+fake-fsl-pkg TestFslPackage
+command_seq_reader pyparsing_helper
+daeauth django-admin-external-auth
+url_utils django-url-utils
+paymaster django-paymaster
+darner pydarner
+Fourchapy python-4chapy
+xprocess pytest-xprocess
+ofc2 pOFCy
+ipa libipa
+dictionary_search django-dictionary-search
+microblog_exceptions python-rest-client
+email_registration django-email-registration
+IssueTrackerOpenID IssueTrackerProduct
+debug_toolbar_mongo django-debug-toolbar-mongo
+postal django-postal
+scaler django-scaler
+tagging_ext django-tagging-ext
+virtstrapsampleplugin virtstrap-sample-plugin
+__shogen__ shogen
+aloha django-aloha-edit
+ppguard PreProGuardian
+conjurer python-conjurer
+snappy ctypes-snappy
+anz anz.dashboard
+submissions edx-submissions
+brainstorm django-brainstorm
+tkh_splash3 tkhelp
+tagtools django-tag-tools
+like_button django-like-button
+gwmt gwmt-dl
+any_imagefield django-any-imagefield
+django_ajax djangoajax
+davlib Python_WebDAV_Library
+doorbell afn
+sneeze nose-sneeze
+phonenumbers phonenumberslite
+brubeckmysql brubeck-mysql
+indexed indexed.py
+putio putio.py
+featureditem django-featured-item
+cached_s3_storage django-cached-s3-storage
+interfaces PythonInterfaces
+autohide_help django-autohide-help
+emailmgr django-emailmgr
+sms django-sms
+moody moody-templates
+CCCgistemp ccc-gistemp
+brubeckuploader brubeck-uploader
+WebCalendarPortal WebOrganiser
+djangojsonmodel django-jsonmodel
+sapversion sapling
+redlock redlock-py
+model_utils django-model-utils
+xxdiff xxdiff-scripts
+sitepush django-sitepush
+cpcgiserver cherrypy-cgiserver
+rider pony-rider
+onec_utils django-onec-utils
+cpyamf PyAMF2
+jenkins_jobs jenkins-job-builder
+rbkmoney django-rbkmoney
+two two.ol
+pygeolib pygeocoder
+soma soma-base
+baco pybaco
+softdelete django-softdelete
+sampledatahelper django-sampledatahelper
+attachment redsolutioncms.django-tinymce-attachment
+servocenter ServoCenter-3.1
+htmloutput nosehtmloutput
+djangonginxremoteusermiddleware django-nginx-remote-user-middleware
+auditable_models django-auditable-models
+server nanodb
+modemcmd modem-cmd
+Qt python-qt
+paginas django-paginas
+retry retry_on_exceptions
+netsnmpapi netsnmpagent
+shortcodes django-template-shortcodes
+readDialogFile print_lol_list
+mobileadmin django-mobileadmin
+merged_inlines django-merged-inlines
+warnings micropython-warnings
+tastypie_mongodb tastypie-mongodb-resource
+ravello_cli ravello-sdk
+crossdb django-crossdb
+pen penpal
+test_performance python-vote-core
+boxcar python-boxcar
+tablib tablib-garetjax
+fragments django-template-fragments
+isotope django-staticfiles-isotope
+PysphereLibrary robotframework-pyspherelibrary
+captouch ExplorerHAT
+mathfilters django-mathfilters
+pywinbuilder python-winbuilder
+bg bg.solr
+run subprocess.run
+sitecats django-sitecats
+pythonscript PythonScriptTranslator
+struct2latex py2tex
+cities_tiny django-cities-tiny
+bn BareNecessities
+django_utils django-utils2
+lawnchair django-lawnchair
+exstatic python-csp
+s3cache django-s3-cache
+googkit_data googkit
+bq bigquery
+tapatalk django-tapatalk
+mpc55xx mpc55xx-bam-loader-g1
+smartsnippets django-cms-smartsnippets
+wsdl pyrannosaurus
+logstash python-logstash
+pythonosc python-osc
+dynamicresponse django-dynamicresponse
+jieba jieba3k
+batchform django-batchform
+jsonrpc json-rpc
+multihostsettings django-multihostsettings
+aspsms py-aspsms
+disposable_email_checker django-disposable-email-checker
+fw_tutorials FireWorks
+ids incf.ids-tools
+run_sample WTForms-ParsleyJS
+graphalchemy graph-alchemy
+ImapLibrary robotframework-imaplibrary
+linediff TracLineDiffMacro
+extensions pymorphous
+genshimacro trac-GenshiMacro
+haweb django-haweb
+webview pywebview
+select_multiple_field django-select-multiple-field
+sayhi alex_sayhi
+description_fixer nose-descriptionfixer
+queryset_iterator django-queryset-iterator
+db_obfuscate db-obcuscate-id
+maelstrom maelstrom-py
+object_log django-object-log
+sparklines django-sparklines
+munkres munkres3
+vnujar html5validator
+answrs django-answrs
+semver node-semver
+meatoo_client meatoo
+mllib qpid-python
+currency django-currency
+aspen_cherrypy_engine aspen-cherrypy
+lucasModule umModuloMaluco344234
+commentsauth django-contrib-comments-auth
+ca_certs_locater httplib2.ca_certs_locater
+nopassword django-nopassword
+fiut django-FIUT
+agent_packager cloudify-agent-packager
+clipboardmodifier clipboard-modifier
+OpenElectrons_LSM303D OpenElectrons_IMUbreakout
+ts3utils TS3Py
+zinnia_feed feed2zinnia
+update_checker_test update_checker
+simulator resync-simulator
+parsnip python-parsnip
+pycalcal lunisolar
+dn designernews_api
+ohmyvim oh-my-vim
+stackhelper django-stackhelper
+parting django-parting
+etcd py-etcd
+suit django-suit
+ajaximage django-ajaximage
+_ensmime ensmime
+vtixy_template VTIXyTemplate
+django_statsd django-statsd-mozilla
+multi_sessions django-multi-sessions
+warlock salesking
+opbasm_lib opbasm
+response_helpers django-response-helpers
+picklefield django-picklefield
+coolasciifaces cool-ascii-faces
+npmat gnumpy
+qourisman django-qourisman
+lingua lingua.autotranslate
+nullmailer django-nullmailer
+ichypd django-ichypd
+pwc PowerConsole
+postgresify django-heroku-postgresify
+atom gdata
+memorycoinrpc memorycoin-python
+object_tools django-object-tools
+sdk xms_sdk
+mustachejs django-mustachejs
+html_validator tiddlywebplugins.tiddlydocs
+uta django-uta
+cid django-cid
+discoverage django-discoverage
+djsgettext django-jsgettext
+migrate_mail django-migrate-mail
+parler_rest django-parler-rest
+PyDviPng PyDvi
+planet django-planet
+grove python-grove
+mongo_sessions django-mongo-sessions
+ui sc_pylibs
+amqpstorm AMQP-Storm
+http_status django-http-status
+file_picker django-file-picker
+libfact afn
+cedict pycedict
+groove Groove-dl
+harest django-hautomation
+uc django-uc
+audit_log django-audit-log
+olap xmla
+formwizard django-formwizard
+lava_scheduler_tool lava-tool
+ledgerautosync ledger-autosync
+basic_editor DragonPyEmulator
+admin_xtra_widgets django-admin-xtra-widgets
+django_testing_recipe django-pastedeploy-settings
+arvados arvados-python-client
+dataloader PyDataLoader
+sitefilter django-sitefilter
+dataProcessor dataProcessorDB
+djweed django-weed
+nested_inline django-nested-inline
+save_the_change django-save-the-change
+wasabisg wasabi-scenegraph
+cafe opencafe
+gbk2utf8 myhello
+saml2 pysaml2
+bracket BracketMaker
+d1_gazetteer dataone.gazetteer
+zinnia_wymeditor zinnia-wysiwyg-wymeditor
+informant django-informant
+lemon LemonFramework
+grs goristock
+meta_mixin django-meta-mixin
+codex PyCodeX
+gametex gametex-django
+PyPIBrowser PyPI-Browser
+request_provider django-request-provider
+nerdlib nerdirc
+nap django-nap
+dlskel dl-skel
+bidiutils django-bidi-utils
+modest_image ModestImage
+forge pyforge
+camo camo-client
+nestedPrintList nestedPrint
+django_testing django-pastedeploy-settings
+smoketest django-smoketest
+lava_dashboard_tool lava-tool
+users django-email-users
+aes Steganocrypto
+gbpclient python-group-based-policy-client
+bibtex_lexer bibtex-pygments-lexer
+visits django-visits
+sphinxdoc django-sphinxdoc
+test_apache_conf_parser apache_conf_parser
+tcprlib TcpProxyReflector
+vernissage django-vernissage
+jeeves jeeves-framework
+mediagenerator django-mediagenerator
+lbff LocalBitTorrentFileFinder
+autodatetimefields django-AutoDateTimeFields
+standard_names CmtStandardNames
+oslo_db oslo.db
+crefi_helper crefi
+multitenancy rapidsms-multitenancy
+svg svg.path
+user_messages geonode-user-messages
+forwardable forwardable.py
+youtube youtube-api-wrapper
+form_models django-form-models
+dnsmadeeasy libcloud-dnsmadeeasy
+happenings django-happenings
+ec2nodefind aws_ops
+spreadsheetresponsemixin django-spreadsheetresponsemixin
+tiddlywiki_validator tiddlywebplugins.tiddlydocs
+gyazo python-gyazo
+latest_tweets django-latest-tweets
+fresh django-fresh
+tlspu tlspu.cookiepolicy
+alipay django-alipay
+easy_pdf django-easy-pdf
+nose_ignoredoc nose-ignore-docstring
+coda pycoda
+afntest afn
+pprocess parallel
+flatpages tgapp-flatpages
+bvc buildout-versions-checker
+djorm_pguuid djorm-ext-pguuid
+bisnode django-bisnode
+deftest mymethods
+webtemplates django-webtemplates
+commenttools glamkit-commenttools
+irods python-irodsclient
+chart_tools django-chart-tools
+pydispatch PyDispatcher
+async_image_save django-async-gt
+compose docker-compose
+spreedly django-spreedly
+ticketref TracTicketReferencePlugin
+base64 micropython-base64
+upload_to django-upload-to
+puresasl pure-sasl
+ccfiletypes django-ccfiletypes
+interminebio intermine-bio
+gencal django-gencal
+cmd_line seins
+fourstore django-4store
+xmllayout pylogfaces
+example_bookmark_merger bookmark_merger
+traytimer afn
+staff_toolbar django-staff-toolbar
+tethys_gizmos django-tethys_gizmos
+xamlwriter rst2xaml
+resources newpy
+tooltips django-tooltips
+nereid trytond_nereid
+rainbow rainbow-cfn
+py23compat jaraco.compat
+uturn django-uturn
+nosenotify nose-notify
+cmsplugin_mailchimp django-cms-mailchimp
+mixins django-mixins
+F2 F2python
+minimongo mimimongo
+affinity cpu_affinity
+dragon dragonpy
+spoon spoonrpc
+django_dummysign django-anysign
+intouch intouch_queryset_csv
+uploader UploadView
+cstar_perf cstar_perf.tool
+cms_pictures_slider django-cms-pictures
+fbauth django-fbauth-templatetag
+fb303 hive-thrift-py
+categories django-categories
+gbpservice group-based-policy
+AndroidLibrary robotframework-androidlibrary
+flexisettings django-flexisettings
+shop_richcatalog django-shop-richcatalog
+smartfields django-smartfields
+magic python-magic
+candv_x django-candv-choices
+transmission transmission-fluid
+gitwiki afn
+restrictedsessions django-restricted-sessions
+unusual django-unusual
+pymailinator py-mailinator
+ltlib ledgertools
+newsletter_subscription django-newsletter-subscription
+flask_mxit_ga Flask-MxitGA
+pep8ext_naming pep8-naming
+qicd qibuild
+uikit_editor django-uikit-editor
+zmqpipeline py-zmq-pipeline
+dictmessages django-dictmessages
+drf_nested_resource django-rest-framework-nested-resource
+clippy django-clippy
+athlete class_test
+libtransforms transforms
+logistics sms_logistics
+zone_admin django_zoneadmin
+admin_export django-admin-export
+debugtools django-debugtools
+gomobile gomobile.supporter
+upip_gzip micropython-upip
+sundial django-sundial
+cron cron.py
+mynewsdesk django-mynewsdesk
+odm synergy_odm
+rolepermissions django-role-permissions
+haiku haiku-lang
+licenses django-licenses
+wdb_server wdb.server
+easydata django-easydata
+datawrap PyDataWrap
+trisdb trisdb-py
+allejo django-allejo
+gitlab_tests pyapi-gitlab
+soup ipython-beautifulsoup
+lfstheme django-lfstheme
+simple_open_graph django-simple-open-graph
+multimedia django-multimedia
+winrm pywinrm
+astar pystar
+enchant pyenchant
+slideshows emencia-django-slideshows
+header_auth django-header-auth
+infuse django-infuse
+urbanairship urbanairship3
+reporting django-reporting
+floppy_gumby_forms django-floppy-gumby
+apihangar django-apihangar
+thecut thecut-durationfield
+enum enum34
+unittest_TAP bayeux
+timezone_field django-timezone-field
+proxy_storage django-proxy-storage
+pluribus neutron-plugin-pluribus
+hkp python-hkp
+kyototycoon python-kyototycoon
+leo leoproj
+aliyunauth requests-aliyun
+ibis pyIBIS
+gmaps_places twentytab-gmaps-places
+_markupbase future
+olegdb olegdb-python
+fabutils vo-fabutils
+nb_urn_client NbUrnClient
+icybackup django-icybackup
+userpass auth-userpass
+github3 github3.py
+rest_framework_yaml djangorestframework-yaml
+satchmo_store Satchmo
+wsgioauth2 wsgi-oauth2
+roslint unilint
+oracletest PyOracle
+mikroeuhb mikroe-uhb
+metro django-metro
+pyrpc fspyrpc
+timedeltatemplatefilter django_timedeltatemplatefilter
+mynester linester
+redis_lock python-redis-lock
+thebops thebops-envtools
+fancy_tests django-fancy-cache
+quantumclient python-quantumclient
+overextends django-overextends
+rest_framework_plist djangorestframework-plist
+cmsplugin_fancybox django-cms-fancybox
+popcorn django_popcorn
+twitter_text twitter-text-py
+honeypot django-honeypot
+dson Dogeon
+MyPagePlugin TracMyPagePlugin
+libcloud apache-libcloud
+realestate_cms_contact django-estate-cms
+jailtalk jailtools
+dbmail django-db-mailer
+bshell django_bshell
+mesos mesos.cli
+autoreports django-autoreports
+l_mirror lmirror
+app MyApplication
+manage django-altauth
+xdvtheme xdvtheme.inventions
+samflow GCAP
+plonesocial plonesocial.twitter.anywhere
+toytable_tests toytable
+staticfiles_precompilers django-staticfiles-precompilers
+multilingual_model django-multilingual-model
+pagedlist pypagedlist
+Mock PyRQ
+readtime pelican-readtime
+badgify django-badgify
+staticblog django-staticblog
+compositekey django-compositekey
+dcu dcu.active-memory
+looplist Bommel_looplist
+ckeditorfiles django_ckeditor_improved
+worldlib world
+simple_elasticsearch django-simple-elasticsearch
+multitenant django-simple-multitenant
+devops dapper-devops
+frog django-frog
+zxcvbn_password django-zxcvbn-password
+link_header LinkHeader
+netfields django-netfields
+mapped_fields django-mapped-fields
+admintimestamps django-admin-timestamps
+clictk pyclictk
+mongoalchemy MongoAlchemyVoltron
+fez fez.djangoskel
+ldap_groups django-ldap-group-mapper
+thumbnail_maker django-thumbnail-maker
+dynamic_pages django-dynamicpages
+matplotlibwidget PyQtdesignerplugins
+haproxy haproxyctl
+themeengine TracThemeEngine
+sudo django-sudo
+pretty py-pretty
+cms_themes django-cms-themes
+djleetchi django-leetchi
+epublib rst2epub2
+teamcity_runner django_teamcity_test_runner
+confy django-confy
+requestrepeat django-requestrepeat
+benchmark octopus-http
+geoexplorer django-geoexplorer
+prefetch django-prefetch
+audit lraudit
+gaphor gaphor.plugins.helloworld
+mailmerge docx-mailmerge
+shpaml django-shpaml
+timecode django-timecode
+umsgpack u-msgpack-python
+gherkin FibraNet
+TestApp wsgisvc
+pika python3-pika
+applitools eyes-selenium
+hessian HessianPy
+arvnodeman arvados-node-manager
+scaffold_report django-report-scaffold
+aspen_pants_engine aspen-pants
+print_indented printIndented
+norecaptcha3 norecaptcha-python3
+mimeparse python-mimeparse
+common_context django_common_context
+archer stfc_stratum_uploader
+publications lemon-publications
+PreForM PreForM.py
+fogcreek FogBugzMiddleware
+scarface django-scarface
+chinook django-chinook
+nextpage django-nextpage
+grape grape.pipeline.runner
+testpkg pypi.testpkg
+kegbot kegbot-pyutils
+gitbigfile git-bigfile
+tap bayeux
+quickstart juju-quickstart
+providers DynamicMachine
+pyamf PyAMF2
+slim django-slim
+tax Satchmo
+htpclauncher htpc-launcher
+testCase Auto_Python_2014
+dorrie ritremixerator
+simple_email_confirmation django-simple-email-confirmation
+staticmediamgr django-staticmediamgr
+synchronise django-synchroniser
+ldclient ldclient-py
+protocol_doc afn
+reversefold reversefold.util
+codeigniter PyCodeigniter
+chru chr
+funcdict FunctionDictionaries
+b2gcommands b2g-commands
+selectize django-selectize
+comuneimola comuneimola.compensi
+filemanager django-filemanager-tjh
+StructuredText py2tex
+suit_sortable django-suit-sortable
+delay python-delay
+actualities django-actualities
+wordpressext the-real-django-wordpress-extras
+shuffler django-shuffler
+spf pyspf
+appointments rapidsms-appointments
+linaro_graphics_app linaro-graphics-dashboard
+sio sioworkers
+rest_framework_chain djangorestframework-chain
+context_extras django-context-extras
+mymigrate django-mymigrate
+cxmanage_api cxmanage
+sinastorage scs-sdk
+farm django-farm
+collection links-collection
+mpconstants marketplace-constants
+sorting django-sort
+timernotify afn
+tack tackpy
+dataforms django-dataforms
+trees treetools
+mpns python-mpns
+lpod lpod-python
+thealot thealot-compendium
+hawk PyHawk-with-a-single-extra-commit
+gitrevision django-gitrevision
+calcrepo calcpkg
+rco python-rco
+cms_facetsearch django-cms-facetsearch
+ppworker ppft
+swingutils jython-swingutils
+pych pyChapel
+os_doc_tools openstack-doc-tools
+direct django-direct
+failover django-failover
+adminsortable2 django-admin-sortable2
+unittests quality_report
+paab paab.policy
+cache_object django-cache-object
+bakery django-bakery
+passreset django-passreset
+rql_solve rql
+healthcare rapidsms-healthcare
+mobile_detector django-mobile-detector
+rovi python-rovi
+annalist_root Annalist
+uclassify uclassify_sc
+dbarray django-dbarray
+twill retwill
+jira jira-rpc
+fake_tempfile pyfakefs
+cloudstorage GoogleAppEngineCloudStorageClient
+pymeta PyMeta3
+cmsplugin_facebook_gallery django-facebook_gallery
+djed djed.static
+wit PyWit
+s3upload django-storages-s3upload
+dy dy.fi
+cloudmailin django-cloudmailin
+framingham10yr python-framingham10yr
+health_check_storage django-health-check
+parallelized_querysets django-parallelized_querysets
+inline_requests scrapy-inline-requests
+peavy django-peavy
+transifex python-transifex
+hbase hbase-thrift
+merlot MerlotTemplates
+xmltest unittest-xml
+lava_kernel_ci_views_app lava-kernel-ci-views
+shuttlecloud shuttlecloud.contacts-api-client
+admin_sso django-admin-sso
+mod1 xctool
+geolocate glocate
+s3direct django-s3direct
+dc_campaign_finance_scraper dc-campaign-finance-scrapers
+binstar_build_client binstar-build
+grappelli_navbar django-grappelli-navbar
+joat PyJOAT
+li py-li
+math_captcha django-math-captcha
+speedbar django-speedbar
+djc django-formrenderingtools
+tdclient td-client
+spellbook HexClient
+forest django_forest
+wtfrecaptcha wtforms-recaptcha
+CMFunc codmacs
+adminactions django-adminactions
+dag py-dag
+roopeshv roopeshv.base_skel
+mongoprofile mongo-profile
+collectd_rest django-collectd-rest
+invitation django-invitation
+condfields TracCondFields
+test_flask_esclient Flask-ESClient
+wemplate wempy
+httplib2 python-rest-client
+supervisorwildcards supervisor-wildcards
+pyhardware pyinstruments
+flake8chart flake8-chart
+occi_os_api openstackocci-icehouse
+url2png django-url2png
+minwebhelpers MinificationWebHelpers
+site_notifications django-site-notifications
+djangoformsetjs django-formset-js
+django_restapi django-restapi-op
+enumfields django-enumfields
+pyimcore pyarmor
+treeadmin django-treeadmin
+djide django-ide
+mstranslator pymstranslator
+django_mailgun django-mailgun-provider
+lifestreams django-lifestreams
+mptt_tree_editor django-mptt-tree-editor
+librtkinter afn
+ravenswood afn
+FTClient FTTools
+follow django-follow
+redmineauth redmine-auth
+nojs django-nojs
+shopify_auth django-shopify-auth
+djnose2 django-nose2
+egg_translations EggTranslations
+afpy afpy.ldap
+npm django-npm
+qp_xml Python_WebDAV_Library
+iron_mq iron-mq-v3
+facebook_connect django-facebook-connect
+require_i18n django-require-i18n
+flatpages_i18n django-flatpages-i18n
+smart_selects django-smart-selects
+ics_generator django-ics-generator
+openoffice openoffice-python
+meta django-meta
+template_debug django-template-debug
+wattup django-wattup
+goto_url django-goto-url
+scielo_extensions scielo-django-extensions
+bigfoot django-bigfoot
+email_phone_user django-email-phone-user
+django_common django-common-helpers
+matrix SudokuStudyLib
+armor armor_api
+simplecommand python-simplecommand
+saplib sapling
+QtBindingHelper sclc
+hyperlinked_relational_serializer djangorestrelationalhyperlink
+cantrips python-cantrips
+entrouvert python-entrouvert
+cascache django-cas-cache
+athletelist KaAthleteList
+socialnetwork django-socialnetwork
+pytestbpdb pytest-bpdb
+stun pystun
+achievements treeio-achievements
+model pylinktester
+angular django-angular-library
+mwapi python-mwapi
+jserrorlogging django-js-error-logging
+pstorelib pstore
+standalone django-standalone
+eci django-eci
+sgbackend sendgrid-django
+contentful contentful.py
+flatpages_plus django-flatpages-plus
+avalara django-oscar-avalara
+webassets_ext webassets-jinja2js
+cube_interface all_spark_cube_client
+dataflake dataflake.docbuilder
+mnml_lexer Mnml-Pygments-Lexer
+twython_django_oauth twython-django
+qpid qpid-python
+zap python-owasp-zap
+linguist django-linguist
+mortar mortar-api-python
+emailconfirmation django-email-confirmation
+testrecipe baelfire
+querybuilder django-query-builder
+polysquarecmakelinter polysquare-cmake-linter
+conversation django-conversation
+birthday django-birthday
+simplexml python-simplexml
+airbrake airbrake-flask
+sieve django_sieve
+oslo_middleware oslo.middleware
+piplapis piplapis-python
+hive_metastore hive-thrift-py
+url_namespaces django-url-namespaces
+uwsgifouinelib uwsgiFouine
+printline myprintline
+labmanager lmsh
+sider__exttest Sider
+tvdb_ui tvdb_api
+redispubsub redis-pubsub-helper
+isbn isbnid
+poachplatelib poachplate
+GtkApp pycolorsel
+d9t d9t.gis
+blogger django-blogger
+magnetodbclient python-magnetodbclient
+django_bootstrap3view_app django-classview-bootstrap3
+denorm django-denorm
+echo python-echo-streamserver
+CURD CURD.py
+goscale goscalecms
+ssl_redirect django-ssl-redirect
+bobtemplates bobtemplates.pypbr
+fairepart django-fairepart
+watchman django-watchman
+hashes python_hashes
+braces django-braces
+reclient re-client
+feedly stream_framework
+tvrage python-tvrage
+token_bucket pysimpirc
+actstream django-activity-stream
+privacy django-privacy
+pyflot python-flot-utils
+universaltag django-universaltag
+pyteomics pyteomics.pepxmltk
+payfast django-payfast
+email_login django-email-login-fc
+templatemail django-template-mail
+configparser_helpers configparser
+inqbus inqbus.ocf.agents
+pgcrypto_fields django-pgcrypto-fields
+ojii ojii-utils
+push_notifications django-push-notifications
+mailviews django-mailviews
+credicoop resumen-credicoop
+anylink django-anylink
+udp pyip
+shell shell.py
+rsbackends RSFile
+debreach django-debreach
+pyglibc glibc
+user_action_confirmation django-user-action-confirmation
+rest_any_permissions drf-any-permissions
+scspostgis django-scspostgis
+asynctask m3-asynctask
+finvoice py-finvoice
+smartagent django-smartagent
+ccthumbs django-ccthumbs
+addcomment TracAddCommentMacro
+fuzzy pyFuzzyLogic
+djgotuskra django-gotuskra
+rencode AppState
+wishlist django-wishlist
+sagepay django-oscar-sagepay
+flaggit django-flaggit
+markdown_utils django-markdown-utils
+FTSync FTTools
+analytics appcubator-analytics
+rest_framework_httpsignature djangorestframework-httpsignature
+stubbing stub
+skypehub django-skypehub
+viaggiatreno TrainStats
+bee sufartest
+piped_zookeeper piped.contrib.zookeeper
+djkorektor django-korektor
+fb303_scripts hive-thrift-py
+WikiTemplates TracWikiTemplates
+radius python-radius
+la_metro python-lametro-api
+impala impyla
+zenoss zenoss.toolbox
+mockups django-mockups
+factorial007 factorial
+articleappkit django-articleappkit
+quieter_formset django-quieter-formset
+anonsurvey django-anonsurvey
+reminders django-reminders
+liuanslagstavlan liu-anslagstavlan
+ninja_ide ninja_ide.contrib.plugins.plugin_creator
+breadcrumb_trail django-breadcrumb-trail
+weewar python-weewar
+extlib vim-vint
+uni_form django-uni-form
+tower_cli ansible-tower-cli
+noseprogressive nose-progressive
+calendarium django-calendarium
+libmproxy mitmproxy
+pydebug python-debug
+virtualssi django-virtualssi
+admin_timeline django-admin-timeline
+noseparallel nose-parallel
+babel babel-cli
+agency djarcheology-agency
+pybb pybbm
+SRS pysrs
+ropemode ropemode_py3k
+hytrp pyhytrp
+djkombu django-kombu
+dogeapi python-dogeapi
+graph_layout drawgraph
+site_settings django-site-settings
+backplane backplane2-pyclient
+velruse rgomes_velruse
+desktopnotifications django-desktop-notifications
+sizefield django-sizefield
+abakaffe abakaffe-cli
+wkhtmltopdf django-wkhtmltopdf
+geniatagger geniatagger-python
+staticfiles django-staticfiles
+example_app django-stalefields
+rest_api_framework PRAF
+pybb_extensions pybbm-extensions
+sfp PyBarobo
+smart_slug django-smart-slug
+msgpack_serializer django-msgpack-serializer
+alex75_console Console-Utility
+optparse_mooi optparse-pretty
+cipher cipher.lazydate
+mplayer mplayer.py
+darts darts.util.lru
+whs whs.utils.rwlock
+materializecssform django-materializecss-form
+eagle_gateway iotrelay-eagle
+embed_video django-embed-video
+payment Satchmo
+ndg ndg-oauth-server
+plumber picles.plumber
+shop_ajax django-shop-ajax
+cas_dev_server django-cas-dev-server
+socialcommerce social-commerce
+m2m_history django-m2m-history
+testconfig nose-testconfig
+jqmobile django-jqmobile
+account_manager django-account-manager
+sf sf_client
+pgcrypto django-pgcrypto
+isegory django-isegory
+bibtex bib2coins
+elinks python-elinks
+stalefields django-stalefields
+flowdock pyflowdock
+wordpress_rss django-wordpress-rss
+geobricks_deployment GeobricksDeployment
+rrda sahuwai
+livefyre python-livefyre
+simple_sso django-simple-sso
+atmosphere atmosphere-python-client
+dbm micropython-dbm
+djretr django-retracer
+gishelper django-gishelper
+pysimplesoap soap2py
+hm tsuru-hm
+crate crate-docs-theme
+twistranet numericube-twistranet
+protoLib django-softmachine
+ac_flask AC-Flask-HipChat
+oauth django-oauth
+simpleticket TracSimpleTicket
+imagequery django-imagequery
+fake_filesystem_glob pyfakefs
+debug_panel django-debug-panel
+jsonspec json-spec
+selfdelete TracSelfDelete
+discover_jenkins django-discover-jenkins
+chianti ChiantiPy
+redirect django-redirect
+resource django-bbs
+inetss ispl
+futuregrid futuregrid.cloud.metric
+djanalytics dj-analytics
+knowledge django-knowledge
+templateserver django-template-server
+cctrl dotcloudng
+restler librestler
+jsonview django-jsonview
+fuzzycount django-postgres-fuzzycount
+cli_query django-cli-query
+sgmllib sgmllib3k
+xbtesting python-xbtesting
+bourbon django-bourbon
+easy_api EasyAPI
+local BlockLoggingInator
+ttr ttr.aws.utils.s3
+sites_tools django-sites-tools
+xdg pyxdg
+modelhistory django-modelhistory
+cube cube-client
+handle ecard
+iipimage django-iipimage
+limpyd_extensions redis-limpyd-extensions
+tbs thebestspinner
+xotl xotl.ql
+chapter1 print_lol
+request_tree django-request-tree
+simpleimages django-simpleimages
+homed afn
+oauth2 oauth2-utf8
+s2repoze pysaml2
+cocluster matsya
+twilio twilio_api
+blarg django-blarg
+spur spur.local
+activatable_model django-activatable-model
+mongofk django-mongoengine-foreignkey
+ncdistributerlib ncdistribute
+lazy_regex globster
+djangoraven django-raven-heka
+PrintNestedList Xu_Jing_Print_Nested_List
+elevator_cli Elevator
+linkthru django-linkthru
+django_bleach mysociety-django-bleach
+alphafilter django-alphafilter
+waveplot waveplot-scanner
+dateutil python-dateutil
+beetsplug beets
+health_check_db django-health-check
+denormalize django-denormalize
+nntp pynntp
+mailmate django-mailmate
+secobj py-secobj
+payments django-payments
+nexmo django-nexmo
+test_extensions django-test-extensions
+zums_jd_test_project zums
+fixture_media django-fixture-media
+html_field django-html-field
+expel expel.message
+ipagare python-ipagare
+timezones django-timezones
+seqdiag_sphinxhelper seqdiag
+shorturlpy python-shorturl
+PBSUtils PBS-utils
+cookie_law django-cookie-law-nl
+buildTools ajk_ios_buildTools
+multipart python-multipart
+dynamic_content django-dynamic-content
+ec2cleanami aws_ops
+Units ish_parser
+keyeditor afn
+requests0 requests-transition
+random_things RandomThings
+gmail pygmail
+hilbert django-hilbert
+servicelocator service-locator
+stats django-basic-stats
+awesome_bootstrap django-awesome-bootstrap
+reform django_reform
+zinnia_bootstrap zinnia-theme-bootstrap
+missing django-missing
+hostlist python-hostlist
+cruds django-cruds
+hijackemail django-hijackemail
+myfirstpython gao375976821
+macros django-templates-macros
+progress progress2
+data_exports django-data-exports
+thumbnail sorl-thumbnail-async
+template_timings_panel django-debug-toolbar-template-timings
+actionbar actionbar.panel
+livestreamer_cli livestreamer
+postgresql_psycopg2_dbdefaults django-postgres-dbdefaults
+amazon python-amazon-simple-product-api
+workboxcli workbox-cli
+djsonapi django-jsonapi
+redcap PyCap
+renren renrenpy
+fgp django-finegrained-permissions
+content_edit django-content-edit
+memcached_hashring django-memcached-hashring
+ripcordclient python-ripcordclient
+django_facebook django-facebook2
+fallback_storage django-fallback-storage
+teamcity teamcity-messages
+p2p p2p-tribune
+key django-key
+oauth_hook requests-oauth
+OpenTokSDK opentok-python-sdk
+avogadro numenta-rogue
+lightsub django-subdomains-handler
+sample_proj datafilters
+hierwiki TracHierWiki
+emitter socket.io-emitter
+jon jonpy
+solace Plurk_Solace
+tls django-tls
+mimeTypes python-rest-client
+tlw 3lwg
+pubsubhubbub_publish PubSubHubbub_Publisher
+webapp2_extras webapp2
+operative python-operative
+qipy qibuild
+inplaceeditform_extra_fields django-inplaceedit-extra-fields
+raml PyRAML
+itertools micropython-itertools
+streams pystreams
+ec2rotatehosts aws_ops
+_yaml PyYAML
+grappelli_te django-grappelli-template-editor
+phoneconfirmation pinax-phone-confirmation
+inviter django-inviter
+regex_tester RegexTester
+commando django-commando
+tastycrust django-tastypie-crust
+sendgridnewsletter sendgrid-newsletter
+ci jenkins_client
+mercadolibre mercadolibre.py
+fallbackdocopt arguments
+cm comt
+heiglerplus django-heiglerplus
+advanced_reports django-advanced-reports
+summary_wiki Summaly
+devserver django-devserver
+adminfilters django-adminfilters
+gtm django-google-tag-manager
+subscribe django-subscribe
+harpoon docker-harpoon
+futupayments django-futupayments
+related_choice_field django-related-choice-field
+pywapa PyWaPa-3k
+MultipartPostHandler dcupload
+onedrive python-onedrive
+cilenisapi python-cilenisapi
+couchdbcurl couchdb-python-curl
+charts microanalytics
+ifuns ifunbae
+quiz simple-quiz
+urlimaging django-url-imaging
+json json-extensions
+template_goodies django_template_goodies
+mangopay django-mangopay
+template_profiler_panel django-debug-toolbar-template-profiler
+mongo_connector elastictex
+aisutils noaadata-py
+feather feather-http
+jet_files jet
+subsetter rdbms-subsetter
+libmushu Mushu
+generic_ct_tag django-contenttype-tag
+xlsx py-xlsx
+allocine allocine-wrapper
+nosealert nose-alert
+gcframe django-gcframe
+ajax_search django-ajax-search
+zenburn pygments_zenburn
+recordpack m3-recordpack
+gtw gtwpy
+abook_storage radicale-remind
+plac_core plac
+controller confine-controller
+gizmo django-gizmo
+ao ao.shorturl
+registration_bootstrap django-registration-bootstrap
+multilingual_news django-multilingual-news
+protorpc protorpc-standalone
+myword pyword
+napoleon pyblish-napoleon
+taggit_templatetags2 django-taggit-templatetags2
+plaid plaid-python
+class_registry django-class-registry
+boto botornado
+glossary django-glossary
+vimeo PyVimeo
+vanilla django-vanilla-views
+autocomplete_light django-autocomplete-light
+viewtester django-viewtester
+emailahoy python-emailahoy
+giza django-giza
+chalk django-chalk
+pipeline_node_sass django-pipeline-node-sass
+ubik_toolbelt ubik
+appengine_toolkit django-appengine-toolkit
+libsonic py-sonic
+contextlib micropython-contextlib
+hashed_url django-hashed-url
+green_comments django-green-comments
+requirejs django-compressor-requirejs
+biribiri biribiri.rpc.client
+do2sshconfig digitalocean_to_sshconfig
+performanceplatform performanceplatform-client
+mutant django-mutant
+adiumsh adium-sh
+kunaki py-kunaki
+douban douban.fm
+guitarpro PyGuitarPro
+sekizai django-sekizai
+fluent_utils django-fluent-utils
+vm PySimpVM
+duat django-duat
+generic_links django-generic-links
+blick python-BLICK
+django_autoslug django-autoslug-field
+cronjobs django-cronjobs
+easy_test_selenium easy_test
+csvImporter django-csv-importer
+dmclient domainmodelclient
+websettings django-websettings
+smart_generic django-smart-selects-generic
+extended_choices django-extended-choices
+ezpkg ezupload
+email_extras django-email-extras
+pindb django-pindb
+urlreduce django-url-reduce
+lazymodel django-lazycache
+linode linode-python
+linotputils LinOTPAdminClientCLI
+bitstamp BitstampClient
+media_tree django-media-tree
+flydra_analysis_tools FlydraAnalysisTools
+pb_update opbasm
+units django-units
+management_audit django-management-audit
+android py-androidbuild
+Speed ish_parser
+pyivi pyinstruments
+piped_database piped.contrib.database
+validatorchain django-validatorchain
+Accessibility robotframework-selenium2accessibility
+authstrap django_authstrap
+ios meteo-downloader
+runstack django-runstack
+DragonPy DragonPyEmulator
+forms_ext django-forms-ext
+v2 v2.theme
+auth django-bbs
+subledger python-subledger
+pysnmp pysnmp-se
+threadedServer JsonSocket
+spirit_user_profile django-spirit-user-profile
+dj_search_url dj-searchurl
+xlwt xlwt-future
+possel possel-server
+gutter gutter-django
+eventhook bigsignal
+pyramid_xml_renderer PyramidXmlRenderer
+builder jenkins-view-builder
+DAC rpiDAC
+apiclient google-api-python-client
+quick_test django_quick_test
+italianskin italianskin.templates
+europeana django-europeana
+weblog django-weblog
+passaporte_web python-passaporte-web
+regdom pyregdom
+vinaigrette django-vinaigrette
+json_messages django-json-messages
+libmassresize massresize
+opencorpora opencorpora-tools
+btsync btsync.py
+template_minifier django-template-minifier
+simplegravatar django-simplegravatar
+biomodeltoolbox notebooktools
+restorm restorm-setuptools
+django_couch django-couch-utils
+fedeworker fede-worker
+mongodb_tool CherrypyMongoDB
+plomino plomino.patternslib
+webui cloudsafe
+pyroutesjs pyroutes.js
+statestyle latimes-statestyle
+localize django-localize
+glue glueviz
+Temperature ish_parser
+distributedlock django-distributedlock
+web web.py
+menuproxy redsolutioncms.django-menu-proxy
+gmapsmarkers twentytab-gmapsmarkers
+supportform django-support-form
+xbmcjson xbmc-json
+speedtracer django-speedtracer
+Broker SAPO-Broker
+bench benchmarker.py
+send2trash Send2Trash3k
+influenceexplorer python-transparencydata
+add awsdd
+test_xlocal xlocal
+timeperiod timeperiod2
+bft django-bft
+graphlab_psutil GraphLab-Create
+oomax ooo-macro-exchange
+rest_utils django-rest-utils
+nfg nfg.ideal
+optimizations django-optimizations
+dprofiling django-profiling
+processedfilefield django-processedfilefield
+tcms django-tcms
+masquerade django-masquerade
+flask_launchkey launchkey-flask
+permredirect TracPermRedirect
+fakeimg django-fakeimg
+redisEventTracker redis-event-tracker
+tastypiedoc django-tastypiedoc
+xmsgs xmsgs-tools
+block_ip django-block-ip
+filetransfers django-filetransfers
+community python-louvain
+iugu iugu-python
+clipthegym clip-the-gym
+propeller python-propeller
+ET_Client FuelSDK
+password Pyntifex
+readlist readlist_erik
+cqlshlib cqlsh
+taggit_autosuggest django-taggit-autosuggest
+oslo_rootwrap oslo.rootwrap
+SnapSearch snapsearch-client-python
+memoize simple-gae-memoize
+emma django_emma
+fborm fogbugz-orm
+yandex_direct django-yandex-direct
+pin_passcode django-pin-passcode
+candy candy.candy
+mrbob mr.bob
+dockitcms django-dockitcms
+app_plugins django-caching-app-plugins
+missingdrawables android-missingdrawables
+async django-async
+ziplookup django-webcam-photoupload
+cmstemplates django-cmstemplates
+arcrest geonode-arcrest
+backlog TracBacklog
+crawler django-crawler
+scrutinizer scrutinizer-ocular
+shed shed_sh
+ntlm python-ntlm
+functional ScalaFunctional
+ordered_m2m django-ordered-m2m
+habitat home_habitat
+mathfield django-mathfield
+ckeditor_demo django-ckeditor
+simple_import django-simple-import
+gerrit python-gerrit
+flatqueries django-flatqueries
+vsc vsc-base
+naturalsortfield django-naturalsortfield
+runabove python-runabove
+cmsplugin_events django-cms-events
+gflags_validators python-gflags
+star django-star
+p3p django-p3p
+cl2csv django-cl2csv
+pymar PymarMongo
+esv django_esv
+rdfrest kTBS
+wlp_parser pygn
+ooservice py3o.renderserver
+statprof statprof-smarkets
+monitoring_agent tanto
+hangul hangul.translit
+mekk mekk.xmind
+beefycachecontrol django-beefycachecontrol
+selenium_boilerplate django-selenium-boilerplate
+gtileoverlay django-gtileoverlay
+activehomed afn
+pepper salt-pepper
+hexgrid pyhexgrid
+browserstack Python-BrowserStack
+socrata_python WindyPie
+webleads django-webleads
+beatbox beatboxxx
+django_env django-environment
+kontagent pykontagent
+realestate_cms_houses django-estate-cms
+sitegate django-sitegate
+shop_ceca django-shop-ceca
+stellar stellar-py
+qspickle django_qspickle
+eloqua django-eloqua
+kestrelcli kestrel-cli
+devotionals django-devotionals
+djftpdtests djftpd
+gandalf gandalf-client
+autofixture django-autofixture
+djconfig django-djconfig
+stackexchange py-stackexchange
+reports Chandler-ReportPlugin
+tailer tailer3
+about django-about
+teamcitycli teamcity_cli
+chartbeat charbeat
+wysiwyg_forms django-wysiwyg-forms
+uTorrent uTorrent.Py
+declareamqp declare-amqp
+pypiuploader pypi-uploader
+tiling python-tiling
+friendlytagloader django-friendly-tag-loader
+dependency Chandler-DependencyPlugin
+switchboard switchboard-python
+easyoptions django-easyoptions
+muranoclient python-muranoclient
+ratelimitbackend django-ratelimit-backend
+undermythumb django-undermythumb
+addendum django-addendum
+txamqp txamqp_ext
+evesrp EVE-SRP
+flask_mustache Flask-MustacheJS
+cocos cocos2d
+easyDecorator Easy_Decorator
+parallelize python-parallelize
+conway gol
+boundaries represent-boundaries
+aws_manager django-aws-manager
+kmeans matsya
+newrelicextensions django-newrelic-extensions
+autoconfigure afn
+binaryfield django-binaryfield
+dropbox dropbox2
+inlinetrans django-inlinetrans
+strategy downloadduxiu
+paintedword painted-word
+virtualbox pyvbox
+closeio faster_closeio
+sudoku SudokuStudyLib
+jwrite pjtree
+appy appy.shared
+nodewatcher cfncluster-node
+table_fu python-tablefu
+friends django-simple-friends
+realestate_cms django-estate-cms
+explain_commands django-explain-commands
+wafflehaus wafflehaus.iweb
+popularity django-popularity-mixin
+ee earthengine-api
+accountant django-accountant
+geocode twentytab-geocode
+ormco ormconame
+tracker django-request-tracker
+booki Booktype
+dynamite django-dynamite
+cratis django-cratis
+test_simple_cache simple_cache
+metapkg archlinux-metapkg
+raft py-raft
+djnetaxept django-netaxept
+hotspots yandex-hotspots
+general_marshall GeneralMarshall
+foundation_icons django-foundation-icons
+aopythontest AOPython
+amitu amitu-zutils
+cratis_admin_suit django-cratis-admin-suit
+improved_inlines django-improved-inlines
+koansys koansys.django.authradius
+sphene django-sct
+cloudfiles python-cloudfiles
+getenv django-getenv
+tracefilter tracer
+distributed_task django_distributed_task
+strange_case StrangeCase
+hn pyhackernews
+ho pisa
+hl hl.colours
+FingerPrint fingerprint-app
+bootlog django-bootlog
+stats_toolkit bw-stats-toolkit
+vkontakte_wall django-vkontakte-wall
+usb1 libusb1
+mopidy_podcast_gpodder Mopidy-Podcast-gpodder.net
+qartez django-qartez
+wise python-wise
+converter PPICounter
+tcloghandler eventlog-writer
+yapi django-yapi
+__winshell_version__ winshell
+Pyrex Pyrex-real
+klarna Klarna_API
+ldap3 python3-ldap
+netauth django-netauth
+pg_fts django-pg-fts
+twemoir django-twemoir
+dirtyfields django-dirtyfields
+termsaverlib termsaver
+virtualenvapi ar-virtualenv-api
+cab django-cab
+diminuendo python-diminuendo
+webdash roborio-webdash
+nosetimer nose-timer
+facter facterpy
+grappelli_nested grappelli-nested-inlines
+hgext logilab-devtools
+wykop wykop-sdk
+easy_select2 django-easy-select2
+idtech pyidtech
+pin django-pin
+django_jinja django_jinja_middleware
+noseperf nose-performance
+user_management django-user-management
+hitcounter django-hitcounter
+ExcelLibrary robotframework-excellibrary
+simplenum simple-enum
+iospush django-ios-push
+utensils django-utensils
+mvob mvob.InfoBlad
+zinnia_markitup zinnia-wysiwyg-markitup
+mac_address_switcher mswitcher
+logrep wtop
+auspost_pac python-auspost-pac
+dedupe_copy DedupeCopy
+default_contact django-basecontact
+mockredis mockredispy
+inc django-inc
+elasticgit elastic-git
+email_change django-email-change
+currency_history django-currency-history
+linksets django_linksets
+teryt django-teryt
+_pytest pytest
+oak django-oak
+simplejson yos_social_sdk
+textbuffer_with_undo pygtk-textbuffer-with-undo
+markupfield django-markupfield
+lookup unholster.django-lookup
+dbparti django-db-parti2
+finch finch-cms
+plex_metadata plex.metadata.py
+dogstatsd dogstatsd-python-fixed
+vocab harvest-vocab
+grappelli_extensions django-grappelli-extensions
+carrousel django-carrousel
+django_easyfilters django-easyfilters-ex
+nosecover3 nose-cover3
+kubernetes python-kubernetes
+wskit wordseek
+get_merge git-get-merge
+gas python-gas-cli
+simple_manager simple-dependencies-manager
+manager_utils django-manager-utils
+addthis django-addthis
+changuito django-changuito
+backstage django_backstage
+shelly_cmd shelly
+vcard vcardreader
+django_twilio_sms django-twilio-sms-2
+StanfordDependencies PyStanfordDependencies
+debian python-debian
+initkit django-initkit
+ghost Ghost.py
+libzzzfs zzzfs
+multiple_include django-multiple-include
+api_docs django-api-docs
+patoolib patool
+pleskapi python-pleskapi
+dashing django-dashing
+gnupg_mails django-gnupg-mails
+ppauto ppft
+tinylinks django-tinylinks
+taskindicator task-indicator
+ptracking_utils python-tracking
+offermaker django-offermaker
+mmail mmailer
+debug_logging django-debug-logging
+newswall django-newswall
+chromeproxy chrome-proxy
+dev_email django-dev-email
+canvas_api_token django-canvas-api-token
+pods django-pods
+blogg django-blogg
+teamrubber teamrubber.theoracle
diff --git a/python/ipnb/resources/META-INF/ipython-notebook.xml b/python/ipnb/resources/META-INF/ipython-notebook.xml
index 498c9ab..a508d38 100644
--- a/python/ipnb/resources/META-INF/ipython-notebook.xml
+++ b/python/ipnb/resources/META-INF/ipython-notebook.xml
@@ -8,7 +8,7 @@
<fileEditorProvider implementation="org.jetbrains.plugins.ipnb.editor.IpnbEditorProvider"/>
<fileTypeFactory implementation="org.jetbrains.plugins.ipnb.IpnbFileTypeFactory"/>
- <projectConfigurable groupId="tools" instance="org.jetbrains.plugins.ipnb.configuration.IpnbConfigurable"
+ <projectConfigurable groupId="language" instance="org.jetbrains.plugins.ipnb.configuration.IpnbConfigurable"
id="org.jetbrains.plugins.ipnb.configuration.IpnbConfigurable" displayName="IPython Notebook"
nonDefaultProject="true"/>
<projectService serviceInterface="org.jetbrains.plugins.ipnb.configuration.IpnbSettings"
diff --git a/python/ipnb/src/org/jetbrains/plugins/ipnb/IpnbConsole.java b/python/ipnb/src/org/jetbrains/plugins/ipnb/IpnbConsole.java
deleted file mode 100644
index 1bae047..0000000
--- a/python/ipnb/src/org/jetbrains/plugins/ipnb/IpnbConsole.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package org.jetbrains.plugins.ipnb;
-
-import com.intellij.execution.ExecutionManager;
-import com.intellij.execution.Executor;
-import com.intellij.execution.executors.DefaultRunExecutor;
-import com.intellij.execution.impl.ConsoleViewImpl;
-import com.intellij.execution.process.KillableColoredProcessHandler;
-import com.intellij.execution.process.UnixProcessManager;
-import com.intellij.execution.ui.RunContentDescriptor;
-import com.intellij.icons.AllIcons;
-import com.intellij.openapi.actionSystem.*;
-import com.intellij.openapi.project.DumbAware;
-import com.intellij.openapi.project.Project;
-import com.intellij.openapi.util.Disposer;
-import org.jetbrains.annotations.NotNull;
-
-import javax.swing.*;
-import java.awt.*;
-
-public class IpnbConsole extends ConsoleViewImpl {
- private final KillableColoredProcessHandler myProcess;
-
- public IpnbConsole(@NotNull final Project project, @NotNull final KillableColoredProcessHandler processHandler) {
- super(project, false);
- myProcess = processHandler;
-
- final Executor executor = DefaultRunExecutor.getRunExecutorInstance();
- final DefaultActionGroup actions = new DefaultActionGroup();
-
- final JComponent consolePanel = createConsolePanel(actions);
- final RunContentDescriptor descriptor = new RunContentDescriptor(this, myProcess, consolePanel, "IPython Notebook");
-
- Disposer.register(this, descriptor);
- actions.add(new StopAction());
- ExecutionManager.getInstance(getProject()).getContentManager().showRunContent(executor, descriptor);
- }
-
- private JComponent createConsolePanel(ActionGroup actions) {
- JPanel panel = new JPanel();
- panel.setLayout(new BorderLayout());
- panel.add(getComponent(), BorderLayout.CENTER);
- panel.add(ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, actions, false).getComponent(), BorderLayout.WEST);
- return panel;
- }
-
- private class StopAction extends AnAction implements DumbAware {
- public StopAction() {
- super("Stop", "Stop", AllIcons.Actions.Suspend);
- }
-
- @Override
- public void actionPerformed(AnActionEvent e) {
- if (myProcess.isProcessTerminated()) return;
- myProcess.destroyProcess();
- UnixProcessManager.sendSigIntToProcessTree(myProcess.getProcess());
- }
-
- @Override
- public void update(AnActionEvent e) {
- e.getPresentation().setVisible(true);
- e.getPresentation().setEnabled(!myProcess.isProcessTerminated());
- }
- }
-}
diff --git a/python/ipnb/src/org/jetbrains/plugins/ipnb/configuration/IpnbConnectionManager.java b/python/ipnb/src/org/jetbrains/plugins/ipnb/configuration/IpnbConnectionManager.java
index c6bb4c8..b7d17c7 100644
--- a/python/ipnb/src/org/jetbrains/plugins/ipnb/configuration/IpnbConnectionManager.java
+++ b/python/ipnb/src/org/jetbrains/plugins/ipnb/configuration/IpnbConnectionManager.java
@@ -21,6 +21,7 @@
import com.intellij.openapi.ui.popup.Balloon;
import com.intellij.openapi.ui.popup.BalloonBuilder;
import com.intellij.openapi.ui.popup.JBPopupFactory;
+import com.intellij.openapi.util.Computable;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
@@ -33,7 +34,6 @@
import com.jetbrains.python.sdk.PythonSdkType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import org.jetbrains.plugins.ipnb.IpnbConsole;
import org.jetbrains.plugins.ipnb.editor.IpnbFileEditor;
import org.jetbrains.plugins.ipnb.editor.panels.code.IpnbCodePanel;
import org.jetbrains.plugins.ipnb.format.cells.output.IpnbOutputCell;
@@ -302,7 +302,25 @@
@Override
public void run() {
new RunContentExecutor(myProject, processHandler)
- .withConsole(new IpnbConsole(myProject, processHandler))
+ .withTitle("IPython Notebook")
+ .withStop(new Runnable() {
+ @Override
+ public void run() {
+ processHandler.destroyProcess();
+ UnixProcessManager.sendSigIntToProcessTree(processHandler.getProcess());
+ }
+ }, new Computable<Boolean>() {
+ @Override
+ public Boolean compute() {
+ return !processHandler.isProcessTerminated();
+ }
+ })
+ .withRerun(new Runnable() {
+ @Override
+ public void run() {
+ startIpythonServer(url, fileEditor);
+ }
+ })
.run();
}
});
diff --git a/python/pluginResources/META-INF/plugin.xml b/python/pluginResources/META-INF/plugin.xml
index b51b3e2..5e7d224 100644
--- a/python/pluginResources/META-INF/plugin.xml
+++ b/python/pluginResources/META-INF/plugin.xml
@@ -15,8 +15,8 @@
<a href="https://youtrack.jetbrains.com/issues/PY">Issue tracker</a><br>
]]></description>
- <!-- <PyCharm version> <Build number> (<Beta>|<EAP>|<RC>)? -->
- <version>@@PYCHARM_VERSION@@ @@BUILD_NUMBER@@ EAP</version>
+ <!-- <PyCharm version> <Build number> -->
+ <version>@@PYCHARM_VERSION@@ @@BUILD_NUMBER@@</version>
<depends>com.intellij.modules.java</depends>
diff --git a/python/pluginSrc/META-INF/python-plugin-core.xml b/python/pluginSrc/META-INF/python-plugin-core.xml
index 445eedc..2cb02ff 100644
--- a/python/pluginSrc/META-INF/python-plugin-core.xml
+++ b/python/pluginSrc/META-INF/python-plugin-core.xml
@@ -40,6 +40,9 @@
<action id="PyManagePackages" class="com.jetbrains.python.packaging.PyManagePackagesAction" text="Manage Python Packages...">
<add-to-group group-id="ToolsMenu" anchor="last"/>
</action>
+
+ <action overrides="true" id="ForceStepInto" class="com.jetbrains.python.debugger.PyForceStepIntoAction" text="Fo_rce Step Into"
+ icon="AllIcons.Debugger.Actions.Force_step_into" description="Step into, ignore stepping filters for libraries, constructors, etc."/>
</actions>
</idea-plugin>
\ No newline at end of file
diff --git a/python/pluginSrc/com/jetbrains/python/psi/impl/PyJavaImportResolver.java b/python/pluginSrc/com/jetbrains/python/psi/impl/PyJavaImportResolver.java
index 0b49516..12e353b 100644
--- a/python/pluginSrc/com/jetbrains/python/psi/impl/PyJavaImportResolver.java
+++ b/python/pluginSrc/com/jetbrains/python/psi/impl/PyJavaImportResolver.java
@@ -29,10 +29,9 @@
*/
public class PyJavaImportResolver implements PyImportResolver {
@Nullable
- public PsiElement resolveImportReference(QualifiedName name, QualifiedNameResolveContext context) {
+ public PsiElement resolveImportReference(QualifiedName name, QualifiedNameResolveContext context, boolean withRoots) {
String fqn = name.toString();
final JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(context.getProject());
- if (psiFacade == null) return null;
final PsiPackage aPackage = psiFacade.findPackage(fqn);
if (aPackage != null) {
return aPackage;
diff --git a/python/psi-api/src/com/jetbrains/python/PyNames.java b/python/psi-api/src/com/jetbrains/python/PyNames.java
index b9da047..2fabb81 100644
--- a/python/psi-api/src/com/jetbrains/python/PyNames.java
+++ b/python/psi-api/src/com/jetbrains/python/PyNames.java
@@ -347,6 +347,7 @@
.putAll(BuiltinMethods)
.put("__nonzero__", _only_self_descr)
.put("__div__", _self_other_descr)
+ .put(NEXT, _only_self_descr)
.build();
public static ImmutableMap<String, BuiltinDescription> PY3_BUILTIN_METHODS = ImmutableMap.<String, BuiltinDescription>builder()
@@ -355,6 +356,7 @@
.put("__bytes__", _only_self_descr)
.put("__format__", new BuiltinDescription("(self, format_spec)"))
.put("__round__", new BuiltinDescription("(self, n=None)"))
+ .put(DUNDER_NEXT, _only_self_descr)
.build();
public static ImmutableMap<String, BuiltinDescription> PY35_BUILTIN_METHODS = ImmutableMap.<String, BuiltinDescription>builder()
diff --git a/python/psi-api/src/com/jetbrains/python/psi/LanguageLevel.java b/python/psi-api/src/com/jetbrains/python/psi/LanguageLevel.java
index 1c56c2b..1be870c 100644
--- a/python/psi-api/src/com/jetbrains/python/psi/LanguageLevel.java
+++ b/python/psi-api/src/com/jetbrains/python/psi/LanguageLevel.java
@@ -56,6 +56,7 @@
public static LanguageLevel FORCE_LANGUAGE_LEVEL = null;
+ @NotNull
public static LanguageLevel getDefault() {
return DEFAULT2;
}
diff --git a/python/psi-api/src/com/jetbrains/python/psi/impl/PyImportResolver.java b/python/psi-api/src/com/jetbrains/python/psi/impl/PyImportResolver.java
index 932b68d..6be7655 100644
--- a/python/psi-api/src/com/jetbrains/python/psi/impl/PyImportResolver.java
+++ b/python/psi-api/src/com/jetbrains/python/psi/impl/PyImportResolver.java
@@ -28,5 +28,5 @@
ExtensionPointName<PyImportResolver> EP_NAME = ExtensionPointName.create("Pythonid.importResolver");
@Nullable
- PsiElement resolveImportReference(QualifiedName name, QualifiedNameResolveContext context);
+ PsiElement resolveImportReference(QualifiedName name, QualifiedNameResolveContext context, boolean withRoots);
}
diff --git a/python/psi-api/src/com/jetbrains/python/psi/impl/PyResolveResultRater.java b/python/psi-api/src/com/jetbrains/python/psi/impl/PyResolveResultRater.java
index 39afca5..6ea921b 100644
--- a/python/psi-api/src/com/jetbrains/python/psi/impl/PyResolveResultRater.java
+++ b/python/psi-api/src/com/jetbrains/python/psi/impl/PyResolveResultRater.java
@@ -17,10 +17,14 @@
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.psi.PsiElement;
+import com.jetbrains.python.psi.types.PyType;
+import com.jetbrains.python.psi.types.TypeEvalContext;
import org.jetbrains.annotations.NotNull;
public interface PyResolveResultRater {
ExtensionPointName<PyResolveResultRater> EP_NAME = ExtensionPointName.create("Pythonid.resolveResultRater");
- int getRate(@NotNull final PsiElement target);
+ int getImportElementRate(@NotNull final PsiElement target);
+
+ int getMemberRate(PsiElement member, PyType type, TypeEvalContext context);
}
diff --git a/python/psi-api/src/com/jetbrains/python/psi/impl/PyResolveResultRaterBase.java b/python/psi-api/src/com/jetbrains/python/psi/impl/PyResolveResultRaterBase.java
new file mode 100644
index 0000000..a0f6d62
--- /dev/null
+++ b/python/psi-api/src/com/jetbrains/python/psi/impl/PyResolveResultRaterBase.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2000-2015 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.jetbrains.python.psi.impl;
+
+import com.intellij.psi.PsiElement;
+import com.jetbrains.python.psi.types.PyType;
+import com.jetbrains.python.psi.types.TypeEvalContext;
+import org.jetbrains.annotations.NotNull;
+
+public class PyResolveResultRaterBase implements PyResolveResultRater {
+
+ public int getImportElementRate(@NotNull final PsiElement target) {
+ return 0;
+ }
+
+ public int getMemberRate(PsiElement member, PyType type, TypeEvalContext context) {
+ return 0;
+ }
+}
diff --git a/python/resources/icons/com/jetbrains/python/debug/StepIntoMyCode.png b/python/resources/icons/com/jetbrains/python/debug/StepIntoMyCode.png
index 6872566..a5cd441 100644
--- a/python/resources/icons/com/jetbrains/python/debug/StepIntoMyCode.png
+++ b/python/resources/icons/com/jetbrains/python/debug/StepIntoMyCode.png
Binary files differ
diff --git a/python/resources/icons/com/jetbrains/python/debug/StepIntoMyCode@2x.png b/python/resources/icons/com/jetbrains/python/debug/StepIntoMyCode@2x.png
index fdd640d..48fe75e 100644
--- a/python/resources/icons/com/jetbrains/python/debug/StepIntoMyCode@2x.png
+++ b/python/resources/icons/com/jetbrains/python/debug/StepIntoMyCode@2x.png
Binary files differ
diff --git a/python/resources/idea/PyCharmCoreApplicationInfo.xml b/python/resources/idea/PyCharmCoreApplicationInfo.xml
index 9f6e79c..5678b51 100644
--- a/python/resources/idea/PyCharmCoreApplicationInfo.xml
+++ b/python/resources/idea/PyCharmCoreApplicationInfo.xml
@@ -1,6 +1,6 @@
<component>
<company name="JetBrains s.r.o." url="https://www.jetbrains.com/?fromIDE"/>
- <version major="4" minor="5" eap="true"/>
+ <version major="4" minor="5.2" eap="false"/>
<build number="__BUILD_NUMBER__" date="__BUILD_DATE__"/>
<logo url="/pycharm_core_logo.png" textcolor="ffffff" progressColor="ffaa16" progressY="230" progressTailIcon="/community_progress_tail.png"/>
<about url="/pycharm_core_about.png" logoX="300" logoY="265" logoW="75" logoH="30" foreground="ffffff" linkColor="fca11a"/>
diff --git a/python/resources/pycharm_core_about.png b/python/resources/pycharm_core_about.png
index ceed226..091faee 100644
--- a/python/resources/pycharm_core_about.png
+++ b/python/resources/pycharm_core_about.png
Binary files differ
diff --git a/python/resources/pycharm_core_about@2x.png b/python/resources/pycharm_core_about@2x.png
index b7d07ab..4609665 100644
--- a/python/resources/pycharm_core_about@2x.png
+++ b/python/resources/pycharm_core_about@2x.png
Binary files differ
diff --git a/python/resources/pycharm_core_logo.png b/python/resources/pycharm_core_logo.png
index 92fddb9..b123ed8 100644
--- a/python/resources/pycharm_core_logo.png
+++ b/python/resources/pycharm_core_logo.png
Binary files differ
diff --git a/python/resources/pycharm_core_logo@2x.png b/python/resources/pycharm_core_logo@2x.png
index 7e8cfc3..e6081f3 100644
--- a/python/resources/pycharm_core_logo@2x.png
+++ b/python/resources/pycharm_core_logo@2x.png
Binary files differ
diff --git a/python/resources/tips/BuiltInServer.html b/python/resources/tips/BuiltInServer.html
index 4515f04..ad4eed9 100644
--- a/python/resources/tips/BuiltInServer.html
+++ b/python/resources/tips/BuiltInServer.html
@@ -5,8 +5,11 @@
<body>
- <p>It is very easy to change the built-in web server port (<span class="control">File | Settings – Debugger – JavaScript</span>),
-and use the "Built-in server port" spinner to set the new value. </p>
+<p>It is very easy to change the built-in web server port.
+In the Settings/Preferences dialog, expand the node
+<span class="control">Build, Execution, Deployment</span>, and click
+<span class="control">Debugger</span>.
+Then, use the "Built-in server port" spin box to set the new value. </p>
<p class="image"><img src="images/builtInServer.png"></p>
<p>Next, open an HTML page in your browser and see it running on the defined port.</p>
diff --git a/python/resources/tips/ClosingTag.html b/python/resources/tips/ClosingTag.html
new file mode 100755
index 0000000..f97c1a7
--- /dev/null
+++ b/python/resources/tips/ClosingTag.html
@@ -0,0 +1,14 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css" href="css/tips.css">
+</head>
+<body>
+
+
+ <p>Did you know that you can edit both opening and closing tags in XML/HTML files ?</p>
+<p>Make sure to select the check box <span class="control">Simultaneous <tag></tag> editing</span>
+in the Smart keys page of the Editor settings/preferences.
+</p>
+<p class="image"><img src="images/closing_tags.png"></p>
+</body>
+</html>
diff --git a/python/resources/tips/DiffChevron.html b/python/resources/tips/DiffChevron.html
new file mode 100755
index 0000000..cb454b7
--- /dev/null
+++ b/python/resources/tips/DiffChevron.html
@@ -0,0 +1,16 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css" href="css/tips.css">
+</head>
+<body>
+ <p>Have you noticed the buttons <img src="images/arrowRight.png"><img src="images/arrow.png">
+marking differences in the Differences viewer?</p>
+<p>You can simply apply differences between panes, by clicking one of these <i>chevron</i> buttons.</p>
+<p>Keep the <span class="shortcut">Ctrl</span> key pressed, and the <i>chevron</i> buttons
+change to <img src="images/arrowRightDown.png"><img src="images/arrowLeftDown.png">.
+Click one of these buttons to append contents of the current pane of the Differences viewer to the other pane.
+</p>
+<p>If you keep <span class="shortcut">Shift</span> pressed, the <i>chevrons</i> turn
+into <img src="images/remove.png">. Click this button to revert changes. </p>
+</body>
+</html>
\ No newline at end of file
diff --git a/python/resources/tips/Emmet.html b/python/resources/tips/Emmet.html
index 6dcec74..3522824 100644
--- a/python/resources/tips/Emmet.html
+++ b/python/resources/tips/Emmet.html
@@ -4,8 +4,9 @@
</head>
<body>
<p>Speed up HTML, XML or CSS development with <span class="control">Emmet</span>.</p>
- <p>Enable this framework in the <span class="control">Emmet(Zen Coding)</span> page of the <span class="control">Settings</span>/<span class="control">Preferences</span> dialog:</p>
+ <p>Enable this framework in the CSS or HTML pages under the
+<span class="control">Emmet(Zen Coding)</span> node of the <span class="control">Settings/Preferences</span> dialog:</p>
<p class="image">
<img src="images/emmet.png"></p>
</body>
-</html>
\ No newline at end of file
+</html>
diff --git a/python/resources/tips/LensMode.html b/python/resources/tips/LensMode.html
new file mode 100755
index 0000000..4b1174e
--- /dev/null
+++ b/python/resources/tips/LensMode.html
@@ -0,0 +1,14 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css" href="css/tips.css">
+</head>
+<body>
+
+ <p>Hover your mouse pointer over a warning, error stripe or just some section of source code
+on the scroll bar outside of the scroll box, and you will see a lens:</p>
+<p class="image"><img src="images/lens.png"></p>
+ <p>If the lens annoys you, get rid of it by clearing the check box on
+the context menu of the code analysis marker:</p>
+<p class="image"><img src="images/lens1.png"></p>
+</body>
+</html>
diff --git a/python/resources/tips/Multiselection1.html b/python/resources/tips/Multiselection1.html
new file mode 100755
index 0000000..869cf0f
--- /dev/null
+++ b/python/resources/tips/Multiselection1.html
@@ -0,0 +1,19 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css" href="css/tips.css">
+</head>
+<body>
+
+
+<p>To select multiple fragments in the "column mode",
+keep <span class="shortcut">Control+Alt+Shift</span>(on Windows and Linux) or
+<span class="shortcut">Cmd+Alt+Shift</span>(on MAC), and drag your mouse cursor:</p>
+
+
+
+ <p class="image"><img src="images/multiselection_column.png"></p>
+
+
+
+</body>
+</html>
diff --git a/python/resources/tips/Multiselection2.html b/python/resources/tips/Multiselection2.html
new file mode 100755
index 0000000..91b557c
--- /dev/null
+++ b/python/resources/tips/Multiselection2.html
@@ -0,0 +1,19 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css" href="css/tips.css">
+</head>
+<body>
+
+
+<p>You can easily select multiple fragments of text. To do that,
+it's enough to keep <span class="shortcut">Alt+Shift</span>
+and drag your mouse cursor:</p>
+
+
+
+ <p class="image"><img src="images/multiselection2.png"></p>
+
+
+
+</body>
+</html>
diff --git a/python/resources/tips/MultiselectionWords.html b/python/resources/tips/MultiselectionWords.html
new file mode 100755
index 0000000..c22ae63
--- /dev/null
+++ b/python/resources/tips/MultiselectionWords.html
@@ -0,0 +1,13 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css" href="css/tips.css">
+</head>
+<body>
+
+
+ <p>To select multiple words, press <span class="shortcut">Alt+Shift</span>, place
+the caret at each word to be selected and double-click the left mouse button.</p>
+</p>
+<p class="image"><img src="images/multiselection_words.png"></p>
+</body>
+</html>
diff --git a/python/resources/tips/PrintKeywords.html b/python/resources/tips/PrintKeywords.html
new file mode 100755
index 0000000..4563f17
--- /dev/null
+++ b/python/resources/tips/PrintKeywords.html
@@ -0,0 +1,12 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css" href="css/tips.css">
+</head>
+<body>
+
+
+<p>Make your printouts (File | Print) nice and informative with the help of keywords.</p>
+<p>For example, use $DATE$ and $TIME$ to specify the exact date and time of the printout.
+
+</body>
+</html>
diff --git a/python/resources/tips/QuickDocOnMouseMove.html b/python/resources/tips/QuickDocOnMouseMove.html
index 9499aea..7579b36 100755
--- a/python/resources/tips/QuickDocOnMouseMove.html
+++ b/python/resources/tips/QuickDocOnMouseMove.html
@@ -9,7 +9,8 @@
pointer over the desired symbol, the quick documentation pop-up window will show
automatically.</p>
<p>To enable this feature, select the check box <span class="control">Show quick doc on mouse move</span>
-in the editor settings.
+in the <span class="control">General</span> page of the editor settings:
</p>
+<p class="image"><img src="images/quick_doc_on_mouse_move.png"></p>
</body>
</html>
diff --git a/python/resources/tips/RemoteInterpreter.html b/python/resources/tips/RemoteInterpreter.html
index 9373493..118c50b 100644
--- a/python/resources/tips/RemoteInterpreter.html
+++ b/python/resources/tips/RemoteInterpreter.html
@@ -7,7 +7,7 @@
PyCharm it is quite easy.</p>
<p>To configure a remote interpreter, press <span class="shortcut">&shortcut:ShowSettings;</span>, and
under the <span class="control">Project Settings</span>. open the page <span class="control">Project Interpreter</span>.</p>
-<p>Then click the geat button, and choose the option <span class="control">Add Remote</span>:</p>
+<p>Then click the gear button, and choose the option <span class="control">Add Remote</span>:</p>
<p>You can use this remote interpreter for your project, or just leave it as one of the available interpreters.</p>
</body>
</html>
diff --git a/python/resources/tips/RichTextCopy.html b/python/resources/tips/RichTextCopy.html
new file mode 100755
index 0000000..ed116c5
--- /dev/null
+++ b/python/resources/tips/RichTextCopy.html
@@ -0,0 +1,14 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css" href="css/tips.css">
+</head>
+<body>
+
+
+ <p>Did you know that it's possible to copy rich text ?</p>
+<p>Make sure that the check box <span class="control">Copy rich text by default</span>
+in the General page of the Editor settings/preferences is selected:
+</p>
+<p class="image"><img src="images/copy_rich_text.png"></p>
+</body>
+</html>
diff --git a/python/resources/tips/ScratchesView.html b/python/resources/tips/ScratchesView.html
new file mode 100755
index 0000000..05dadc4
--- /dev/null
+++ b/python/resources/tips/ScratchesView.html
@@ -0,0 +1,9 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css" href="css/tips.css">
+</head>
+<body>
+<p>To see all the available scratch files, choose Scratches view in the Project tool window.</p>
+<p class="image"><img src="images/scratches_view.png"></p>
+</body>
+</html>
\ No newline at end of file
diff --git a/python/resources/tips/TypeHinting.html b/python/resources/tips/TypeHinting.html
new file mode 100644
index 0000000..ccadcdb
--- /dev/null
+++ b/python/resources/tips/TypeHinting.html
@@ -0,0 +1,13 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css" href="css/tips.css">
+</head>
+<body>
+ <p>Use <span class="control">type hinting</span> to inform PyCharm about
+the expected types of parameters, local variables, fields, or return values.</p>
+<p>When the expected type is specified as a docstring, PyCharm provides code completion
+that suggests elements of the corresponding type:</p>
+ <p class="image">
+ <img src="images/type_hinting_return.png"></p>
+</body>
+</html>
diff --git a/python/resources/tips/images/arrow.png b/python/resources/tips/images/arrow.png
new file mode 100755
index 0000000..8ef96d8
--- /dev/null
+++ b/python/resources/tips/images/arrow.png
Binary files differ
diff --git a/python/resources/tips/images/arrow@2x.png b/python/resources/tips/images/arrow@2x.png
new file mode 100755
index 0000000..786f83e
--- /dev/null
+++ b/python/resources/tips/images/arrow@2x.png
Binary files differ
diff --git a/python/resources/tips/images/arrow@2x_dark.png b/python/resources/tips/images/arrow@2x_dark.png
new file mode 100755
index 0000000..5f3b65f
--- /dev/null
+++ b/python/resources/tips/images/arrow@2x_dark.png
Binary files differ
diff --git a/python/resources/tips/images/arrowLeftDown.png b/python/resources/tips/images/arrowLeftDown.png
new file mode 100755
index 0000000..e01b1b4
--- /dev/null
+++ b/python/resources/tips/images/arrowLeftDown.png
Binary files differ
diff --git a/python/resources/tips/images/arrowLeftDown@2x.png b/python/resources/tips/images/arrowLeftDown@2x.png
new file mode 100755
index 0000000..39397c4c
--- /dev/null
+++ b/python/resources/tips/images/arrowLeftDown@2x.png
Binary files differ
diff --git a/python/resources/tips/images/arrowLeftDown@2x_dark.png b/python/resources/tips/images/arrowLeftDown@2x_dark.png
new file mode 100755
index 0000000..f7d0791
--- /dev/null
+++ b/python/resources/tips/images/arrowLeftDown@2x_dark.png
Binary files differ
diff --git a/python/resources/tips/images/arrowLeftDown_dark.png b/python/resources/tips/images/arrowLeftDown_dark.png
new file mode 100755
index 0000000..e54c525
--- /dev/null
+++ b/python/resources/tips/images/arrowLeftDown_dark.png
Binary files differ
diff --git a/python/resources/tips/images/arrowRight.png b/python/resources/tips/images/arrowRight.png
new file mode 100755
index 0000000..f7d7684
--- /dev/null
+++ b/python/resources/tips/images/arrowRight.png
Binary files differ
diff --git a/python/resources/tips/images/arrowRight@2x.png b/python/resources/tips/images/arrowRight@2x.png
new file mode 100755
index 0000000..299b7d3
--- /dev/null
+++ b/python/resources/tips/images/arrowRight@2x.png
Binary files differ
diff --git a/python/resources/tips/images/arrowRight@2x_dark.png b/python/resources/tips/images/arrowRight@2x_dark.png
new file mode 100755
index 0000000..7c83eae
--- /dev/null
+++ b/python/resources/tips/images/arrowRight@2x_dark.png
Binary files differ
diff --git a/python/resources/tips/images/arrowRightDown.png b/python/resources/tips/images/arrowRightDown.png
new file mode 100755
index 0000000..7f005f1
--- /dev/null
+++ b/python/resources/tips/images/arrowRightDown.png
Binary files differ
diff --git a/python/resources/tips/images/arrowRightDown@2x.png b/python/resources/tips/images/arrowRightDown@2x.png
new file mode 100755
index 0000000..d116ce1
--- /dev/null
+++ b/python/resources/tips/images/arrowRightDown@2x.png
Binary files differ
diff --git a/python/resources/tips/images/arrowRightDown@2x_dark.png b/python/resources/tips/images/arrowRightDown@2x_dark.png
new file mode 100755
index 0000000..9c0c3a5
--- /dev/null
+++ b/python/resources/tips/images/arrowRightDown@2x_dark.png
Binary files differ
diff --git a/python/resources/tips/images/arrowRightDown_dark.png b/python/resources/tips/images/arrowRightDown_dark.png
new file mode 100755
index 0000000..6df2507
--- /dev/null
+++ b/python/resources/tips/images/arrowRightDown_dark.png
Binary files differ
diff --git a/python/resources/tips/images/arrowRight_dark.png b/python/resources/tips/images/arrowRight_dark.png
new file mode 100755
index 0000000..6d1d8e0
--- /dev/null
+++ b/python/resources/tips/images/arrowRight_dark.png
Binary files differ
diff --git a/python/resources/tips/images/arrow_dark.png b/python/resources/tips/images/arrow_dark.png
new file mode 100755
index 0000000..7bebe9b
--- /dev/null
+++ b/python/resources/tips/images/arrow_dark.png
Binary files differ
diff --git a/python/resources/tips/images/builtInServer.png b/python/resources/tips/images/builtInServer.png
index 9adc67c..f70861b 100644
--- a/python/resources/tips/images/builtInServer.png
+++ b/python/resources/tips/images/builtInServer.png
Binary files differ
diff --git a/python/resources/tips/images/builtInServer@2x.png b/python/resources/tips/images/builtInServer@2x.png
index 27cfb66..ca20972 100644
--- a/python/resources/tips/images/builtInServer@2x.png
+++ b/python/resources/tips/images/builtInServer@2x.png
Binary files differ
diff --git a/python/resources/tips/images/buitInServer@2x_dark.png b/python/resources/tips/images/buitInServer@2x_dark.png
new file mode 100644
index 0000000..032f1fe
--- /dev/null
+++ b/python/resources/tips/images/buitInServer@2x_dark.png
Binary files differ
diff --git a/python/resources/tips/images/buitInServer_dark.png b/python/resources/tips/images/buitInServer_dark.png
new file mode 100644
index 0000000..323e7e8
--- /dev/null
+++ b/python/resources/tips/images/buitInServer_dark.png
Binary files differ
diff --git a/python/resources/tips/images/closing_tags.png b/python/resources/tips/images/closing_tags.png
new file mode 100755
index 0000000..501bd71
--- /dev/null
+++ b/python/resources/tips/images/closing_tags.png
Binary files differ
diff --git a/python/resources/tips/images/closing_tags@2x.png b/python/resources/tips/images/closing_tags@2x.png
new file mode 100755
index 0000000..b4aac91
--- /dev/null
+++ b/python/resources/tips/images/closing_tags@2x.png
Binary files differ
diff --git a/python/resources/tips/images/closing_tags@2x_dark.png b/python/resources/tips/images/closing_tags@2x_dark.png
new file mode 100755
index 0000000..0784461
--- /dev/null
+++ b/python/resources/tips/images/closing_tags@2x_dark.png
Binary files differ
diff --git a/python/resources/tips/images/closing_tags_dark.png b/python/resources/tips/images/closing_tags_dark.png
new file mode 100755
index 0000000..3685efe
--- /dev/null
+++ b/python/resources/tips/images/closing_tags_dark.png
Binary files differ
diff --git a/python/resources/tips/images/copy_rich_text.png b/python/resources/tips/images/copy_rich_text.png
new file mode 100755
index 0000000..c578a23
--- /dev/null
+++ b/python/resources/tips/images/copy_rich_text.png
Binary files differ
diff --git a/python/resources/tips/images/copy_rich_text@2x.png b/python/resources/tips/images/copy_rich_text@2x.png
new file mode 100755
index 0000000..00f0039
--- /dev/null
+++ b/python/resources/tips/images/copy_rich_text@2x.png
Binary files differ
diff --git a/python/resources/tips/images/copy_rich_text@2x_dark.png b/python/resources/tips/images/copy_rich_text@2x_dark.png
new file mode 100755
index 0000000..0a3ef32
--- /dev/null
+++ b/python/resources/tips/images/copy_rich_text@2x_dark.png
Binary files differ
diff --git a/python/resources/tips/images/copy_rich_text_dark.png b/python/resources/tips/images/copy_rich_text_dark.png
new file mode 100755
index 0000000..9d4bfa9
--- /dev/null
+++ b/python/resources/tips/images/copy_rich_text_dark.png
Binary files differ
diff --git a/python/resources/tips/images/emmet.png b/python/resources/tips/images/emmet.png
index 2fd359c..b6d9e3e 100644
--- a/python/resources/tips/images/emmet.png
+++ b/python/resources/tips/images/emmet.png
Binary files differ
diff --git a/python/resources/tips/images/emmet@2x.png b/python/resources/tips/images/emmet@2x.png
index 96ea893..2b8ab5d 100644
--- a/python/resources/tips/images/emmet@2x.png
+++ b/python/resources/tips/images/emmet@2x.png
Binary files differ
diff --git a/python/resources/tips/images/emmet@2x_dark.png b/python/resources/tips/images/emmet@2x_dark.png
index 22a1ee7..b681061 100644
--- a/python/resources/tips/images/emmet@2x_dark.png
+++ b/python/resources/tips/images/emmet@2x_dark.png
Binary files differ
diff --git a/python/resources/tips/images/emmet_dark.png b/python/resources/tips/images/emmet_dark.png
index dd1239f..8813cef 100644
--- a/python/resources/tips/images/emmet_dark.png
+++ b/python/resources/tips/images/emmet_dark.png
Binary files differ
diff --git a/python/resources/tips/images/lens.png b/python/resources/tips/images/lens.png
new file mode 100755
index 0000000..5d5cac1
--- /dev/null
+++ b/python/resources/tips/images/lens.png
Binary files differ
diff --git a/python/resources/tips/images/lens1.png b/python/resources/tips/images/lens1.png
new file mode 100755
index 0000000..947d8e7
--- /dev/null
+++ b/python/resources/tips/images/lens1.png
Binary files differ
diff --git a/python/resources/tips/images/lens1@2x.png b/python/resources/tips/images/lens1@2x.png
new file mode 100755
index 0000000..148db6a
--- /dev/null
+++ b/python/resources/tips/images/lens1@2x.png
Binary files differ
diff --git a/python/resources/tips/images/lens1@2x_dark.png b/python/resources/tips/images/lens1@2x_dark.png
new file mode 100755
index 0000000..3259582
--- /dev/null
+++ b/python/resources/tips/images/lens1@2x_dark.png
Binary files differ
diff --git a/python/resources/tips/images/lens1_dark.png b/python/resources/tips/images/lens1_dark.png
new file mode 100755
index 0000000..082c7e8
--- /dev/null
+++ b/python/resources/tips/images/lens1_dark.png
Binary files differ
diff --git a/python/resources/tips/images/lens@2x.png b/python/resources/tips/images/lens@2x.png
new file mode 100755
index 0000000..a3f4043
--- /dev/null
+++ b/python/resources/tips/images/lens@2x.png
Binary files differ
diff --git a/python/resources/tips/images/lens@2x_dark.png b/python/resources/tips/images/lens@2x_dark.png
new file mode 100755
index 0000000..965a13f
--- /dev/null
+++ b/python/resources/tips/images/lens@2x_dark.png
Binary files differ
diff --git a/python/resources/tips/images/lens_dark.png b/python/resources/tips/images/lens_dark.png
new file mode 100755
index 0000000..0bd2296
--- /dev/null
+++ b/python/resources/tips/images/lens_dark.png
Binary files differ
diff --git a/python/resources/tips/images/multiselection2.png b/python/resources/tips/images/multiselection2.png
new file mode 100755
index 0000000..ae05462
--- /dev/null
+++ b/python/resources/tips/images/multiselection2.png
Binary files differ
diff --git a/python/resources/tips/images/multiselection2@2x.png b/python/resources/tips/images/multiselection2@2x.png
new file mode 100755
index 0000000..9d9b000
--- /dev/null
+++ b/python/resources/tips/images/multiselection2@2x.png
Binary files differ
diff --git a/python/resources/tips/images/multiselection2@2x_dark.png b/python/resources/tips/images/multiselection2@2x_dark.png
new file mode 100755
index 0000000..58a76b4
--- /dev/null
+++ b/python/resources/tips/images/multiselection2@2x_dark.png
Binary files differ
diff --git a/python/resources/tips/images/multiselection2_dark.png b/python/resources/tips/images/multiselection2_dark.png
new file mode 100755
index 0000000..cc9e361
--- /dev/null
+++ b/python/resources/tips/images/multiselection2_dark.png
Binary files differ
diff --git a/python/resources/tips/images/multiselection_column.png b/python/resources/tips/images/multiselection_column.png
new file mode 100755
index 0000000..1c9c41f
--- /dev/null
+++ b/python/resources/tips/images/multiselection_column.png
Binary files differ
diff --git a/python/resources/tips/images/multiselection_column@2x.png b/python/resources/tips/images/multiselection_column@2x.png
new file mode 100755
index 0000000..65a53ea
--- /dev/null
+++ b/python/resources/tips/images/multiselection_column@2x.png
Binary files differ
diff --git a/python/resources/tips/images/multiselection_column@2x_dark.png b/python/resources/tips/images/multiselection_column@2x_dark.png
new file mode 100755
index 0000000..3f3062e
--- /dev/null
+++ b/python/resources/tips/images/multiselection_column@2x_dark.png
Binary files differ
diff --git a/python/resources/tips/images/multiselection_column_dark.png b/python/resources/tips/images/multiselection_column_dark.png
new file mode 100755
index 0000000..80febfd
--- /dev/null
+++ b/python/resources/tips/images/multiselection_column_dark.png
Binary files differ
diff --git a/python/resources/tips/images/multiselection_words.png b/python/resources/tips/images/multiselection_words.png
new file mode 100755
index 0000000..dde0b5e
--- /dev/null
+++ b/python/resources/tips/images/multiselection_words.png
Binary files differ
diff --git a/python/resources/tips/images/multiselection_words@2x.png b/python/resources/tips/images/multiselection_words@2x.png
new file mode 100755
index 0000000..8783788
--- /dev/null
+++ b/python/resources/tips/images/multiselection_words@2x.png
Binary files differ
diff --git a/python/resources/tips/images/multiselection_words@2x_dark.png b/python/resources/tips/images/multiselection_words@2x_dark.png
new file mode 100755
index 0000000..9b6f30c
--- /dev/null
+++ b/python/resources/tips/images/multiselection_words@2x_dark.png
Binary files differ
diff --git a/python/resources/tips/images/multiselection_words_dark.png b/python/resources/tips/images/multiselection_words_dark.png
new file mode 100755
index 0000000..c40c193
--- /dev/null
+++ b/python/resources/tips/images/multiselection_words_dark.png
Binary files differ
diff --git a/python/resources/tips/images/quick_doc_on_mouse_move.png b/python/resources/tips/images/quick_doc_on_mouse_move.png
new file mode 100755
index 0000000..a3ac90a
--- /dev/null
+++ b/python/resources/tips/images/quick_doc_on_mouse_move.png
Binary files differ
diff --git a/python/resources/tips/images/quick_doc_on_mouse_move@2x.png b/python/resources/tips/images/quick_doc_on_mouse_move@2x.png
new file mode 100755
index 0000000..ed08a56
--- /dev/null
+++ b/python/resources/tips/images/quick_doc_on_mouse_move@2x.png
Binary files differ
diff --git a/python/resources/tips/images/quick_doc_on_mouse_move@2x_dark.png b/python/resources/tips/images/quick_doc_on_mouse_move@2x_dark.png
new file mode 100755
index 0000000..3553692
--- /dev/null
+++ b/python/resources/tips/images/quick_doc_on_mouse_move@2x_dark.png
Binary files differ
diff --git a/python/resources/tips/images/quick_doc_on_mouse_move_dark.png b/python/resources/tips/images/quick_doc_on_mouse_move_dark.png
new file mode 100755
index 0000000..e72d1a4
--- /dev/null
+++ b/python/resources/tips/images/quick_doc_on_mouse_move_dark.png
Binary files differ
diff --git a/python/resources/tips/images/quickdoc.png b/python/resources/tips/images/quickdoc.png
new file mode 100755
index 0000000..74201b0
--- /dev/null
+++ b/python/resources/tips/images/quickdoc.png
Binary files differ
diff --git a/python/resources/tips/images/quickdoc@2x.png b/python/resources/tips/images/quickdoc@2x.png
new file mode 100755
index 0000000..cd9fb06
--- /dev/null
+++ b/python/resources/tips/images/quickdoc@2x.png
Binary files differ
diff --git a/python/resources/tips/images/quickdoc@2x_dark.png b/python/resources/tips/images/quickdoc@2x_dark.png
new file mode 100755
index 0000000..2b62385
--- /dev/null
+++ b/python/resources/tips/images/quickdoc@2x_dark.png
Binary files differ
diff --git a/python/resources/tips/images/quickdoc_dark.png b/python/resources/tips/images/quickdoc_dark.png
new file mode 100755
index 0000000..69a50d0
--- /dev/null
+++ b/python/resources/tips/images/quickdoc_dark.png
Binary files differ
diff --git a/python/resources/tips/images/remove.png b/python/resources/tips/images/remove.png
new file mode 100755
index 0000000..8bad73e
--- /dev/null
+++ b/python/resources/tips/images/remove.png
Binary files differ
diff --git a/python/resources/tips/images/remove@2x.png b/python/resources/tips/images/remove@2x.png
new file mode 100755
index 0000000..a6c1562
--- /dev/null
+++ b/python/resources/tips/images/remove@2x.png
Binary files differ
diff --git a/python/resources/tips/images/remove@2x_dark.png b/python/resources/tips/images/remove@2x_dark.png
new file mode 100755
index 0000000..f8911a5
--- /dev/null
+++ b/python/resources/tips/images/remove@2x_dark.png
Binary files differ
diff --git a/python/resources/tips/images/remove_dark.png b/python/resources/tips/images/remove_dark.png
new file mode 100755
index 0000000..df091cd
--- /dev/null
+++ b/python/resources/tips/images/remove_dark.png
Binary files differ
diff --git a/python/resources/tips/images/scratches_view.png b/python/resources/tips/images/scratches_view.png
new file mode 100755
index 0000000..30f2941
--- /dev/null
+++ b/python/resources/tips/images/scratches_view.png
Binary files differ
diff --git a/python/resources/tips/images/scratches_view@2x.png b/python/resources/tips/images/scratches_view@2x.png
new file mode 100755
index 0000000..d7f6a4d
--- /dev/null
+++ b/python/resources/tips/images/scratches_view@2x.png
Binary files differ
diff --git a/python/resources/tips/images/scratches_view@2x_dark.png b/python/resources/tips/images/scratches_view@2x_dark.png
new file mode 100755
index 0000000..6b74963
--- /dev/null
+++ b/python/resources/tips/images/scratches_view@2x_dark.png
Binary files differ
diff --git a/python/resources/tips/images/scratches_view_dark.png b/python/resources/tips/images/scratches_view_dark.png
new file mode 100755
index 0000000..5e7ca58
--- /dev/null
+++ b/python/resources/tips/images/scratches_view_dark.png
Binary files differ
diff --git a/python/resources/tips/images/type_hinting_return.png b/python/resources/tips/images/type_hinting_return.png
new file mode 100644
index 0000000..d49d42cc
--- /dev/null
+++ b/python/resources/tips/images/type_hinting_return.png
Binary files differ
diff --git a/python/resources/tips/moveFileToChangelist.html b/python/resources/tips/moveFileToChangelist.html
index 7ec305e..7bd33df 100644
--- a/python/resources/tips/moveFileToChangelist.html
+++ b/python/resources/tips/moveFileToChangelist.html
@@ -7,7 +7,8 @@
<p>
You can move any file to a changelist of your choice. To do that, just choose
-<span class="control">Move to Changelist</span> on the file context menu in the Changes tool window:
+<span class="control">Move to Changelist</span> on the file context menu in the
+Local Changes tab of the Version Control tool window:
</p>
<p class="image"><img src="images/move_to_changelist.png"></p>
diff --git a/python/skeletons/skeletons-mac-392-10.10-python-2.7.6.zip b/python/skeletons/skeletons-mac-392-10.10-python-2.7.6.zip
new file mode 100644
index 0000000..43b4344
--- /dev/null
+++ b/python/skeletons/skeletons-mac-392-10.10-python-2.7.6.zip
Binary files differ
diff --git a/python/src/META-INF/IdeTipsAndTricks.xml b/python/src/META-INF/IdeTipsAndTricks.xml
index e920175..06b2dadd 100644
--- a/python/src/META-INF/IdeTipsAndTricks.xml
+++ b/python/src/META-INF/IdeTipsAndTricks.xml
@@ -114,5 +114,14 @@
<tipAndTrick file="QuickDocInSuggestionList.html"/>
<tipAndTrick file="QuickDocOnMouseMove.html"/>
<tipAndTrick file="TerminalOpen.html"/>
+ <tipAndTrick file="ClosingTag.html"/>
+ <tipAndTrick file="DiffChevron.html"/>
+ <tipAndTrick file="LensMode.html"/>
+ <tipAndTrick file="Multiselection1.html"/>
+ <tipAndTrick file="Multiselection2.html"/>
+ <tipAndTrick file="MultiselectionWords.html"/>
+ <tipAndTrick file="PrintKeywords.html"/>
+ <tipAndTrick file="RichTextCopy.html"/>
+ <tipAndTrick file="ScratchesView.html"/>
</extensions>
</idea-plugin>
\ No newline at end of file
diff --git a/python/src/META-INF/python-core.xml b/python/src/META-INF/python-core.xml
index ef2a4ff..2257979 100644
--- a/python/src/META-INF/python-core.xml
+++ b/python/src/META-INF/python-core.xml
@@ -282,74 +282,74 @@
<stubElementTypeHolder class="com.jetbrains.python.PyElementTypes"/>
- <localInspection language="Python" shortName="PyArgumentListInspection" suppressId="PyArgumentList" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.incorrect.call.arguments" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyArgumentListInspection"/>
- <localInspection language="Python" shortName="PyRedeclarationInspection" suppressId="PyRedeclaration" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.redeclaration" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyRedeclarationInspection"/>
- <localInspection language="Python" shortName="PyUnresolvedReferencesInspection" suppressId="PyUnresolvedReferences" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.unresolved.refs" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.unresolvedReference.PyUnresolvedReferencesInspection"/>
- <localInspection language="Python" shortName="PyInterpreterInspection" suppressId="PyInterpreter" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.invalid.interpreter" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyInterpreterInspection"/>
- <localInspection language="Python" shortName="PyMethodParametersInspection" suppressId="PyMethodParameters" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.problematic.first.parameter" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyMethodParametersInspection"/>
- <localInspection language="Python" shortName="PyUnreachableCodeInspection" suppressId="PyUnreachableCode" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.unreachable.code" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyUnreachableCodeInspection"/>
- <localInspection language="Python" shortName="PyMethodFirstArgAssignmentInspection" suppressId="PyMethodFirstArgAssignment" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.first.arg.assign" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyMethodFirstArgAssignmentInspection"/>
- <localInspection language="Python" shortName="PyStringFormatInspection" suppressId="PyStringFormat" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.str.format" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyStringFormatInspection"/>
- <localInspection language="Python" shortName="PyMethodOverridingInspection" suppressId="PyMethodOverriding" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.method.over" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyMethodOverridingInspection"/>
- <localInspection language="Python" shortName="PyInitNewSignatureInspection" suppressId="PyInitNewSignature" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.new.init.signature" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyInitNewSignatureInspection"/>
- <localInspection language="Python" shortName="PyTrailingSemicolonInspection" suppressId="PyTrailingSemicolon" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.trailing.semicolon" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyTrailingSemicolonInspection"/>
- <localInspection language="Python" shortName="PyReturnFromInitInspection" suppressId="PyReturnFromInit" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.init.return" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyReturnFromInitInspection"/>
- <localInspection language="Python" shortName="PyUnusedLocalInspection" suppressId="PyUnusedLocal" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.unused" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyUnusedLocalInspection"/>
- <localInspection language="Python" shortName="PyDictCreationInspection" suppressId="PyDictCreation" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.dict.creation" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyDictCreationInspection"/>
- <localInspection language="Python" shortName="PyDictDuplicateKeysInspection" suppressId="PyDictDuplicateKeys" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.duplicate.keys" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyDictDuplicateKeysInspection"/>
- <localInspection language="Python" shortName="PyExceptClausesOrderInspection" suppressId="PyExceptClausesOrder" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.bad.except.clauses.order" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyExceptClausesOrderInspection"/>
- <localInspection language="Python" shortName="PyTupleAssignmentBalanceInspection" suppressId="PyTupleAssignmentBalance" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.incorrect.assignment" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyTupleAssignmentBalanceInspection"/>
- <localInspection language="Python" shortName="PyClassicStyleClassInspection" suppressId="PyClassicStyleClass" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.classic.class.usage" groupKey="INSP.GROUP.python" enabledByDefault="false" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyClassicStyleClassInspection"/>
- <localInspection language="Python" shortName="PyExceptionInheritInspection" suppressId="PyExceptionInherit" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.exception.not.inherit" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyExceptionInheritInspection"/>
- <localInspection language="Python" shortName="PyDefaultArgumentInspection" suppressId="PyDefaultArgument" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.default.argument" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyDefaultArgumentInspection"/>
- <localInspection language="Python" shortName="PyRaisingNewStyleClassInspection" suppressId="PyRaisingNewStyleClass" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.raising.new.style.class" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyRaisingNewStyleClassInspection"/>
- <localInspection language="Python" shortName="PyDocstringInspection" suppressId="PyDocstring" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.docstring" groupKey="INSP.GROUP.python" enabledByDefault="false" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyDocstringInspection"/>
- <localInspection language="Python" shortName="PyUnboundLocalVariableInspection" suppressId="PyUnboundLocalVariable" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.unbound" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyUnboundLocalVariableInspection"/>
- <localInspection language="Python" shortName="PyStatementEffectInspection" suppressId="PyStatementEffect" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.statement.effect" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyStatementEffectInspection"/>
- <localInspection language="Python" shortName="PySimplifyBooleanCheckInspection" suppressId="PySimplifyBooleanCheck" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.check.can.be.simplified" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PySimplifyBooleanCheckInspection"/>
- <localInspection language="Python" shortName="PyFromFutureImportInspection" suppressId="PyFromFutureImport" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.from.future.import" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyFromFutureImportInspection"/>
- <localInspection language="Python" shortName="PyComparisonWithNoneInspection" suppressId="PyComparisonWithNone" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.comparison.with.none" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyComparisonWithNoneInspection"/>
- <localInspection language="Python" shortName="PyStringExceptionInspection" suppressId="PyStringException" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.raising.string.exception" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyStringExceptionInspection"/>
- <localInspection language="Python" shortName="PySuperArgumentsInspection" suppressId="PySuperArguments" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.wrong.super.arguments" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PySuperArgumentsInspection"/>
- <localInspection language="Python" shortName="PyByteLiteralInspection" suppressId="PyByteLiteral" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.byte.literal" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyByteLiteralInspection"/>
- <localInspection language="Python" shortName="PyNonAsciiCharInspection" suppressId="PyNonAsciiChar" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.non.ascii" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyNonAsciiCharInspection"/>
- <localInspection language="Python" shortName="PyTupleItemAssignmentInspection" suppressId="PyTupleItemAssignment" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.tuple.item.assignment" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyTupleItemAssignmentInspection"/>
- <localInspection language="Python" shortName="PyCallingNonCallableInspection" suppressId="PyCallingNonCallable" displayName="Trying to call a non-callable object" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyCallingNonCallableInspection"/>
- <localInspection language="Python" shortName="PyPropertyAccessInspection" suppressId="PyPropertyAccess" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.property.access" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyPropertyAccessInspection"/>
- <localInspection language="Python" shortName="PyPropertyDefinitionInspection" suppressId="PyPropertyDefinition" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.property.definition" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyPropertyDefinitionInspection"/>
- <localInspection language="Python" shortName="PyInconsistentIndentationInspection" suppressId="PyInconsistentIndentation" displayName="Inconsistent indentation" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyInconsistentIndentationInspection"/>
- <localInspection language="Python" shortName="PyNestedDecoratorsInspection" suppressId="PyNestedDecorators" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.nested.decorators" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyNestedDecoratorsInspection"/>
- <localInspection language="Python" shortName="PyCallByClassInspection" suppressId="PyCallByClass" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.different.class.call" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyCallByClassInspection"/>
- <localInspection language="Python" shortName="PyBroadExceptionInspection" suppressId="PyBroadException" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.too.broad.exception.clauses" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyBroadExceptionInspection"/>
- <localInspection language="Python" shortName="PyRedundantParenthesesInspection" suppressId="PyRedundantParentheses" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.redundant.parentheses" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyRedundantParenthesesInspection"/>
- <localInspection language="Python" shortName="PyAugmentAssignmentInspection" suppressId="PyAugmentAssignment" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.augment.assignment" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyAugmentAssignmentInspection"/>
- <localInspection language="Python" shortName="PyChainedComparisonsInspection" suppressId="PyChainedComparisons" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.chained.comparisons" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyChainedComparisonsInspection"/>
- <localInspection language="Python" shortName="PyOldStyleClassesInspection" suppressId="PyOldStyleClasses" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.oldstyle.class" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyOldStyleClassesInspection"/>
- <localInspection language="Python" shortName="PyCompatibilityInspection" suppressId="PyCompatibility" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.compatibility" groupKey="INSP.GROUP.python" enabledByDefault="false" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyCompatibilityInspection"/>
- <localInspection language="Python" shortName="PyListCreationInspection" suppressId="PyListCreation" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.list.creation" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyListCreationInspection"/>
- <localInspection language="Python" shortName="PyUnnecessaryBackslashInspection" suppressId="PyUnnecessaryBackslash" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.unnecessary.backslash" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyUnnecessaryBackslashInspection"/>
- <localInspection language="Python" shortName="PySingleQuotedDocstringInspection" suppressId="PySingleQuotedDocstring" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.single.quoted.docstring" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PySingleQuotedDocstringInspection"/>
- <localInspection language="Python" shortName="PyMissingConstructorInspection" suppressId="PyMissingConstructor" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.missing.super.constructor" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyMissingConstructorInspection"/>
- <localInspection language="Python" shortName="PyArgumentEqualDefaultInspection" suppressId="PyArgumentEqualDefault" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.argument.equal.default" groupKey="INSP.GROUP.python" enabledByDefault="false" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyArgumentEqualDefaultInspection"/>
- <localInspection language="Python" shortName="PySetFunctionToLiteralInspection" suppressId="PySetFunctionToLiteral" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.set.function.to.literal" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PySetFunctionToLiteralInspection"/>
- <localInspection language="Python" shortName="PyDecoratorInspection" suppressId="PyDecorator" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.decorator.outside.class" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyDecoratorInspection"/>
- <localInspection language="Python" shortName="PyTypeCheckerInspection" suppressId="PyTypeChecker" displayName="Type checker" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyTypeCheckerInspection"/>
- <localInspection language="Python" shortName="PyDeprecationInspection" suppressId="PyDeprecation" displayName="Deprecated function, class or module" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyDeprecationInspection"/>
- <localInspection language="Python" shortName="PyMandatoryEncodingInspection" suppressId="PyMandatoryEncoding" displayName="No encoding specified for file" groupKey="INSP.GROUP.python" enabledByDefault="false" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyMandatoryEncodingInspection"/>
- <localInspection language="Python" shortName="PyPackageRequirementsInspection" suppressId="PyPackageRequirements" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.requirements" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyPackageRequirementsInspection"/>
- <localInspection language="Python" shortName="PyPep8Inspection" suppressId="PyPep8" displayName="PEP 8 coding style violation" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyPep8Inspection"/>
- <localInspection language="Python" shortName="PyAttributeOutsideInitInspection" suppressId="PyAttributeOutsideInit" displayName="Instance attribute defined outside __init__" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyAttributeOutsideInitInspection"/>
- <localInspection language="Python" shortName="PyClassHasNoInitInspection" suppressId="PyClassHasNoInit" displayName="Class has no __init__ method" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyClassHasNoInitInspection"/>
- <localInspection language="Python" shortName="PyNoneFunctionAssignmentInspection" suppressId="PyNoneFunctionAssignment" displayName="Assigning function call that doesn't return anything" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyNoneFunctionAssignmentInspection"/>
- <localInspection language="Python" shortName="PyGlobalUndefinedInspection" suppressId="PyGlobalUndefined" displayName="Global variable is undefined at the module level" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyGlobalUndefinedInspection"/>
- <localInspection language="Python" shortName="PyProtectedMemberInspection" suppressId="PyProtectedMember" displayName="Access to a protected member of a class" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyProtectedMemberInspection"/>
- <localInspection language="Python" shortName="PyMethodMayBeStaticInspection" suppressId="PyMethodMayBeStatic" displayName="Method may be static" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyMethodMayBeStaticInspection"/>
- <localInspection language="Python" shortName="PyDocstringTypesInspection" suppressId="PyDocstringTypes" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.docstring.types" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyDocstringTypesInspection"/>
- <localInspection language="Python" shortName="PyShadowingBuiltinsInspection" suppressId="PyShadowingBuiltins" displayName="Shadowing built-ins" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyShadowingBuiltinsInspection"/>
- <localInspection language="Python" shortName="PyShadowingNamesInspection" suppressId="PyShadowingNames" displayName="Shadowing names from outer scopes" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyShadowingNamesInspection"/>
- <localInspection language="Python" shortName="PyAbstractClassInspection" suppressId="PyAbstractClass" displayName="Class must implement all abstract methods" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyAbstractClassInspection"/>
- <localInspection language="Python" shortName="PyPep8NamingInspection" suppressId="PyPep8Naming" displayName="PEP 8 naming convention violation" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyPep8NamingInspection"/>
- <localInspection language="Python" shortName="PyAssignmentToLoopOrWithParameterInspection" suppressId="PyAssignmentToLoopOrWithParameter" displayName="Assignment to 'for' loop or 'with' statement parameter" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyAssignmentToLoopOrWithParameterInspection"/>
+ <localInspection language="Python" shortName="PyArgumentListInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.incorrect.call.arguments" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyArgumentListInspection"/>
+ <localInspection language="Python" shortName="PyRedeclarationInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.redeclaration" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyRedeclarationInspection"/>
+ <localInspection language="Python" shortName="PyUnresolvedReferencesInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.unresolved.refs" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.unresolvedReference.PyUnresolvedReferencesInspection"/>
+ <localInspection language="Python" shortName="PyInterpreterInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.invalid.interpreter" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyInterpreterInspection"/>
+ <localInspection language="Python" shortName="PyMethodParametersInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.problematic.first.parameter" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyMethodParametersInspection"/>
+ <localInspection language="Python" shortName="PyUnreachableCodeInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.unreachable.code" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyUnreachableCodeInspection"/>
+ <localInspection language="Python" shortName="PyMethodFirstArgAssignmentInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.first.arg.assign" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyMethodFirstArgAssignmentInspection"/>
+ <localInspection language="Python" shortName="PyStringFormatInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.str.format" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyStringFormatInspection"/>
+ <localInspection language="Python" shortName="PyMethodOverridingInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.method.over" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyMethodOverridingInspection"/>
+ <localInspection language="Python" shortName="PyInitNewSignatureInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.new.init.signature" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyInitNewSignatureInspection"/>
+ <localInspection language="Python" shortName="PyTrailingSemicolonInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.trailing.semicolon" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyTrailingSemicolonInspection"/>
+ <localInspection language="Python" shortName="PyReturnFromInitInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.init.return" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyReturnFromInitInspection"/>
+ <localInspection language="Python" shortName="PyUnusedLocalInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.unused" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyUnusedLocalInspection"/>
+ <localInspection language="Python" shortName="PyDictCreationInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.dict.creation" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyDictCreationInspection"/>
+ <localInspection language="Python" shortName="PyDictDuplicateKeysInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.duplicate.keys" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyDictDuplicateKeysInspection"/>
+ <localInspection language="Python" shortName="PyExceptClausesOrderInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.bad.except.clauses.order" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyExceptClausesOrderInspection"/>
+ <localInspection language="Python" shortName="PyTupleAssignmentBalanceInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.incorrect.assignment" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyTupleAssignmentBalanceInspection"/>
+ <localInspection language="Python" shortName="PyClassicStyleClassInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.classic.class.usage" groupKey="INSP.GROUP.python" enabledByDefault="false" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyClassicStyleClassInspection"/>
+ <localInspection language="Python" shortName="PyExceptionInheritInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.exception.not.inherit" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyExceptionInheritInspection"/>
+ <localInspection language="Python" shortName="PyDefaultArgumentInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.default.argument" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyDefaultArgumentInspection"/>
+ <localInspection language="Python" shortName="PyRaisingNewStyleClassInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.raising.new.style.class" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyRaisingNewStyleClassInspection"/>
+ <localInspection language="Python" shortName="PyDocstringInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.docstring" groupKey="INSP.GROUP.python" enabledByDefault="false" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyDocstringInspection"/>
+ <localInspection language="Python" shortName="PyUnboundLocalVariableInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.unbound" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyUnboundLocalVariableInspection"/>
+ <localInspection language="Python" shortName="PyStatementEffectInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.statement.effect" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyStatementEffectInspection"/>
+ <localInspection language="Python" shortName="PySimplifyBooleanCheckInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.check.can.be.simplified" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PySimplifyBooleanCheckInspection"/>
+ <localInspection language="Python" shortName="PyFromFutureImportInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.from.future.import" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyFromFutureImportInspection"/>
+ <localInspection language="Python" shortName="PyComparisonWithNoneInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.comparison.with.none" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyComparisonWithNoneInspection"/>
+ <localInspection language="Python" shortName="PyStringExceptionInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.raising.string.exception" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyStringExceptionInspection"/>
+ <localInspection language="Python" shortName="PySuperArgumentsInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.wrong.super.arguments" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PySuperArgumentsInspection"/>
+ <localInspection language="Python" shortName="PyByteLiteralInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.byte.literal" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyByteLiteralInspection"/>
+ <localInspection language="Python" shortName="PyNonAsciiCharInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.non.ascii" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyNonAsciiCharInspection"/>
+ <localInspection language="Python" shortName="PyTupleItemAssignmentInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.tuple.item.assignment" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyTupleItemAssignmentInspection"/>
+ <localInspection language="Python" shortName="PyCallingNonCallableInspection" displayName="Trying to call a non-callable object" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyCallingNonCallableInspection"/>
+ <localInspection language="Python" shortName="PyPropertyAccessInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.property.access" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyPropertyAccessInspection"/>
+ <localInspection language="Python" shortName="PyPropertyDefinitionInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.property.definition" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyPropertyDefinitionInspection"/>
+ <localInspection language="Python" shortName="PyInconsistentIndentationInspection" displayName="Inconsistent indentation" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyInconsistentIndentationInspection"/>
+ <localInspection language="Python" shortName="PyNestedDecoratorsInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.nested.decorators" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyNestedDecoratorsInspection"/>
+ <localInspection language="Python" shortName="PyCallByClassInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.different.class.call" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyCallByClassInspection"/>
+ <localInspection language="Python" shortName="PyBroadExceptionInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.too.broad.exception.clauses" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyBroadExceptionInspection"/>
+ <localInspection language="Python" shortName="PyRedundantParenthesesInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.redundant.parentheses" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyRedundantParenthesesInspection"/>
+ <localInspection language="Python" shortName="PyAugmentAssignmentInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.augment.assignment" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyAugmentAssignmentInspection"/>
+ <localInspection language="Python" shortName="PyChainedComparisonsInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.chained.comparisons" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyChainedComparisonsInspection"/>
+ <localInspection language="Python" shortName="PyOldStyleClassesInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.oldstyle.class" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyOldStyleClassesInspection"/>
+ <localInspection language="Python" shortName="PyCompatibilityInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.compatibility" groupKey="INSP.GROUP.python" enabledByDefault="false" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyCompatibilityInspection"/>
+ <localInspection language="Python" shortName="PyListCreationInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.list.creation" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyListCreationInspection"/>
+ <localInspection language="Python" shortName="PyUnnecessaryBackslashInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.unnecessary.backslash" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyUnnecessaryBackslashInspection"/>
+ <localInspection language="Python" shortName="PySingleQuotedDocstringInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.single.quoted.docstring" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PySingleQuotedDocstringInspection"/>
+ <localInspection language="Python" shortName="PyMissingConstructorInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.missing.super.constructor" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyMissingConstructorInspection"/>
+ <localInspection language="Python" shortName="PyArgumentEqualDefaultInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.argument.equal.default" groupKey="INSP.GROUP.python" enabledByDefault="false" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyArgumentEqualDefaultInspection"/>
+ <localInspection language="Python" shortName="PySetFunctionToLiteralInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.set.function.to.literal" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PySetFunctionToLiteralInspection"/>
+ <localInspection language="Python" shortName="PyDecoratorInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.decorator.outside.class" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyDecoratorInspection"/>
+ <localInspection language="Python" shortName="PyTypeCheckerInspection" displayName="Type checker" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyTypeCheckerInspection"/>
+ <localInspection language="Python" shortName="PyDeprecationInspection" displayName="Deprecated function, class or module" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyDeprecationInspection"/>
+ <localInspection language="Python" shortName="PyMandatoryEncodingInspection" displayName="No encoding specified for file" groupKey="INSP.GROUP.python" enabledByDefault="false" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyMandatoryEncodingInspection"/>
+ <localInspection language="Python" shortName="PyPackageRequirementsInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.requirements" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyPackageRequirementsInspection"/>
+ <localInspection language="Python" shortName="PyPep8Inspection" displayName="PEP 8 coding style violation" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyPep8Inspection"/>
+ <localInspection language="Python" shortName="PyAttributeOutsideInitInspection" displayName="Instance attribute defined outside __init__" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyAttributeOutsideInitInspection"/>
+ <localInspection language="Python" shortName="PyClassHasNoInitInspection" displayName="Class has no __init__ method" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyClassHasNoInitInspection"/>
+ <localInspection language="Python" shortName="PyNoneFunctionAssignmentInspection" displayName="Assigning function call that doesn't return anything" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyNoneFunctionAssignmentInspection"/>
+ <localInspection language="Python" shortName="PyGlobalUndefinedInspection" displayName="Global variable is undefined at the module level" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyGlobalUndefinedInspection"/>
+ <localInspection language="Python" shortName="PyProtectedMemberInspection" displayName="Access to a protected member of a class" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyProtectedMemberInspection"/>
+ <localInspection language="Python" shortName="PyMethodMayBeStaticInspection" displayName="Method may be static" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyMethodMayBeStaticInspection"/>
+ <localInspection language="Python" shortName="PyDocstringTypesInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.docstring.types" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyDocstringTypesInspection"/>
+ <localInspection language="Python" shortName="PyShadowingBuiltinsInspection" displayName="Shadowing built-ins" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyShadowingBuiltinsInspection"/>
+ <localInspection language="Python" shortName="PyShadowingNamesInspection" displayName="Shadowing names from outer scopes" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyShadowingNamesInspection"/>
+ <localInspection language="Python" shortName="PyAbstractClassInspection" displayName="Class must implement all abstract methods" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyAbstractClassInspection"/>
+ <localInspection language="Python" shortName="PyPep8NamingInspection" displayName="PEP 8 naming convention violation" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyPep8NamingInspection"/>
+ <localInspection language="Python" shortName="PyAssignmentToLoopOrWithParameterInspection" displayName="Assignment to 'for' loop or 'with' statement parameter" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyAssignmentToLoopOrWithParameterInspection"/>
<liveTemplateContext implementation="com.jetbrains.python.codeInsight.liveTemplates.PythonTemplateContextType"/>
<liveTemplateMacro implementation="com.jetbrains.python.codeInsight.liveTemplates.CollectionElementNameMacro"/>
@@ -545,8 +545,6 @@
<!-- typing -->
<multiHostInjector implementation="com.jetbrains.python.codeInsight.PyTypingAnnotationInjector"/>
-
- <lang.inspectionSuppressor language="Python" implementationClass="com.jetbrains.python.inspections.PyInspectionsSuppressor"/>
</extensions>
<extensionPoints>
@@ -582,6 +580,7 @@
<extensionPoint qualifiedName="Pythonid.pyReferenceResolveProvider" interface="com.jetbrains.python.psi.resolve.PyReferenceResolveProvider"/>
<extensionPoint qualifiedName="Pythonid.breakpointHandler" interface="com.jetbrains.python.debugger.PyBreakpointHandlerFactory"/>
<extensionPoint qualifiedName="Pythonid.consoleOptionsProvider" interface="com.jetbrains.python.console.PyConsoleOptionsProvider"/>
+ <extensionPoint qualifiedName="Pythonid.pyRootTypeProvider" interface="com.jetbrains.python.module.PyRootTypeProvider"/>
</extensionPoints>
<extensions defaultExtensionNs="Pythonid">
@@ -630,6 +629,7 @@
<!-- NumPy -->
<pyModuleMembersProvider implementation="com.jetbrains.numpy.codeInsight.NumpyModuleMembersProvider"/>
<typeProvider implementation="com.jetbrains.numpy.codeInsight.NumpyDocStringTypeProvider"/>
+ <resolveResultRater implementation="com.jetbrains.numpy.codeInsight.NumpyResolveRater"/>
</extensions>
<project-components>
@@ -734,13 +734,6 @@
<add-to-group group-id="ToolsMenu" anchor="first"/>
</action>
- <action id="StepIntoMyCode" class="com.jetbrains.python.debugger.PyStepIntoMyCodeAction" icon="PythonIcons.Python.Debug.StepIntoMyCode"
- text="Step Into My Code" description="Step to the next line executed ignoring libraries">
- <add-to-group group-id="DebugMainMenu" relative-to-action="StepInto" anchor="after"/>
- <add-to-group group-id="XDebugger.ToolWindow.TopToolbar" relative-to-action="StepInto" anchor="after"/>
- <keyboard-shortcut keymap="$default" first-keystroke="alt shift F7"/>
- </action>
-
<group id="PyPackagingMenu" text="Packaging">
<action id="CreateSetupPy" class="com.jetbrains.python.packaging.setupPy.CreateSetupPyAction"/>
<action id="RunSetupPyTask" class="com.jetbrains.python.packaging.setupPy.SetupTaskChooserAction"/>
@@ -772,6 +765,12 @@
<add-to-group group-id="RefactoringMenu" anchor="last" />
</action>
+ <action id="StepIntoMyCode" class="com.jetbrains.python.debugger.PyStepIntoMyCodeAction" icon="PythonIcons.Python.Debug.StepIntoMyCode"
+ text="Step Into My Code" description="Step to the next line executed ignoring libraries"
+ use-shortcut-of="ForceStepInto">
+ <add-to-group group-id="DebugMainMenu" relative-to-action="StepInto" anchor="after"/>
+ <add-to-group group-id="XDebugger.ToolWindow.TopToolbar" relative-to-action="StepInto" anchor="after"/>
+ </action>
</actions>
diff --git a/python/src/com/jetbrains/commandInterface/commandLine/CommandLineDocumentationProvider.java b/python/src/com/jetbrains/commandInterface/commandLine/CommandLineDocumentationProvider.java
index 7c41e3d..a107e35 100644
--- a/python/src/com/jetbrains/commandInterface/commandLine/CommandLineDocumentationProvider.java
+++ b/python/src/com/jetbrains/commandInterface/commandLine/CommandLineDocumentationProvider.java
@@ -24,11 +24,15 @@
import com.jetbrains.commandInterface.command.Command;
import com.jetbrains.commandInterface.command.Help;
import com.jetbrains.commandInterface.command.Option;
-import com.jetbrains.commandInterface.commandLine.psi.*;
+import com.jetbrains.commandInterface.commandLine.psi.CommandLineArgument;
+import com.jetbrains.commandInterface.commandLine.psi.CommandLineCommand;
+import com.jetbrains.commandInterface.commandLine.psi.CommandLineOption;
+import com.jetbrains.commandInterface.commandLine.psi.CommandLineVisitor;
import com.jetbrains.python.psi.PyUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -45,6 +49,7 @@
if (help == null) {
return null;
}
+
final String helpText = help.getHelpString();
// For some reason we can't return empty sting (leads to "fetching doc" string)
return (StringUtil.isEmptyOrSpaces(helpText) ? null : helpText);
@@ -68,18 +73,22 @@
public PsiElement getCustomDocumentationElement(@NotNull final Editor editor,
@NotNull final PsiFile file,
@Nullable final PsiElement contextElement) {
- final CommandLineElement commandLineElement = PsiTreeUtil.getParentOfType(contextElement, CommandLineElement.class);
- if (commandLineElement != null) {
- return commandLineElement;
+
+ // First we try to find required parent for context element. Then, for element to the left of caret to support case "command<caret>"
+ for (final PsiElement element : Arrays.asList(contextElement, file.findElementAt(editor.getCaretModel().getOffset() - 1))) {
+ final CommandLineElement commandLineElement = PsiTreeUtil.getParentOfType(element, CommandLineElement.class);
+ if (commandLineElement != null) {
+ return commandLineElement;
+ }
}
- return PyUtil.as(file, CommandLineFile.class);
+ return null;
}
/**
* Searches for help text for certain element
+ *
* @param element element to search help for
* @return help or
- *
*/
@Nullable
private static Help findHelp(@NotNull final PsiElement element) {
diff --git a/python/src/com/jetbrains/commandInterface/console/CommandConsole.java b/python/src/com/jetbrains/commandInterface/console/CommandConsole.java
index b40cfcd..dad6123 100644
--- a/python/src/com/jetbrains/commandInterface/console/CommandConsole.java
+++ b/python/src/com/jetbrains/commandInterface/console/CommandConsole.java
@@ -18,6 +18,7 @@
import com.intellij.execution.console.LanguageConsoleBuilder;
import com.intellij.execution.console.LanguageConsoleImpl;
import com.intellij.execution.console.LanguageConsoleView;
+import com.intellij.execution.filters.UrlFilter;
import com.intellij.execution.process.ProcessAdapter;
import com.intellij.execution.process.ProcessEvent;
import com.intellij.execution.process.ProcessHandler;
@@ -142,6 +143,7 @@
console.getComponent(); // For some reason console does not have component until this method is called which leads to some errros.
console.getConsoleEditor().getSettings().setAdditionalLinesCount(2); // to prevent PY-15583
Disposer.register(module.getProject(), console); // To dispose console when project disposes
+ console.addMessageFilter(new UrlFilter());
return console;
}
diff --git a/python/src/com/jetbrains/numpy/codeInsight/NumpyDocStringTypeProvider.java b/python/src/com/jetbrains/numpy/codeInsight/NumpyDocStringTypeProvider.java
index 2181441..0406f46 100644
--- a/python/src/com/jetbrains/numpy/codeInsight/NumpyDocStringTypeProvider.java
+++ b/python/src/com/jetbrains/numpy/codeInsight/NumpyDocStringTypeProvider.java
@@ -17,6 +17,8 @@
import com.google.common.collect.Lists;
import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
@@ -24,6 +26,7 @@
import com.intellij.psi.PsiFile;
import com.jetbrains.numpy.documentation.NumPyDocString;
import com.jetbrains.numpy.documentation.NumPyDocStringParameter;
+import com.jetbrains.python.documentation.PyDocumentationSettings;
import com.jetbrains.python.psi.*;
import com.jetbrains.python.psi.impl.PyBuiltinCache;
import com.jetbrains.python.psi.impl.PyExpressionCodeFragmentImpl;
@@ -43,13 +46,18 @@
*/
public class NumpyDocStringTypeProvider extends PyTypeProviderBase {
private static final Map<String, String> NUMPY_ALIAS_TO_REAL_TYPE = new HashMap<String, String>();
+ public static String NDARRAY = "numpy.core.multiarray.ndarray";
+
+ private static String NDARRAY_OR_ITERABLE = NDARRAY + " or collections.Iterable";
static {
- NUMPY_ALIAS_TO_REAL_TYPE.put("ndarray", "numpy.core.multiarray.ndarray");
- NUMPY_ALIAS_TO_REAL_TYPE.put("numpy.ndarray", "numpy.core.multiarray.ndarray");
+ NUMPY_ALIAS_TO_REAL_TYPE.put("ndarray", NDARRAY);
+ NUMPY_ALIAS_TO_REAL_TYPE.put("numpy.ndarray", NDARRAY);
// 184 occurrences
- NUMPY_ALIAS_TO_REAL_TYPE.put("array_like", "numpy.core.multiarray.ndarray or collections.Iterable");
- NUMPY_ALIAS_TO_REAL_TYPE.put("array-like", "numpy.core.multiarray.ndarray or collections.Iterable");
+
+ NUMPY_ALIAS_TO_REAL_TYPE.put("array_like", NDARRAY_OR_ITERABLE);
+
+ NUMPY_ALIAS_TO_REAL_TYPE.put("array-like", NDARRAY_OR_ITERABLE);
// Parameters marked as 'data-type' actually get any Python type identifier such as 'bool' or
// an instance of 'numpy.core.multiarray.dtype', however the type checker isn't able to check it.
// 30 occurrences
@@ -58,8 +66,8 @@
// 16 occurrences
NUMPY_ALIAS_TO_REAL_TYPE.put("scalar", "int or long or float or complex");
// 10 occurrences
- NUMPY_ALIAS_TO_REAL_TYPE.put("array", "numpy.core.multiarray.ndarray or collections.Iterable");
- NUMPY_ALIAS_TO_REAL_TYPE.put("numpy.array", "numpy.core.multiarray.ndarray or collections.Iterable");
+ NUMPY_ALIAS_TO_REAL_TYPE.put("array", NDARRAY_OR_ITERABLE);
+ NUMPY_ALIAS_TO_REAL_TYPE.put("numpy.array", NDARRAY_OR_ITERABLE);
// 9 occurrences
NUMPY_ALIAS_TO_REAL_TYPE.put("any", "object");
// 5 occurrences
@@ -83,7 +91,7 @@
@Nullable
@Override
public PyType getCallType(@NotNull PyFunction function, @Nullable PyCallSiteExpression callSite, @NotNull TypeEvalContext context) {
- if (isInsideNumPy(function)) {
+ if (isApplicable(function)) {
final PyExpression callee = callSite instanceof PyCallExpression ? ((PyCallExpression)callSite).getCallee() : null;
final NumPyDocString docString = NumPyDocString.forFunction(function, callee);
if (docString != null) {
@@ -140,7 +148,7 @@
@Nullable
@Override
public Ref<PyType> getParameterType(@NotNull PyNamedParameter parameter, @NotNull PyFunction function, @NotNull TypeEvalContext context) {
- if (isInsideNumPy(function)) {
+ if (isApplicable(function)) {
final String name = parameter.getName();
if (name != null) {
final PyType type = getParameterType(function, name);
@@ -155,17 +163,29 @@
private static boolean isInsideNumPy(@NotNull PsiElement element) {
if (ApplicationManager.getApplication().isUnitTestMode()) return true;
final PsiFile file = element.getContainingFile();
+
if (file != null) {
final PyPsiFacade facade = getPsiFacade(element);
final VirtualFile virtualFile = file.getVirtualFile();
if (virtualFile != null) {
final String name = facade.findShortestImportableName(virtualFile, element);
- return name != null && name.startsWith("numpy.");
+ return name != null && (name.startsWith("numpy.") || name.startsWith("matplotlib."));
}
}
return false;
}
+ private static boolean isApplicable(@NotNull PsiElement element) {
+ final Module module = ModuleUtilCore.findModuleForPsiElement(element);
+ if (module != null){
+ if (PyDocumentationSettings.getInstance(module).isNumpyFormat(element.getContainingFile())) {
+ return true;
+ }
+ }
+
+ return isInsideNumPy(element);
+ }
+
private static PyPsiFacade getPsiFacade(@NotNull PsiElement anchor) {
return PyPsiFacade.getInstance(anchor.getProject());
}
@@ -237,7 +257,7 @@
private static boolean isUfuncType(@NotNull PsiElement anchor, @NotNull final String typeString) {
for (String typeName : NumPyDocString.getNumpyUnionType(typeString)) {
- if (anchor instanceof PyFunction && NumpyUfuncs.isUFunc(((PyFunction)anchor).getName()) &&
+ if (anchor instanceof PyFunction && isInsideNumPy(anchor) && NumpyUfuncs.isUFunc(((PyFunction)anchor).getName()) &&
("array_like".equals(typeName) || "ndarray".equals(typeName))) {
return true;
}
@@ -258,7 +278,7 @@
}
if (parameter != null) {
if (isUfuncType(function, parameter.getType())) {
- return getPsiFacade(function).parseTypeAnnotation("T <= numbers.Number|numpy.core.multiarray.ndarray", function);
+ return getPsiFacade(function).parseTypeAnnotation("T <= numbers.Number or numpy.core.multiarray.ndarray or collections.Iterable", function);
}
final PyType numpyDocType = parseNumpyDocType(function, parameter.getType());
if ("size".equals(parameterName)) {
diff --git a/python/src/com/jetbrains/numpy/codeInsight/NumpyModuleMembersProvider.java b/python/src/com/jetbrains/numpy/codeInsight/NumpyModuleMembersProvider.java
index 6db3ccf..bd96bd6 100644
--- a/python/src/com/jetbrains/numpy/codeInsight/NumpyModuleMembersProvider.java
+++ b/python/src/com/jetbrains/numpy/codeInsight/NumpyModuleMembersProvider.java
@@ -15,8 +15,13 @@
*/
package com.jetbrains.numpy.codeInsight;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.util.QualifiedName;
import com.jetbrains.python.codeInsight.PyCustomMember;
import com.jetbrains.python.psi.PyFile;
+import com.jetbrains.python.psi.PyPsiFacade;
+import com.jetbrains.python.psi.PyUtil;
+import com.jetbrains.python.psi.resolve.QualifiedNameResolver;
import com.jetbrains.python.psi.types.PyModuleMembersProvider;
import java.util.ArrayList;
@@ -37,16 +42,36 @@
"float16", "float32", "float64", "float80", "float96", "float128", "float256",
"complex32", "complex64", "complex128", "complex160", "complex192", "complex256", "complex512", "double"
};
+ private static final String[] PYTHON_TYPES = {
+ "int_", "bool_", "float_", "cfloat", "string_", "str_",
+ "unicode_", "object_", "complex_", "bytes_", "byte", "ubyte", "void",
+ "short", "ushort", "intc", "uintc", "intp", "uintp", "uint",
+ "longlong", "ulonglong", "single", "csingle",
+ "longfloat", "clongfloat"};
+
+ private static String DTYPE = "numpy.core.multiarray.dtype";
@Override
protected Collection<PyCustomMember> getMembersByQName(PyFile module, String qName) {
if ("numpy".equals(qName)) {
final List<PyCustomMember> members = new ArrayList<PyCustomMember>();
for (String type : NUMERIC_TYPES) {
- members.add(new PyCustomMember(type, "numpy.core.multiarray.dtype", false));
+ members.add(new PyCustomMember(type, DTYPE, false));
}
+ for (String type : PYTHON_TYPES) {
+ members.add(new PyCustomMember(type, DTYPE, false));
+ }
+ addTestingModule(module, members);
return members;
}
return Collections.emptyList();
}
+
+ private static void addTestingModule(PyFile module, List<PyCustomMember> members) {
+ PyPsiFacade psiFacade = PyPsiFacade.getInstance(module.getProject());
+ final QualifiedNameResolver resolver =
+ psiFacade.qualifiedNameResolver(QualifiedName.fromDottedString("numpy.testing")).withPlainDirectories().fromElement(module);
+ PsiElement testingModule = PyUtil.turnDirIntoInit(resolver.firstResult());
+ members.add(new PyCustomMember("testing", testingModule));
+ }
}
diff --git a/python/src/com/jetbrains/numpy/codeInsight/NumpyResolveRater.java b/python/src/com/jetbrains/numpy/codeInsight/NumpyResolveRater.java
new file mode 100644
index 0000000..304e9e7
--- /dev/null
+++ b/python/src/com/jetbrains/numpy/codeInsight/NumpyResolveRater.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2000-2015 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.jetbrains.numpy.codeInsight;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiNamedElement;
+import com.jetbrains.python.PyNames;
+import com.jetbrains.python.psi.impl.PyResolveResultRaterBase;
+import com.jetbrains.python.psi.types.PyType;
+import com.jetbrains.python.psi.types.PyTypeChecker;
+import com.jetbrains.python.psi.types.PyTypeParser;
+import com.jetbrains.python.psi.types.TypeEvalContext;
+
+public class NumpyResolveRater extends PyResolveResultRaterBase {
+
+ @Override
+ public int getMemberRate(PsiElement member, PyType type, TypeEvalContext context) {
+ if (member instanceof PsiNamedElement) {
+ final PyType ndArray = PyTypeParser.getTypeByName(member, NumpyDocStringTypeProvider.NDARRAY);
+ if (PyTypeChecker.match(ndArray, type, context) &&
+ PyNames.isRightOperatorName(((PsiNamedElement)member).getName())) {
+ return 100;
+ }
+ }
+ return 0;
+ }
+}
diff --git a/python/src/com/jetbrains/numpy/codeInsight/NumpyUfuncs.java b/python/src/com/jetbrains/numpy/codeInsight/NumpyUfuncs.java
index 5f5abc8..185c4c4 100644
--- a/python/src/com/jetbrains/numpy/codeInsight/NumpyUfuncs.java
+++ b/python/src/com/jetbrains/numpy/codeInsight/NumpyUfuncs.java
@@ -102,5 +102,6 @@
UFUNC_LIST.add("ceil");
UFUNC_LIST.add("trunc");
+ UFUNC_LIST.add("fabs");
}
}
diff --git a/python/src/com/jetbrains/python/codeInsight/PyTypingAnnotationInjector.java b/python/src/com/jetbrains/python/codeInsight/PyTypingAnnotationInjector.java
index 16a7b86..b460e0f 100644
--- a/python/src/com/jetbrains/python/codeInsight/PyTypingAnnotationInjector.java
+++ b/python/src/com/jetbrains/python/codeInsight/PyTypingAnnotationInjector.java
@@ -24,16 +24,27 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import java.util.regex.Pattern;
+
/**
* @author vlan
*/
public class PyTypingAnnotationInjector extends PyInjectorBase {
+ public static final Pattern RE_TYPING_ANNOTATION = Pattern.compile("\\s*\\S+(\\[.*\\])?\\s*");
+
@Nullable
@Override
public Language getInjectedLanguage(@NotNull PsiElement context) {
- if (context instanceof PyStringLiteralExpression && PsiTreeUtil.getParentOfType(context, PyAnnotation.class, true) != null) {
- return PyDocstringLanguageDialect.getInstance();
+ if (context instanceof PyStringLiteralExpression) {
+ final PyStringLiteralExpression expr = (PyStringLiteralExpression)context;
+ if (PsiTreeUtil.getParentOfType(context, PyAnnotation.class, true) != null && isTypingAnnotation(expr.getStringValue())) {
+ return PyDocstringLanguageDialect.getInstance();
+ }
}
return null;
}
+
+ private static boolean isTypingAnnotation(@NotNull String s) {
+ return RE_TYPING_ANNOTATION.matcher(s).matches();
+ }
}
diff --git a/python/src/com/jetbrains/python/console/PydevConsoleCommunication.java b/python/src/com/jetbrains/python/console/PydevConsoleCommunication.java
index d16eb2d..013c2fa 100644
--- a/python/src/com/jetbrains/python/console/PydevConsoleCommunication.java
+++ b/python/src/com/jetbrains/python/console/PydevConsoleCommunication.java
@@ -56,7 +56,7 @@
private static final String EXEC_LINE = "execLine";
private static final String EXEC_MULTILINE = "execMultipleLines";
- private static final String GET_COMPLETIONS = "getSuggestions";
+ private static final String GET_COMPLETIONS = "getCompletions";
private static final String GET_DESCRIPTION = "getDescription";
private static final String GET_FRAME = "getFrame";
private static final String GET_VARIABLE = "getVariable";
diff --git a/python/src/com/jetbrains/python/console/PydevConsoleRunner.java b/python/src/com/jetbrains/python/console/PydevConsoleRunner.java
index 414e1d3..f5f5446 100644
--- a/python/src/com/jetbrains/python/console/PydevConsoleRunner.java
+++ b/python/src/com/jetbrains/python/console/PydevConsoleRunner.java
@@ -239,15 +239,24 @@
}
public static Map<String, String> addDefaultEnvironments(Sdk sdk, Map<String, String> envs, @NotNull Project project) {
- Charset defaultCharset = EncodingProjectManager.getInstance(project).getDefaultCharset();
-
- final String encoding = defaultCharset.name();
- setPythonIOEncoding(setPythonUnbuffered(envs), encoding);
+ setCorrectStdOutEncoding(envs, project);
PythonSdkFlavor.initPythonPath(envs, true, PythonCommandLineState.getAddedPaths(sdk));
return envs;
}
+ /**
+ * Add requered ENV var to Python task to set its stdout charset to current project charset to allow it print correctly.
+ * @param envs map of envs to add variable
+ * @param project current project
+ */
+ public static void setCorrectStdOutEncoding(@NotNull final Map<String, String> envs, @NotNull final Project project) {
+ final Charset defaultCharset = EncodingProjectManager.getInstance(project).getDefaultCharset();
+
+ final String encoding = defaultCharset.name();
+ setPythonIOEncoding(setPythonUnbuffered(envs), encoding);
+ }
+
@Override
protected List<AnAction> fillToolBarActions(final DefaultActionGroup toolbarActions,
diff --git a/python/src/com/jetbrains/python/debugger/PyDebugProcess.java b/python/src/com/jetbrains/python/debugger/PyDebugProcess.java
index 7eed689..0ab8651 100644
--- a/python/src/com/jetbrains/python/debugger/PyDebugProcess.java
+++ b/python/src/com/jetbrains/python/debugger/PyDebugProcess.java
@@ -61,6 +61,7 @@
import com.jetbrains.python.console.pydev.PydevCompletionVariant;
import com.jetbrains.python.debugger.pydev.*;
import com.jetbrains.python.psi.PyFunction;
+import com.jetbrains.python.psi.PyImportElement;
import com.jetbrains.python.psi.resolve.PyResolveUtil;
import com.jetbrains.python.psi.types.PyClassType;
import com.jetbrains.python.psi.types.PyType;
@@ -854,7 +855,11 @@
PyResolveUtil.scopeCrawlUp(new PsiScopeProcessor() {
@Override
public boolean execute(@NotNull PsiElement element, @NotNull ResolveState state) {
- elementRef.set(element);
+ if (!(element instanceof PyImportElement)) {
+ if (elementRef.isNull()) {
+ elementRef.set(element);
+ }
+ }
return false;
}
diff --git a/python/src/com/jetbrains/python/debugger/PyForceStepIntoAction.java b/python/src/com/jetbrains/python/debugger/PyForceStepIntoAction.java
index 6e03067..756b4bf 100644
--- a/python/src/com/jetbrains/python/debugger/PyForceStepIntoAction.java
+++ b/python/src/com/jetbrains/python/debugger/PyForceStepIntoAction.java
@@ -18,35 +18,44 @@
import com.intellij.execution.RunManager;
import com.intellij.execution.RunnerAndConfigurationSettings;
import com.intellij.execution.configurations.RunConfiguration;
-import com.intellij.openapi.actionSystem.AnActionEvent;
-import com.intellij.openapi.actionSystem.CommonDataKeys;
+import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.project.Project;
+import com.intellij.xdebugger.XDebugSession;
import com.intellij.xdebugger.impl.DebuggerSupport;
import com.intellij.xdebugger.impl.actions.DebuggerActionHandler;
-import com.intellij.xdebugger.impl.actions.XDebuggerActionBase;
+import com.intellij.xdebugger.impl.actions.ForceStepIntoAction;
+import com.intellij.xdebugger.impl.actions.XDebuggerSuspendedActionHandler;
import com.jetbrains.python.run.AbstractPythonRunConfiguration;
import org.jetbrains.annotations.NotNull;
-public class PyForceStepIntoAction extends XDebuggerActionBase {
- @Override
- protected boolean isEnabled(AnActionEvent e) {
- Project project = e.getData(CommonDataKeys.PROJECT);
- if (project != null) {
- RunnerAndConfigurationSettings settings = RunManager.getInstance(project).getSelectedConfiguration();
- if (settings != null) {
- RunConfiguration runConfiguration = settings.getConfiguration();
- if (runConfiguration instanceof AbstractPythonRunConfiguration) {
- return false;
- }
- }
- }
+public class PyForceStepIntoAction extends ForceStepIntoAction {
+ private final XDebuggerSuspendedActionHandler myPyForceStepIntoHandler;
- return super.isEnabled(e);
+ public PyForceStepIntoAction() {
+ myPyForceStepIntoHandler = new XDebuggerSuspendedActionHandler() {
+ @Override
+ protected void perform(@NotNull final XDebugSession session, final DataContext dataContext) {
+ session.forceStepInto();
+ }
+
+ @Override
+ public boolean isEnabled(@NotNull XDebugSession session, final DataContext dataContext) {
+ Project project = CommonDataKeys.PROJECT.getData(dataContext);
+ RunnerAndConfigurationSettings settings = RunManager.getInstance(project).getSelectedConfiguration();
+ if (settings != null) {
+ RunConfiguration runConfiguration = settings.getConfiguration();
+ if (runConfiguration instanceof AbstractPythonRunConfiguration) {
+ return false;
+ }
+ }
+ return super.isEnabled(session, dataContext);
+ }
+ };
}
@NotNull
@Override
protected DebuggerActionHandler getHandler(@NotNull DebuggerSupport debuggerSupport) {
- return debuggerSupport.getForceStepIntoHandler();
+ return myPyForceStepIntoHandler;
}
}
diff --git a/python/src/com/jetbrains/python/documentation/DocStringFormat.java b/python/src/com/jetbrains/python/documentation/DocStringFormat.java
index 094e47d..1649178 100644
--- a/python/src/com/jetbrains/python/documentation/DocStringFormat.java
+++ b/python/src/com/jetbrains/python/documentation/DocStringFormat.java
@@ -26,8 +26,9 @@
public static final String PLAIN = "Plain";
public static final String EPYTEXT = "Epytext";
public static final String REST = "reStructuredText";
+ public static final String NUMPY = "NumPy";
- public static final List<String> ALL = ImmutableList.of(PLAIN, EPYTEXT, REST);
+ public static final List<String> ALL = ImmutableList.of(PLAIN, EPYTEXT, REST, NUMPY);
private DocStringFormat() {
}
diff --git a/python/src/com/jetbrains/python/documentation/PyDocumentationSettings.java b/python/src/com/jetbrains/python/documentation/PyDocumentationSettings.java
index fe36834..f17e8ff 100644
--- a/python/src/com/jetbrains/python/documentation/PyDocumentationSettings.java
+++ b/python/src/com/jetbrains/python/documentation/PyDocumentationSettings.java
@@ -53,6 +53,10 @@
return isFormat(file, DocStringFormat.REST);
}
+ public boolean isNumpyFormat(PsiFile file) {
+ return isFormat(file, DocStringFormat.NUMPY);
+ }
+
public boolean isPlain(PsiFile file) {
return isFormat(file, DocStringFormat.PLAIN);
}
diff --git a/python/src/com/jetbrains/python/formatter/PyTrailingBlankLinesPostFormatProcessor.java b/python/src/com/jetbrains/python/formatter/PyTrailingBlankLinesPostFormatProcessor.java
index 362d01a..4890006 100644
--- a/python/src/com/jetbrains/python/formatter/PyTrailingBlankLinesPostFormatProcessor.java
+++ b/python/src/com/jetbrains/python/formatter/PyTrailingBlankLinesPostFormatProcessor.java
@@ -15,6 +15,7 @@
*/
package com.jetbrains.python.formatter;
+import com.intellij.lang.injection.InjectedLanguageManager;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.ex.EditorSettingsExternalizable;
import com.intellij.openapi.project.Project;
@@ -26,7 +27,7 @@
import com.intellij.psi.codeStyle.CodeStyleSettings;
import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
import com.intellij.psi.impl.source.codeStyle.PostFormatProcessor;
-import com.jetbrains.python.psi.PyFile;
+import com.jetbrains.python.PythonLanguage;
import org.jetbrains.annotations.NotNull;
/**
@@ -43,13 +44,21 @@
* @author Mikhail Golubev
*/
public class PyTrailingBlankLinesPostFormatProcessor implements PostFormatProcessor {
+
+ private static boolean isApplicableTo(@NotNull PsiFile source) {
+ if (InjectedLanguageManager.getInstance(source.getProject()).isInjectedFragment(source)) {
+ return false;
+ }
+ return source.getLanguage().isKindOf(PythonLanguage.getInstance());
+ }
+
@Override
public PsiElement processElement(@NotNull PsiElement source, @NotNull CodeStyleSettings settings) {
- if (source instanceof PyFile) {
- final PyFile pyFile = (PyFile)source;
- final TextRange whitespaceRange = findTrailingWhitespacesRange(pyFile);
+ final PsiFile psiFile = source.getContainingFile();
+ if (isApplicableTo(psiFile)) {
+ final TextRange whitespaceRange = findTrailingWhitespacesRange(psiFile);
if (source.getTextRange().intersects(whitespaceRange)) {
- replaceOrDeleteTrailingWhitespaces(pyFile, whitespaceRange);
+ replaceOrDeleteTrailingWhitespaces(psiFile, whitespaceRange);
}
}
return source;
@@ -57,12 +66,12 @@
@Override
public TextRange processText(@NotNull PsiFile source, @NotNull TextRange rangeToReformat, @NotNull CodeStyleSettings settings) {
- if (!(source instanceof PyFile)) {
+ if (!isApplicableTo(source)) {
return rangeToReformat;
}
final TextRange oldWhitespaceRange = findTrailingWhitespacesRange(source);
if (rangeToReformat.intersects(oldWhitespaceRange)) {
- final TextRange newWhitespaceRange = replaceOrDeleteTrailingWhitespaces((PyFile)source, oldWhitespaceRange);
+ final TextRange newWhitespaceRange = replaceOrDeleteTrailingWhitespaces(source, oldWhitespaceRange);
final int delta = newWhitespaceRange.getLength() - oldWhitespaceRange.getLength();
if (oldWhitespaceRange.contains(rangeToReformat)) {
return newWhitespaceRange;
@@ -99,7 +108,7 @@
}
@NotNull
- private static TextRange replaceOrDeleteTrailingWhitespaces(@NotNull final PyFile pyFile, @NotNull final TextRange whitespaceRange) {
+ private static TextRange replaceOrDeleteTrailingWhitespaces(@NotNull final PsiFile pyFile, @NotNull final TextRange whitespaceRange) {
final Project project = pyFile.getProject();
final PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project);
final Document document = documentManager.getDocument(pyFile);
diff --git a/python/src/com/jetbrains/python/inspections/PyDocstringInspection.java b/python/src/com/jetbrains/python/inspections/PyDocstringInspection.java
index 790ff7b..ca73f0d 100644
--- a/python/src/com/jetbrains/python/inspections/PyDocstringInspection.java
+++ b/python/src/com/jetbrains/python/inspections/PyDocstringInspection.java
@@ -21,16 +21,19 @@
import com.google.common.collect.Sets;
import com.intellij.codeInspection.LocalInspectionToolSession;
import com.intellij.codeInspection.ProblemsHolder;
+import com.intellij.codeInspection.SuppressQuickFix;
import com.intellij.lang.ASTNode;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiElementVisitor;
+import com.intellij.psi.util.PsiTreeUtil;
import com.jetbrains.python.PyBundle;
import com.jetbrains.python.PyNames;
import com.jetbrains.python.documentation.DocStringUtil;
import com.jetbrains.python.inspections.quickfix.DocstringQuickFix;
+import com.jetbrains.python.inspections.quickfix.PySuppressInspectionFix;
import com.jetbrains.python.psi.*;
import com.jetbrains.python.testing.PythonUnitTestUtil;
import com.jetbrains.python.toolbox.Substring;
@@ -226,4 +229,19 @@
return hasMissing ? missing : Collections.<PyParameter>emptyList();
}
}
+
+ @NotNull
+ @Override
+ public SuppressQuickFix[] getBatchSuppressActions(@Nullable PsiElement element) {
+ List<SuppressQuickFix> result = new ArrayList<SuppressQuickFix>();
+ if (element != null) {
+ if (PsiTreeUtil.getParentOfType(element, PyFunction.class) != null) {
+ result.add(new PySuppressInspectionFix(getShortName().replace("Inspection", ""), "Suppress for function", PyFunction.class));
+ }
+ if (PsiTreeUtil.getParentOfType(element, PyClass.class) != null) {
+ result.add(new PySuppressInspectionFix(getShortName().replace("Inspection", ""), "Suppress for class", PyClass.class));
+ }
+ }
+ return result.toArray(new SuppressQuickFix[result.size()]);
+ }
}
diff --git a/python/src/com/jetbrains/python/inspections/PyInspection.java b/python/src/com/jetbrains/python/inspections/PyInspection.java
index bbc064d..993dcdc 100644
--- a/python/src/com/jetbrains/python/inspections/PyInspection.java
+++ b/python/src/com/jetbrains/python/inspections/PyInspection.java
@@ -16,26 +16,31 @@
package com.jetbrains.python.inspections;
import com.intellij.codeInspection.LocalInspectionTool;
+import com.intellij.codeInspection.SuppressQuickFix;
+import com.intellij.codeInspection.SuppressionUtil;
+import com.intellij.psi.PsiComment;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiWhiteSpace;
import com.intellij.psi.util.PsiTreeUtil;
import com.jetbrains.python.PyBundle;
-import com.jetbrains.python.psi.PyExpressionCodeFragment;
+import com.jetbrains.python.codeInsight.controlflow.ScopeOwner;
+import com.jetbrains.python.inspections.quickfix.PySuppressInspectionFix;
+import com.jetbrains.python.psi.*;
import com.jetbrains.python.psi.impl.PyFileImpl;
-import org.intellij.lang.annotations.Pattern;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-public abstract class PyInspection extends LocalInspectionTool {
- @Pattern(VALID_ID_PATTERN)
- @NotNull
- @Override
- public String getID() {
- //noinspection PatternValidation
- return getShortName(super.getID());
- }
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+/**
+ * @author yole
+ */
+public abstract class PyInspection extends LocalInspectionTool {
@Nls
@NotNull
@Override
@@ -54,20 +59,80 @@
return true;
}
+ @NotNull
+ @Override
+ public SuppressQuickFix[] getBatchSuppressActions(@Nullable PsiElement element) {
+ List<SuppressQuickFix> result = new ArrayList<SuppressQuickFix>();
+ result.add(new PySuppressInspectionFix(getSuppressId(), "Suppress for statement", PyStatement.class) {
+ @Override
+ public PsiElement getContainer(PsiElement context) {
+ if (PsiTreeUtil.getParentOfType(context, PyStatementList.class, false, ScopeOwner.class) != null ||
+ PsiTreeUtil.getParentOfType(context, PyFunction.class, PyClass.class) == null) {
+ return super.getContainer(context);
+ }
+ return null;
+ }
+ });
+ result.add(new PySuppressInspectionFix(getSuppressId(), "Suppress for function", PyFunction.class));
+ result.add(new PySuppressInspectionFix(getSuppressId(), "Suppress for class", PyClass.class));
+ return result.toArray(new SuppressQuickFix[result.size()]);
+ }
+
@Override
public boolean isSuppressedFor(@NotNull PsiElement element) {
final PsiFile file = element.getContainingFile();
- if (file instanceof PyFileImpl && !((PyFileImpl)file).isAcceptedFor(this.getClass())) {
- return true;
+ boolean isAccepted = true;
+ if (file instanceof PyFileImpl) {
+ isAccepted = ((PyFileImpl)file).isAcceptedFor(this.getClass());
}
- return isSuppressForCodeFragment(element) || super.isSuppressedFor(element);
+ return !isAccepted || isSuppressedForParent(element, PyStatement.class) ||
+ isSuppressedForParent(element, PyFunction.class) ||
+ isSuppressedForParent(element, PyClass.class) ||
+ isSuppressForCodeFragment(element);
}
- private boolean isSuppressForCodeFragment(@Nullable PsiElement element) {
+ private boolean isSuppressForCodeFragment(PsiElement element) {
return isSuppressForCodeFragment() && PsiTreeUtil.getParentOfType(element, PyExpressionCodeFragment.class) != null;
}
protected boolean isSuppressForCodeFragment() {
return false;
}
+
+ private boolean isSuppressedForParent(PsiElement element, final Class<? extends PyElement> parentClass) {
+ PyElement parent = PsiTreeUtil.getParentOfType(element, parentClass, false);
+ if (parent == null) {
+ return false;
+ }
+ return isSuppressedForElement(parent);
+ }
+
+ private boolean isSuppressedForElement(PyElement stmt) {
+ PsiElement prevSibling = stmt.getPrevSibling();
+ if (prevSibling == null) {
+ final PsiElement parent = stmt.getParent();
+ if (parent != null) {
+ prevSibling = parent.getPrevSibling();
+ }
+ }
+ while (prevSibling instanceof PsiComment || prevSibling instanceof PsiWhiteSpace) {
+ if (prevSibling instanceof PsiComment && isSuppressedInComment(prevSibling.getText().substring(1).trim())) {
+ return true;
+ }
+ prevSibling = prevSibling.getPrevSibling();
+ }
+ return false;
+ }
+
+ private static final Pattern SUPPRESS_PATTERN = Pattern.compile(SuppressionUtil.COMMON_SUPPRESS_REGEXP);
+
+ private boolean isSuppressedInComment(String commentText) {
+ Matcher m = SUPPRESS_PATTERN.matcher(commentText);
+ return m.matches() && SuppressionUtil.isInspectionToolIdMentioned(m.group(1), getSuppressId());
+ }
+
+ @NotNull
+ protected String getSuppressId() {
+ return getShortName().replace("Inspection", "");
+ }
}
diff --git a/python/src/com/jetbrains/python/inspections/PyInspectionsSuppressor.java b/python/src/com/jetbrains/python/inspections/PyInspectionsSuppressor.java
deleted file mode 100644
index 545c1b3..0000000
--- a/python/src/com/jetbrains/python/inspections/PyInspectionsSuppressor.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package com.jetbrains.python.inspections;
-
-import com.intellij.codeInspection.InspectionSuppressor;
-import com.intellij.codeInspection.SuppressQuickFix;
-import com.intellij.codeInspection.SuppressionUtil;
-import com.intellij.psi.PsiComment;
-import com.intellij.psi.PsiElement;
-import com.intellij.psi.PsiWhiteSpace;
-import com.intellij.psi.util.PsiTreeUtil;
-import com.jetbrains.python.codeInsight.controlflow.ScopeOwner;
-import com.jetbrains.python.inspections.quickfix.PySuppressInspectionFix;
-import com.jetbrains.python.psi.*;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class PyInspectionsSuppressor implements InspectionSuppressor {
- private static final Pattern SUPPRESS_PATTERN = Pattern.compile(SuppressionUtil.COMMON_SUPPRESS_REGEXP);
- private static final String PY_DOCSTRING_INSPECTION_ID = new PyDocstringInspection().getID();
-
- @NotNull
- @Override
- public SuppressQuickFix[] getSuppressActions(@Nullable PsiElement element, @NotNull String toolId) {
- if (PY_DOCSTRING_INSPECTION_ID.equals(toolId)) {
- return new SuppressQuickFix[]{
- new PySuppressInspectionFix(toolId, "Suppress for function", PyFunction.class),
- new PySuppressInspectionFix(toolId, "Suppress for class", PyClass.class)
- };
- }
- else {
- return new SuppressQuickFix[]{
- new PySuppressInspectionFix(toolId, "Suppress for statement", PyStatement.class) {
- @Override
- public PsiElement getContainer(PsiElement context) {
- if (PsiTreeUtil.getParentOfType(context, PyStatementList.class, false, ScopeOwner.class) != null ||
- PsiTreeUtil.getParentOfType(context, PyFunction.class, PyClass.class) == null) {
- return super.getContainer(context);
- }
- return null;
- }
- },
- new PySuppressInspectionFix(toolId, "Suppress for function", PyFunction.class),
- new PySuppressInspectionFix(toolId, "Suppress for class", PyClass.class)
- };
- }
- }
-
- @Override
- public boolean isSuppressedFor(@NotNull PsiElement element, @NotNull String toolId) {
- return isSuppressedForParent(element, PyStatement.class, toolId) ||
- isSuppressedForParent(element, PyFunction.class, toolId) ||
- isSuppressedForParent(element, PyClass.class, toolId);
- }
-
- private static boolean isSuppressedForParent(@NotNull PsiElement element,
- @NotNull final Class<? extends PyElement> parentClass,
- @NotNull String suppressId) {
- PyElement parent = PsiTreeUtil.getParentOfType(element, parentClass, false);
- if (parent == null) {
- return false;
- }
- return isSuppressedForElement(parent, suppressId);
- }
-
- private static boolean isSuppressedForElement(@NotNull PyElement stmt, @NotNull String suppressId) {
- PsiElement prevSibling = stmt.getPrevSibling();
- if (prevSibling == null) {
- final PsiElement parent = stmt.getParent();
- if (parent != null) {
- prevSibling = parent.getPrevSibling();
- }
- }
- while (prevSibling instanceof PsiComment || prevSibling instanceof PsiWhiteSpace) {
- if (prevSibling instanceof PsiComment && isSuppressedInComment(prevSibling.getText().substring(1).trim(), suppressId)) {
- return true;
- }
- prevSibling = prevSibling.getPrevSibling();
- }
- return false;
- }
-
- private static boolean isSuppressedInComment(@NotNull String commentText, @NotNull String suppressId) {
- Matcher m = SUPPRESS_PATTERN.matcher(commentText);
- return m.matches() && SuppressionUtil.isInspectionToolIdMentioned(m.group(1), suppressId);
- }
-}
diff --git a/python/src/com/jetbrains/python/inspections/unresolvedReference/PyUnresolvedReferencesInspection.java b/python/src/com/jetbrains/python/inspections/unresolvedReference/PyUnresolvedReferencesInspection.java
index b6ad83f..c336d8f 100644
--- a/python/src/com/jetbrains/python/inspections/unresolvedReference/PyUnresolvedReferencesInspection.java
+++ b/python/src/com/jetbrains/python/inspections/unresolvedReference/PyUnresolvedReferencesInspection.java
@@ -144,8 +144,15 @@
public boolean isEnabled(@NotNull PsiElement anchor) {
if (myIsEnabled == null) {
final boolean isPyCharm = PlatformUtils.isPyCharm();
- myIsEnabled = (isPyCharm && PythonSdkType.getSdk(anchor) != null || !isPyCharm) &&
- !PySkeletonRefresher.isGeneratingSkeletons();
+ if (PySkeletonRefresher.isGeneratingSkeletons()) {
+ myIsEnabled = false;
+ }
+ else if (isPyCharm) {
+ myIsEnabled = PythonSdkType.getSdk(anchor) != null || PyUtil.isInScratchFile(anchor);
+ }
+ else {
+ myIsEnabled = true;
+ }
}
return myIsEnabled;
}
@@ -593,9 +600,13 @@
final Sdk sdk = PythonSdkType.findPythonSdk(module);
if (module != null && sdk != null) {
if (PyPIPackageUtil.INSTANCE.isInPyPI(packageName)) {
- final List<PyRequirement> requirements = Collections.singletonList(new PyRequirement(packageName));
- final String name = "Install package " + packageName;
- actions.add(new PyPackageRequirementsInspection.PyInstallRequirementsFix(name, module, sdk, requirements));
+ addInstallPackageAction(actions, packageName, module, sdk);
+ }
+ else {
+ if (PyPIPackageUtil.PACKAGES_TOPLEVEL.containsKey(packageName)) {
+ final String suggestedPackage = PyPIPackageUtil.PACKAGES_TOPLEVEL.get(packageName);
+ addInstallPackageAction(actions, suggestedPackage, module, sdk);
+ }
}
}
}
@@ -603,6 +614,12 @@
registerProblem(node, description, hl_type, null, rangeInElement, actions.toArray(new LocalQuickFix[actions.size()]));
}
+ private static void addInstallPackageAction(List<LocalQuickFix> actions, String packageName, Module module, Sdk sdk) {
+ final List<PyRequirement> requirements = Collections.singletonList(new PyRequirement(packageName));
+ final String name = "Install package " + packageName;
+ actions.add(new PyPackageRequirementsInspection.PyInstallRequirementsFix(name, module, sdk, requirements));
+ }
+
/**
* Checks if type is custom type and has custom member with certain name
* @param refName name to check
diff --git a/python/src/com/jetbrains/python/module/PyContentEntriesEditor.java b/python/src/com/jetbrains/python/module/PyContentEntriesEditor.java
index 3a25e02..e00010e 100644
--- a/python/src/com/jetbrains/python/module/PyContentEntriesEditor.java
+++ b/python/src/com/jetbrains/python/module/PyContentEntriesEditor.java
@@ -16,9 +16,8 @@
package com.jetbrains.python.module;
import com.intellij.openapi.Disposable;
-import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CustomShortcutSet;
-import com.intellij.openapi.actionSystem.Presentation;
+import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.project.Project;
@@ -26,21 +25,14 @@
import com.intellij.openapi.roots.ContentFolder;
import com.intellij.openapi.roots.ModifiableRootModel;
import com.intellij.openapi.roots.impl.ContentEntryImpl;
-import com.intellij.openapi.roots.impl.ContentFolderBaseImpl;
import com.intellij.openapi.roots.ui.configuration.*;
import com.intellij.openapi.roots.ui.configuration.actions.ContentEntryEditingAction;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.Disposer;
-import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.pointers.VirtualFilePointer;
-import com.intellij.openapi.vfs.pointers.VirtualFilePointerListener;
-import com.intellij.openapi.vfs.pointers.VirtualFilePointerManager;
-import com.intellij.ui.JBColor;
import com.intellij.util.EventDispatcher;
import com.intellij.util.containers.MultiMap;
-import com.jetbrains.python.templateLanguages.TemplatesService;
-import icons.PythonIcons;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jps.model.module.JpsModuleSourceRootType;
@@ -50,34 +42,26 @@
import javax.swing.event.ChangeListener;
import javax.swing.tree.TreeCellRenderer;
import java.awt.*;
-import java.awt.event.InputEvent;
-import java.awt.event.KeyEvent;
-import java.util.ArrayList;
import java.util.List;
public class PyContentEntriesEditor extends CommonContentEntriesEditor {
- private static final Color TEMPLATES_COLOR = JBColor.MAGENTA;
- private final MultiMap<ContentEntry, VirtualFilePointer> myTemplateRoots = new MultiMap<ContentEntry, VirtualFilePointer>();
+ private final PyRootTypeProvider[] myRootTypeProviders;
private final Module myModule;
private Disposable myFilePointersDisposable;
-
- private final VirtualFilePointerListener DUMMY_LISTENER = new VirtualFilePointerListener() {
- @Override
- public void beforeValidityChanged(@NotNull VirtualFilePointer[] pointers) {
- }
-
- @Override
- public void validityChanged(@NotNull VirtualFilePointer[] pointers) {
- }
- };
+ private MyContentEntryEditor myContentEntryEditor;
public PyContentEntriesEditor(Module module, ModuleConfigurationState moduleConfigurationState,
JpsModuleSourceRootType<?>... rootTypes) {
super(module.getName(), moduleConfigurationState, rootTypes);
+ myRootTypeProviders = Extensions.getExtensions(PyRootTypeProvider.EP_NAME);
myModule = module;
reset();
}
+ public MyContentEntryEditor getContentEntryEditor() {
+ return myContentEntryEditor;
+ }
+
@Override
protected ContentEntryTreeEditor createContentEntryTreeEditor(Project project) {
return new MyContentEntryTreeEditor(project, getEditHandlers());
@@ -90,24 +74,19 @@
return entries;
}
+ public ContentEntry[] getContentEntries() {
+ return getModel().getContentEntries();
+ }
+
@Override
public void reset() {
if (myFilePointersDisposable != null) {
Disposer.dispose(myFilePointersDisposable);
}
- myTemplateRoots.clear();
myFilePointersDisposable = Disposer.newDisposable();
- final TemplatesService instance = TemplatesService.getInstance(myModule);
- if (instance != null) {
- final List<VirtualFile> folders = instance.getTemplateFolders();
- for (VirtualFile folder : folders) {
- ContentEntry contentEntry = findContentEntryForFile(folder);
- if (contentEntry != null) {
- myTemplateRoots.putValue(contentEntry, VirtualFilePointerManager.getInstance().create(folder, myFilePointersDisposable,
- DUMMY_LISTENER));
- }
- }
+ for (PyRootTypeProvider provider : myRootTypeProviders) {
+ provider.reset(myFilePointersDisposable, this, myModule);
}
if (myRootTreeEditor != null) {
@@ -117,17 +96,6 @@
}
}
- @Nullable
- private ContentEntry findContentEntryForFile(VirtualFile virtualFile) {
- for (ContentEntry contentEntry : getModel().getContentEntries()) {
- final VirtualFile file = contentEntry.getFile();
- if (file != null && VfsUtilCore.isAncestor(file, virtualFile, false)) {
- return contentEntry;
- }
- }
- return null;
- }
-
@Override
public void disposeUIResources() {
super.disposeUIResources();
@@ -139,40 +107,26 @@
@Override
public void apply() throws ConfigurationException {
super.apply();
- List<VirtualFile> templateRoots = getCurrentState();
- final TemplatesService templatesService = TemplatesService.getInstance(myModule);
- if (templatesService != null) {
- templatesService.setTemplateFolders(templateRoots.toArray(new VirtualFile[templateRoots.size()]));
+ for (PyRootTypeProvider provider : myRootTypeProviders) {
+ provider.apply(myModule);
}
}
- private List<VirtualFile> getCurrentState() {
- List<VirtualFile> result = new ArrayList<VirtualFile>();
- for (ContentEntry entry : myTemplateRoots.keySet()) {
- for (VirtualFilePointer filePointer : myTemplateRoots.get(entry)) {
- result.add(filePointer.getFile());
- }
- }
- return result;
- }
-
@Override
public boolean isModified() {
if (super.isModified()) return true;
- final TemplatesService templatesService = TemplatesService.getInstance(myModule);
- if (templatesService != null) {
- List<VirtualFile> original = templatesService.getTemplateFolders();
- List<VirtualFile> current = getCurrentState();
-
- if (!Comparing.haveEqualElements(original, current)) return true;
-
+ for (PyRootTypeProvider provider : myRootTypeProviders) {
+ if (provider.isModified(myModule)) {
+ return true;
+ }
}
return false;
}
@Override
- protected MyContentEntryEditor createContentEntryEditor(String contentEntryUrl) {
- return new MyContentEntryEditor(contentEntryUrl, getEditHandlers());
+ protected ContentEntryEditor createContentEntryEditor(String contentEntryUrl) {
+ myContentEntryEditor = new MyContentEntryEditor(contentEntryUrl, getEditHandlers());
+ return myContentEntryEditor;
}
protected class MyContentEntryEditor extends ContentEntryEditor {
@@ -202,37 +156,33 @@
@Override
public void deleteContentFolder(ContentEntry contentEntry, ContentFolder folder) {
- if (folder instanceof TemplateRootFolder) {
- removeTemplateRoot(folder.getUrl());
+ for (PyRootTypeProvider provider : myRootTypeProviders) {
+ if (provider.isMine(folder)) {
+ removeRoot(contentEntry, folder.getUrl(), provider);
+ return;
+ }
}
- else {
- super.deleteContentFolder(contentEntry, folder);
+ super.deleteContentFolder(contentEntry, folder);
+ }
+
+ public void removeRoot(@Nullable ContentEntry contentEntry, String folder, PyRootTypeProvider provider) {
+ if (contentEntry == null) {
+ contentEntry = getContentEntry();
+ }
+ VirtualFilePointer root = getRoot(provider, folder);
+ if (root != null) {
+ provider.removeRoot(contentEntry, root, getModel());
+ fireUpdate();
}
}
- public void addTemplateRoot(@NotNull final VirtualFile file) {
- final VirtualFilePointer root = VirtualFilePointerManager.getInstance().create(file, myFilePointersDisposable, DUMMY_LISTENER);
- myTemplateRoots.putValue(getContentEntry(), root);
+ public void fireUpdate() {
myEventDispatcher.getMulticaster().stateChanged(new ChangeEvent(this));
update();
}
- public void removeTemplateRoot(@NotNull final String url) {
- final VirtualFilePointer root = getTemplateRoot(url);
- if (root != null) {
- myTemplateRoots.remove(getContentEntry(), root);
- myEventDispatcher.getMulticaster().stateChanged(new ChangeEvent(this));
- update();
- }
- }
-
- public boolean hasTemplateRoot(@NotNull final VirtualFile file) {
- return getTemplateRoot(file.getUrl()) != null;
- }
-
- @Nullable
- public VirtualFilePointer getTemplateRoot(@NotNull final String url) {
- for (VirtualFilePointer filePointer : myTemplateRoots.get(getContentEntry())) {
+ public VirtualFilePointer getRoot(PyRootTypeProvider provider, @NotNull final String url) {
+ for (VirtualFilePointer filePointer : provider.getRoots().get(getContentEntry())) {
if (Comparing.equal(filePointer.getUrl(), url)) {
return filePointer;
}
@@ -240,6 +190,11 @@
return null;
}
+ public void addRoot(PyRootTypeProvider provider, @NotNull final VirtualFilePointer root) {
+ provider.getRoots().putValue(getContentEntry(), root);
+ fireUpdate();
+ }
+
protected class MyContentRootPanel extends ContentRootPanel {
public MyContentRootPanel() {
super(MyContentEntryEditor.this, getEditHandlers());
@@ -255,22 +210,22 @@
@Override
protected void addFolderGroupComponents() {
super.addFolderGroupComponents();
- if (!myTemplateRoots.get(getContentEntry()).isEmpty()) {
- final List<TemplateRootFolder> folders = new ArrayList<TemplateRootFolder>(myTemplateRoots.size());
- for (VirtualFilePointer root : myTemplateRoots.get(getContentEntry())) {
- folders.add(new TemplateRootFolder(root, getContentEntry()));
+ for (PyRootTypeProvider provider : myRootTypeProviders) {
+ MultiMap<ContentEntry, VirtualFilePointer> roots = provider.getRoots();
+ if (!roots.get(getContentEntry()).isEmpty()) {
+ final JComponent sourcesComponent = createFolderGroupComponent(provider.getName() + " Folders",
+ provider.createFolders(getContentEntry()),
+ provider.getColor(), null);
+ this.add(sourcesComponent, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTH,
+ GridBagConstraints.HORIZONTAL, new Insets(0, 0, 10, 0), 0, 0));
}
- final JComponent sourcesComponent = createFolderGroupComponent("Template Folders",
- folders.toArray(new ContentFolder[folders.size()]),
- TEMPLATES_COLOR, null);
- this.add(sourcesComponent, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTH,
- GridBagConstraints.HORIZONTAL, new Insets(0, 0, 10, 0), 0, 0));
+
}
}
}
}
- private static class MyContentEntryTreeEditor extends ContentEntryTreeEditor {
+ private class MyContentEntryTreeEditor extends ContentEntryTreeEditor {
private final ChangeListener myListener = new ChangeListener() {
@Override
@@ -306,43 +261,14 @@
@Override
protected void createEditingActions() {
super.createEditingActions();
-
- ContentEntryEditingAction a = new ContentEntryEditingAction(myTree) {
- {
- final Presentation templatePresentation = getTemplatePresentation();
- templatePresentation.setText("Templates");
- templatePresentation.setDescription("Template Folders");
- templatePresentation.setIcon(PythonIcons.Python.TemplateRoot);
+ for (PyRootTypeProvider provider : myRootTypeProviders) {
+ ContentEntryEditingAction action = provider.createRootEntryEditingAction(myTree, myFilePointersDisposable, PyContentEntriesEditor.this, getModel());
+ myEditingActionsGroup.add(action);
+ CustomShortcutSet shortcut = provider.getShortcut();
+ if (shortcut != null) {
+ action.registerCustomShortcutSet(shortcut, myTree);
}
-
- @Override
- public boolean isSelected(AnActionEvent e) {
- final VirtualFile[] selectedFiles = getSelectedFiles();
- return selectedFiles.length != 0 && getContentEntryEditor().hasTemplateRoot(selectedFiles[0]);
- }
-
- @Override
- public void setSelected(AnActionEvent e, boolean isSelected) {
- final VirtualFile[] selectedFiles = getSelectedFiles();
- assert selectedFiles.length != 0;
-
- for (VirtualFile selectedFile : selectedFiles) {
- boolean wasSelected = getContentEntryEditor().hasTemplateRoot(selectedFile);
- if (isSelected) {
- if (!wasSelected) {
- getContentEntryEditor().addTemplateRoot(selectedFile);
- }
- }
- else {
- if (wasSelected) {
- getContentEntryEditor().removeTemplateRoot(selectedFile.getUrl());
- }
- }
- }
- }
- };
- myEditingActionsGroup.add(a);
- a.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_R, InputEvent.ALT_MASK)), myTree);
+ }
}
@Override
@@ -350,18 +276,14 @@
return new ContentEntryTreeCellRenderer(this, getEditHandlers()) {
@Override
protected Icon updateIcon(final ContentEntry entry, final VirtualFile file, final Icon originalIcon) {
- if (getContentEntryEditor().hasTemplateRoot(file)) {
- return PythonIcons.Python.TemplateRoot;
+ for (PyRootTypeProvider provider : myRootTypeProviders) {
+ if (provider.hasRoot(file, PyContentEntriesEditor.this)) {
+ return provider.getIcon();
+ }
}
return super.updateIcon(entry, file, originalIcon);
}
};
}
}
- private static class TemplateRootFolder extends ContentFolderBaseImpl {
- protected TemplateRootFolder(@NotNull VirtualFilePointer filePointer, @NotNull ContentEntryImpl contentEntry) {
- super(filePointer, contentEntry);
- }
- }
-
}
diff --git a/python/src/com/jetbrains/python/module/PyRootTypeProvider.java b/python/src/com/jetbrains/python/module/PyRootTypeProvider.java
new file mode 100644
index 0000000..dd5a063
--- /dev/null
+++ b/python/src/com/jetbrains/python/module/PyRootTypeProvider.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright 2000-2015 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.jetbrains.python.module;
+
+import com.intellij.openapi.Disposable;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.CustomShortcutSet;
+import com.intellij.openapi.actionSystem.Presentation;
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.roots.ContentEntry;
+import com.intellij.openapi.roots.ContentFolder;
+import com.intellij.openapi.roots.ModifiableRootModel;
+import com.intellij.openapi.roots.ui.configuration.actions.ContentEntryEditingAction;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.vfs.pointers.VirtualFilePointer;
+import com.intellij.openapi.vfs.pointers.VirtualFilePointerListener;
+import com.intellij.openapi.vfs.pointers.VirtualFilePointerManager;
+import com.intellij.util.containers.MultiMap;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.awt.*;
+
+public abstract class PyRootTypeProvider {
+ public static final ExtensionPointName<PyRootTypeProvider> EP_NAME = ExtensionPointName.create("Pythonid.pyRootTypeProvider");
+ protected final VirtualFilePointerListener DUMMY_LISTENER = new VirtualFilePointerListener() {
+ @Override
+ public void beforeValidityChanged(@NotNull VirtualFilePointer[] pointers) {
+ }
+
+ @Override
+ public void validityChanged(@NotNull VirtualFilePointer[] pointers) {
+ }
+ };
+
+ public abstract void reset(@NotNull final Disposable disposable, PyContentEntriesEditor editor, Module module);
+
+ public abstract void apply(Module module);
+
+ public abstract boolean isModified(Module module);
+
+ public abstract boolean isMine(ContentFolder folder);
+
+ public void removeRoot(ContentEntry contentEntry, @NotNull final VirtualFilePointer root, ModifiableRootModel model) {
+ getRoots().remove(contentEntry, root);
+ }
+ public abstract MultiMap<ContentEntry, VirtualFilePointer> getRoots();
+
+ public abstract Icon getIcon();
+
+ public abstract String getName();
+
+ public String getNamePlural() {
+ return getName() + "s";
+ }
+
+ public abstract Color getColor();
+
+ @Nullable
+ public CustomShortcutSet getShortcut() {
+ return null;
+ }
+
+
+ protected class RootEntryEditingAction extends ContentEntryEditingAction {
+ private final Disposable myDisposable;
+ private final PyContentEntriesEditor myEditor;
+ private final ModifiableRootModel myModel;
+
+ public RootEntryEditingAction(JTree tree, Disposable disposable, PyContentEntriesEditor editor, ModifiableRootModel model) {
+ super(tree);
+ final Presentation templatePresentation = getTemplatePresentation();
+ templatePresentation.setText(getNamePlural());
+ templatePresentation.setDescription(getName() + " Folders");
+ templatePresentation.setIcon(getIcon());
+ myDisposable = disposable;
+ myEditor = editor;
+ myModel = model;
+ }
+
+ @Override
+ public boolean isSelected(AnActionEvent e) {
+ final VirtualFile[] selectedFiles = getSelectedFiles();
+ return selectedFiles.length != 0 && hasRoot(selectedFiles[0], myEditor);
+ }
+
+ @Override
+ public void setSelected(AnActionEvent e, boolean isSelected) {
+ final VirtualFile[] selectedFiles = getSelectedFiles();
+ assert selectedFiles.length != 0;
+
+ for (VirtualFile selectedFile : selectedFiles) {
+ boolean wasSelected = hasRoot(selectedFile, myEditor);
+ if (isSelected) {
+ if (!wasSelected) {
+ final VirtualFilePointer root = VirtualFilePointerManager.getInstance().create(selectedFile, myDisposable, DUMMY_LISTENER);
+ addRoot(root, myEditor);
+ }
+ }
+ else {
+ if (wasSelected) {
+ removeRoot(selectedFile, myEditor, myModel);
+ }
+ }
+ }
+ }
+ }
+
+ private void addRoot(VirtualFilePointer root, PyContentEntriesEditor editor) {
+ editor.getContentEntryEditor().addRoot(this, root);
+ }
+
+ protected void removeRoot(VirtualFile selectedFile, PyContentEntriesEditor editor, ModifiableRootModel model) {
+ editor.getContentEntryEditor().removeRoot(null, selectedFile.getUrl(), this);
+ }
+
+ protected boolean hasRoot(VirtualFile file, PyContentEntriesEditor editor) {
+ PyContentEntriesEditor.MyContentEntryEditor entryEditor = editor.getContentEntryEditor();
+ return entryEditor.getRoot(this, file.getUrl()) != null;
+ }
+
+ public abstract ContentEntryEditingAction createRootEntryEditingAction(JTree tree,
+ Disposable disposable, PyContentEntriesEditor editor, ModifiableRootModel model);
+
+ public abstract ContentFolder[] createFolders(ContentEntry contentEntry);
+}
diff --git a/python/src/com/jetbrains/python/packaging/PyPIPackageUtil.java b/python/src/com/jetbrains/python/packaging/PyPIPackageUtil.java
index bc8e3a1..97a81b3 100644
--- a/python/src/com/jetbrains/python/packaging/PyPIPackageUtil.java
+++ b/python/src/com/jetbrains/python/packaging/PyPIPackageUtil.java
@@ -17,9 +17,12 @@
import com.google.common.collect.Lists;
import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.io.HttpRequests;
import com.intellij.util.net.HttpConfigurable;
import com.intellij.webcore.packaging.RepoPackage;
+import com.jetbrains.python.PythonHelpersLocator;
import org.apache.xmlrpc.*;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -54,6 +57,8 @@
@NonNls public static final String PYPI_URL = "https://pypi.python.org/pypi";
@NonNls public static final String PYPI_LIST_URL = "https://pypi.python.org/pypi?%3Aaction=index";
+ public static Map<String, String> PACKAGES_TOPLEVEL = new HashMap<String, String>();
+
public static final PyPIPackageUtil INSTANCE = new PyPIPackageUtil();
private XmlRpcClient myXmlRpcClient;
@@ -63,6 +68,31 @@
private Set<RepoPackage> myAdditionalPackageNames;
@Nullable private volatile Set<String> myPackageNames = null;
+
+ static {
+ try {
+ fillPackages();
+ }
+ catch (IOException e) {
+ LOG.error("Cannot find \"packages\". " + e.getMessage());
+ }
+ }
+
+ private static void fillPackages() throws IOException {
+ FileReader reader = new FileReader(PythonHelpersLocator.getHelperPath("/tools/packages"));
+ try {
+ final String text = FileUtil.loadTextAndClose(reader);
+ final List<String> lines = StringUtil.split(text, "\n");
+ for (String line : lines) {
+ final List<String> split = StringUtil.split(line, " ");
+ PACKAGES_TOPLEVEL.put(split.get(0), split.get(1));
+ }
+ }
+ finally {
+ reader.close();
+ }
+ }
+
public static Set<String> getPackageNames(final String url) throws IOException {
final TreeSet<String> names = new TreeSet<String>();
final HTMLEditorKit.ParserCallback callback =
diff --git a/python/src/com/jetbrains/python/packaging/PyRemotePackageManagerImpl.java b/python/src/com/jetbrains/python/packaging/PyRemotePackageManagerImpl.java
index 15c0748..2ef527f 100644
--- a/python/src/com/jetbrains/python/packaging/PyRemotePackageManagerImpl.java
+++ b/python/src/com/jetbrains/python/packaging/PyRemotePackageManagerImpl.java
@@ -32,6 +32,7 @@
import com.intellij.util.PathMappingSettings;
import com.jetbrains.python.remote.PyRemoteSdkAdditionalDataBase;
import com.jetbrains.python.remote.PythonRemoteInterpreterManager;
+import com.jetbrains.python.sdk.PythonSdkType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -179,6 +180,7 @@
if (manager != null) {
try {
manager.runVagrant(myVagrantFolder, myMachineName);
+ PythonSdkType.getInstance().setupSdkPaths(mySdk);
clearCaches();
}
catch (ExecutionException e) {
diff --git a/python/src/com/jetbrains/python/psi/PyUtil.java b/python/src/com/jetbrains/python/psi/PyUtil.java
index 4d104f1..331c2d1 100644
--- a/python/src/com/jetbrains/python/psi/PyUtil.java
+++ b/python/src/com/jetbrains/python/psi/PyUtil.java
@@ -23,6 +23,7 @@
import com.intellij.codeInsight.lookup.LookupElementBuilder;
import com.intellij.ide.fileTemplates.FileTemplate;
import com.intellij.ide.fileTemplates.FileTemplateManager;
+import com.intellij.ide.scratch.ScratchFileService;
import com.intellij.injected.editor.VirtualFileWindow;
import com.intellij.lang.ASTFactory;
import com.intellij.lang.ASTNode;
@@ -827,15 +828,23 @@
return guessLanguageLevel(project);
}
- private static LanguageLevel guessLanguageLevel(@NotNull Project project) {
+ @NotNull
+ public static LanguageLevel guessLanguageLevel(@NotNull Project project) {
final ModuleManager moduleManager = ModuleManager.getInstance(project);
if (moduleManager != null) {
+ LanguageLevel maxLevel = null;
for (Module projectModule : moduleManager.getModules()) {
final Sdk sdk = PythonSdkType.findPythonSdk(projectModule);
if (sdk != null) {
- return PythonSdkType.getLanguageLevelForSdk(sdk);
+ final LanguageLevel level = PythonSdkType.getLanguageLevelForSdk(sdk);
+ if (maxLevel == null || maxLevel.isOlderThan(level)) {
+ maxLevel = level;
+ }
}
}
+ if (maxLevel != null) {
+ return maxLevel;
+ }
}
return LanguageLevel.getDefault();
}
@@ -1803,6 +1812,16 @@
return type == builtinCache.getObjectType() || type == builtinCache.getOldstyleClassobjType();
}
+ public static boolean isInScratchFile(@NotNull PsiElement element) {
+ final ScratchFileService service = ScratchFileService.getInstance();
+ final PsiFile file = element.getContainingFile();
+ if (file != null) {
+ final VirtualFile virtualFile = file.getVirtualFile();
+ return service != null && virtualFile != null && service.getRootType(virtualFile) != null;
+ }
+ return false;
+ }
+
/**
* This helper class allows to collect various information about AST nodes composing {@link PyStringLiteralExpression}.
*/
diff --git a/python/src/com/jetbrains/python/psi/impl/PyFileImpl.java b/python/src/com/jetbrains/python/psi/impl/PyFileImpl.java
index 71a8380..7d9bc1f 100644
--- a/python/src/com/jetbrains/python/psi/impl/PyFileImpl.java
+++ b/python/src/com/jetbrains/python/psi/impl/PyFileImpl.java
@@ -24,7 +24,6 @@
import com.intellij.openapi.roots.ProjectFileIndex;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.io.FileUtil;
-import com.intellij.openapi.vfs.NonPhysicalFileSystem;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.*;
@@ -108,7 +107,7 @@
Map<String, PsiElement> localDeclarations,
MultiMap<String, PsiElement> ambiguousDeclarations,
List<PsiElement> nameDefiners) {
- if (child instanceof PsiNamedElement) {
+ if (child instanceof PyTargetExpression || child instanceof PyFunction || child instanceof PyClass) {
final String name = ((PsiNamedElement)child).getName();
localDeclarations.put(name, child);
}
diff --git a/python/src/com/jetbrains/python/psi/impl/PyNamedParameterImpl.java b/python/src/com/jetbrains/python/psi/impl/PyNamedParameterImpl.java
index 7c89a1c4..76e9669 100644
--- a/python/src/com/jetbrains/python/psi/impl/PyNamedParameterImpl.java
+++ b/python/src/com/jetbrains/python/psi/impl/PyNamedParameterImpl.java
@@ -349,11 +349,29 @@
}
@Nullable
- private static PyNamedParameter getParameterByCallArgument(@NotNull PsiElement element, @NotNull TypeEvalContext context) {
- final PyCallExpression call = PsiTreeUtil.getParentOfType(element, PyCallExpression.class);
- if (call != null) {
- final PyArgumentList argumentList = call.getArgumentList();
- if (argumentList != null) {
+ private PyNamedParameter getParameterByCallArgument(@NotNull PsiElement element, @NotNull TypeEvalContext context) {
+ final PyArgumentList argumentList = PsiTreeUtil.getParentOfType(element, PyArgumentList.class);
+ if (argumentList != null) {
+ boolean elementIsArgument = false;
+ for (PyExpression argument : argumentList.getArgumentExpressions()) {
+ if (PyPsiUtils.flattenParens(argument) == element) {
+ elementIsArgument = true;
+ break;
+ }
+ }
+ final PyCallExpression callExpression = argumentList.getCallExpression();
+ if (elementIsArgument && callExpression != null) {
+ final PyExpression callee = callExpression.getCallee();
+ if (callee instanceof PyReferenceExpression) {
+ final PyReferenceExpression calleeReferenceExpr = (PyReferenceExpression)callee;
+ final PyExpression firstQualifier = PyPsiUtils.getFirstQualifier(calleeReferenceExpr);
+ if (firstQualifier != null) {
+ final PsiReference ref = firstQualifier.getReference();
+ if (ref != null && ref.isReferenceTo(this)) {
+ return null;
+ }
+ }
+ }
final PyResolveContext resolveContext = PyResolveContext.noImplicits().withTypeEvalContext(context);
final CallArgumentsMapping mapping = argumentList.analyzeCall(resolveContext);
for (Map.Entry<PyExpression, PyNamedParameter> entry : mapping.getPlainMappedParams().entrySet()) {
diff --git a/python/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java b/python/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java
index c93f776..a78934b 100644
--- a/python/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java
+++ b/python/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java
@@ -49,6 +49,7 @@
import com.jetbrains.python.PythonModuleTypeBase;
import com.jetbrains.python.facet.PythonFacetSettings;
import com.jetbrains.python.psi.LanguageLevel;
+import com.jetbrains.python.psi.PyUtil;
import com.jetbrains.python.psi.resolve.PythonSdkPathCache;
import com.jetbrains.python.sdk.PythonSdkType;
import org.jetbrains.annotations.NotNull;
@@ -108,7 +109,10 @@
}
if (file == null) return null;
final Sdk sdk = getFileSdk(project, file);
- return PythonSdkType.getLanguageLevelForSdk(sdk);
+ if (sdk != null) {
+ return PythonSdkType.getLanguageLevelForSdk(sdk);
+ }
+ return PyUtil.guessLanguageLevel(project);
}
@Nullable
diff --git a/python/src/com/jetbrains/python/psi/resolve/QualifiedNameResolverImpl.java b/python/src/com/jetbrains/python/psi/resolve/QualifiedNameResolverImpl.java
index 8c0c38f..e0ce6f2 100644
--- a/python/src/com/jetbrains/python/psi/resolve/QualifiedNameResolverImpl.java
+++ b/python/src/com/jetbrains/python/psi/resolve/QualifiedNameResolverImpl.java
@@ -37,6 +37,7 @@
import com.jetbrains.python.console.PydevConsoleRunner;
import com.jetbrains.python.facet.PythonPathContributingFacet;
import com.jetbrains.python.psi.PyFile;
+import com.jetbrains.python.psi.PyUtil;
import com.jetbrains.python.psi.impl.PyBuiltinCache;
import com.jetbrains.python.psi.impl.PyImportResolver;
import com.jetbrains.python.sdk.PySdkUtil;
@@ -84,7 +85,7 @@
@Override
public QualifiedNameResolver fromElement(@NotNull PsiElement foothold) {
myContext.setFromElement(foothold);
- if (PydevConsoleRunner.isInPydevConsole(foothold)) {
+ if (PydevConsoleRunner.isInPydevConsole(foothold) || PyUtil.isInScratchFile(foothold)) {
withAllModules();
Sdk sdk = PydevConsoleRunner.getConsoleSdk(foothold);
if (sdk != null) {
@@ -257,7 +258,7 @@
if (!myWithoutForeign) {
for (PyImportResolver resolver : Extensions.getExtensions(PyImportResolver.EP_NAME)) {
- PsiElement foreign = resolver.resolveImportReference(myQualifiedName, myContext);
+ PsiElement foreign = resolver.resolveImportReference(myQualifiedName, myContext, !myWithoutRoots);
if (foreign != null) {
myForeignResults.add(foreign);
}
diff --git a/python/src/com/jetbrains/python/psi/resolve/ResolveImportUtil.java b/python/src/com/jetbrains/python/psi/resolve/ResolveImportUtil.java
index d4d5a0f..7f2596e 100644
--- a/python/src/com/jetbrains/python/psi/resolve/ResolveImportUtil.java
+++ b/python/src/com/jetbrains/python/psi/resolve/ResolveImportUtil.java
@@ -384,7 +384,7 @@
rate += 100;
}
for (PyResolveResultRater rater : Extensions.getExtensions(PyResolveResultRater.EP_NAME)) {
- rate += rater.getRate(target);
+ rate += rater.getImportElementRate(target);
}
}
ret.poke(target, rate);
@@ -396,7 +396,7 @@
/**
* @param element what we test (identifier, reference, import element, etc)
* @return the how the element relates to an enclosing import statement, if any
- * @see com.jetbrains.python.psi.resolve.PointInImport
+ * @see PointInImport
*/
@NotNull
public static PointInImport getPointInImport(@NotNull PsiElement element) {
diff --git a/python/src/com/jetbrains/python/psi/types/PyClassTypeImpl.java b/python/src/com/jetbrains/python/psi/types/PyClassTypeImpl.java
index 922aaaf..6d26167 100644
--- a/python/src/com/jetbrains/python/psi/types/PyClassTypeImpl.java
+++ b/python/src/com/jetbrains/python/psi/types/PyClassTypeImpl.java
@@ -37,6 +37,7 @@
import com.jetbrains.python.codeInsight.PyCustomMemberUtils;
import com.jetbrains.python.psi.*;
import com.jetbrains.python.psi.impl.PyBuiltinCache;
+import com.jetbrains.python.psi.impl.PyResolveResultRater;
import com.jetbrains.python.psi.impl.ResolveResultList;
import com.jetbrains.python.psi.resolve.*;
import com.jetbrains.python.psi.stubs.PyClassNameIndex;
@@ -190,9 +191,16 @@
classMember = resolveByOverridingAncestorsMembersProviders(this, name, location);
if (classMember != null) {
- return ResolveResultList.to(classMember);
+ final ResolveResultList list = new ResolveResultList();
+ int rate = RatedResolveResult.RATE_NORMAL;
+ for (PyResolveResultRater rater : Extensions.getExtensions(PyResolveResultRater.EP_NAME)) {
+ rate += rater.getMemberRate(classMember, this, context);
+ }
+ list.poke(classMember, rate);
+ return list;
}
+
if (inherited) {
for (PyClassLikeType type : myClass.getAncestorTypes(context)) {
if (type instanceof PyClassType) {
diff --git a/python/src/com/jetbrains/python/psi/types/PyModuleType.java b/python/src/com/jetbrains/python/psi/types/PyModuleType.java
index 2cfef4d..cd642a6 100644
--- a/python/src/com/jetbrains/python/psi/types/PyModuleType.java
+++ b/python/src/com/jetbrains/python/psi/types/PyModuleType.java
@@ -106,6 +106,10 @@
if (!inSameFile(location, myModule)) {
importElements.addAll(myModule.getImportTargets());
}
+ final List<PyFromImportStatement> imports = myModule.getFromImports();
+ for (PyFromImportStatement anImport : imports) {
+ Collections.addAll(importElements, anImport.getImportElements());
+ }
}
final List<? extends RatedResolveResult> implicitMembers = resolveImplicitPackageMember(name, importElements);
if (implicitMembers != null) {
@@ -185,6 +189,18 @@
importedQNames.add(implicitSubModuleQName);
}
}
+ else {
+ final List<PsiElement> elements = ResolveImportUtil.resolveFromImportStatementSource(fromImportStatement, element.getImportedQName());
+ for (PsiElement psiElement : elements) {
+ if (psiElement instanceof PsiFile) {
+ final VirtualFile virtualFile = ((PsiFile)psiElement).getVirtualFile();
+ final QualifiedName qName = QualifiedNameFinder.findShortestImportableQName(element, virtualFile);
+ if (qName != null) {
+ importedQNames.add(qName);
+ }
+ }
+ }
+ }
}
else if (stmt instanceof PyImportStatement) {
final QualifiedName importedQName = element.getImportedQName();
diff --git a/python/src/com/jetbrains/python/remote/PythonRemoteInterpreterManager.java b/python/src/com/jetbrains/python/remote/PythonRemoteInterpreterManager.java
index e213446..5708e5f 100644
--- a/python/src/com/jetbrains/python/remote/PythonRemoteInterpreterManager.java
+++ b/python/src/com/jetbrains/python/remote/PythonRemoteInterpreterManager.java
@@ -26,6 +26,7 @@
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.projectRoots.SdkAdditionalData;
import com.intellij.openapi.projectRoots.SdkModificator;
+import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.remote.*;
@@ -54,6 +55,8 @@
public static final String WEB_DEPLOYMENT_PLUGIN_IS_DISABLED =
"Remote interpreter can't be executed. Please enable the Remote Hosts Access plugin."; //TODO: this message is incorrect
+ public final static Key<PathMappingSettings> PATH_MAPPING_SETTINGS_KEY = Key.create("PATH_MAPPING_SETTINGS_KEY");
+
public abstract ProcessHandler startRemoteProcess(@Nullable Project project,
@NotNull PyRemoteSdkCredentials data,
@NotNull GeneralCommandLine commandLine,
@@ -103,7 +106,7 @@
RemoteProjectSettings settings,
RemoteSdkCredentials data);
- public abstract void copyFromRemote(@NotNull Project project,
+ public abstract void copyFromRemote(Sdk sdk, @NotNull Project project,
RemoteSdkCredentials data,
List<PathMappingSettings.PathMapping> mappings);
diff --git a/python/src/com/jetbrains/python/run/AbstractPythonRunConfiguration.java b/python/src/com/jetbrains/python/run/AbstractPythonRunConfiguration.java
index 0586803..2957987d 100644
--- a/python/src/com/jetbrains/python/run/AbstractPythonRunConfiguration.java
+++ b/python/src/com/jetbrains/python/run/AbstractPythonRunConfiguration.java
@@ -49,6 +49,7 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -227,7 +228,7 @@
final String addContentRoots = JDOMExternalizerUtil.readField(element, "ADD_CONTENT_ROOTS");
myAddContentRoots = addContentRoots == null || Boolean.parseBoolean(addContentRoots);
final String addSourceRoots = JDOMExternalizerUtil.readField(element, "ADD_SOURCE_ROOTS");
- myAddSourceRoots = addSourceRoots == null|| Boolean.parseBoolean(addSourceRoots);
+ myAddSourceRoots = addSourceRoots == null || Boolean.parseBoolean(addSourceRoots);
getConfigurationModule().readExternal(element);
setMappingSettings(PathMappingSettings.readExternal(element));
@@ -412,12 +413,27 @@
final VirtualFile virtualFile = location.getVirtualFile();
if (virtualFile != null) {
String path = virtualFile.getCanonicalPath();
- if (pyClass != null)
+ if (pyClass != null) {
path += "::" + pyClass.getName();
- if (pyFunction != null)
+ }
+ if (pyFunction != null) {
path += "::" + pyFunction.getName();
+ }
return path;
}
return null;
}
+
+ /**
+ * @return working directory to run, never null, does its best to return project dir if empty.
+ * Unlike {@link #getWorkingDirectory()} it does not simply take directory from config.
+ */
+ @NotNull
+ public String getWorkingDirectorySafe() {
+ final String result = StringUtil.isEmpty(myWorkingDirectory) ? getProject().getBasePath() : myWorkingDirectory;
+ if (result == null) {
+ return new File(".").getAbsolutePath();
+ }
+ return result;
+ }
}
diff --git a/python/src/com/jetbrains/python/run/PyRemoteTracebackFilter.java b/python/src/com/jetbrains/python/run/PyRemoteTracebackFilter.java
index 2af1a64..5d7840a 100644
--- a/python/src/com/jetbrains/python/run/PyRemoteTracebackFilter.java
+++ b/python/src/com/jetbrains/python/run/PyRemoteTracebackFilter.java
@@ -20,6 +20,7 @@
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.remote.RemoteProcessHandlerBase;
import com.intellij.util.PathMappingSettings;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -36,7 +37,7 @@
@Override
@Nullable
- protected VirtualFile findFileByName(String fileName) {
+ protected VirtualFile findFileByName(@NotNull String fileName) {
VirtualFile vFile = super.findFileByName(fileName);
if (vFile != null) {
return vFile;
diff --git a/python/src/com/jetbrains/python/run/PyTracebackParser.java b/python/src/com/jetbrains/python/run/PyTracebackParser.java
new file mode 100644
index 0000000..145cad6
--- /dev/null
+++ b/python/src/com/jetbrains/python/run/PyTracebackParser.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2000-2015 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.jetbrains.python.run;
+
+import com.jetbrains.python.traceBackParsers.LinkInTrace;
+import com.jetbrains.python.traceBackParsers.TraceBackParser;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Finds links in default python traceback
+ *
+ * @author Ilya.Kazakevich
+ */
+public class PyTracebackParser extends TraceBackParser {
+
+
+ public PyTracebackParser() {
+ super(Pattern.compile("File \"([^\"]+)\", line (\\d+)"));
+ }
+
+ @NotNull
+ @Override
+ protected LinkInTrace findLinkInTrace(@NotNull final String line, @NotNull final Matcher matchedMatcher) {
+ final String fileName = matchedMatcher.group(1).replace('\\', '/');
+ final int lineNumber = Integer.parseInt(matchedMatcher.group(2));
+ final int startPos = line.indexOf('\"') + 1;
+ final int endPos = line.indexOf('\"', startPos);
+ return new LinkInTrace(fileName, lineNumber, startPos, endPos);
+ }
+}
diff --git a/python/src/com/jetbrains/python/run/PythonCommandLineState.java b/python/src/com/jetbrains/python/run/PythonCommandLineState.java
index 33914b1..31bad8f 100644
--- a/python/src/com/jetbrains/python/run/PythonCommandLineState.java
+++ b/python/src/com/jetbrains/python/run/PythonCommandLineState.java
@@ -24,6 +24,7 @@
import com.intellij.execution.configurations.*;
import com.intellij.execution.filters.TextConsoleBuilder;
import com.intellij.execution.filters.TextConsoleBuilderFactory;
+import com.intellij.execution.filters.UrlFilter;
import com.intellij.execution.process.ProcessHandler;
import com.intellij.execution.process.ProcessTerminatedListener;
import com.intellij.execution.runners.ExecutionEnvironment;
@@ -44,6 +45,7 @@
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.JarFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.vfs.encoding.EncodingProjectManager;
import com.intellij.remote.RemoteProcessHandlerBase;
import com.intellij.util.PlatformUtils;
import com.intellij.util.containers.HashMap;
@@ -76,6 +78,7 @@
public static final String GROUP_EXE_OPTIONS = "Exe Options";
public static final String GROUP_DEBUGGER = "Debugger";
+ public static final String GROUP_PROFILER = "Profiler";
public static final String GROUP_SCRIPT = "Script";
private final AbstractPythonRunConfiguration myConfig;
@@ -130,6 +133,7 @@
protected ConsoleView createAndAttachConsole(Project project, ProcessHandler processHandler, Executor executor)
throws ExecutionException {
final ConsoleView consoleView = createConsoleBuilder(project).getConsole();
+ consoleView.addMessageFilter(new UrlFilter());
addTracebackFilter(project, consoleView, processHandler);
@@ -144,8 +148,9 @@
.addMessageFilter(new PyRemoteTracebackFilter(project, myConfig.getWorkingDirectory(), (RemoteProcessHandlerBase)processHandler));
}
else {
- consoleView.addMessageFilter(new PythonTracebackFilter(project, myConfig.getWorkingDirectory()));
+ consoleView.addMessageFilter(new PythonTracebackFilter(project, myConfig.getWorkingDirectorySafe()));
}
+ consoleView.addMessageFilter(new UrlFilter()); // Url filter is always nice to have
}
private TextConsoleBuilder createConsoleBuilder(Project project) {
@@ -216,6 +221,8 @@
public GeneralCommandLine generateCommandLine() throws ExecutionException {
GeneralCommandLine commandLine = createCommandLine();
+ commandLine.withCharset(EncodingProjectManager.getInstance(myConfig.getProject()).getDefaultCharset());
+
setRunnerPath(commandLine);
// define groups
@@ -242,6 +249,7 @@
ParametersList params = commandLine.getParametersList();
params.addParamsGroup(GROUP_EXE_OPTIONS);
params.addParamsGroup(GROUP_DEBUGGER);
+ params.addParamsGroup(GROUP_PROFILER);
params.addParamsGroup(GROUP_SCRIPT);
}
diff --git a/python/src/com/jetbrains/python/run/PythonTracebackFilter.java b/python/src/com/jetbrains/python/run/PythonTracebackFilter.java
index 5cee1cb..8988172 100644
--- a/python/src/com/jetbrains/python/run/PythonTracebackFilter.java
+++ b/python/src/com/jetbrains/python/run/PythonTracebackFilter.java
@@ -21,11 +21,12 @@
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
+import com.jetbrains.python.traceBackParsers.LinkInTrace;
+import com.jetbrains.python.traceBackParsers.TraceBackParser;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.File;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
/**
* @author yole
@@ -33,31 +34,34 @@
public class PythonTracebackFilter implements Filter {
private final Project myProject;
private final String myWorkingDirectory;
- private final Pattern myMatchingPattern = Pattern.compile("File \"([^\"]+)\", line (\\d+)");
- public PythonTracebackFilter(Project project) {
+ public PythonTracebackFilter(final Project project) {
myProject = project;
myWorkingDirectory = null;
}
- public PythonTracebackFilter(Project project, @Nullable String workingDirectory) {
+ public PythonTracebackFilter(final Project project, @Nullable final String workingDirectory) {
myProject = project;
myWorkingDirectory = workingDirectory;
}
- public Result applyFilter(String line, int entireLength) {
- // File "C:\Progs\Crack\psidc\scummdc.py", line 72, in ?
- Matcher matcher = myMatchingPattern.matcher(line);
- if (matcher.find()) {
- String fileName = matcher.group(1).replace('\\', '/');
- int lineNumber = Integer.parseInt(matcher.group(2));
- VirtualFile vFile = findFileByName(fileName);
-
+ @Override
+ @Nullable
+ public final Result applyFilter(@NotNull final String line, final int entireLength) {
+
+ for (final TraceBackParser parser : TraceBackParser.PARSERS) {
+ final LinkInTrace linkInTrace = parser.findLinkInTrace(line);
+ if (linkInTrace == null) {
+ continue;
+ }
+ final int lineNumber = linkInTrace.getLineNumber();
+ final VirtualFile vFile = findFileByName(linkInTrace.getFileName());
+
if (vFile != null) {
- OpenFileHyperlinkInfo hyperlink = new OpenFileHyperlinkInfo(myProject, vFile, lineNumber - 1);
+ final OpenFileHyperlinkInfo hyperlink = new OpenFileHyperlinkInfo(myProject, vFile, lineNumber - 1);
final int textStartOffset = entireLength - line.length();
- int startPos = line.indexOf('\"') + 1;
- int endPos = line.indexOf('\"', startPos);
+ final int startPos = linkInTrace.getStartPos();
+ final int endPos = linkInTrace.getEndPos();
return new Result(startPos + textStartOffset, endPos + textStartOffset, hyperlink);
}
}
@@ -65,7 +69,7 @@
}
@Nullable
- protected VirtualFile findFileByName(String fileName) {
+ protected VirtualFile findFileByName(@NotNull final String fileName) {
VirtualFile vFile = LocalFileSystem.getInstance().findFileByPath(fileName);
if (vFile == null && !StringUtil.isEmptyOrSpaces(myWorkingDirectory)) {
vFile = LocalFileSystem.getInstance().findFileByIoFile(new File(myWorkingDirectory, fileName));
diff --git a/python/src/com/jetbrains/python/sdk/PythonSdkType.java b/python/src/com/jetbrains/python/sdk/PythonSdkType.java
index 779b108..b35435a 100644
--- a/python/src/com/jetbrains/python/sdk/PythonSdkType.java
+++ b/python/src/com/jetbrains/python/sdk/PythonSdkType.java
@@ -844,6 +844,7 @@
return null;
}
+ @NotNull
public static LanguageLevel getLanguageLevelForSdk(@Nullable Sdk sdk) {
if (sdk != null && sdk.getSdkType() instanceof PythonSdkType) {
final PythonSdkFlavor flavor = PythonSdkFlavor.getFlavor(sdk);
diff --git a/python/src/com/jetbrains/python/sdk/flavors/PyPySdkFlavor.java b/python/src/com/jetbrains/python/sdk/flavors/PyPySdkFlavor.java
index 5cd8ac5..d4fa3ea 100644
--- a/python/src/com/jetbrains/python/sdk/flavors/PyPySdkFlavor.java
+++ b/python/src/com/jetbrains/python/sdk/flavors/PyPySdkFlavor.java
@@ -77,8 +77,9 @@
return "PyPy";
}
+ @NotNull
@Override
- public LanguageLevel getLanguageLevel(Sdk sdk) {
+ public LanguageLevel getLanguageLevel(@NotNull Sdk sdk) {
final String versionString = sdk.getVersionString();
if (versionString != null) {
final Matcher matcher = VERSION_STRING_RE.matcher(versionString);
diff --git a/python/src/com/jetbrains/python/sdk/flavors/PythonSdkFlavor.java b/python/src/com/jetbrains/python/sdk/flavors/PythonSdkFlavor.java
index 0f33f55..3ecaf40 100644
--- a/python/src/com/jetbrains/python/sdk/flavors/PythonSdkFlavor.java
+++ b/python/src/com/jetbrains/python/sdk/flavors/PythonSdkFlavor.java
@@ -218,7 +218,8 @@
@NotNull
public abstract String getName();
- public LanguageLevel getLanguageLevel(Sdk sdk) {
+ @NotNull
+ public LanguageLevel getLanguageLevel(@NotNull Sdk sdk) {
final String version = sdk.getVersionString();
final String prefix = getName() + " ";
if (version != null && version.startsWith(prefix)) {
diff --git a/python/src/com/jetbrains/python/testing/PythonTestCommandLineStateBase.java b/python/src/com/jetbrains/python/testing/PythonTestCommandLineStateBase.java
index 3600aba..a532152 100644
--- a/python/src/com/jetbrains/python/testing/PythonTestCommandLineStateBase.java
+++ b/python/src/com/jetbrains/python/testing/PythonTestCommandLineStateBase.java
@@ -72,10 +72,13 @@
if (isDebug()) {
final ConsoleView testsOutputConsoleView = SMTestRunnerConnectionUtil.createConsole(PythonTRunnerConsoleProperties.FRAMEWORK_NAME,
- consoleProperties,
- getEnvironment());
- final ConsoleView consoleView = new PythonDebugLanguageConsoleView(project, PythonSdkType.findSdkByPath(myConfiguration.getInterpreterPath()), testsOutputConsoleView);
+ consoleProperties,
+ getEnvironment());
+ final ConsoleView consoleView =
+ new PythonDebugLanguageConsoleView(project, PythonSdkType.findSdkByPath(myConfiguration.getInterpreterPath()),
+ testsOutputConsoleView);
consoleView.attachToProcess(processHandler);
+ addTracebackFilter(project, consoleView, processHandler);
return consoleView;
}
final ConsoleView consoleView = SMTestRunnerConnectionUtil.createAndAttachConsole(PythonTRunnerConsoleProperties.FRAMEWORK_NAME,
@@ -122,6 +125,9 @@
cmd.setWorkDirectory(script.getParent().getPath());
}
}
+ if (cmd.getWorkDirectory() == null) { // If current dir still not set, lets use project dir
+ cmd.setWorkDirectory(myConfiguration.getWorkingDirectorySafe());
+ }
}
@Override
diff --git a/python/src/com/jetbrains/python/testing/pytest/PyTestTracebackFilter.java b/python/src/com/jetbrains/python/testing/pytest/PyTestTracebackFilter.java
deleted file mode 100644
index 5da0512..0000000
--- a/python/src/com/jetbrains/python/testing/pytest/PyTestTracebackFilter.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2000-2014 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.jetbrains.python.testing.pytest;
-
-import com.intellij.execution.filters.Filter;
-import com.intellij.execution.filters.OpenFileHyperlinkInfo;
-import com.intellij.openapi.project.Project;
-import com.intellij.openapi.util.text.StringUtil;
-import com.intellij.openapi.vfs.LocalFileSystem;
-import com.intellij.openapi.vfs.VirtualFile;
-import org.jetbrains.annotations.Nullable;
-
-import java.io.File;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * User : catherine
- */
-public class PyTestTracebackFilter implements Filter {
- private final Project myProject;
- private final String myWorkingDirectory;
- private final Pattern myMatchingPattern = Pattern.compile("([^\"]+):(\\d+)");
-
- public PyTestTracebackFilter(Project project, @Nullable String workingDirectory) {
- myProject = project;
- myWorkingDirectory = workingDirectory;
- }
-
- public Result applyFilter(String line, int entireLength) {
- // C:\Progs\Crack\psidc\scummdc.py:72: AssertionError
- Matcher matcher = myMatchingPattern.matcher(line);
- if (matcher.find()) {
- String fileName = matcher.group(1).replace('\\', '/');
- int lineNumber = Integer.parseInt(matcher.group(2));
- VirtualFile vFile = LocalFileSystem.getInstance().findFileByPath(fileName);
- if (vFile == null && !StringUtil.isEmptyOrSpaces(myWorkingDirectory)) {
- vFile = LocalFileSystem.getInstance().findFileByIoFile(new File(myWorkingDirectory, fileName));
- }
-
- if (vFile != null) {
- OpenFileHyperlinkInfo hyperlink = new OpenFileHyperlinkInfo(myProject, vFile, lineNumber - 1);
- final int textStartOffset = entireLength - line.length();
- int startPos = 0;
- int endPos = line.lastIndexOf(':');
- return new Result(startPos + textStartOffset, endPos + textStartOffset, hyperlink);
- }
- }
- return null;
- }
-}
diff --git a/python/src/com/jetbrains/python/testing/pytest/PyTestTracebackParser.java b/python/src/com/jetbrains/python/testing/pytest/PyTestTracebackParser.java
new file mode 100644
index 0000000..9363a9b
--- /dev/null
+++ b/python/src/com/jetbrains/python/testing/pytest/PyTestTracebackParser.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2000-2014 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.jetbrains.python.testing.pytest;
+
+import com.jetbrains.python.traceBackParsers.LinkInTrace;
+import com.jetbrains.python.traceBackParsers.TraceBackParser;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * User : catherine
+ */
+public final class PyTestTracebackParser extends TraceBackParser {
+
+ public PyTestTracebackParser() {
+ super(Pattern.compile("([^\"]+):(\\d+)"));
+ }
+
+ @NotNull
+ @Override
+ protected LinkInTrace findLinkInTrace(@NotNull final String line, @NotNull final Matcher matchedMatcher) {
+ final String fileName = matchedMatcher.group(1).replace('\\', '/');
+ final int lineNumber = Integer.parseInt(matchedMatcher.group(2));
+ final int startPos = 0;
+ final int endPos = line.lastIndexOf(':');
+ return new LinkInTrace(fileName, lineNumber, startPos, endPos);
+ }
+}
diff --git a/python/src/com/jetbrains/python/testing/unittest/PythonUnitTestCommandLineState.java b/python/src/com/jetbrains/python/testing/unittest/PythonUnitTestCommandLineState.java
index d915180..90b0f5b 100644
--- a/python/src/com/jetbrains/python/testing/unittest/PythonUnitTestCommandLineState.java
+++ b/python/src/com/jetbrains/python/testing/unittest/PythonUnitTestCommandLineState.java
@@ -67,7 +67,8 @@
case TEST_FOLDER:
final String folderName = FileUtil.toSystemDependentName(myConfig.getFolderName() + "/");
if (!StringUtil.isEmpty(myConfig.getPattern()) && myConfig.usePattern()) {
- specs.add(folderName + ";" + myConfig.getPattern());
+ // ";" can't be used with bash, so we use "_args_separator_"
+ specs.add(folderName + "_args_separator_" + myConfig.getPattern());
}
else {
specs.add(folderName);
diff --git a/python/src/com/jetbrains/python/traceBackParsers/LinkInTrace.java b/python/src/com/jetbrains/python/traceBackParsers/LinkInTrace.java
new file mode 100644
index 0000000..f121040
--- /dev/null
+++ b/python/src/com/jetbrains/python/traceBackParsers/LinkInTrace.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2000-2015 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.jetbrains.python.traceBackParsers;
+
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Information about trace produced by {@link TraceBackParser}
+ *
+ * @author Ilya.Kazakevich
+ */
+public final class LinkInTrace {
+ @NotNull
+ private final String myFileName;
+ private final int myLineNumber;
+ private final int myStartPos;
+ private final int myEndPos;
+
+ /**
+ * @param fileName name of file this line has link to
+ * @param lineNumber number of line in file
+ * @param startPos start position of link in line
+ * @param endPos end position of link in line
+ */
+ public LinkInTrace(@NotNull final String fileName, final int lineNumber, final int startPos, final int endPos) {
+ myFileName = fileName;
+ myLineNumber = lineNumber;
+ myStartPos = startPos;
+ myEndPos = endPos;
+ }
+
+ /**
+ *
+ * @return name of file this line has link to
+ */
+ @NotNull
+ public String getFileName() {
+ return myFileName;
+ }
+
+ /**
+ *
+ * @return number of line in file
+ */
+ public int getLineNumber() {
+ return myLineNumber;
+ }
+
+ /**
+ *
+ * @return start position of link in line
+ */
+ public int getStartPos() {
+ return myStartPos;
+ }
+
+ /**
+ *
+ * @return end position of link in line
+ */
+ public int getEndPos() {
+ return myEndPos;
+ }
+}
diff --git a/python/src/com/jetbrains/python/traceBackParsers/TraceBackParser.java b/python/src/com/jetbrains/python/traceBackParsers/TraceBackParser.java
new file mode 100644
index 0000000..b5aa77e
--- /dev/null
+++ b/python/src/com/jetbrains/python/traceBackParsers/TraceBackParser.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2000-2015 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.jetbrains.python.traceBackParsers;
+
+import com.jetbrains.python.run.PyTracebackParser;
+import com.jetbrains.python.testing.pytest.PyTestTracebackParser;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Parent of all traceback filters. Extend it and your impl. to {@link #PARSERS}.
+ * When implement, provide {@link Pattern pattern}, and your code will be called only if line matches this pattern
+ *
+ * @author Ilya.Kazakevich
+ */
+public abstract class TraceBackParser {
+ @NotNull
+ private final Pattern myPattern;
+
+ /**
+ * @param pattern pattern to be used to match line.
+ */
+ protected TraceBackParser(@NotNull final Pattern pattern) {
+ myPattern = pattern;
+ }
+
+
+ @NotNull // TODO: use EP instead?
+ @SuppressWarnings("PublicStaticArrayField") // Noone will change it, anyway.
+ public static final TraceBackParser[] PARSERS = {new PyTestTracebackParser(), new PyTracebackParser()};
+
+
+ /**
+ * Searches for link in line
+ *
+ * @param line line to search link in
+ * @return line info (if found)
+ */
+ @Nullable
+ public final LinkInTrace findLinkInTrace(@NotNull final String line) {
+ final Matcher matcher = myPattern.matcher(line);
+ if (!matcher.find()) {
+ return null;
+ }
+ return findLinkInTrace(line, matcher);
+ }
+
+
+ /**
+ * Fetches link from line
+ *
+ * @param line line to search link in
+ * @param matchedMatcher regex matcher that found link
+ * @return line info
+ */
+ @NotNull
+ protected abstract LinkInTrace findLinkInTrace(@NotNull String line, @NotNull Matcher matchedMatcher);
+}
diff --git a/python/src/com/jetbrains/python/traceBackParsers/package-info.java b/python/src/com/jetbrains/python/traceBackParsers/package-info.java
new file mode 100644
index 0000000..5b2f8f3
--- /dev/null
+++ b/python/src/com/jetbrains/python/traceBackParsers/package-info.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2000-2015 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * <h1>A pack of test output parsers.</h1>
+ * <p>
+ * Each parser knows how to parse test output to fetch file links from stack traces.
+ * All parsers should extend {@link com.jetbrains.python.traceBackParsers.TraceBackParser} and be installed to
+ * {@link com.jetbrains.python.traceBackParsers.TraceBackParser#PARSERS} while this functionality has no EP.
+ * </p>
+ */
+package com.jetbrains.python.traceBackParsers;
\ No newline at end of file
diff --git a/python/testData/completion/dunderNext.after.py b/python/testData/completion/dunderNext.after.py
new file mode 100644
index 0000000..3611806
--- /dev/null
+++ b/python/testData/completion/dunderNext.after.py
@@ -0,0 +1,2 @@
+class C:
+ def __next__(self):
diff --git a/python/testData/completion/dunderNext.py b/python/testData/completion/dunderNext.py
new file mode 100644
index 0000000..2b5c2a2
--- /dev/null
+++ b/python/testData/completion/dunderNext.py
@@ -0,0 +1,2 @@
+class C:
+ def __nex<caret>
diff --git a/python/testData/completion/next.after.py b/python/testData/completion/next.after.py
new file mode 100644
index 0000000..c232fb2
--- /dev/null
+++ b/python/testData/completion/next.after.py
@@ -0,0 +1,2 @@
+class C:
+ def next(self):
diff --git a/python/testData/completion/next.py b/python/testData/completion/next.py
new file mode 100644
index 0000000..cd2bca2
--- /dev/null
+++ b/python/testData/completion/next.py
@@ -0,0 +1,2 @@
+class C:
+ def nex<caret>
diff --git a/python/testData/formatter/reformatOfSingleElementPossible_after.py b/python/testData/formatter/reformatOfSingleElementPossible_after.py
index 2528c03..8fc002b 100644
--- a/python/testData/formatter/reformatOfSingleElementPossible_after.py
+++ b/python/testData/formatter/reformatOfSingleElementPossible_after.py
@@ -1,2 +1,2 @@
x=[1,2,3]
-y = 'spam' * 2
\ No newline at end of file
+y = 'spam' * 2
diff --git a/python/testData/inspections/PyCompatibilityInspection/callExpression.py b/python/testData/inspections/PyCompatibilityInspection/callExpression.py
index 106470d..41cce70 100644
--- a/python/testData/inspections/PyCompatibilityInspection/callExpression.py
+++ b/python/testData/inspections/PyCompatibilityInspection/callExpression.py
@@ -6,7 +6,7 @@
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not have method reduce">reduce()</warning>
<warning descr="Python version 2.4 does not have method all">all()</warning>
-<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4 do not have method buffer">buffer()</warning>
+<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not have method buffer">buffer()</warning>
def foo(a,b,c):
print (a,b,c)
diff --git a/python/testData/inspections/PyUnresolvedReferencesInspection/baseStringCheck.py b/python/testData/inspections/PyUnresolvedReferencesInspection/baseStringCheck.py
new file mode 100644
index 0000000..a91281d
--- /dev/null
+++ b/python/testData/inspections/PyUnresolvedReferencesInspection/baseStringCheck.py
@@ -0,0 +1,4 @@
+def repl(s):
+ if not isinstance(s, basestring):
+ return s
+ return s.replace(s.replace('a', 'b'), s)
diff --git a/python/testData/inspections/suppress/suppressInsideInjection.py b/python/testData/inspections/suppress/suppressInsideInjection.py
deleted file mode 100644
index a81f71a..0000000
--- a/python/testData/inspections/suppress/suppressInsideInjection.py
+++ /dev/null
@@ -1,3 +0,0 @@
-# language=Python
-print "# noinspection PyUnresolvedReferences\
-print xxx"
\ No newline at end of file
diff --git a/python/testData/inspections/suppress/suppressOutsideInjection.py b/python/testData/inspections/suppress/suppressOutsideInjection.py
deleted file mode 100644
index 911cbc5..0000000
--- a/python/testData/inspections/suppress/suppressOutsideInjection.py
+++ /dev/null
@@ -1,3 +0,0 @@
-# noinspection PyUnresolvedReferences
-#language=Python
-print "print xxx"
\ No newline at end of file
diff --git a/python/testData/resolve/multiFile/keywordArgument/KeywordArgument.py b/python/testData/resolve/multiFile/keywordArgument/KeywordArgument.py
new file mode 100644
index 0000000..603adb3
--- /dev/null
+++ b/python/testData/resolve/multiFile/keywordArgument/KeywordArgument.py
@@ -0,0 +1,5 @@
+from a import A
+
+print(A())
+# <ref>
+
diff --git a/python/testData/resolve/multiFile/keywordArgument/a.py b/python/testData/resolve/multiFile/keywordArgument/a.py
new file mode 100644
index 0000000..55c335c
--- /dev/null
+++ b/python/testData/resolve/multiFile/keywordArgument/a.py
@@ -0,0 +1,9 @@
+
+class A:
+ pass
+
+def foo(A=1):
+ pass
+
+foo(A=2)
+
diff --git a/python/testData/resolve/multiFile/relativeImport/RelativeImport.py b/python/testData/resolve/multiFile/relativeImport/RelativeImport.py
new file mode 100644
index 0000000..2a53048
--- /dev/null
+++ b/python/testData/resolve/multiFile/relativeImport/RelativeImport.py
@@ -0,0 +1,4 @@
+import x
+
+print(x.z)
+# <ref>
diff --git a/python/testData/resolve/multiFile/relativeImport/x/__init__.py b/python/testData/resolve/multiFile/relativeImport/x/__init__.py
new file mode 100644
index 0000000..d7c3d7c
--- /dev/null
+++ b/python/testData/resolve/multiFile/relativeImport/x/__init__.py
@@ -0,0 +1,5 @@
+__author__ = 'ktisha'
+
+from . import z as qq
+
+print(z)
\ No newline at end of file
diff --git a/python/testData/resolve/multiFile/relativeImport/x/z.py b/python/testData/resolve/multiFile/relativeImport/x/z.py
new file mode 100644
index 0000000..ab9d8416
--- /dev/null
+++ b/python/testData/resolve/multiFile/relativeImport/x/z.py
@@ -0,0 +1,4 @@
+__author__ = 'ktisha'
+
+def foo():
+ return 1
\ No newline at end of file
diff --git a/python/testData/testRunner/env/pytest/test2.py b/python/testData/testRunner/env/pytest/test2.py
index b6c7b08..bcac55a 100644
--- a/python/testData/testRunner/env/pytest/test2.py
+++ b/python/testData/testRunner/env/pytest/test2.py
@@ -1,10 +1,15 @@
class TestPyTest:
def testOne(self):
+ print("I am test1")
assert 5 == 2*2
def testTwo(self):
assert True
+ def testFail(self):
+ print("I will fail")
+ assert False
+
def testThree():
assert 4 == 2*2
diff --git a/python/testData/testRunner/env/unit/another_file_for_pattern.py b/python/testData/testRunner/env/unit/another_file_for_pattern.py
new file mode 100644
index 0000000..665c479
--- /dev/null
+++ b/python/testData/testRunner/env/unit/another_file_for_pattern.py
@@ -0,0 +1,9 @@
+__author__ = 'Ilya.Kazakevich'
+from unittest import TestCase
+
+class UTests(TestCase):
+ def testByPattern(self):
+ pass
+
+ def testByPattern2(self):
+ pass
\ No newline at end of file
diff --git a/python/testData/testRunner/env/unit/file_for_pattern.py b/python/testData/testRunner/env/unit/file_for_pattern.py
new file mode 100644
index 0000000..6ae7d7e
--- /dev/null
+++ b/python/testData/testRunner/env/unit/file_for_pattern.py
@@ -0,0 +1,9 @@
+__author__ = 'Ilya.Kazakevich'
+from unittest import TestCase
+
+class UTests(TestCase):
+ def testByPattern(self):
+ self.assertTrue(False)
+
+ def testByPattern2(self):
+ self.assertTrue(False)
\ No newline at end of file
diff --git a/python/testData/testRunner/env/unit/reference_tests.py b/python/testData/testRunner/env/unit/reference_tests.py
new file mode 100644
index 0000000..4d803c6
--- /dev/null
+++ b/python/testData/testRunner/env/unit/reference_tests.py
@@ -0,0 +1,17 @@
+__author__ = 'Ilya.Kazakevich'
+import unittest
+
+
+class SpamTest(unittest.TestCase):
+ def test_1(self):
+ self.fail()
+
+
+class SpamTest2(unittest.TestCase):
+ def test_2(self):
+ assert False
+
+
+class SpamTest3(unittest.TestCase):
+ def test_3(self):
+ print('File "reference_tests.py", line 17') # Lets try if relative path works
diff --git a/python/testSrc/com/jetbrains/env/PyEnvTestCase.java b/python/testSrc/com/jetbrains/env/PyEnvTestCase.java
index 4907b1e..fc9f8dc 100644
--- a/python/testSrc/com/jetbrains/env/PyEnvTestCase.java
+++ b/python/testSrc/com/jetbrains/env/PyEnvTestCase.java
@@ -125,18 +125,30 @@
List<String> roots = getPythonRoots();
- if (roots.size() == 0) {
- String msg = testName +
- ": environments are not defined. Skipping. \nSpecify either " +
- PYCHARM_PYTHON_ENVS +
- " or " +
- PYCHARM_PYTHON_VIRTUAL_ENVS +
- " environment variable.";
- LOG.warn(msg);
- System.out.println(msg);
- return;
- }
-
+ /**
+ * <p>
+ * {@link org.junit.AssumptionViolatedException} here means this test must be <strong>skipped</strong>.
+ * TeamCity supports this (if not you should create and issue about that).
+ * Idea does not support it for JUnit 3, while JUnit 4 must be supported.
+ * </p>
+ *<p>
+ * It this error brakes your test, please <strong>do not</strong> revert. Instead, do the following:
+ * <ol>
+ * <li>Make sure {@link com.jetbrains.env.python} tests are <strong>excluded</strong> from your configuration (unless you are
+ * PyCharm developer)</li>
+ * <li>Check that your environment supports {@link AssumptionViolatedException}.
+ * JUnit 4 was created about 10 years ago, so fixing environment is much better approach than hacky "return;" here.
+ * </li>
+ * </ol>
+ *</p>
+ */
+ Assume.assumeFalse(testName +
+ ": environments are not defined. Skipping. \nSpecify either " +
+ PYCHARM_PYTHON_ENVS +
+ " or " +
+ PYCHARM_PYTHON_VIRTUAL_ENVS +
+ " environment variable.",
+ roots.isEmpty());
doRunTests(testTask, testName, roots);
}
@@ -179,7 +191,8 @@
for (File f : virtualenvs) {
result.add(f.getAbsolutePath());
}
- } else {
+ }
+ else {
LOG.error(root + " is not a directory of doesn't exist");
}
}
diff --git a/python/testSrc/com/jetbrains/env/python/testing/PythonPyTestingTest.java b/python/testSrc/com/jetbrains/env/python/testing/PythonPyTestingTest.java
index ab3dee6..8a0c0ef 100644
--- a/python/testSrc/com/jetbrains/env/python/testing/PythonPyTestingTest.java
+++ b/python/testSrc/com/jetbrains/env/python/testing/PythonPyTestingTest.java
@@ -1,12 +1,15 @@
package com.jetbrains.env.python.testing;
+import com.intellij.execution.testframework.sm.runner.ui.MockPrinter;
import com.jetbrains.env.PyEnvTestCase;
import com.jetbrains.env.ut.PyTestTestTask;
+import org.hamcrest.Matchers;
+import org.junit.Assert;
/**
* User : catherine
*/
-public class PythonPyTestingTest extends PyEnvTestCase{
+public class PythonPyTestingTest extends PyEnvTestCase {
public void testPytestRunner() {
runPythonTest(new PyTestTestTask("/testRunner/env/pytest", "test1.py") {
@@ -24,9 +27,15 @@
@Override
public void after() {
- assertEquals(8, allTestsCount());
+ assertEquals(9, allTestsCount());
assertEquals(5, passedTestsCount());
- assertEquals(3, failedTestsCount());
+ assertEquals(4, failedTestsCount());
+ Assert
+ .assertThat("No test stdout", MockPrinter.fillPrinter(findTestByName("testOne")).getStdOut(), Matchers.startsWith("I am test1"));
+
+ // Ensure test has stdout even it fails
+ Assert.assertThat("No stdout for fail", MockPrinter.fillPrinter(findTestByName("testFail")).getStdOut(),
+ Matchers.startsWith("I will fail"));
}
});
}
diff --git a/python/testSrc/com/jetbrains/env/python/testing/PythonUnitTestingTest.java b/python/testSrc/com/jetbrains/env/python/testing/PythonUnitTestingTest.java
index 682eb81..9dbc062 100644
--- a/python/testSrc/com/jetbrains/env/python/testing/PythonUnitTestingTest.java
+++ b/python/testSrc/com/jetbrains/env/python/testing/PythonUnitTestingTest.java
@@ -1,13 +1,17 @@
package com.jetbrains.env.python.testing;
import com.jetbrains.env.PyEnvTestCase;
+import com.jetbrains.env.ut.PyTestTestTask;
import com.jetbrains.env.ut.PyUnitTestTask;
-import junit.framework.Assert;
+import org.hamcrest.Matchers;
+import org.junit.Assert;
+
+import java.util.List;
/**
* @author traff
*/
-public class PythonUnitTestingTest extends PyEnvTestCase{
+public class PythonUnitTestingTest extends PyEnvTestCase {
public void testUTRunner() {
runPythonTest(new PyUnitTestTask("/testRunner/env/unit", "test1.py") {
@@ -32,6 +36,21 @@
});
}
+ /**
+ * Ensures pattern is supported
+ */
+ public void testUTRunnerByPattern() {
+ runPythonTest(new PyUnitTestTask("/testRunner/env/unit", "_args_separator_*pattern.py") {
+
+ @Override
+ public void after() {
+ assertEquals(4, allTestsCount());
+ assertEquals(2, passedTestsCount());
+ assertEquals(2, failedTestsCount());
+ }
+ });
+ }
+
public void testClass() {
runPythonTest(new PyUnitTestTask("/testRunner/env/unit", "test_file.py::GoodTest") {
@@ -65,6 +84,44 @@
});
}
+ /**
+ * Ensures file references are highlighted for python traceback
+ */
+ public void testUnitTestFileReferences() {
+ final String fileName = "reference_tests.py";
+ runPythonTest(new PyUnitTestTask("/testRunner/env/unit", fileName) {
+
+ @Override
+ public void after() {
+ final List<String> fileNames = getHighlightedStrings().second;
+ Assert.assertThat("Wrong number of highlighted entries", fileNames, Matchers.hasSize(3));
+ // UnitTest highlights file name
+ Assert.assertThat("Bad line highlighted", fileNames, Matchers.everyItem(Matchers.endsWith(fileName)));
+ }
+ });
+ }
+
+ /**
+ * Ensures file references are highlighted for pytest traceback
+ */
+ public void testPyTestFileReferences() {
+ final String fileName = "reference_tests.py";
+ runPythonTest(new PyTestTestTask("/testRunner/env/unit", fileName) {
+
+ @Override
+ public void after() {
+ final List<String> fileNames = getHighlightedStrings().second;
+ Assert.assertThat("No lines highlighted", fileNames, Matchers.not(Matchers.empty()));
+ // PyTest highlights file:line_number
+ Assert.assertThat("Bad line highlighted", fileNames, Matchers.everyItem(Matchers.anyOf(Matchers.endsWith("reference_tests.py:13"),
+ Matchers.endsWith("reference_tests.py:7"),
+ Matchers.endsWith("reference_tests.py"),
+ Matchers.endsWith("reference_tests.py:12"))));
+ }
+ });
+ }
+
+
public void testDependent() {
runPythonTest(new PyUnitTestTask("/testRunner/env/unit", "dependentTests/test_my_class.py") {
diff --git a/python/testSrc/com/jetbrains/env/ut/PyUnitTestTask.java b/python/testSrc/com/jetbrains/env/ut/PyUnitTestTask.java
index 2615c75a..e662b60 100644
--- a/python/testSrc/com/jetbrains/env/ut/PyUnitTestTask.java
+++ b/python/testSrc/com/jetbrains/env/ut/PyUnitTestTask.java
@@ -7,22 +7,30 @@
import com.intellij.execution.configurations.ConfigurationFactory;
import com.intellij.execution.configurations.RunConfiguration;
import com.intellij.execution.executors.DefaultRunExecutor;
+import com.intellij.execution.impl.ConsoleViewImpl;
import com.intellij.execution.process.ProcessAdapter;
import com.intellij.execution.process.ProcessEvent;
import com.intellij.execution.process.ProcessHandler;
import com.intellij.execution.runners.ExecutionEnvironment;
import com.intellij.execution.runners.ExecutionEnvironmentBuilder;
import com.intellij.execution.runners.ProgramRunner;
+import com.intellij.execution.testframework.AbstractTestProxy;
import com.intellij.execution.testframework.Filter;
import com.intellij.execution.testframework.sm.runner.SMTestProxy;
import com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView;
import com.intellij.execution.testframework.sm.runner.ui.TestResultsViewer;
+import com.intellij.execution.ui.ConsoleView;
import com.intellij.execution.ui.RunContentDescriptor;
import com.intellij.openapi.application.Result;
import com.intellij.openapi.application.WriteAction;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.ex.RangeHighlighterEx;
+import com.intellij.openapi.editor.markup.RangeHighlighter;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.io.FileUtilRt;
import com.intellij.util.Processor;
@@ -40,6 +48,8 @@
import org.junit.Assert;
import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
/**
* Tasks to run unit test configurations.
@@ -190,7 +200,7 @@
* Run configuration.
*
* @param settings settings (if have any, null otherwise)
- * @param config configuration to run
+ * @param config configuration to run
* @throws Exception
*/
protected void runConfiguration(@Nullable final RunnerAndConfigurationSettings settings,
@@ -271,6 +281,41 @@
Assert.assertEquals(output(), 0, failedTestsCount());
}
+ /**
+ * Searches for test by its name recursevly in {@link #myTestProxy}
+ *
+ * @param testName test name to find
+ * @return test
+ * @throws AssertionError if no test found
+ */
+ @NotNull
+ public AbstractTestProxy findTestByName(@NotNull final String testName) {
+ final AbstractTestProxy test = findTestByName(testName, myTestProxy);
+ assert test != null : "No test found with name" + testName;
+ return test;
+ }
+
+ /**
+ * Searches for test by its name recursevly in test, passed as arumuent.
+ *
+ * @param testName test name to find
+ * @param test root test
+ * @return test or null if not found
+ */
+ @Nullable
+ private static AbstractTestProxy findTestByName(@NotNull final String testName, @NotNull final AbstractTestProxy test) {
+ if (test.getName().equals(testName)) {
+ return test;
+ }
+ for (final AbstractTestProxy testProxy : test.getChildren()) {
+ final AbstractTestProxy result = findTestByName(testName, testProxy);
+ if (result != null) {
+ return result;
+ }
+ }
+ return null;
+ }
+
public int failedTestsCount() {
return myTestProxy.collectChildren(NOT_SUIT.and(Filter.FAILED_OR_INTERRUPTED)).size();
}
@@ -279,6 +324,38 @@
return myTestProxy.collectChildren(NOT_SUIT.and(Filter.PASSED)).size();
}
+ /**
+ * Gets highlighted information from test console. Some parts of output (like file links) may be highlighted, and you need to check them.
+ *
+ * @return pair of [[ranges], [texts]] where range is [from,to] in doc. for each region, and "text" is text extracted from this region.
+ * For example assume that in document "spam eggs ham" words "ham" and "spam" are highlighted.
+ * You should have 2 ranges (0, 4) and (10, 13) and 2 strings (spam and ham)
+ */
+ @NotNull
+ public final Pair<List<Pair<Integer, Integer>>, List<String>> getHighlightedStrings() {
+ final ConsoleView console = myConsoleView.getConsole();
+ assert console instanceof ConsoleViewImpl : "Console has no editor!";
+ final Editor editor = ((ConsoleViewImpl)console).getEditor();
+ final List<String> resultStrings = new ArrayList<String>();
+ final List<Pair<Integer, Integer>> resultRanges = new ArrayList<Pair<Integer, Integer>>();
+ UIUtil.invokeAndWaitIfNeeded(new Runnable() {
+ @Override
+ public void run() {
+ for (final RangeHighlighter highlighter : editor.getMarkupModel().getAllHighlighters()) {
+ if (highlighter instanceof RangeHighlighterEx) {
+ final int start = ((RangeHighlighterEx)highlighter).getAffectedAreaStartOffset();
+ final int end = ((RangeHighlighterEx)highlighter).getAffectedAreaEndOffset();
+ resultRanges.add(Pair.create(start, end));
+ resultStrings.add(editor.getDocument().getText().substring(start, end));
+ }
+ }
+ }
+ });
+ final String message = String.format("Following output is searched for hightlighed strings: %s \n", editor.getDocument().getText());
+ Logger.getInstance(getClass()).warn(message);
+ return Pair.create(resultRanges, resultStrings);
+ }
+
public void assertFinished() {
Assert.assertTrue("State is " + myTestProxy.getMagnitudeInfo().getTitle() + "\n" + output(),
myTestProxy.wasLaunched() && !myTestProxy.wasTerminated());
diff --git a/python/testSrc/com/jetbrains/python/Py3CompletionTest.java b/python/testSrc/com/jetbrains/python/Py3CompletionTest.java
index ea154cb..dfeb8c0 100644
--- a/python/testSrc/com/jetbrains/python/Py3CompletionTest.java
+++ b/python/testSrc/com/jetbrains/python/Py3CompletionTest.java
@@ -151,4 +151,9 @@
}
});
}
+
+ // PY-11214
+ public void testDunderNext() {
+ doTest();
+ }
}
diff --git a/python/testSrc/com/jetbrains/python/PyMultiFileResolveTest.java b/python/testSrc/com/jetbrains/python/PyMultiFileResolveTest.java
index 244be95..97060e8 100644
--- a/python/testSrc/com/jetbrains/python/PyMultiFileResolveTest.java
+++ b/python/testSrc/com/jetbrains/python/PyMultiFileResolveTest.java
@@ -15,7 +15,9 @@
*/
package com.jetbrains.python;
+import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.*;
+import com.intellij.psi.impl.source.PsiFileImpl;
import com.jetbrains.python.fixtures.PyMultiFileResolveTestCase;
import com.jetbrains.python.fixtures.PyTestCase;
import com.jetbrains.python.psi.*;
@@ -383,4 +385,26 @@
}
});
}
+
+ public void testKeywordArgument() {
+ final PsiFile file = prepareFile();
+ final PsiManager psiManager = myFixture.getPsiManager();
+ final VirtualFile dir = myFixture.findFileInTempDir("a.py");
+ final PsiFile psiFile = psiManager.findFile(dir);
+ //noinspection ConstantConditions we need to unstub a.py here
+ ((PsiFileImpl)psiFile).calcTreeElement();
+ final PsiElement element;
+ try {
+ element = doResolve(file);
+ }
+ catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ assertResolveResult(element, PyClass.class, "A");
+ }
+
+ public void testRelativeImport() {
+ assertResolvesTo(PyFile.class, "z.py");
+ }
+
}
\ No newline at end of file
diff --git a/python/testSrc/com/jetbrains/python/PyRegexpTest.java b/python/testSrc/com/jetbrains/python/PyRegexpTest.java
index cce3941..0ca3d79 100644
--- a/python/testSrc/com/jetbrains/python/PyRegexpTest.java
+++ b/python/testSrc/com/jetbrains/python/PyRegexpTest.java
@@ -17,9 +17,13 @@
import com.intellij.lang.injection.InjectedLanguageManager;
import com.intellij.lexer.Lexer;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiLanguageInjectionHost;
import com.jetbrains.python.codeInsight.regexp.PythonRegexpParserDefinition;
import com.jetbrains.python.codeInsight.regexp.PythonVerboseRegexpParserDefinition;
@@ -157,7 +161,7 @@
private void doTestInjectedText(@NotNull String text, @NotNull String expected) {
myFixture.configureByText(PythonFileType.INSTANCE, text);
final InjectedLanguageManager languageManager = InjectedLanguageManager.getInstance(myFixture.getProject());
- final PsiLanguageInjectionHost host = languageManager.getInjectionHost(myFixture.getElementAtCaret());
+ final PsiLanguageInjectionHost host = languageManager.getInjectionHost(getElementAtCaret());
assertNotNull(host);
final List<Pair<PsiElement, TextRange>> files = languageManager.getInjectedPsiFiles(host);
assertNotNull(files);
@@ -166,6 +170,17 @@
assertEquals(expected, injected.getText());
}
+ @NotNull
+ private PsiElement getElementAtCaret() {
+ final Editor editor = myFixture.getEditor();
+ final Document document = editor.getDocument();
+ final PsiFile file = PsiDocumentManager.getInstance(myFixture.getProject()).getPsiFile(document);
+ assertNotNull(file);
+ final PsiElement element = file.findElementAt(myFixture.getCaretOffset());
+ assertNotNull(element);
+ return element;
+ }
+
private void doTestHighlighting() {
myFixture.testHighlighting(true, false, true, "regexp/" + getTestName(true) + ".py");
}
diff --git a/python/testSrc/com/jetbrains/python/PySuppressInspectionsTest.java b/python/testSrc/com/jetbrains/python/PySuppressInspectionsTest.java
index 0a049b9..1eab5f2 100644
--- a/python/testSrc/com/jetbrains/python/PySuppressInspectionsTest.java
+++ b/python/testSrc/com/jetbrains/python/PySuppressInspectionsTest.java
@@ -18,11 +18,14 @@
import com.intellij.codeInsight.intention.IntentionAction;
import com.jetbrains.python.fixtures.PyTestCase;
import com.jetbrains.python.inspections.PyInspection;
-import com.jetbrains.python.inspections.PyUnusedLocalInspection;
import com.jetbrains.python.inspections.unresolvedReference.PyUnresolvedReferencesInspection;
+import com.jetbrains.python.inspections.PyUnusedLocalInspection;
import java.util.List;
+/**
+ * @author yole
+ */
public class PySuppressInspectionsTest extends PyTestCase {
public void testSuppressedForStatement() {
doTestHighlighting(PyUnresolvedReferencesInspection.class);
@@ -43,15 +46,7 @@
public void testSuppressForImport() { // PY-2240
doTestHighlighting(PyUnresolvedReferencesInspection.class);
}
-
- public void testSuppressInsideInjection() {
- doTestHighlighting(PyUnresolvedReferencesInspection.class);
- }
- public void testSuppressOutsideInjection() {
- doTestHighlighting(PyUnresolvedReferencesInspection.class);
- }
-
private void doTestHighlighting(final Class<? extends PyInspection> inspectionClass) {
myFixture.configureByFile("inspections/suppress/" + getTestName(true) + ".py");
myFixture.enableInspections(inspectionClass);
diff --git a/python/testSrc/com/jetbrains/python/PyTypingTest.java b/python/testSrc/com/jetbrains/python/PyTypingTest.java
index 6ac1fdf..b6126e9 100644
--- a/python/testSrc/com/jetbrains/python/PyTypingTest.java
+++ b/python/testSrc/com/jetbrains/python/PyTypingTest.java
@@ -15,6 +15,15 @@
*/
package com.jetbrains.python;
+import com.intellij.lang.injection.InjectedLanguageManager;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiLanguageInjectionHost;
import com.intellij.testFramework.LightProjectDescriptor;
import com.jetbrains.python.documentation.PythonDocumentationProvider;
import com.jetbrains.python.fixtures.PyTestCase;
@@ -25,6 +34,8 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import java.util.List;
+
/**
* Tests for a type system based on mypy's typing module.
*
@@ -306,6 +317,59 @@
" pass\n");
}
+ public void testStringLiteralInjection() {
+ doTestInjectedText("class C:\n" +
+ " def foo(self, expr: '<caret>C'):\n" +
+ " pass\n",
+ "C");
+ }
+
+ public void testStringLiteralInjectionParameterizedType() {
+ doTestInjectedText("from typing import Union, List\n" +
+ "\n" +
+ "class C:\n" +
+ " def foo(self, expr: '<caret>Union[List[C], C]'):\n" +
+ " pass\n",
+ "Union[List[C], C]");
+ }
+
+ // PY-15810
+ public void testNoStringLiteralInjectionForNonTypingStrings() {
+ doTestNoInjectedText("class C:\n" +
+ " def foo(self, expr: '<caret>foo bar'):\n" +
+ " pass\n");
+ }
+
+ private void doTestNoInjectedText(@NotNull String text) {
+ myFixture.configureByText(PythonFileType.INSTANCE, text);
+ final InjectedLanguageManager languageManager = InjectedLanguageManager.getInstance(myFixture.getProject());
+ final PsiLanguageInjectionHost host = languageManager.getInjectionHost(getElementAtCaret());
+ assertNull(host);
+ }
+
+ private void doTestInjectedText(@NotNull String text, @NotNull String expected) {
+ myFixture.configureByText(PythonFileType.INSTANCE, text);
+ final InjectedLanguageManager languageManager = InjectedLanguageManager.getInstance(myFixture.getProject());
+ final PsiLanguageInjectionHost host = languageManager.getInjectionHost(getElementAtCaret());
+ assertNotNull(host);
+ final List<Pair<PsiElement, TextRange>> files = languageManager.getInjectedPsiFiles(host);
+ assertNotNull(files);
+ assertFalse(files.isEmpty());
+ final PsiElement injected = files.get(0).getFirst();
+ assertEquals(expected, injected.getText());
+ }
+
+ @NotNull
+ private PsiElement getElementAtCaret() {
+ final Editor editor = myFixture.getEditor();
+ final Document document = editor.getDocument();
+ final PsiFile file = PsiDocumentManager.getInstance(myFixture.getProject()).getPsiFile(document);
+ assertNotNull(file);
+ final PsiElement element = file.findElementAt(myFixture.getCaretOffset());
+ assertNotNull(element);
+ return element;
+ }
+
private void doTest(@NotNull String expectedType, @NotNull String text) {
myFixture.copyDirectoryToProject("typing", "");
myFixture.configureByText(PythonFileType.INSTANCE, text);
diff --git a/python/testSrc/com/jetbrains/python/PythonCompletionTest.java b/python/testSrc/com/jetbrains/python/PythonCompletionTest.java
index fe379fe..288384e 100644
--- a/python/testSrc/com/jetbrains/python/PythonCompletionTest.java
+++ b/python/testSrc/com/jetbrains/python/PythonCompletionTest.java
@@ -770,4 +770,9 @@
public void testStructuralType() {
doTest();
}
+
+ // PY-11214
+ public void testNext() {
+ doTest();
+ }
}
diff --git a/python/testSrc/com/jetbrains/python/fixtures/PyMultiFileResolveTestCase.java b/python/testSrc/com/jetbrains/python/fixtures/PyMultiFileResolveTestCase.java
index 22b4e54..e327980 100644
--- a/python/testSrc/com/jetbrains/python/fixtures/PyMultiFileResolveTestCase.java
+++ b/python/testSrc/com/jetbrains/python/fixtures/PyMultiFileResolveTestCase.java
@@ -60,7 +60,7 @@
PsiDocumentManager.getInstance(myFixture.getProject()).commitAllDocuments();
}
- private PsiFile prepareFile() {
+ protected PsiFile prepareFile() {
prepareTestDirectory();
VirtualFile sourceFile = null;
for (String ext : new String[]{".py", ".pyx"}) {
diff --git a/python/testSrc/com/jetbrains/python/fixtures/PyTestCase.java b/python/testSrc/com/jetbrains/python/fixtures/PyTestCase.java
index 0e6c77e..e311f36 100644
--- a/python/testSrc/com/jetbrains/python/fixtures/PyTestCase.java
+++ b/python/testSrc/com/jetbrains/python/fixtures/PyTestCase.java
@@ -49,10 +49,7 @@
import com.intellij.testFramework.PlatformTestCase;
import com.intellij.testFramework.TestDataPath;
import com.intellij.testFramework.UsefulTestCase;
-import com.intellij.testFramework.fixtures.CodeInsightTestFixture;
-import com.intellij.testFramework.fixtures.IdeaProjectTestFixture;
-import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory;
-import com.intellij.testFramework.fixtures.TestFixtureBuilder;
+import com.intellij.testFramework.fixtures.*;
import com.intellij.testFramework.fixtures.impl.LightTempDirTestFixtureImpl;
import com.intellij.usageView.UsageInfo;
import com.intellij.usages.Usage;
@@ -124,12 +121,20 @@
TestFixtureBuilder<IdeaProjectTestFixture> fixtureBuilder = factory.createLightFixtureBuilder(getProjectDescriptor());
final IdeaProjectTestFixture fixture = fixtureBuilder.getFixture();
myFixture = IdeaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(fixture,
- new LightTempDirTestFixtureImpl(true));
+ createTempDirFixture());
myFixture.setUp();
myFixture.setTestDataPath(getTestDataPath());
}
+ /**
+ * @return fixture to be used as temporary dir.
+ */
+ @NotNull
+ protected TempDirTestFixture createTempDirFixture() {
+ return new LightTempDirTestFixtureImpl(true); // "tmp://" dir by default
+ }
+
protected String getTestDataPath() {
return PythonTestUtil.getTestDataPath();
}
diff --git a/python/testSrc/com/jetbrains/python/inspections/PyUnresolvedReferencesInspectionTest.java b/python/testSrc/com/jetbrains/python/inspections/PyUnresolvedReferencesInspectionTest.java
index 5981c6b..1499084 100644
--- a/python/testSrc/com/jetbrains/python/inspections/PyUnresolvedReferencesInspectionTest.java
+++ b/python/testSrc/com/jetbrains/python/inspections/PyUnresolvedReferencesInspectionTest.java
@@ -505,6 +505,11 @@
doTest();
}
+ // PY-11541
+ public void testBaseStringCheck() {
+ doTest();
+ }
+
@NotNull
@Override
protected Class<? extends PyInspection> getInspectionClass() {
diff --git a/python/testSrc/com/jetbrains/python/run/PyTracebackParserTest.java b/python/testSrc/com/jetbrains/python/run/PyTracebackParserTest.java
new file mode 100644
index 0000000..6d56531
--- /dev/null
+++ b/python/testSrc/com/jetbrains/python/run/PyTracebackParserTest.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2000-2015 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.jetbrains.python.run;
+
+import com.jetbrains.python.traceBackParsers.LinkInTrace;
+import junit.framework.TestCase;
+import org.junit.Assert;
+
+/**
+ * Ensures we can parse python traces for links
+ *
+ * @author Ilya.Kazakevich
+ */
+public class PyTracebackParserTest extends TestCase {
+
+
+ /**
+ * Ensures we find link in stack trace
+ */
+ public void testLineWithLink() throws Exception {
+ final LinkInTrace linkInTrace = new PyTracebackParser().findLinkInTrace("File \"foo/bar.py\", line 42 failed");
+ Assert.assertNotNull("Failed to parse line", linkInTrace);
+ Assert.assertEquals("Bad file name", "foo/bar.py", linkInTrace.getFileName());
+ Assert.assertEquals("Bad line number", 42, linkInTrace.getLineNumber());
+ Assert.assertEquals("Bad start pos", 6, linkInTrace.getStartPos());
+ Assert.assertEquals("Bad end pos", 16, linkInTrace.getEndPos());
+ }
+
+ /**
+ * lines with out of file references should not have links
+ */
+ public void testLineNoLink() throws Exception {
+ Assert.assertNull("File with no lines should not work", new PyTracebackParser().findLinkInTrace("File \"foo/bar.py\""));
+ Assert.assertNull("No file name provided, but link found", new PyTracebackParser().findLinkInTrace("line 42 failed"));
+ }
+}
diff --git a/python/testSrc/com/jetbrains/python/testing/pytest/PyTestTracebackParserTest.java b/python/testSrc/com/jetbrains/python/testing/pytest/PyTestTracebackParserTest.java
new file mode 100644
index 0000000..1dd8847
--- /dev/null
+++ b/python/testSrc/com/jetbrains/python/testing/pytest/PyTestTracebackParserTest.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2000-2015 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.jetbrains.python.testing.pytest;
+
+import com.jetbrains.python.traceBackParsers.LinkInTrace;
+import junit.framework.TestCase;
+import org.junit.Assert;
+
+/**
+ * Ensures we can parse pytest traces for links
+ *
+ * @author Ilya.Kazakevich
+ */
+public final class PyTestTracebackParserTest extends TestCase {
+
+
+ /**
+ * Ensures we find link in stack trace
+ */
+ public void testLineWithLink() throws Exception {
+ final LinkInTrace linkInTrace = new PyTestTracebackParser().findLinkInTrace("foo/bar.py:42 file ");
+ Assert.assertNotNull("Failed to parse line", linkInTrace);
+ Assert.assertEquals("Bad file name", "foo/bar.py", linkInTrace.getFileName());
+ Assert.assertEquals("Bad line number", 42, linkInTrace.getLineNumber());
+ Assert.assertEquals("Bad start pos", 0, linkInTrace.getStartPos());
+ Assert.assertEquals("Bad end pos", 10, linkInTrace.getEndPos());
+ }
+
+ /**
+ * lines with out of file references should not have links
+ */
+ public void testLineNoLink() throws Exception {
+ Assert.assertNull("File with no lines should not work", new PyTestTracebackParser().findLinkInTrace("foo/bar.py file "));
+ Assert.assertNull("No file name provided, but link found", new PyTestTracebackParser().findLinkInTrace(":12 file "));
+ }
+}
diff --git a/resources/src/META-INF/IdeaPlugin.xml b/resources/src/META-INF/IdeaPlugin.xml
index 42045ae..a9748e9 100644
--- a/resources/src/META-INF/IdeaPlugin.xml
+++ b/resources/src/META-INF/IdeaPlugin.xml
@@ -1257,7 +1257,9 @@
<projectService serviceInterface="com.intellij.ide.todo.nodes.TodoTreeHelper"
serviceImplementation="com.intellij.ide.todo.nodes.TodoJavaTreeHelper"/>
+ <createFromTemplateHandler implementation="com.intellij.ide.fileTemplates.JavaInternalTemplatesHandler"/>
<createFromTemplateHandler implementation="com.intellij.ide.fileTemplates.JavaCreateFromTemplateHandler"/>
+
<defaultTemplatePropertiesProvider implementation="com.intellij.ide.fileTemplates.TemplatePackagePropertyProvider"/>
<favoriteNodeProvider implementation="com.intellij.ide.favoritesTreeView.PsiClassFavoriteNodeProvider"/>
<favoriteNodeProvider implementation="com.intellij.ide.favoritesTreeView.PsiFieldFavoriteNodeProvider"/>
diff --git a/xml/impl/src/com/intellij/codeInsight/editorActions/XmlTagNameSynchronizer.java b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlTagNameSynchronizer.java
index 73f2f8b..ae96a2b 100644
--- a/xml/impl/src/com/intellij/codeInsight/editorActions/XmlTagNameSynchronizer.java
+++ b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlTagNameSynchronizer.java
@@ -22,6 +22,7 @@
import com.intellij.codeInspection.htmlInspections.RenameTagBeginOrEndIntentionAction;
import com.intellij.lang.Language;
import com.intellij.lang.html.HTMLLanguage;
+import com.intellij.lang.injection.InjectedLanguageManager;
import com.intellij.lang.xhtml.XHTMLLanguage;
import com.intellij.lang.xml.XMLLanguage;
import com.intellij.openapi.Disposable;
@@ -238,7 +239,7 @@
if (myMarkers.isEmpty()) return;
boolean fitsInMarker = fitsInMarker(offset, oldLength);
- if (!fitsInMarker) {
+ if (!fitsInMarker || myMarkers.size() != myEditor.getCaretModel().getCaretCount()) {
clearMarkers();
beforeDocumentChange(event);
}
@@ -339,9 +340,9 @@
if (support == null) return null;
- int diff = offset - element.getTextRange().getStartOffset();
final TextRange range = support.getTextRange();
- return range != null ? document.createRangeMarker(range.getStartOffset() + diff, range.getEndOffset() + diff, true) : null;
+ TextRange realRange = InjectedLanguageManager.getInstance(file.getProject()).injectedToHost(element.getContainingFile(), range);
+ return document.createRangeMarker(realRange.getStartOffset(), realRange.getEndOffset(), true);
}
private static PsiElement findSupportElement(PsiElement element) {
diff --git a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/GenerationNode.java b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/GenerationNode.java
index be96959..1c3a859 100644
--- a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/GenerationNode.java
+++ b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/GenerationNode.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -285,7 +285,12 @@
final XmlFile xmlFile = token.getFile();
PsiFileFactory fileFactory = PsiFileFactory.getInstance(xmlFile.getProject());
- XmlFile dummyFile = (XmlFile)fileFactory.createFileFromText("dummy.html", HTMLLanguage.INSTANCE, xmlFile.getText(), false, true);
+ String text = xmlFile.getText();
+ final PsiElement context = callback.getFile().getContext();
+ if (context != null && context.getText().startsWith("\"")) {
+ text = text.replace('"', '\'');
+ }
+ XmlFile dummyFile = (XmlFile)fileFactory.createFileFromText("dummy.html", HTMLLanguage.INSTANCE, text, false, true);
final XmlTag tag = dummyFile.getRootTag();
if (tag != null) {
@@ -324,7 +329,7 @@
}
private static String prepareVariableName(@NotNull String attributeName) {
- char[] toReplace = {'-', '+', ':'};
+ char[] toReplace = {'$', '-', '+', ':'};
StringBuilder builder = new StringBuilder(attributeName.length());
for (int i = 0; i < attributeName.length(); i++) {
char c = attributeName.charAt(i);
@@ -491,7 +496,7 @@
for (XmlAttribute xmlAttribute : tag.getAttributes()) {
final String attributeName = xmlAttribute.getName();
final XmlAttributeValue xmlAttributeValueElement = xmlAttribute.getValueElement();
- if (xmlAttributeValueElement != null && !attributes.containsKey(attributeName)) {
+ if ((xmlAttributeValueElement != null && !attributes.containsKey(attributeName)) || !ZenCodingUtil.isXML11ValidQName(attributeName)) {
continue;
}
diff --git a/xml/impl/src/com/intellij/ide/browsers/impl/WebBrowserServiceImpl.java b/xml/impl/src/com/intellij/ide/browsers/impl/WebBrowserServiceImpl.java
index 6cd24659..097a1d1 100644
--- a/xml/impl/src/com/intellij/ide/browsers/impl/WebBrowserServiceImpl.java
+++ b/xml/impl/src/com/intellij/ide/browsers/impl/WebBrowserServiceImpl.java
@@ -48,7 +48,7 @@
VirtualFile file = request.getVirtualFile();
return file instanceof LightVirtualFile || !request.getFile().getViewProvider().isPhysical()
? Collections.<Url>emptyList()
- : Collections.singleton(Urls.newFromVirtualFile(file));
+ : Collections.singletonList(Urls.newFromVirtualFile(file));
}
@NotNull
diff --git a/xml/impl/src/com/intellij/javaee/HtmlLanguageLevelForm.form b/xml/impl/src/com/intellij/javaee/DefaultSchemasConfigurable.form
similarity index 60%
rename from xml/impl/src/com/intellij/javaee/HtmlLanguageLevelForm.form
rename to xml/impl/src/com/intellij/javaee/DefaultSchemasConfigurable.form
index 60ecb1c..50f06f6 100644
--- a/xml/impl/src/com/intellij/javaee/HtmlLanguageLevelForm.form
+++ b/xml/impl/src/com/intellij/javaee/DefaultSchemasConfigurable.form
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.javaee.HtmlLanguageLevelForm">
- <grid id="27dc6" binding="myContentPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.javaee.DefaultSchemasConfigurable">
+ <grid id="27dc6" binding="myContentPanel" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
- <xy x="20" y="20" width="326" height="138"/>
+ <xy x="20" y="20" width="326" height="210"/>
</constraints>
<properties/>
<border type="none"/>
@@ -63,6 +63,45 @@
</grid>
</children>
</grid>
+ <grid id="8cca" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+ <margin top="0" left="0" bottom="0" right="0"/>
+ <constraints>
+ <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties/>
+ <clientProperties>
+ <BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/>
+ </clientProperties>
+ <border type="none" title="XML Schema version"/>
+ <children>
+ <component id="170a5" class="com.intellij.ui.components.JBRadioButton" binding="myXMLSchema10JBRadioButton" default-binding="true">
+ <constraints>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="XML Schema 1.0"/>
+ </properties>
+ </component>
+ <hspacer id="20064">
+ <constraints>
+ <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+ </constraints>
+ </hspacer>
+ <component id="5f537" class="com.intellij.ui.components.JBRadioButton" binding="myXMLSchema11JBRadioButton" default-binding="true">
+ <constraints>
+ <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="XML Schema 1.1"/>
+ </properties>
+ </component>
+ </children>
+ </grid>
+ <vspacer id="4a76a">
+ <constraints>
+ <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
+ </constraints>
+ </vspacer>
</children>
</grid>
<buttonGroups>
@@ -71,5 +110,9 @@
<member id="bb372"/>
<member id="192c4"/>
</group>
+ <group name="XMLSchemaGroup">
+ <member id="170a5"/>
+ <member id="5f537"/>
+ </group>
</buttonGroups>
</form>
diff --git a/xml/impl/src/com/intellij/javaee/DefaultSchemasConfigurable.java b/xml/impl/src/com/intellij/javaee/DefaultSchemasConfigurable.java
new file mode 100644
index 0000000..e1ad2d7
--- /dev/null
+++ b/xml/impl/src/com/intellij/javaee/DefaultSchemasConfigurable.java
@@ -0,0 +1,149 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.javaee;
+
+import com.intellij.openapi.options.Configurable;
+import com.intellij.openapi.options.ConfigurationException;
+import com.intellij.openapi.project.Project;
+import com.intellij.ui.TextFieldWithAutoCompletion;
+import com.intellij.ui.components.JBRadioButton;
+import com.intellij.util.ui.UIUtil;
+import com.intellij.xml.Html5SchemaProvider;
+import com.intellij.xml.util.XmlUtil;
+import org.jetbrains.annotations.Nls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Arrays;
+
+/**
+ * @author Eugene.Kudelevsky
+ */
+public class DefaultSchemasConfigurable implements Configurable {
+ private final Project myProject;
+ private JRadioButton myHtml4RadioButton;
+ private JRadioButton myHtml5RadioButton;
+ private JRadioButton myOtherRadioButton;
+ private JPanel myContentPanel;
+ private JPanel myOtherDoctypeWrapper;
+ private JBRadioButton myXMLSchema10JBRadioButton;
+ private JBRadioButton myXMLSchema11JBRadioButton;
+ private TextFieldWithAutoCompletion myDoctypeTextField;
+
+ public DefaultSchemasConfigurable(final Project project) {
+ myProject = project;
+ }
+
+ @NotNull
+ private String getDoctype() {
+ if (myHtml4RadioButton.isSelected()) {
+ return XmlUtil.XHTML_URI;
+ }
+ if (myHtml5RadioButton.isSelected()) {
+ return Html5SchemaProvider.getHtml5SchemaLocation();
+ }
+ return myDoctypeTextField.getText();
+ }
+
+ @Nls
+ @Override
+ public String getDisplayName() {
+ return "Default XML Schemas";
+ }
+
+ @Nullable
+ @Override
+ public String getHelpTopic() {
+ return null;
+ }
+
+ @Nullable
+ @Override
+ public JComponent createComponent() {
+ final String[] urls = ExternalResourceManager.getInstance().getResourceUrls(null, true);
+ myDoctypeTextField = TextFieldWithAutoCompletion.create(myProject, Arrays.asList(urls), null, true, null);
+ myOtherDoctypeWrapper.add(myDoctypeTextField);
+ ActionListener listener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ myDoctypeTextField.setEnabled(myOtherRadioButton.isSelected());
+ }
+ };
+ myHtml4RadioButton.addActionListener(listener);
+ myHtml5RadioButton.addActionListener(listener);
+ myOtherRadioButton.addActionListener(listener);
+ return myContentPanel;
+ }
+
+ @Override
+ public boolean isModified() {
+ return !ExternalResourceManagerEx.getInstanceEx().getDefaultHtmlDoctype(myProject).equals(getDoctype()) ||
+ ExternalResourceManagerEx.getInstanceEx().getXmlSchemaVersion(myProject) != getSchemaVersion();
+ }
+
+ @Override
+ public void apply() throws ConfigurationException {
+ ExternalResourceManagerEx.getInstanceEx().setDefaultHtmlDoctype(getDoctype(), myProject);
+ ExternalResourceManagerEx.getInstanceEx().setXmlSchemaVersion(getSchemaVersion(), myProject);
+ }
+
+ private ExternalResourceManagerEx.XMLSchemaVersion getSchemaVersion() {
+ return myXMLSchema10JBRadioButton.isSelected()
+ ? ExternalResourceManagerEx.XMLSchemaVersion.XMLSchema_1_0
+ : ExternalResourceManagerEx.XMLSchemaVersion.XMLSchema_1_1;
+ }
+
+ @Override
+ public void reset() {
+ final String doctype = ExternalResourceManagerEx.getInstanceEx().getDefaultHtmlDoctype(myProject);
+ if (doctype.isEmpty() || doctype.equals(XmlUtil.XHTML4_SCHEMA_LOCATION)) {
+ myHtml4RadioButton.setSelected(true);
+ myDoctypeTextField.setEnabled(false);
+ }
+ else if (doctype.equals(Html5SchemaProvider.getHtml5SchemaLocation())) {
+ myHtml5RadioButton.setSelected(true);
+ myDoctypeTextField.setEnabled(false);
+ }
+ else {
+ myOtherRadioButton.setSelected(true);
+ myDoctypeTextField.setEnabled(true);
+ UIUtil.invokeLaterIfNeeded(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ myDoctypeTextField.setText(doctype);
+ }
+ catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
+ }
+ if (ExternalResourceManagerEx.getInstanceEx().getXmlSchemaVersion(myProject) == ExternalResourceManagerEx.XMLSchemaVersion.XMLSchema_1_0) {
+ myXMLSchema10JBRadioButton.setSelected(true);
+ }
+ else {
+ myXMLSchema11JBRadioButton.setSelected(true);
+ }
+ }
+
+ @Override
+ public void disposeUIResources() {
+ }
+}
diff --git a/xml/impl/src/com/intellij/javaee/ExternalResourceConfigurable.java b/xml/impl/src/com/intellij/javaee/ExternalResourceConfigurable.java
index d4f4586..1b03bdc 100644
--- a/xml/impl/src/com/intellij/javaee/ExternalResourceConfigurable.java
+++ b/xml/impl/src/com/intellij/javaee/ExternalResourceConfigurable.java
@@ -47,10 +47,8 @@
private JPanel myPanel;
private List<NameLocationPair> myPairs;
private List<String> myIgnoredUrls;
- private String myDefaultHtmlDoctype;
private AddEditRemovePanel<NameLocationPair> myExtPanel;
private AddEditRemovePanel<String> myIgnorePanel;
- private HtmlLanguageLevelForm myHtmlLanguageLevelForm;
@Nullable private final Project myProject;
private final List<NameLocationPair> myNewPairs;
@@ -129,27 +127,11 @@
return editIgnoreLocation(o);
}
};
- if (myProject != null) {
- myHtmlLanguageLevelForm = new HtmlLanguageLevelForm(myProject);
- myHtmlLanguageLevelForm.addListener(new HtmlLanguageLevelForm.MyListener() {
- @Override
- public void doctypeChanged() {
- if (!myHtmlLanguageLevelForm.getDoctype().equals(myDefaultHtmlDoctype)) {
- setModified(true);
- }
- }
- });
- }
myPanel.add(myExtPanel,
new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTH, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
myPanel.add(myIgnorePanel,
new GridBagConstraints(0, 1, 1, 1, 1, 1, GridBagConstraints.NORTH, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
- if (myProject != null) {
- myPanel.add(myHtmlLanguageLevelForm.getContentPanel(),
- new GridBagConstraints(0, 2, 1, 1, 1, 0, GridBagConstraints.SOUTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0),
- 0, 0));
- }
myExtPanel.setData(myPairs);
myIgnorePanel.setData(myIgnoredUrls);
@@ -187,9 +169,6 @@
String url = (String)myIgnoredUrl;
manager.addIgnoredResource(url);
}
- if (myProject != null) {
- manager.setDefaultHtmlDoctype(myHtmlLanguageLevelForm.getDoctype(), myProject);
- }
}
});
@@ -236,11 +215,6 @@
}
}
- if (myProject != null) {
- myDefaultHtmlDoctype = manager.getDefaultHtmlDoctype(myProject);
- myHtmlLanguageLevelForm.resetFromDoctype(myDefaultHtmlDoctype);
- }
-
setModified(!myNewPairs.isEmpty());
}
@@ -249,7 +223,6 @@
myPanel = null;
myExtPanel = null;
myIgnorePanel = null;
- myHtmlLanguageLevelForm = null;
}
@Override
diff --git a/xml/impl/src/com/intellij/javaee/HtmlLanguageLevelForm.java b/xml/impl/src/com/intellij/javaee/HtmlLanguageLevelForm.java
deleted file mode 100644
index 5d4668a9..0000000
--- a/xml/impl/src/com/intellij/javaee/HtmlLanguageLevelForm.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright 2000-2010 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.intellij.javaee;
-
-import com.intellij.openapi.editor.event.DocumentAdapter;
-import com.intellij.openapi.editor.event.DocumentEvent;
-import com.intellij.openapi.project.Project;
-import com.intellij.ui.TextFieldWithAutoCompletion;
-import com.intellij.util.containers.ContainerUtil;
-import com.intellij.util.ui.UIUtil;
-import com.intellij.xml.Html5SchemaProvider;
-import com.intellij.xml.util.XmlUtil;
-import org.jetbrains.annotations.NotNull;
-
-import javax.swing.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * @author Eugene.Kudelevsky
- */
-public class HtmlLanguageLevelForm {
- private JRadioButton myHtml4RadioButton;
- private JRadioButton myHtml5RadioButton;
- private JRadioButton myOtherRadioButton;
- private JPanel myContentPanel;
- private JPanel myOtherDoctypeWrapper;
- private final TextFieldWithAutoCompletion myDoctypeTextField;
- private final List<MyListener> myListeners = ContainerUtil.createLockFreeCopyOnWriteList();
-
- public HtmlLanguageLevelForm(Project project) {
- final String[] urls = ExternalResourceManager.getInstance().getResourceUrls(null, true);
- myDoctypeTextField = TextFieldWithAutoCompletion.create(project, Arrays.asList(urls), null, true, null);
- myOtherDoctypeWrapper.add(myDoctypeTextField);
- ActionListener listener = new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- myDoctypeTextField.setEnabled(myOtherRadioButton.isSelected());
- fireDoctypeChanged();
- }
- };
- myHtml4RadioButton.addActionListener(listener);
- myHtml5RadioButton.addActionListener(listener);
- myOtherRadioButton.addActionListener(listener);
- myDoctypeTextField.addDocumentListener(new DocumentAdapter() {
- @Override
- public void documentChanged(DocumentEvent e) {
- fireDoctypeChanged();
- }
- });
- }
-
- public JPanel getContentPanel() {
- return myContentPanel;
- }
-
- @NotNull
- public String getDoctype() {
- if (myHtml4RadioButton.isSelected()) {
- return XmlUtil.XHTML_URI;
- }
- if (myHtml5RadioButton.isSelected()) {
- return Html5SchemaProvider.getHtml5SchemaLocation();
- }
- return myDoctypeTextField.getText();
- }
-
- public void resetFromDoctype(final String doctype) {
- if (doctype == null || doctype.isEmpty() || doctype.equals(XmlUtil.XHTML4_SCHEMA_LOCATION)) {
- myHtml4RadioButton.setSelected(true);
- myDoctypeTextField.setEnabled(false);
- }
- else if (doctype.equals(Html5SchemaProvider.getHtml5SchemaLocation())) {
- myHtml5RadioButton.setSelected(true);
- myDoctypeTextField.setEnabled(false);
- }
- else {
- myOtherRadioButton.setSelected(true);
- myDoctypeTextField.setEnabled(true);
- UIUtil.invokeLaterIfNeeded(new Runnable() {
- @Override
- public void run() {
- try {
- myDoctypeTextField.setText(doctype);
- }
- catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- });
- }
- }
-
- public void addListener(@NotNull MyListener listener) {
- myListeners.add(listener);
- }
-
- public void removeListener(@NotNull MyListener listener) {
- myListeners.remove(listener);
- }
-
- private void fireDoctypeChanged() {
- for (MyListener listener : myListeners) {
- listener.doctypeChanged();
- }
- }
-
- public interface MyListener {
- void doctypeChanged();
- }
-}
diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/DefaultXmlTagNameProvider.java b/xml/impl/src/com/intellij/psi/impl/source/xml/DefaultXmlTagNameProvider.java
index 714d305..b8d4e4a 100644
--- a/xml/impl/src/com/intellij/psi/impl/source/xml/DefaultXmlTagNameProvider.java
+++ b/xml/impl/src/com/intellij/psi/impl/source/xml/DefaultXmlTagNameProvider.java
@@ -29,10 +29,7 @@
import com.intellij.xml.util.XmlUtil;
import org.jetbrains.annotations.NotNull;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
+import java.util.*;
public class DefaultXmlTagNameProvider implements XmlTagNameProvider {
@Override
@@ -50,12 +47,15 @@
@SuppressWarnings("unchecked") List<XmlElementDescriptor> variants = TagNameVariantCollector
.getTagDescriptors(tag, namespaces, nsInfo);
+ final Set<String> visited = new HashSet<String>();
for (int i = 0; i < variants.size(); i++) {
XmlElementDescriptor descriptor = variants.get(i);
String qname = descriptor.getName(tag);
+ if (!visited.add(qname)) continue;
if (!prefix.isEmpty() && qname.startsWith(prefix + ":")) {
qname = qname.substring(prefix.length() + 1);
}
+
PsiElement declaration = descriptor.getDeclaration();
LookupElementBuilder lookupElement = declaration == null ? LookupElementBuilder.create(qname) : LookupElementBuilder.create(declaration, qname);
final int separator = qname.indexOf(':');
diff --git a/xml/impl/src/com/intellij/xml/actions/validate/StdErrorReporter.java b/xml/impl/src/com/intellij/xml/actions/validate/StdErrorReporter.java
index ac63a17..88736b8 100644
--- a/xml/impl/src/com/intellij/xml/actions/validate/StdErrorReporter.java
+++ b/xml/impl/src/com/intellij/xml/actions/validate/StdErrorReporter.java
@@ -147,7 +147,7 @@
new Runnable() {
@Override
public void run() {
- final VirtualFile file = myHandler.getFile(ex.getPublicId(), ex.getSystemId());
+ final VirtualFile file = myHandler.getProblemFile(ex);
myErrorsView.addMessage(
problemType == ValidateXmlActionHandler.ProblemType.WARNING ? MessageCategory.WARNING : MessageCategory.ERROR,
new String[]{ex.getLocalizedMessage()},
diff --git a/xml/impl/src/com/intellij/xml/breadcrumbs/BreadcrumbsLoaderComponent.java b/xml/impl/src/com/intellij/xml/breadcrumbs/BreadcrumbsLoaderComponent.java
index aeff2ab..d005830 100644
--- a/xml/impl/src/com/intellij/xml/breadcrumbs/BreadcrumbsLoaderComponent.java
+++ b/xml/impl/src/com/intellij/xml/breadcrumbs/BreadcrumbsLoaderComponent.java
@@ -18,6 +18,7 @@
import com.intellij.application.options.editor.WebEditorOptions;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.components.AbstractProjectComponent;
+import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.fileEditor.*;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Disposer;
@@ -60,10 +61,14 @@
@Override
public void fileOpened(@NotNull final FileEditorManager source, @NotNull final VirtualFile file) {
if (isEnabled() && isSuitable(source.getProject(), file)) {
- final FileEditor[] fileEditors = source.getEditors(file);
+ final FileEditor[] fileEditors = source.getAllEditors(file);
for (final FileEditor fileEditor : fileEditors) {
if (fileEditor instanceof TextEditor) {
- final BreadcrumbsXmlWrapper wrapper = new BreadcrumbsXmlWrapper(((TextEditor)fileEditor).getEditor());
+ Editor editor = ((TextEditor)fileEditor).getEditor();
+ if (BreadcrumbsXmlWrapper.getBreadcrumbsComponent(editor) != null) {
+ continue;
+ }
+ final BreadcrumbsXmlWrapper wrapper = new BreadcrumbsXmlWrapper(editor);
final JComponent c = wrapper.getComponent();
source.addTopComponent(fileEditor, c);
diff --git a/xml/tests/src/com/intellij/codeInsight/XmlEventsTest.java b/xml/tests/src/com/intellij/codeInsight/XmlEventsTest.java
index 0f6cc98..dfc68b2 100644
--- a/xml/tests/src/com/intellij/codeInsight/XmlEventsTest.java
+++ b/xml/tests/src/com/intellij/codeInsight/XmlEventsTest.java
@@ -156,7 +156,7 @@
((DocumentEx)document).setInBulkUpdate(false);
}
}.execute();
- assertEquals("(Xml document changed)\n", listener.getEventString());
+ assertEquals("(Xml document changed)", listener.getEventString().trim());
}
public void testDocumentChange1() throws Exception{
diff --git a/xml/tests/src/com/intellij/codeInsight/completion/XmlSyncTagCommunityTest.java b/xml/tests/src/com/intellij/codeInsight/completion/XmlSyncTagCommunityTest.java
index f9200b9..f7986ca 100644
--- a/xml/tests/src/com/intellij/codeInsight/completion/XmlSyncTagCommunityTest.java
+++ b/xml/tests/src/com/intellij/codeInsight/completion/XmlSyncTagCommunityTest.java
@@ -16,6 +16,7 @@
package com.intellij.codeInsight.completion;
import com.intellij.openapi.actionSystem.IdeActions;
+import com.intellij.openapi.editor.VisualPosition;
/**
* @author Dennis.Ushakov
@@ -64,6 +65,17 @@
"</divv>");
}
+ public void testMultiCaretAdding() {
+ doTest("<div<caret>></div>\n" +
+ "<div></div>\n", "\b\b\biii",
+ "<iii></iii>\n" +
+ "<div></div>\n");
+ myFixture.getEditor().getCaretModel().addCaret(new VisualPosition(1, 4));
+ type("\b");
+ myFixture.checkResult("<ii></ii>\n" +
+ "<di></di>\n");
+ }
+
public void testAfterUndo() {
doTest("<div class=\"container\">\n" +
" <div class=\"row\">\n" +
diff --git a/xml/tests/src/com/intellij/xml/XmlConstraintsTest.java b/xml/tests/src/com/intellij/xml/XmlConstraintsTest.java
index 4284f52..d437711 100644
--- a/xml/tests/src/com/intellij/xml/XmlConstraintsTest.java
+++ b/xml/tests/src/com/intellij/xml/XmlConstraintsTest.java
@@ -19,11 +19,11 @@
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.xml.XmlFile;
import com.intellij.psi.xml.XmlTag;
-import com.intellij.testFramework.fixtures.CodeInsightFixtureTestCase;
+import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.Convertor;
-import com.intellij.xml.actions.validate.ValidateXmlActionHandler;
import com.intellij.xml.actions.validate.TestErrorReporter;
+import com.intellij.xml.actions.validate.ValidateXmlActionHandler;
import org.apache.xerces.impl.Constants;
import org.apache.xerces.impl.xs.XSComplexTypeDecl;
import org.apache.xerces.impl.xs.XSElementDecl;
@@ -49,7 +49,7 @@
* @author Dmitry Avdeev
*/
@SuppressWarnings({"UseOfObsoleteCollectionType"})
-public class XmlConstraintsTest extends CodeInsightFixtureTestCase {
+public class XmlConstraintsTest extends LightCodeInsightFixtureTestCase {
public void testXercesGrammar() throws Exception {
XSModel xsModel = getXSModel("test.xml", "test.xsd");
@@ -153,9 +153,4 @@
protected String getBasePath() {
return "/xml/tests/testData/constraints";
}
-
- @Override
- protected boolean isCommunity() {
- return true;
- }
}
diff --git a/xml/xml-psi-impl/gen/com/intellij/lexer/_HtmlLexer.java b/xml/xml-psi-impl/gen/com/intellij/lexer/_HtmlLexer.java
index 6aa25d6..8c57dbc 100644
--- a/xml/xml-psi-impl/gen/com/intellij/lexer/_HtmlLexer.java
+++ b/xml/xml-psi-impl/gen/com/intellij/lexer/_HtmlLexer.java
@@ -1,4 +1,4 @@
-/* The following code was generated by JFlex 1.4.3 on 9/29/14 1:13 PM */
+/* The following code was generated by JFlex 1.4.3 on 4/30/15 7:30 PM */
/* It's an automatically generated code. Do not modify it. */
package com.intellij.lexer;
@@ -10,7 +10,7 @@
/**
* This class is a scanner generated by
* <a href="http://www.jflex.de/">JFlex</a> 1.4.3
- * on 9/29/14 1:13 PM from the specification file
+ * on 4/30/15 7:30 PM from the specification file
* <tt>/Users/denofevil/Code/IDEA/tools/lexer/../../community/xml/xml-psi-impl/src/com/intellij/lexer/_HtmlLexer.flex</tt>
*/
public class _HtmlLexer implements FlexLexer {
@@ -59,60 +59,79 @@
"\1\53\1\27\1\40\2\1\1\33\1\31\1\57\1\17\1\25\1\56"+
"\1\1\1\55\1\22\1\35\2\1\1\60\1\23\1\1\1\0\1\42"+
"\55\0\1\1\12\0\1\1\4\0\1\1\5\0\27\1\1\0\37\1"+
- "\1\0\u013f\1\31\0\162\1\4\0\14\1\16\0\5\1\11\0\1\1"+
- "\213\0\1\1\13\0\1\1\1\0\3\1\1\0\1\1\1\0\24\1"+
- "\1\0\54\1\1\0\46\1\1\0\5\1\4\0\202\1\10\0\105\1"+
- "\1\0\46\1\2\0\2\1\6\0\20\1\41\0\46\1\2\0\1\1"+
- "\7\0\47\1\110\0\33\1\5\0\3\1\56\0\32\1\5\0\13\1"+
- "\43\0\2\1\1\0\143\1\1\0\1\1\17\0\2\1\7\0\2\1"+
- "\12\0\3\1\2\0\1\1\20\0\1\1\1\0\36\1\35\0\3\1"+
- "\60\0\46\1\13\0\1\1\u0152\0\66\1\3\0\1\1\22\0\1\1"+
- "\7\0\12\1\43\0\10\1\2\0\2\1\2\0\26\1\1\0\7\1"+
- "\1\0\1\1\3\0\4\1\3\0\1\1\36\0\2\1\1\0\3\1"+
- "\16\0\2\1\23\0\6\1\4\0\2\1\2\0\26\1\1\0\7\1"+
- "\1\0\2\1\1\0\2\1\1\0\2\1\37\0\4\1\1\0\1\1"+
- "\23\0\3\1\20\0\11\1\1\0\3\1\1\0\26\1\1\0\7\1"+
- "\1\0\2\1\1\0\5\1\3\0\1\1\22\0\1\1\17\0\2\1"+
- "\43\0\10\1\2\0\2\1\2\0\26\1\1\0\7\1\1\0\2\1"+
- "\1\0\5\1\3\0\1\1\36\0\2\1\1\0\3\1\17\0\1\1"+
- "\21\0\1\1\1\0\6\1\3\0\3\1\1\0\4\1\3\0\2\1"+
- "\1\0\1\1\1\0\2\1\3\0\2\1\3\0\3\1\3\0\10\1"+
- "\1\0\3\1\113\0\10\1\1\0\3\1\1\0\27\1\1\0\12\1"+
- "\1\0\5\1\46\0\2\1\43\0\10\1\1\0\3\1\1\0\27\1"+
+ "\1\0\u01ca\1\4\0\14\1\16\0\5\1\7\0\1\1\1\0\1\1"+
+ "\201\0\5\1\1\0\2\1\2\0\4\1\10\0\1\1\1\0\3\1"+
+ "\1\0\1\1\1\0\24\1\1\0\123\1\1\0\213\1\10\0\236\1"+
+ "\11\0\46\1\2\0\1\1\7\0\47\1\110\0\33\1\5\0\3\1"+
+ "\55\0\53\1\43\0\2\1\1\0\143\1\1\0\1\1\17\0\2\1"+
+ "\7\0\2\1\12\0\3\1\2\0\1\1\20\0\1\1\1\0\36\1"+
+ "\35\0\131\1\13\0\1\1\30\0\41\1\11\0\2\1\4\0\1\1"+
+ "\5\0\26\1\4\0\1\1\11\0\1\1\3\0\1\1\27\0\31\1"+
+ "\107\0\1\1\1\0\13\1\127\0\66\1\3\0\1\1\22\0\1\1"+
+ "\7\0\12\1\17\0\7\1\1\0\7\1\5\0\10\1\2\0\2\1"+
+ "\2\0\26\1\1\0\7\1\1\0\1\1\3\0\4\1\3\0\1\1"+
+ "\20\0\1\1\15\0\2\1\1\0\3\1\16\0\2\1\23\0\6\1"+
+ "\4\0\2\1\2\0\26\1\1\0\7\1\1\0\2\1\1\0\2\1"+
+ "\1\0\2\1\37\0\4\1\1\0\1\1\23\0\3\1\20\0\11\1"+
+ "\1\0\3\1\1\0\26\1\1\0\7\1\1\0\2\1\1\0\5\1"+
+ "\3\0\1\1\22\0\1\1\17\0\2\1\43\0\10\1\2\0\2\1"+
+ "\2\0\26\1\1\0\7\1\1\0\2\1\1\0\5\1\3\0\1\1"+
+ "\36\0\2\1\1\0\3\1\17\0\1\1\21\0\1\1\1\0\6\1"+
+ "\3\0\3\1\1\0\4\1\3\0\2\1\1\0\1\1\1\0\2\1"+
+ "\3\0\2\1\3\0\3\1\3\0\14\1\26\0\1\1\64\0\10\1"+
+ "\1\0\3\1\1\0\27\1\1\0\12\1\1\0\5\1\3\0\1\1"+
+ "\32\0\2\1\6\0\2\1\43\0\10\1\1\0\3\1\1\0\27\1"+
"\1\0\12\1\1\0\5\1\3\0\1\1\40\0\1\1\1\0\2\1"+
- "\43\0\10\1\1\0\3\1\1\0\27\1\1\0\20\1\46\0\2\1"+
- "\43\0\22\1\3\0\30\1\1\0\11\1\1\0\1\1\2\0\7\1"+
- "\72\0\60\1\1\0\2\1\14\0\7\1\72\0\2\1\1\0\1\1"+
- "\2\0\2\1\1\0\1\1\2\0\1\1\6\0\4\1\1\0\7\1"+
- "\1\0\3\1\1\0\1\1\1\0\1\1\2\0\2\1\1\0\4\1"+
- "\1\0\2\1\11\0\1\1\2\0\5\1\1\0\1\1\25\0\2\1"+
- "\42\0\1\1\77\0\10\1\1\0\42\1\35\0\4\1\164\0\42\1"+
- "\1\0\5\1\1\0\2\1\45\0\6\1\112\0\46\1\12\0\51\1"+
- "\7\0\132\1\5\0\104\1\5\0\122\1\6\0\7\1\1\0\77\1"+
- "\1\0\1\1\1\0\4\1\2\0\7\1\1\0\1\1\1\0\4\1"+
- "\2\0\47\1\1\0\1\1\1\0\4\1\2\0\37\1\1\0\1\1"+
- "\1\0\4\1\2\0\7\1\1\0\1\1\1\0\4\1\2\0\7\1"+
- "\1\0\7\1\1\0\27\1\1\0\37\1\1\0\1\1\1\0\4\1"+
- "\2\0\7\1\1\0\47\1\1\0\23\1\105\0\125\1\14\0\u026c\1"+
- "\2\0\10\1\12\0\32\1\5\0\113\1\25\0\15\1\1\0\4\1"+
- "\16\0\22\1\16\0\22\1\16\0\15\1\1\0\3\1\17\0\64\1"+
- "\43\0\1\1\4\0\1\1\103\0\130\1\10\0\51\1\127\0\35\1"+
- "\63\0\36\1\2\0\5\1\u038b\0\154\1\224\0\234\1\4\0\132\1"+
- "\6\0\26\1\2\0\6\1\2\0\46\1\2\0\6\1\2\0\10\1"+
+ "\17\0\2\1\22\0\10\1\1\0\3\1\1\0\51\1\2\0\1\1"+
+ "\20\0\1\1\21\0\2\1\30\0\6\1\5\0\22\1\3\0\30\1"+
+ "\1\0\11\1\1\0\1\1\2\0\7\1\72\0\60\1\1\0\2\1"+
+ "\14\0\7\1\72\0\2\1\1\0\1\1\2\0\2\1\1\0\1\1"+
+ "\2\0\1\1\6\0\4\1\1\0\7\1\1\0\3\1\1\0\1\1"+
+ "\1\0\1\1\2\0\2\1\1\0\4\1\1\0\2\1\11\0\1\1"+
+ "\2\0\5\1\1\0\1\1\25\0\4\1\40\0\1\1\77\0\10\1"+
+ "\1\0\44\1\33\0\5\1\163\0\53\1\24\0\1\1\20\0\6\1"+
+ "\4\0\4\1\3\0\1\1\3\0\2\1\7\0\3\1\4\0\15\1"+
+ "\14\0\1\1\21\0\46\1\1\0\1\1\5\0\1\1\2\0\53\1"+
+ "\1\0\u014d\1\1\0\4\1\2\0\7\1\1\0\1\1\1\0\4\1"+
+ "\2\0\51\1\1\0\4\1\2\0\41\1\1\0\4\1\2\0\7\1"+
+ "\1\0\1\1\1\0\4\1\2\0\17\1\1\0\71\1\1\0\4\1"+
+ "\2\0\103\1\45\0\20\1\20\0\125\1\14\0\u026c\1\2\0\21\1"+
+ "\1\0\32\1\5\0\113\1\25\0\15\1\1\0\4\1\16\0\22\1"+
+ "\16\0\22\1\16\0\15\1\1\0\3\1\17\0\64\1\43\0\1\1"+
+ "\4\0\1\1\103\0\130\1\10\0\51\1\1\0\1\1\5\0\106\1"+
+ "\12\0\35\1\63\0\36\1\2\0\5\1\13\0\54\1\25\0\7\1"+
+ "\70\0\27\1\11\0\65\1\122\0\1\1\135\0\57\1\21\0\7\1"+
+ "\67\0\36\1\15\0\2\1\12\0\54\1\32\0\44\1\51\0\3\1"+
+ "\12\0\44\1\153\0\4\1\1\0\4\1\3\0\2\1\11\0\300\1"+
+ "\100\0\u0116\1\2\0\6\1\2\0\46\1\2\0\6\1\2\0\10\1"+
"\1\0\1\1\1\0\1\1\1\0\1\1\1\0\37\1\2\0\65\1"+
"\1\0\7\1\1\0\1\1\3\0\3\1\1\0\7\1\3\0\4\1"+
"\2\0\6\1\4\0\15\1\5\0\3\1\1\0\7\1\164\0\1\1"+
- "\15\0\1\1\202\0\1\1\4\0\1\1\2\0\12\1\1\0\1\1"+
- "\3\0\5\1\6\0\1\1\1\0\1\1\1\0\1\1\1\0\4\1"+
- "\1\0\3\1\1\0\7\1\3\0\3\1\5\0\5\1\u0ebb\0\2\1"+
- "\52\0\5\1\5\0\2\1\4\0\126\1\6\0\3\1\1\0\132\1"+
- "\1\0\4\1\5\0\50\1\4\0\136\1\21\0\30\1\70\0\20\1"+
- "\u0200\0\u19b6\1\112\0\u51a6\1\132\0\u048d\1\u0773\0\u2ba4\1\u215c\0\u012e\1"+
- "\2\0\73\1\225\0\7\1\14\0\5\1\5\0\1\1\1\0\12\1"+
- "\1\0\15\1\1\0\5\1\1\0\1\1\1\0\2\1\1\0\2\1"+
- "\1\0\154\1\41\0\u016b\1\22\0\100\1\2\0\66\1\50\0\14\1"+
- "\164\0\5\1\1\0\207\1\44\0\32\1\6\0\32\1\13\0\131\1"+
- "\3\0\6\1\2\0\6\1\2\0\6\1\2\0\3\1\43\0";
+ "\15\0\1\1\20\0\15\1\145\0\1\1\4\0\1\1\2\0\12\1"+
+ "\1\0\1\1\3\0\5\1\6\0\1\1\1\0\1\1\1\0\1\1"+
+ "\1\0\4\1\1\0\13\1\2\0\4\1\5\0\5\1\4\0\1\1"+
+ "\64\0\2\1\u0a7b\0\57\1\1\0\57\1\1\0\205\1\6\0\4\1"+
+ "\3\0\2\1\14\0\46\1\1\0\1\1\5\0\1\1\2\0\70\1"+
+ "\7\0\1\1\20\0\27\1\11\0\7\1\1\0\7\1\1\0\7\1"+
+ "\1\0\7\1\1\0\7\1\1\0\7\1\1\0\7\1\1\0\7\1"+
+ "\120\0\1\1\u01d5\0\2\1\52\0\5\1\5\0\2\1\4\0\126\1"+
+ "\6\0\3\1\1\0\132\1\1\0\4\1\5\0\51\1\3\0\136\1"+
+ "\21\0\33\1\65\0\20\1\u0200\0\u19b6\1\112\0\u51cd\1\63\0\u048d\1"+
+ "\103\0\56\1\2\0\u010d\1\3\0\20\1\12\0\2\1\24\0\57\1"+
+ "\20\0\31\1\10\0\106\1\61\0\11\1\2\0\147\1\2\0\4\1"+
+ "\1\0\4\1\14\0\13\1\115\0\12\1\1\0\3\1\1\0\4\1"+
+ "\1\0\27\1\35\0\64\1\16\0\62\1\76\0\6\1\3\0\1\1"+
+ "\16\0\34\1\12\0\27\1\31\0\35\1\7\0\57\1\34\0\1\1"+
+ "\60\0\51\1\27\0\3\1\1\0\10\1\24\0\27\1\3\0\1\1"+
+ "\5\0\60\1\1\0\1\1\3\0\2\1\2\0\5\1\2\0\1\1"+
+ "\1\0\1\1\30\0\3\1\2\0\13\1\7\0\3\1\14\0\6\1"+
+ "\2\0\6\1\2\0\6\1\11\0\7\1\1\0\7\1\221\0\43\1"+
+ "\35\0\u2ba4\1\14\0\27\1\4\0\61\1\u2104\0\u016e\1\2\0\152\1"+
+ "\46\0\7\1\14\0\5\1\5\0\1\1\1\0\12\1\1\0\15\1"+
+ "\1\0\5\1\1\0\1\1\1\0\2\1\1\0\2\1\1\0\154\1"+
+ "\41\0\u016b\1\22\0\100\1\2\0\66\1\50\0\14\1\164\0\5\1"+
+ "\1\0\207\1\44\0\32\1\6\0\32\1\13\0\131\1\3\0\6\1"+
+ "\2\0\6\1\2\0\6\1\2\0\3\1\43\0";
/**
* Translates characters to character classes
@@ -251,26 +270,25 @@
"\1\0\2\112\1\0\3\112\6\0\20\112\1\145\3\112"+
"\11\0\1\137\7\112\1\0\2\112\1\0\3\112\6\0"+
"\22\112\1\146\1\112\11\0\1\137\7\112\36\0\2\147"+
- "\52\0\2\150\33\0\1\124\35\0\1\151\66\0\1\152"+
- "\13\0\41\57\1\0\3\57\1\130\14\57\41\67\1\0"+
- "\20\67\6\0\1\153\71\0\2\154\43\0\2\135\1\0"+
- "\3\135\6\0\24\135\12\0\7\135\1\0\2\136\1\0"+
- "\3\136\6\0\24\136\12\0\7\136\2\0\1\140\47\0"+
- "\1\155\11\0\1\156\12\0\1\156\2\0\1\156\5\0"+
- "\1\156\7\0\2\156\14\0\1\156\4\0\1\156\1\0"+
- "\2\112\1\0\3\112\6\0\24\112\11\0\1\155\7\112"+
- "\1\0\2\112\1\0\3\112\6\0\2\112\1\157\21\112"+
- "\11\0\1\137\7\112\1\0\2\112\1\0\3\112\6\0"+
- "\10\112\1\142\13\112\11\0\1\137\7\112\1\0\2\112"+
- "\1\0\3\112\6\0\2\112\1\114\21\112\11\0\1\137"+
- "\7\112\1\0\2\112\1\0\3\112\6\0\24\112\11\0"+
- "\1\137\2\112\1\144\4\112\32\0\2\160\60\0\2\161"+
- "\46\0\1\162\43\0\1\156\12\0\1\156\2\0\1\156"+
- "\5\0\1\156\7\0\2\156\12\0\1\155\1\0\1\156"+
- "\4\0\1\156\1\0\2\112\1\0\3\112\6\0\24\112"+
- "\11\0\1\137\2\112\1\142\4\112\40\0\1\163\42\0"+
- "\2\164\57\0\1\165\64\0\1\166\62\0\2\167\62\0"+
- "\1\170\33\0";
+ "\52\0\2\150\71\0\1\151\66\0\1\152\13\0\41\57"+
+ "\1\0\3\57\1\130\14\57\41\67\1\0\20\67\6\0"+
+ "\1\153\71\0\2\154\43\0\2\135\1\0\3\135\6\0"+
+ "\24\135\12\0\7\135\1\0\2\136\1\0\3\136\6\0"+
+ "\24\136\12\0\7\136\2\0\1\140\47\0\1\155\11\0"+
+ "\1\156\12\0\1\156\2\0\1\156\5\0\1\156\7\0"+
+ "\2\156\14\0\1\156\4\0\1\156\1\0\2\112\1\0"+
+ "\3\112\6\0\24\112\11\0\1\155\7\112\1\0\2\112"+
+ "\1\0\3\112\6\0\2\112\1\157\21\112\11\0\1\137"+
+ "\7\112\1\0\2\112\1\0\3\112\6\0\10\112\1\142"+
+ "\13\112\11\0\1\137\7\112\1\0\2\112\1\0\3\112"+
+ "\6\0\2\112\1\114\21\112\11\0\1\137\7\112\1\0"+
+ "\2\112\1\0\3\112\6\0\24\112\11\0\1\137\2\112"+
+ "\1\144\4\112\32\0\2\160\60\0\2\161\46\0\1\162"+
+ "\43\0\1\156\12\0\1\156\2\0\1\156\5\0\1\156"+
+ "\7\0\2\156\12\0\1\155\1\0\1\156\4\0\1\156"+
+ "\1\0\2\112\1\0\3\112\6\0\24\112\11\0\1\137"+
+ "\2\112\1\142\4\112\40\0\1\163\42\0\2\164\57\0"+
+ "\1\165\64\0\1\166\62\0\2\167\62\0\1\170\33\0";
private static int [] zzUnpackTrans() {
int [] result = new int[4050];
@@ -384,19 +402,15 @@
}
+ /**
+ * Creates a new scanner
+ *
+ * @param in the java.io.Reader to read input from.
+ */
public _HtmlLexer(java.io.Reader in) {
this.zzReader = in;
}
- /**
- * Creates a new scanner.
- * There is also java.io.Reader version of this constructor.
- *
- * @param in the java.io.Inputstream to read input from.
- */
- public _HtmlLexer(java.io.InputStream in) {
- this(new java.io.InputStreamReader(in));
- }
/**
* Unpacks the compressed character translation table.
@@ -408,7 +422,7 @@
char [] map = new char[0x10000];
int i = 0; /* index in packed string */
int j = 0; /* index in unpacked array */
- while (i < 1258) {
+ while (i < 1634) {
int count = packed.charAt(i++);
char value = packed.charAt(i++);
do map[j++] = value; while (--count > 0);
diff --git a/xml/xml-psi-impl/resources/standardSchemas/XMLSchema-1_1/XMLSchema-hasFacetAndProperty.xsd b/xml/xml-psi-impl/resources/standardSchemas/XMLSchema-1_1/XMLSchema-hasFacetAndProperty.xsd
new file mode 100644
index 0000000..df871d5
--- /dev/null
+++ b/xml/xml-psi-impl/resources/standardSchemas/XMLSchema-1_1/XMLSchema-hasFacetAndProperty.xsd
@@ -0,0 +1,142 @@
+<?xml version='1.0'?>
+<!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "XMLSchema.dtd" [
+<!ENTITY % s ''>
+<!ENTITY % p ''>
+<!-- keep this XML 1.0 correct -->
+<!ATTLIST schema xmlns:hfp CDATA #IMPLIED
+ xmlns:xhtml CDATA #IMPLIED
+ xmlns:xsi CDATA #IMPLIED
+ xsi:schemaLocation CDATA #IMPLIED>
+<!ELEMENT xhtml:p ANY>
+<!ELEMENT xhtml:em ANY>
+]>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3.org/2001/XMLSchema-hasFacetAndProperty" xmlns:hfp="http://www.w3.org/2001/XMLSchema-hasFacetAndProperty" xmlns:xhtml="http://www.w3.org/1999/xhtml"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.w3.org/1999/xhtml http://www.w3.org/1999/xhtml.xsd">
+
+ <annotation>
+ <documentation>
+ <xhtml:p> This schema defines 2 elements for use in the
+appinfo portion section of (potentially) all builtin datatypes in the schema
+for XML Schema Part 2: Datatypes. </xhtml:p>
+ <xhtml:p> One intended use of
+this appinfo is in the generation of the HTML version of the XML Schema Part 2:
+Datatypes specification itself. All portions of the HTML text which describe
+the facets and/or properties of each datatype is generated by an XSLT
+transformation which keys off of this appinfo. </xhtml:p>
+ <xhtml:p> Schema
+processors may have another use for this appinfo (although one certainly not
+required in any way by the specification). The information may be useful in
+dynamically building validation modules/classes and/or user-interfaces for
+schema creation. </xhtml:p>
+ </documentation>
+ </annotation>
+
+ <element name="hasFacet">
+ <annotation>
+ <documentation>
+ <xhtml:p>
+ hasFacet is used to signal that the contraining facet
+ given in the name attribute is applicable to a primitive
+ datatype (and all types derived from it).
+</xhtml:p>
+ <xhtml:p>
+ Note: this element will only appear in the appinfo of
+ primitive types or built-in types derived by "list".
+ </xhtml:p>
+ <xhtml:p>
+ A schema processor (or the XSLT which generates the
+ HTML version of the XML Schema Part 2: Datatypes
+ specification) which reads a derived simpleType
+ definition should walk up the base type chain until
+ it reaches the primitive type at the top of the chain
+ and "push" all facets found their down to all derived
+ types in the chain.
+ </xhtml:p>
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="name" use="required">
+ <simpleType>
+ <annotation>
+ <documentation>
+ <xhtml:p>
+ This datatype names all existing contraining facets.
+</xhtml:p>
+ <xhtml:p>
+ Question: should each of the enumerations below be
+ given a documentation annotation, which would contain
+ the text to be used in the definition of the facet
+ in the XML Schema Part 2: Datatypes specification?
+ Might be nice to try to collect all of that information
+ together here.
+ </xhtml:p>
+ </documentation>
+ </annotation>
+ <restriction base="NMTOKEN">
+ <enumeration value="length"/>
+ <enumeration value="minLength"/>
+ <enumeration value="maxLength"/>
+ <enumeration value="pattern"/>
+ <enumeration value="enumeration"/>
+ <enumeration value="maxInclusive"/>
+ <enumeration value="maxExclusive"/>
+ <enumeration value="minInclusive"/>
+ <enumeration value="minExclusive"/>
+ <enumeration value="totalDigits"/>
+ <enumeration value="fractionDigits"/>
+ <enumeration value="whiteSpace"/>
+ <enumeration value="maxScale"/>
+ <enumeration value="minScale"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="hasProperty">
+ <annotation>
+ <documentation>
+ <xhtml:p> hasProperty is used to signal that the property
+given in the name attribute has the value given in the value attribute for the
+datatype in which it occurs (and all types derived from it, which do not
+override the value of the property). </xhtml:p>
+ <xhtml:p> Note: this element
+may appear in the appinfo of primitive and built-in derived types. </xhtml:p>
+ <xhtml:p> A schema processor (or the XSLT which generates the HTML version of
+the XML Schema Part 2: Datatypes specification) which reads a simpleType
+definition should gather the information from any occurances of hasProperty in
+that simpleType definition, and then walk up the base type chain gathering
+information from any occurances of hasProperty (unless a value was given to the
+name in a dervied type) until either it reaches the primitive type at the top
+of the chain or it has gathered values for all existing properties. </xhtml:p>
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="name" use="required">
+ <simpleType>
+ <annotation>
+ <documentation>
+ <xhtml:p> This datatype names all existing fundamental
+facets, otherwise known as properties (with the exception of
+<xhtml:em>equality</xhtml:em>, a property which has no
+<xhtml:em>value</xhtml:em>). </xhtml:p>
+ <xhtml:p> Question: should each of
+the enumerations below be given a documentation annotation, which would contain
+the text to be used in the definition of the properties in the XML Schema Part
+2: Datatypes specification? Might be nice to try to collect all of that
+information together here. </xhtml:p>
+ </documentation>
+ </annotation>
+ <restriction base="NMTOKEN">
+ <enumeration value="ordered"/>
+ <enumeration value="bounded"/>
+ <enumeration value="cardinality"/>
+ <enumeration value="numeric"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="value" type="normalizedString" use="required"/>
+ </complexType>
+ </element>
+</schema>
diff --git a/xml/xml-psi-impl/resources/standardSchemas/XMLSchema-1_1/XMLSchema.xsd b/xml/xml-psi-impl/resources/standardSchemas/XMLSchema-1_1/XMLSchema.xsd
new file mode 100644
index 0000000..fa36f54
--- /dev/null
+++ b/xml/xml-psi-impl/resources/standardSchemas/XMLSchema-1_1/XMLSchema.xsd
@@ -0,0 +1,2545 @@
+<?xml version='1.0'?>
+
+<!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XSD 1.1//EN" "XMLSchema.dtd" [
+
+<!-- provide ID type information even for parsers which only read the
+ internal subset -->
+<!ATTLIST xs:schema id ID #IMPLIED>
+<!ATTLIST xs:complexType id ID #IMPLIED>
+<!ATTLIST xs:complexContent id ID #IMPLIED>
+<!ATTLIST xs:simpleContent id ID #IMPLIED>
+<!ATTLIST xs:extension id ID #IMPLIED>
+<!ATTLIST xs:element id ID #IMPLIED>
+<!ATTLIST xs:group id ID #IMPLIED>
+<!ATTLIST xs:all id ID #IMPLIED>
+<!ATTLIST xs:choice id ID #IMPLIED>
+<!ATTLIST xs:sequence id ID #IMPLIED>
+<!ATTLIST xs:any id ID #IMPLIED>
+<!ATTLIST xs:anyAttribute id ID #IMPLIED>
+<!ATTLIST xs:attribute id ID #IMPLIED>
+<!ATTLIST xs:attributeGroup id ID #IMPLIED>
+<!ATTLIST xs:unique id ID #IMPLIED>
+<!ATTLIST xs:key id ID #IMPLIED>
+<!ATTLIST xs:keyref id ID #IMPLIED>
+<!ATTLIST xs:selector id ID #IMPLIED>
+<!ATTLIST xs:field id ID #IMPLIED>
+<!ATTLIST xs:assert id ID #IMPLIED>
+<!ATTLIST xs:include id ID #IMPLIED>
+<!ATTLIST xs:import id ID #IMPLIED>
+<!ATTLIST xs:redefine id ID #IMPLIED>
+<!ATTLIST xs:override id ID #IMPLIED>
+<!ATTLIST xs:notation id ID #IMPLIED>
+]>
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:hfp="http://www.w3.org/2001/XMLSchema-hasFacetAndProperty"
+ elementFormDefault="qualified" xml:lang="EN"
+ targetNamespace="http://www.w3.org/2001/XMLSchema"
+ version="structures.xsd (rec-20120405)">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html">
+ The schema corresponding to this document is normative,
+ with respect to the syntactic constraints it expresses in the
+ XML Schema Definition Language. The documentation (within 'documentation' elements)
+ below, is not normative, but rather highlights important aspects of
+ the W3C Recommendation of which this is a part.
+
+ See below (at the bottom of this document) for information about
+ the revision and namespace-versioning policy governing this
+ schema document.
+
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:import namespace="http://www.w3.org/XML/1998/namespace"
+ schemaLocation="http://www.w3.org/2001/xml.xsd">
+ <xs:annotation>
+ <xs:documentation>
+ Get access to the xml: attribute groups for xml:lang
+ as declared on 'schema' and 'documentation' below
+ </xs:documentation>
+ </xs:annotation>
+ </xs:import>
+ <xs:complexType name="openAttrs">
+ <xs:annotation>
+ <xs:documentation>
+ This type is extended by almost all schema types
+ to allow attributes from other namespaces to be
+ added to user schemas.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:restriction base="xs:anyType">
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="annotated">
+ <xs:annotation>
+ <xs:documentation>
+ This type is extended by all types which allow annotation
+ other than <schema> itself
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:extension base="xs:openAttrs">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="id" type="xs:ID"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:group name="composition">
+ <xs:choice>
+ <xs:element ref="xs:include"/>
+ <xs:element ref="xs:import"/>
+ <xs:element ref="xs:redefine"/>
+ <xs:element ref="xs:override"/>
+ <xs:element ref="xs:annotation"/>
+ </xs:choice>
+ </xs:group>
+ <xs:group name="schemaTop">
+ <xs:annotation>
+ <xs:documentation>
+ This group is for the
+ elements which occur freely at the top level of schemas.
+ All of their types are based on the "annotated" type by extension.</xs:documentation>
+ </xs:annotation>
+ <xs:choice>
+ <xs:group ref="xs:redefinable"/>
+ <xs:element ref="xs:element"/>
+ <xs:element ref="xs:attribute"/>
+ <xs:element ref="xs:notation"/>
+ </xs:choice>
+ </xs:group>
+ <xs:group name="redefinable">
+ <xs:annotation>
+ <xs:documentation>
+ This group is for the
+ elements which can self-redefine (see <redefine> below).</xs:documentation>
+ </xs:annotation>
+ <xs:choice>
+ <xs:element ref="xs:simpleType"/>
+ <xs:element ref="xs:complexType"/>
+ <xs:element ref="xs:group"/>
+ <xs:element ref="xs:attributeGroup"/>
+ </xs:choice>
+ </xs:group>
+ <xs:simpleType name="formChoice">
+ <xs:annotation>
+ <xs:documentation>
+ A utility type, not for public use</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="qualified"/>
+ <xs:enumeration value="unqualified"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="reducedDerivationControl">
+ <xs:annotation>
+ <xs:documentation>
+ A utility type, not for public use</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:derivationControl">
+ <xs:enumeration value="extension"/>
+ <xs:enumeration value="restriction"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="derivationSet">
+ <xs:annotation>
+ <xs:documentation>
+ A utility type, not for public use</xs:documentation>
+ <xs:documentation>
+ #all or (possibly empty) subset of {extension, restriction}</xs:documentation>
+ </xs:annotation>
+ <xs:union>
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="#all"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType>
+ <xs:list itemType="xs:reducedDerivationControl"/>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ <xs:simpleType name="typeDerivationControl">
+ <xs:annotation>
+ <xs:documentation>
+ A utility type, not for public use</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:derivationControl">
+ <xs:enumeration value="extension"/>
+ <xs:enumeration value="restriction"/>
+ <xs:enumeration value="list"/>
+ <xs:enumeration value="union"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="fullDerivationSet">
+ <xs:annotation>
+ <xs:documentation>
+ A utility type, not for public use</xs:documentation>
+ <xs:documentation>
+ #all or (possibly empty) subset of {extension, restriction, list, union}</xs:documentation>
+ </xs:annotation>
+ <xs:union>
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="#all"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType>
+ <xs:list itemType="xs:typeDerivationControl"/>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ <xs:element name="schema" id="schema">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-schema"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:openAttrs">
+ <xs:sequence>
+ <xs:group ref="xs:composition" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:sequence minOccurs="0">
+ <xs:element ref="xs:defaultOpenContent"/>
+ <xs:element ref="xs:annotation" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="xs:schemaTop"/>
+ <xs:element ref="xs:annotation" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:sequence>
+ <xs:attribute name="targetNamespace" type="xs:anyURI"/>
+ <xs:attribute name="version" type="xs:token"/>
+ <xs:attribute name="finalDefault" type="xs:fullDerivationSet"
+ default="" use="optional"/>
+ <xs:attribute name="blockDefault" type="xs:blockSet" default=""
+ use="optional"/>
+ <xs:attribute name="attributeFormDefault" type="xs:formChoice"
+ default="unqualified" use="optional"/>
+ <xs:attribute name="elementFormDefault" type="xs:formChoice"
+ default="unqualified" use="optional"/>
+ <xs:attribute name="defaultAttributes" type="xs:QName"/>
+ <xs:attribute name="xpathDefaultNamespace" type="xs:xpathDefaultNamespace"
+ default="##local" use="optional"/>
+ <xs:attribute name="id" type="xs:ID"/>
+ <xs:attribute ref="xml:lang"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:key name="element">
+ <xs:selector xpath="xs:element"/>
+ <xs:field xpath="@name"/>
+ </xs:key>
+ <xs:key name="attribute">
+ <xs:selector xpath="xs:attribute"/>
+ <xs:field xpath="@name"/>
+ </xs:key>
+ <xs:key name="type">
+ <xs:selector xpath="xs:complexType|xs:simpleType"/>
+ <xs:field xpath="@name"/>
+ </xs:key>
+ <xs:key name="group">
+ <xs:selector xpath="xs:group"/>
+ <xs:field xpath="@name"/>
+ </xs:key>
+ <xs:key name="attributeGroup">
+ <xs:selector xpath="xs:attributeGroup"/>
+ <xs:field xpath="@name"/>
+ </xs:key>
+ <xs:key name="notation">
+ <xs:selector xpath="xs:notation"/>
+ <xs:field xpath="@name"/>
+ </xs:key>
+ <xs:key name="identityConstraint">
+ <xs:selector xpath=".//xs:key|.//xs:unique|.//xs:keyref"/>
+ <xs:field xpath="@name"/>
+ </xs:key>
+ </xs:element>
+ <xs:simpleType name="allNNI">
+ <xs:annotation>
+ <xs:documentation>
+ for maxOccurs</xs:documentation>
+ </xs:annotation>
+ <xs:union memberTypes="xs:nonNegativeInteger">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="unbounded"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ <xs:attributeGroup name="occurs">
+ <xs:annotation>
+ <xs:documentation>
+ for all particles</xs:documentation>
+ </xs:annotation>
+ <xs:attribute name="minOccurs" type="xs:nonNegativeInteger" default="1"
+ use="optional"/>
+ <xs:attribute name="maxOccurs" type="xs:allNNI" default="1" use="optional"/>
+ </xs:attributeGroup>
+ <xs:attributeGroup name="defRef">
+ <xs:annotation>
+ <xs:documentation>
+ for element, group and attributeGroup,
+ which both define and reference</xs:documentation>
+ </xs:annotation>
+ <xs:attribute name="name" type="xs:NCName"/>
+ <xs:attribute name="ref" type="xs:QName"/>
+ </xs:attributeGroup>
+ <xs:group name="typeDefParticle">
+ <xs:annotation>
+ <xs:documentation>
+ 'complexType' uses this</xs:documentation>
+ </xs:annotation>
+ <xs:choice>
+ <xs:element name="group" type="xs:groupRef"/>
+ <xs:element ref="xs:all"/>
+ <xs:element ref="xs:choice"/>
+ <xs:element ref="xs:sequence"/>
+ </xs:choice>
+ </xs:group>
+ <xs:group name="nestedParticle">
+ <xs:choice>
+ <xs:element name="element" type="xs:localElement"/>
+ <xs:element name="group" type="xs:groupRef"/>
+
+ <xs:element ref="xs:choice"/>
+ <xs:element ref="xs:sequence"/>
+ <xs:element ref="xs:any"/>
+ </xs:choice>
+ </xs:group>
+ <xs:group name="particle">
+ <xs:choice>
+ <xs:element name="element" type="xs:localElement"/>
+ <xs:element name="group" type="xs:groupRef"/>
+ <xs:element ref="xs:all"/>
+ <xs:element ref="xs:choice"/>
+ <xs:element ref="xs:sequence"/>
+ <xs:element ref="xs:any"/>
+ </xs:choice>
+ </xs:group>
+ <xs:complexType name="attribute">
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:sequence>
+ <xs:element name="simpleType" type="xs:localSimpleType" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attributeGroup ref="xs:defRef"/>
+ <xs:attribute name="type" type="xs:QName"/>
+ <xs:attribute name="use" default="optional" use="optional">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="prohibited"/>
+ <xs:enumeration value="optional"/>
+ <xs:enumeration value="required"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="default" type="xs:string"/>
+ <xs:attribute name="fixed" type="xs:string"/>
+ <xs:attribute name="form" type="xs:formChoice"/>
+ <xs:attribute name="targetNamespace" type="xs:anyURI"/>
+
+ <xs:attribute name="inheritable" type="xs:boolean"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="topLevelAttribute">
+ <xs:complexContent>
+ <xs:restriction base="xs:attribute">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:element name="simpleType" type="xs:localSimpleType" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="ref" use="prohibited"/>
+ <xs:attribute name="form" use="prohibited"/>
+ <xs:attribute name="use" use="prohibited"/>
+ <xs:attribute name="targetNamespace" use="prohibited"/>
+ <xs:attribute name="name" type="xs:NCName" use="required"/>
+ <xs:attribute name="inheritable" type="xs:boolean"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:group name="attrDecls">
+ <xs:sequence>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="attribute" type="xs:attribute"/>
+ <xs:element name="attributeGroup" type="xs:attributeGroupRef"/>
+ </xs:choice>
+ <xs:element ref="xs:anyAttribute" minOccurs="0"/>
+ </xs:sequence>
+ </xs:group>
+ <xs:element name="anyAttribute" id="anyAttribute">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-anyAttribute"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:wildcard">
+ <xs:attribute name="notQName" type="xs:qnameListA"
+ use="optional"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:group name="assertions">
+ <xs:sequence>
+ <xs:element name="assert" type="xs:assertion"
+ minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:group>
+ <xs:complexType name="assertion">
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:attribute name="test" type="xs:string"/>
+ <xs:attribute name="xpathDefaultNamespace" type="xs:xpathDefaultNamespace"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:group name="complexTypeModel">
+ <xs:choice>
+ <xs:element ref="xs:simpleContent"/>
+ <xs:element ref="xs:complexContent"/>
+ <xs:sequence>
+ <xs:annotation>
+ <xs:documentation>
+ This branch is short for
+ <complexContent>
+ <restriction base="xs:anyType">
+ ...
+ </restriction>
+ </complexContent></xs:documentation>
+ </xs:annotation>
+ <xs:element ref="xs:openContent" minOccurs="0"/>
+ <xs:group ref="xs:typeDefParticle" minOccurs="0"/>
+ <xs:group ref="xs:attrDecls"/>
+ <xs:group ref="xs:assertions"/>
+ </xs:sequence>
+ </xs:choice>
+ </xs:group>
+ <xs:complexType name="complexType" abstract="true">
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:group ref="xs:complexTypeModel"/>
+ <xs:attribute name="name" type="xs:NCName">
+ <xs:annotation>
+ <xs:documentation>
+ Will be restricted to required or prohibited</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="mixed" type="xs:boolean" use="optional">
+ <xs:annotation>
+ <xs:documentation>
+ Not allowed if simpleContent child is chosen.
+ May be overridden by setting on complexContent child.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="abstract" type="xs:boolean" default="false"
+ use="optional"/>
+ <xs:attribute name="final" type="xs:derivationSet"/>
+ <xs:attribute name="block" type="xs:derivationSet"/>
+ <xs:attribute name="defaultAttributesApply" type="xs:boolean"
+ default="true" use="optional"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="topLevelComplexType">
+ <xs:complexContent>
+ <xs:restriction base="xs:complexType">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:group ref="xs:complexTypeModel"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:NCName" use="required"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="localComplexType">
+ <xs:complexContent>
+ <xs:restriction base="xs:complexType">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:group ref="xs:complexTypeModel"/>
+ </xs:sequence>
+ <xs:attribute name="name" use="prohibited"/>
+ <xs:attribute name="abstract" use="prohibited"/>
+ <xs:attribute name="final" use="prohibited"/>
+ <xs:attribute name="block" use="prohibited"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="restrictionType">
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:sequence>
+ <xs:choice minOccurs="0">
+
+ <xs:sequence>
+ <xs:element ref="xs:openContent" minOccurs="0"/>
+ <xs:group ref="xs:typeDefParticle"/>
+ </xs:sequence>
+ <xs:group ref="xs:simpleRestrictionModel"/>
+ </xs:choice>
+ <xs:group ref="xs:attrDecls"/>
+ <xs:group ref="xs:assertions"/>
+ </xs:sequence>
+ <xs:attribute name="base" type="xs:QName" use="required"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="complexRestrictionType">
+ <xs:complexContent>
+ <xs:restriction base="xs:restrictionType">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:choice minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>This choice is added simply to
+ make this a valid restriction per the REC</xs:documentation>
+ </xs:annotation>
+
+ <xs:sequence>
+ <xs:element ref="xs:openContent" minOccurs="0"/>
+ <xs:group ref="xs:typeDefParticle"/>
+ </xs:sequence>
+ </xs:choice>
+ <xs:group ref="xs:attrDecls"/>
+ <xs:group ref="xs:assertions"/>
+ </xs:sequence>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="extensionType">
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:sequence>
+ <xs:element ref="xs:openContent" minOccurs="0"/>
+ <xs:group ref="xs:typeDefParticle" minOccurs="0"/>
+ <xs:group ref="xs:attrDecls"/>
+ <xs:group ref="xs:assertions"/>
+ </xs:sequence>
+ <xs:attribute name="base" type="xs:QName" use="required"/>
+
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:element name="complexContent" id="complexContent">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-complexContent"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:choice>
+ <xs:element name="restriction" type="xs:complexRestrictionType"/>
+ <xs:element name="extension" type="xs:extensionType"/>
+ </xs:choice>
+ <xs:attribute name="mixed" type="xs:boolean">
+ <xs:annotation>
+ <xs:documentation>
+ Overrides any setting on complexType parent.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="openContent" id="openContent">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-openContent"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:sequence>
+ <xs:element name="any" minOccurs="0" type="xs:wildcard"/>
+ </xs:sequence>
+ <xs:attribute name="mode" default="interleave" use="optional">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="none"/>
+ <xs:enumeration value="interleave"/>
+ <xs:enumeration value="suffix"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="defaultOpenContent" id="defaultOpenContent">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-defaultOpenContent"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:sequence>
+ <xs:element name="any" type="xs:wildcard"/>
+ </xs:sequence>
+ <xs:attribute name="appliesToEmpty" type="xs:boolean"
+ default="false" use="optional"/>
+ <xs:attribute name="mode" default="interleave" use="optional">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="interleave"/>
+ <xs:enumeration value="suffix"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:complexType name="simpleRestrictionType">
+ <xs:complexContent>
+ <xs:restriction base="xs:restrictionType">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:choice minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>This choice is added simply to
+ make this a valid restriction per the REC</xs:documentation>
+ </xs:annotation>
+ <xs:group ref="xs:simpleRestrictionModel"/>
+ </xs:choice>
+ <xs:group ref="xs:attrDecls"/>
+ <xs:group ref="xs:assertions"/>
+ </xs:sequence>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="simpleExtensionType">
+ <xs:complexContent>
+ <xs:restriction base="xs:extensionType">
+ <xs:sequence>
+ <xs:annotation>
+ <xs:documentation>
+ No typeDefParticle group reference</xs:documentation>
+ </xs:annotation>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:group ref="xs:attrDecls"/>
+ <xs:group ref="xs:assertions"/>
+ </xs:sequence>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:element name="simpleContent" id="simpleContent">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-simpleContent"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:choice>
+ <xs:element name="restriction" type="xs:simpleRestrictionType"/>
+ <xs:element name="extension" type="xs:simpleExtensionType"/>
+ </xs:choice>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="complexType" type="xs:topLevelComplexType" id="complexType">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-complexType"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:simpleType name="blockSet">
+ <xs:annotation>
+ <xs:documentation>
+ A utility type, not for public use</xs:documentation>
+ <xs:documentation>
+ #all or (possibly empty) subset of {substitution, extension,
+ restriction}</xs:documentation>
+ </xs:annotation>
+ <xs:union>
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="#all"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType>
+ <xs:list>
+ <xs:simpleType>
+ <xs:restriction base="xs:derivationControl">
+ <xs:enumeration value="extension"/>
+ <xs:enumeration value="restriction"/>
+ <xs:enumeration value="substitution"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:list>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ <xs:complexType name="element" abstract="true">
+ <xs:annotation>
+ <xs:documentation>
+ The element element can be used either
+ at the top level to define an element-type binding globally,
+ or within a content model to either reference a globally-defined
+ element or type or declare an element-type binding locally.
+ The ref form is not allowed at the top level.</xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:sequence>
+ <xs:choice minOccurs="0">
+ <xs:element name="simpleType" type="xs:localSimpleType"/>
+ <xs:element name="complexType" type="xs:localComplexType"/>
+ </xs:choice>
+ <xs:element name="alternative" type="xs:altType"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xs:group ref="xs:identityConstraint" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attributeGroup ref="xs:defRef"/>
+ <xs:attribute name="type" type="xs:QName"/>
+
+ <xs:attribute name="substitutionGroup">
+ <xs:simpleType>
+ <xs:list itemType="xs:QName"/>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attributeGroup ref="xs:occurs"/>
+ <xs:attribute name="default" type="xs:string"/>
+ <xs:attribute name="fixed" type="xs:string"/>
+ <xs:attribute name="nillable" type="xs:boolean" use="optional"/>
+ <xs:attribute name="abstract" type="xs:boolean" default="false"
+ use="optional"/>
+ <xs:attribute name="final" type="xs:derivationSet"/>
+ <xs:attribute name="block" type="xs:blockSet"/>
+ <xs:attribute name="form" type="xs:formChoice"/>
+ <xs:attribute name="targetNamespace" type="xs:anyURI"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="topLevelElement">
+ <xs:complexContent>
+ <xs:restriction base="xs:element">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:choice minOccurs="0">
+ <xs:element name="simpleType" type="xs:localSimpleType"/>
+ <xs:element name="complexType" type="xs:localComplexType"/>
+ </xs:choice>
+ <xs:element name="alternative" type="xs:altType"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xs:group ref="xs:identityConstraint" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="ref" use="prohibited"/>
+ <xs:attribute name="form" use="prohibited"/>
+ <xs:attribute name="targetNamespace" use="prohibited"/>
+ <xs:attribute name="minOccurs" use="prohibited"/>
+ <xs:attribute name="maxOccurs" use="prohibited"/>
+ <xs:attribute name="name" type="xs:NCName" use="required"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="localElement">
+ <xs:complexContent>
+ <xs:restriction base="xs:element">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:choice minOccurs="0">
+ <xs:element name="simpleType" type="xs:localSimpleType"/>
+ <xs:element name="complexType" type="xs:localComplexType"/>
+ </xs:choice>
+ <xs:element name="alternative" type="xs:altType"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xs:group ref="xs:identityConstraint" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="substitutionGroup" use="prohibited"/>
+ <xs:attribute name="final" use="prohibited"/>
+ <xs:attribute name="abstract" use="prohibited"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:element name="element" type="xs:topLevelElement" id="element">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-element"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:complexType name="altType">
+ <xs:annotation>
+ <xs:documentation>
+ This type is used for 'alternative' elements.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:choice minOccurs="0">
+ <xs:element name="simpleType" type="xs:localSimpleType"/>
+ <xs:element name="complexType" type="xs:localComplexType"/>
+ </xs:choice>
+ <xs:attribute name="test" type="xs:string" use="optional"/>
+ <xs:attribute name="type" type="xs:QName" use="optional"/>
+ <xs:attribute name="xpathDefaultNamespace" type="xs:xpathDefaultNamespace"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="group" abstract="true">
+ <xs:annotation>
+ <xs:documentation>
+ group type for explicit groups, named top-level groups and
+ group references</xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+
+ <xs:group ref="xs:particle" minOccurs="0" maxOccurs="unbounded"/>
+
+ <xs:attributeGroup ref="xs:defRef"/>
+ <xs:attributeGroup ref="xs:occurs"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="realGroup">
+ <xs:complexContent>
+ <xs:restriction base="xs:group">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:choice minOccurs="0" maxOccurs="1">
+ <xs:element ref="xs:all"/>
+ <xs:element ref="xs:choice"/>
+ <xs:element ref="xs:sequence"/>
+ </xs:choice>
+
+ </xs:sequence>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="namedGroup">
+ <xs:complexContent>
+ <xs:restriction base="xs:realGroup">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:choice minOccurs="1" maxOccurs="1">
+ <xs:element name="all">
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:restriction base="xs:all">
+ <xs:group ref="xs:allModel"/>
+ <xs:attribute name="minOccurs" use="prohibited"/>
+ <xs:attribute name="maxOccurs" use="prohibited"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="choice" type="xs:simpleExplicitGroup"/>
+ <xs:element name="sequence" type="xs:simpleExplicitGroup"/>
+ </xs:choice>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:NCName" use="required"/>
+ <xs:attribute name="ref" use="prohibited"/>
+ <xs:attribute name="minOccurs" use="prohibited"/>
+ <xs:attribute name="maxOccurs" use="prohibited"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="groupRef">
+ <xs:complexContent>
+ <xs:restriction base="xs:realGroup">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="ref" type="xs:QName" use="required"/>
+ <xs:attribute name="name" use="prohibited"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="explicitGroup">
+ <xs:annotation>
+ <xs:documentation>
+ group type for the three kinds of group</xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:restriction base="xs:group">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:group ref="xs:nestedParticle" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" use="prohibited"/>
+ <xs:attribute name="ref" use="prohibited"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="simpleExplicitGroup">
+ <xs:complexContent>
+ <xs:restriction base="xs:explicitGroup">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:group ref="xs:nestedParticle" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="minOccurs" use="prohibited"/>
+ <xs:attribute name="maxOccurs" use="prohibited"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:group name="allModel">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>This choice with min/max is here to
+ avoid a pblm with the Elt:All/Choice/Seq
+ Particle derivation constraint</xs:documentation>
+ </xs:annotation>
+ <xs:element name="element" type="xs:localElement"/>
+ <xs:element ref="xs:any"/>
+ <xs:element name="group">
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:restriction base="xs:groupRef">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="minOccurs" fixed="1" type="xs:nonNegativeInteger"/>
+ <xs:attribute name="maxOccurs" fixed="1" type="xs:nonNegativeInteger"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ </xs:choice>
+ </xs:sequence>
+ </xs:group>
+ <xs:complexType name="all">
+ <xs:annotation>
+ <xs:documentation>
+ Only elements allowed inside</xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:restriction base="xs:explicitGroup">
+ <xs:group ref="xs:allModel"/>
+ <xs:attribute name="minOccurs" default="1" use="optional">
+ <xs:simpleType>
+ <xs:restriction base="xs:nonNegativeInteger">
+ <xs:enumeration value="0"/>
+ <xs:enumeration value="1"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="maxOccurs" default="1" use="optional">
+ <xs:simpleType>
+ <xs:restriction base="xs:allNNI">
+ <xs:enumeration value="0"/>
+ <xs:enumeration value="1"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:element name="all" type="xs:all" id="all">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-all"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="choice" type="xs:explicitGroup" id="choice">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-choice"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="sequence" type="xs:explicitGroup" id="sequence">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-sequence"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="group" type="xs:namedGroup" id="group">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-group"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:attributeGroup name="anyAttrGroup">
+ <xs:attribute name="namespace" type="xs:namespaceList"
+ use="optional"/>
+ <xs:attribute name="notNamespace" use="optional">
+ <xs:simpleType>
+ <xs:restriction base="xs:basicNamespaceList">
+ <xs:minLength value="1"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="processContents" default="strict" use="optional">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="skip"/>
+ <xs:enumeration value="lax"/>
+ <xs:enumeration value="strict"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:attributeGroup>
+ <xs:complexType name="wildcard">
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+
+ <xs:attributeGroup ref="xs:anyAttrGroup"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:element name="any" id="any">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-any"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:wildcard">
+ <xs:attribute name="notQName" type="xs:qnameList"
+ use="optional"/>
+ <xs:attributeGroup ref="xs:occurs"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:annotation>
+ <xs:documentation>
+ simple type for the value of the 'namespace' attr of
+ 'any' and 'anyAttribute'</xs:documentation>
+ </xs:annotation>
+ <xs:annotation>
+ <xs:documentation>
+ Value is
+ ##any - - any non-conflicting WFXML/attribute at all
+
+ ##other - - any non-conflicting WFXML/attribute from
+ namespace other than targetNS
+
+ ##local - - any unqualified non-conflicting WFXML/attribute
+
+ one or - - any non-conflicting WFXML/attribute from
+ more URI the listed namespaces
+ references
+ (space separated)
+
+ ##targetNamespace or ##local may appear in the above list, to
+ refer to the targetNamespace of the enclosing
+ schema or an absent targetNamespace respectively</xs:documentation>
+ </xs:annotation>
+ <xs:simpleType name="namespaceList">
+ <xs:annotation>
+ <xs:documentation>
+ A utility type, not for public use</xs:documentation>
+ </xs:annotation>
+
+ <xs:union memberTypes="xs:specialNamespaceList xs:basicNamespaceList" />
+ </xs:simpleType>
+ <xs:simpleType name="basicNamespaceList">
+ <xs:annotation>
+ <xs:documentation>
+ A utility type, not for public use</xs:documentation>
+ </xs:annotation>
+ <xs:list>
+ <xs:simpleType>
+ <xs:union memberTypes="xs:anyURI">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="##targetNamespace"/>
+ <xs:enumeration value="##local"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:list>
+ </xs:simpleType>
+ <xs:simpleType name="specialNamespaceList">
+ <xs:annotation>
+ <xs:documentation>
+ A utility type, not for public use</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="##any"/>
+ <xs:enumeration value="##other"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="qnameList">
+ <xs:annotation>
+ <xs:documentation>
+ A utility type, not for public use
+ </xs:documentation>
+ </xs:annotation>
+ <xs:list>
+ <xs:simpleType>
+ <xs:union memberTypes="xs:QName">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="##defined"/>
+ <xs:enumeration value="##definedSibling"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:list>
+ </xs:simpleType>
+ <xs:simpleType name="qnameListA">
+ <xs:annotation>
+ <xs:documentation>
+ A utility type, not for public use
+ </xs:documentation>
+ </xs:annotation>
+ <xs:list>
+ <xs:simpleType>
+ <xs:union memberTypes="xs:QName">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="##defined"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:list>
+ </xs:simpleType>
+ <xs:simpleType name="xpathDefaultNamespace">
+ <xs:union memberTypes="xs:anyURI">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="##defaultNamespace"/>
+ <xs:enumeration value="##targetNamespace"/>
+ <xs:enumeration value="##local"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ <xs:element name="attribute" type="xs:topLevelAttribute" id="attribute">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-attribute"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:complexType name="attributeGroup" abstract="true">
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+
+ <xs:group ref="xs:attrDecls"/>
+
+ <xs:attributeGroup ref="xs:defRef"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="namedAttributeGroup">
+ <xs:complexContent>
+ <xs:restriction base="xs:attributeGroup">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:group ref="xs:attrDecls"/>
+
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:NCName" use="required"/>
+ <xs:attribute name="ref" use="prohibited"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="attributeGroupRef">
+ <xs:complexContent>
+ <xs:restriction base="xs:attributeGroup">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="ref" type="xs:QName" use="required"/>
+ <xs:attribute name="name" use="prohibited"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:element name="attributeGroup" type="xs:namedAttributeGroup"
+ id="attributeGroup">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-attributeGroup"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="include" id="include">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-include"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:attribute name="schemaLocation" type="xs:anyURI" use="required"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="redefine" id="redefine">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-redefine"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:openAttrs">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="xs:annotation"/>
+ <xs:group ref="xs:redefinable"/>
+ </xs:choice>
+ <xs:attribute name="schemaLocation" type="xs:anyURI" use="required"/>
+ <xs:attribute name="id" type="xs:ID"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="override" id="override">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-override"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:openAttrs">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:group ref="xs:schemaTop" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="schemaLocation" type="xs:anyURI" use="required"/>
+ <xs:attribute name="id" type="xs:ID"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="import" id="import">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-import"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:attribute name="namespace" type="xs:anyURI"/>
+ <xs:attribute name="schemaLocation" type="xs:anyURI"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="selector" id="selector">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-selector"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:attribute name="xpath" use="required">
+ <xs:simpleType>
+ <xs:annotation>
+ <xs:documentation>A subset of XPath expressions for use
+in selectors</xs:documentation>
+ <xs:documentation>A utility type, not for public
+use</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:token"/>
+
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="xpathDefaultNamespace" type="xs:xpathDefaultNamespace"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="field" id="field">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-field"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:attribute name="xpath" use="required">
+ <xs:simpleType>
+ <xs:annotation>
+ <xs:documentation>A subset of XPath expressions for use
+in fields</xs:documentation>
+ <xs:documentation>A utility type, not for public
+use</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:token"/>
+
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="xpathDefaultNamespace" type="xs:xpathDefaultNamespace"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:complexType name="keybase">
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:sequence minOccurs="0">
+ <xs:element ref="xs:selector"/>
+ <xs:element ref="xs:field" minOccurs="1" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:NCName"/>
+ <xs:attribute name="ref" type="xs:QName"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:group name="identityConstraint">
+ <xs:annotation>
+ <xs:documentation>The three kinds of identity constraints, all with
+ type of or derived from 'keybase'.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:choice>
+ <xs:element ref="xs:unique"/>
+ <xs:element ref="xs:key"/>
+ <xs:element ref="xs:keyref"/>
+ </xs:choice>
+ </xs:group>
+ <xs:element name="unique" type="xs:keybase" id="unique">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-unique"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="key" type="xs:keybase" id="key">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-key"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="keyref" id="keyref">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-keyref"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:keybase">
+ <xs:attribute name="refer" type="xs:QName"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="notation" id="notation">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-notation"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:attribute name="name" type="xs:NCName" use="required"/>
+ <xs:attribute name="public" type="xs:public"/>
+ <xs:attribute name="system" type="xs:anyURI"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:simpleType name="public">
+ <xs:annotation>
+ <xs:documentation>
+ A utility type, not for public use</xs:documentation>
+ <xs:documentation>
+ A public identifier, per ISO 8879</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:token"/>
+ </xs:simpleType>
+ <xs:element name="appinfo" id="appinfo">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-appinfo"/>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:any processContents="lax"/>
+ </xs:sequence>
+ <xs:attribute name="source" type="xs:anyURI"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="documentation" id="documentation">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-documentation"/>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:any processContents="lax"/>
+ </xs:sequence>
+ <xs:attribute name="source" type="xs:anyURI"/>
+ <xs:attribute ref="xml:lang"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="annotation" id="annotation">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-annotation"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:openAttrs">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="xs:appinfo"/>
+ <xs:element ref="xs:documentation"/>
+ </xs:choice>
+ <xs:attribute name="id" type="xs:ID"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:annotation>
+ <xs:documentation>
+ notations for use within schema documents</xs:documentation>
+ </xs:annotation>
+ <xs:notation name="XMLSchemaStructures" public="structures"
+ system="http://www.w3.org/2000/08/XMLSchema.xsd"/>
+ <xs:notation name="XML" public="REC-xml-19980210"
+ system="http://www.w3.org/TR/1998/REC-xml-19980210"/>
+ <xs:complexType name="anyType" mixed="true">
+ <xs:annotation>
+ <xs:documentation>
+ Not the real urType, but as close an approximation as we can
+ get in the XML representation</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
+ </xs:sequence>
+ <xs:anyAttribute processContents="lax"/>
+ </xs:complexType>
+
+ <xs:annotation>
+ <xs:documentation>
+ In keeping with the XML Schema WG's standard versioning policy,
+ the material in this schema document will persist at the URI
+ http://www.w3.org/2012/04/XMLSchema.xsd.
+
+ At the date of issue it can also be found at the URI
+ http://www.w3.org/2009/XMLSchema/XMLSchema.xsd.
+
+ The schema document at that URI may however change in the future,
+ in order to remain compatible with the latest version of XSD
+ and its namespace. In other words, if XSD or the XML Schema
+ namespace change, the version of this document at
+ http://www.w3.org/2009/XMLSchema/XMLSchema.xsd will change accordingly;
+ the version at http://www.w3.org/2012/04/XMLSchema.xsd will not change.
+
+ Previous dated (and unchanging) versions of this schema document
+ include:
+
+ http://www.w3.org/2012/01/XMLSchema.xsd
+ (XSD 1.1 Proposed Recommendation)
+
+ http://www.w3.org/2011/07/XMLSchema.xsd
+ (XSD 1.1 Candidate Recommendation)
+
+ http://www.w3.org/2009/04/XMLSchema.xsd
+ (XSD 1.1 Candidate Recommendation)
+
+ http://www.w3.org/2004/10/XMLSchema.xsd
+ (XSD 1.0 Recommendation, Second Edition)
+
+ http://www.w3.org/2001/05/XMLSchema.xsd
+ (XSD 1.0 Recommendation, First Edition)
+
+
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+ <xs:documentation source="../datatypes/datatypes-with-errata.html">
+ The schema corresponding to this document is normative,
+ with respect to the syntactic constraints it expresses in the
+ XML Schema language. The documentation (within <documentation>
+ elements) below, is not normative, but rather highlights important
+ aspects of the W3C Recommendation of which this is a part
+ </xs:documentation>
+ </xs:annotation>
+ <xs:annotation>
+ <xs:documentation>
+ First the built-in primitive datatypes. These definitions are for
+ information only, the real built-in definitions are magic.
+ </xs:documentation>
+ <xs:documentation>
+ For each built-in datatype in this schema (both primitive and
+ derived) can be uniquely addressed via a URI constructed
+ as follows:
+ 1) the base URI is the URI of the XML Schema namespace
+ 2) the fragment identifier is the name of the datatype
+
+ For example, to address the int datatype, the URI is:
+
+ http://www.w3.org/2001/XMLSchema#int
+
+ Additionally, each facet definition element can be uniquely
+ addressed via a URI constructed as follows:
+ 1) the base URI is the URI of the XML Schema namespace
+ 2) the fragment identifier is the name of the facet
+
+ For example, to address the maxInclusive facet, the URI is:
+
+ http://www.w3.org/2001/XMLSchema#maxInclusive
+
+ Additionally, each facet usage in a built-in datatype definition
+ can be uniquely addressed via a URI constructed as follows:
+ 1) the base URI is the URI of the XML Schema namespace
+ 2) the fragment identifier is the name of the datatype, followed
+ by a period (".") followed by the name of the facet
+
+ For example, to address the usage of the maxInclusive facet in
+ the definition of int, the URI is:
+
+ http://www.w3.org/2001/XMLSchema#int.maxInclusive
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:simpleType name="string" id="string">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="length"/>
+ <hfp:hasFacet name="minLength"/>
+ <hfp:hasFacet name="maxLength"/>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasProperty name="ordered" value="false"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality" value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#string"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace value="preserve" id="string.preserve"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="boolean" id="boolean">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasProperty name="ordered" value="false"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality" value="finite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#boolean"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace fixed="true" value="collapse" id="boolean.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="float" id="float">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="partial"/>
+ <hfp:hasProperty name="bounded" value="true"/>
+ <hfp:hasProperty name="cardinality" value="finite"/>
+ <hfp:hasProperty name="numeric" value="true"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#float"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace fixed="true" value="collapse" id="float.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="double" id="double">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="partial"/>
+ <hfp:hasProperty name="bounded" value="true"/>
+ <hfp:hasProperty name="cardinality" value="finite"/>
+ <hfp:hasProperty name="numeric" value="true"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#double"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace fixed="true" value="collapse" id="double.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="decimal" id="decimal">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="totalDigits"/>
+ <hfp:hasFacet name="fractionDigits"/>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="total"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality" value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="true"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#decimal"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace fixed="true" value="collapse" id="decimal.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="duration" id="duration">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="partial"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality" value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#duration"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace fixed="true" value="collapse" id="duration.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="dateTime" id="dateTime">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="partial"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality" value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#dateTime"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace fixed="true" value="collapse" id="dateTime.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="time" id="time">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="partial"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality" value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#time"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace fixed="true" value="collapse" id="time.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="date" id="date">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="partial"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality" value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#date"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace fixed="true" value="collapse" id="date.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="gYearMonth" id="gYearMonth">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="partial"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality" value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#gYearMonth"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace fixed="true" value="collapse" id="gYearMonth.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="gYear" id="gYear">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="partial"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality" value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#gYear"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace fixed="true" value="collapse" id="gYear.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="gMonthDay" id="gMonthDay">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="partial"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality" value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#gMonthDay"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace fixed="true" value="collapse" id="gMonthDay.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="gDay" id="gDay">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="partial"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality" value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#gDay"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace fixed="true" value="collapse" id="gDay.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="gMonth" id="gMonth">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="partial"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality" value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#gMonth"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace fixed="true" value="collapse" id="gMonth.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="hexBinary" id="hexBinary">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="length"/>
+ <hfp:hasFacet name="minLength"/>
+ <hfp:hasFacet name="maxLength"/>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasProperty name="ordered" value="false"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality" value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#binary"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace fixed="true" value="collapse" id="hexBinary.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="base64Binary" id="base64Binary">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="length"/>
+ <hfp:hasFacet name="minLength"/>
+ <hfp:hasFacet name="maxLength"/>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasProperty name="ordered" value="false"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality" value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#base64Binary"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace fixed="true" value="collapse" id="base64Binary.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="anyURI" id="anyURI">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="length"/>
+ <hfp:hasFacet name="minLength"/>
+ <hfp:hasFacet name="maxLength"/>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasProperty name="ordered" value="false"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality" value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#anyURI"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace fixed="true" value="collapse" id="anyURI.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="QName" id="QName">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="length"/>
+ <hfp:hasFacet name="minLength"/>
+ <hfp:hasFacet name="maxLength"/>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasProperty name="ordered" value="false"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality" value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#QName"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace fixed="true" value="collapse" id="QName.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="NOTATION" id="NOTATION">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="length"/>
+ <hfp:hasFacet name="minLength"/>
+ <hfp:hasFacet name="maxLength"/>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasProperty name="ordered" value="false"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality" value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#NOTATION"/>
+ <xs:documentation>
+ NOTATION cannot be used directly in a schema; rather a type
+ must be derived from it by specifying at least one enumeration
+ facet whose value is the name of a NOTATION declared in the
+ schema.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace fixed="true" value="collapse" id="NOTATION.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:annotation>
+ <xs:documentation>
+ Now the derived primitive types
+ </xs:documentation>
+ </xs:annotation>
+ <xs:simpleType name="normalizedString" id="normalizedString">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#normalizedString"/>
+ </xs:annotation>
+ <xs:restriction base="xs:string">
+ <xs:whiteSpace value="replace" id="normalizedString.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="token" id="token">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#token"/>
+ </xs:annotation>
+ <xs:restriction base="xs:normalizedString">
+ <xs:whiteSpace value="collapse" id="token.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="language" id="language">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#language"/>
+ </xs:annotation>
+ <xs:restriction base="xs:token">
+ <xs:pattern value="[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*"
+ id="language.pattern">
+ <xs:annotation>
+ <xs:documentation source="http://www.ietf.org/rfc/rfc3066.txt">
+ pattern specifies the content of section 2.12 of XML 1.0e2
+ and RFC 3066 (Revised version of RFC 1766).
+ </xs:documentation>
+ </xs:annotation>
+ </xs:pattern>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="IDREFS" id="IDREFS">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="length"/>
+ <hfp:hasFacet name="minLength"/>
+ <hfp:hasFacet name="maxLength"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasProperty name="ordered" value="false"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality" value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#IDREFS"/>
+ </xs:annotation>
+ <xs:restriction>
+ <xs:simpleType>
+ <xs:list itemType="xs:IDREF"/>
+ </xs:simpleType>
+ <xs:minLength value="1" id="IDREFS.minLength"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="ENTITIES" id="ENTITIES">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="length"/>
+ <hfp:hasFacet name="minLength"/>
+ <hfp:hasFacet name="maxLength"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasProperty name="ordered" value="false"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality" value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#ENTITIES"/>
+ </xs:annotation>
+ <xs:restriction>
+ <xs:simpleType>
+ <xs:list itemType="xs:ENTITY"/>
+ </xs:simpleType>
+ <xs:minLength value="1" id="ENTITIES.minLength"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="NMTOKEN" id="NMTOKEN">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#NMTOKEN"/>
+ </xs:annotation>
+ <xs:restriction base="xs:token">
+ <xs:pattern value="\c+" id="NMTOKEN.pattern">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/REC-xml#NT-Nmtoken">
+ pattern matches production 7 from the XML spec
+ </xs:documentation>
+ </xs:annotation>
+ </xs:pattern>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="NMTOKENS" id="NMTOKENS">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="length"/>
+ <hfp:hasFacet name="minLength"/>
+ <hfp:hasFacet name="maxLength"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasProperty name="ordered" value="false"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality" value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#NMTOKENS"/>
+ </xs:annotation>
+ <xs:restriction>
+ <xs:simpleType>
+ <xs:list itemType="xs:NMTOKEN"/>
+ </xs:simpleType>
+ <xs:minLength value="1" id="NMTOKENS.minLength"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="Name" id="Name">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#Name"/>
+ </xs:annotation>
+ <xs:restriction base="xs:token">
+ <xs:pattern value="\i\c*" id="Name.pattern">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/REC-xml#NT-Name">
+ pattern matches production 5 from the XML spec
+ </xs:documentation>
+ </xs:annotation>
+ </xs:pattern>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="NCName" id="NCName">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#NCName"/>
+ </xs:annotation>
+ <xs:restriction base="xs:Name">
+ <xs:pattern value="[\i-[:]][\c-[:]]*" id="NCName.pattern">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/REC-xml-names/#NT-NCName">
+ pattern matches production 4 from the Namespaces in XML spec
+ </xs:documentation>
+ </xs:annotation>
+ </xs:pattern>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="ID" id="ID">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#ID"/>
+ </xs:annotation>
+ <xs:restriction base="xs:NCName"/>
+ </xs:simpleType>
+ <xs:simpleType name="IDREF" id="IDREF">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#IDREF"/>
+ </xs:annotation>
+ <xs:restriction base="xs:NCName"/>
+ </xs:simpleType>
+ <xs:simpleType name="ENTITY" id="ENTITY">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#ENTITY"/>
+ </xs:annotation>
+ <xs:restriction base="xs:NCName"/>
+ </xs:simpleType>
+ <xs:simpleType name="integer" id="integer">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#integer"/>
+ </xs:annotation>
+ <xs:restriction base="xs:decimal">
+ <xs:fractionDigits fixed="true" value="0" id="integer.fractionDigits"/>
+ <xs:pattern value="[\-+]?[0-9]+"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="nonPositiveInteger" id="nonPositiveInteger">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#nonPositiveInteger"/>
+ </xs:annotation>
+ <xs:restriction base="xs:integer">
+ <xs:maxInclusive value="0" id="nonPositiveInteger.maxInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="negativeInteger" id="negativeInteger">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#negativeInteger"/>
+ </xs:annotation>
+ <xs:restriction base="xs:nonPositiveInteger">
+ <xs:maxInclusive value="-1" id="negativeInteger.maxInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="long" id="long">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasProperty name="bounded" value="true"/>
+ <hfp:hasProperty name="cardinality" value="finite"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#long"/>
+ </xs:annotation>
+ <xs:restriction base="xs:integer">
+ <xs:minInclusive value="-9223372036854775808" id="long.minInclusive"/>
+ <xs:maxInclusive value="9223372036854775807" id="long.maxInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="int" id="int">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#int"/>
+ </xs:annotation>
+ <xs:restriction base="xs:long">
+ <xs:minInclusive value="-2147483648" id="int.minInclusive"/>
+ <xs:maxInclusive value="2147483647" id="int.maxInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="short" id="short">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#short"/>
+ </xs:annotation>
+ <xs:restriction base="xs:int">
+ <xs:minInclusive value="-32768" id="short.minInclusive"/>
+ <xs:maxInclusive value="32767" id="short.maxInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="byte" id="byte">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#byte"/>
+ </xs:annotation>
+ <xs:restriction base="xs:short">
+ <xs:minInclusive value="-128" id="byte.minInclusive"/>
+ <xs:maxInclusive value="127" id="byte.maxInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="nonNegativeInteger" id="nonNegativeInteger">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#nonNegativeInteger"/>
+ </xs:annotation>
+ <xs:restriction base="xs:integer">
+ <xs:minInclusive value="0" id="nonNegativeInteger.minInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="unsignedLong" id="unsignedLong">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasProperty name="bounded" value="true"/>
+ <hfp:hasProperty name="cardinality" value="finite"/>
+ </xs:appinfo>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#unsignedLong"/>
+ </xs:annotation>
+ <xs:restriction base="xs:nonNegativeInteger">
+ <xs:maxInclusive value="18446744073709551615"
+ id="unsignedLong.maxInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="unsignedInt" id="unsignedInt">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#unsignedInt"/>
+ </xs:annotation>
+ <xs:restriction base="xs:unsignedLong">
+ <xs:maxInclusive value="4294967295" id="unsignedInt.maxInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="unsignedShort" id="unsignedShort">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#unsignedShort"/>
+ </xs:annotation>
+ <xs:restriction base="xs:unsignedInt">
+ <xs:maxInclusive value="65535" id="unsignedShort.maxInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="unsignedByte" id="unsignedByte">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#unsignedByte"/>
+ </xs:annotation>
+ <xs:restriction base="xs:unsignedShort">
+ <xs:maxInclusive value="255" id="unsignedByte.maxInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="positiveInteger" id="positiveInteger">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#positiveInteger"/>
+ </xs:annotation>
+ <xs:restriction base="xs:nonNegativeInteger">
+ <xs:minInclusive value="1" id="positiveInteger.minInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="derivationControl">
+ <xs:annotation>
+ <xs:documentation>
+ A utility type, not for public use</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="substitution"/>
+ <xs:enumeration value="extension"/>
+ <xs:enumeration value="restriction"/>
+ <xs:enumeration value="list"/>
+ <xs:enumeration value="union"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:group name="simpleDerivation">
+ <xs:choice>
+ <xs:element ref="xs:restriction"/>
+ <xs:element ref="xs:list"/>
+ <xs:element ref="xs:union"/>
+ </xs:choice>
+ </xs:group>
+ <xs:simpleType name="simpleDerivationSet">
+ <xs:annotation>
+ <xs:documentation>
+ #all or (possibly empty) subset of {restriction, union, list}
+ </xs:documentation>
+ <xs:documentation>
+ A utility type, not for public use</xs:documentation>
+ </xs:annotation>
+ <xs:union>
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="#all"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType>
+ <xs:list>
+ <xs:simpleType>
+ <xs:restriction base="xs:derivationControl">
+ <xs:enumeration value="list"/>
+ <xs:enumeration value="union"/>
+ <xs:enumeration value="restriction"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:list>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ <xs:complexType name="simpleType" abstract="true">
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:group ref="xs:simpleDerivation"/>
+ <xs:attribute name="final" type="xs:simpleDerivationSet"/>
+ <xs:attribute name="name" type="xs:NCName">
+ <xs:annotation>
+ <xs:documentation>
+ Can be restricted to required or forbidden
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="topLevelSimpleType">
+ <xs:complexContent>
+ <xs:restriction base="xs:simpleType">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:group ref="xs:simpleDerivation"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:NCName" use="required">
+ <xs:annotation>
+ <xs:documentation>
+ Required at the top level
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="localSimpleType">
+ <xs:complexContent>
+ <xs:restriction base="xs:simpleType">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:group ref="xs:simpleDerivation"/>
+ </xs:sequence>
+ <xs:attribute name="name" use="prohibited">
+ <xs:annotation>
+ <xs:documentation>
+ Forbidden when nested
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="final" use="prohibited"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:element name="simpleType" type="xs:topLevelSimpleType" id="simpleType">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-simpleType"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:group name="facets">
+ <xs:annotation>
+ <xs:documentation>
+ We should use a substitution group for facets, but
+ that's ruled out because it would allow users to
+ add their own, which we're not ready for yet.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:choice>
+ <xs:element ref="xs:minExclusive"/>
+ <xs:element ref="xs:minInclusive"/>
+ <xs:element ref="xs:maxExclusive"/>
+ <xs:element ref="xs:maxInclusive"/>
+ <xs:element ref="xs:totalDigits"/>
+ <xs:element ref="xs:fractionDigits"/>
+ <xs:element ref="xs:length"/>
+ <xs:element ref="xs:minLength"/>
+ <xs:element ref="xs:maxLength"/>
+ <xs:element ref="xs:enumeration"/>
+ <xs:element ref="xs:whiteSpace"/>
+ <xs:element ref="xs:pattern"/>
+ </xs:choice>
+ </xs:group>
+ <xs:group name="simpleRestrictionModel">
+ <xs:sequence>
+ <xs:element name="simpleType" type="xs:localSimpleType" minOccurs="0"/>
+ <xs:group ref="xs:facets" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:group>
+ <xs:element name="restriction" id="restriction">
+ <xs:complexType>
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-restriction">
+ base attribute and simpleType child are mutually
+ exclusive, but one or other is required
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:group ref="xs:simpleRestrictionModel"/>
+ <xs:attribute name="base" type="xs:QName" use="optional"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="list" id="list">
+ <xs:complexType>
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-list">
+ itemType attribute and simpleType child are mutually
+ exclusive, but one or other is required
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:sequence>
+ <xs:element name="simpleType" type="xs:localSimpleType"
+ minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="itemType" type="xs:QName" use="optional"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="union" id="union">
+ <xs:complexType>
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-union">
+ memberTypes attribute must be non-empty or there must be
+ at least one simpleType child
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:sequence>
+ <xs:element name="simpleType" type="xs:localSimpleType"
+ minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="memberTypes" use="optional">
+ <xs:simpleType>
+ <xs:list itemType="xs:QName"/>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:complexType name="facet">
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:attribute name="value" use="required"/>
+ <xs:attribute name="fixed" type="xs:boolean" default="false"
+ use="optional"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="noFixedFacet">
+ <xs:complexContent>
+ <xs:restriction base="xs:facet">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="fixed" use="prohibited"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:element name="minExclusive" type="xs:facet" id="minExclusive">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-minExclusive"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="minInclusive" type="xs:facet" id="minInclusive">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-minInclusive"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="maxExclusive" type="xs:facet" id="maxExclusive">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-maxExclusive"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="maxInclusive" type="xs:facet" id="maxInclusive">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-maxInclusive"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:complexType name="numFacet">
+ <xs:complexContent>
+ <xs:restriction base="xs:facet">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="value" type="xs:nonNegativeInteger" use="required"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:element name="totalDigits" id="totalDigits">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-totalDigits"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:restriction base="xs:numFacet">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="value" type="xs:positiveInteger" use="required"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="fractionDigits" type="xs:numFacet" id="fractionDigits">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-fractionDigits"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="length" type="xs:numFacet" id="length">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-length"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="minLength" type="xs:numFacet" id="minLength">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-minLength"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="maxLength" type="xs:numFacet" id="maxLength">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-maxLength"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="enumeration" type="xs:noFixedFacet" id="enumeration">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-enumeration"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="whiteSpace" id="whiteSpace">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-whiteSpace"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:restriction base="xs:facet">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="value" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="preserve"/>
+ <xs:enumeration value="replace"/>
+ <xs:enumeration value="collapse"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="pattern" id="pattern">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-pattern"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:restriction base="xs:noFixedFacet">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="value" type="xs:string" use="required"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+</xs:schema>
\ No newline at end of file
diff --git a/xml/xml-psi-impl/src/com/intellij/javaee/CoreExternalResourceManager.java b/xml/xml-psi-impl/src/com/intellij/javaee/CoreExternalResourceManager.java
index c3ebfe1..320e821 100644
--- a/xml/xml-psi-impl/src/com/intellij/javaee/CoreExternalResourceManager.java
+++ b/xml/xml-psi-impl/src/com/intellij/javaee/CoreExternalResourceManager.java
@@ -119,6 +119,16 @@
}
@Override
+ public XMLSchemaVersion getXmlSchemaVersion(@NotNull Project project) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setXmlSchemaVersion(XMLSchemaVersion version, @NotNull Project project) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
public String getCatalogPropertiesFile() {
throw new UnsupportedOperationException();
}
diff --git a/xml/xml-psi-impl/src/com/intellij/javaee/ExternalResourceManagerEx.java b/xml/xml-psi-impl/src/com/intellij/javaee/ExternalResourceManagerEx.java
index e8b7ee6..f5f548b 100644
--- a/xml/xml-psi-impl/src/com/intellij/javaee/ExternalResourceManagerEx.java
+++ b/xml/xml-psi-impl/src/com/intellij/javaee/ExternalResourceManagerEx.java
@@ -24,6 +24,11 @@
public abstract class ExternalResourceManagerEx extends ExternalResourceManager {
@NonNls public static final String STANDARD_SCHEMAS = "/standardSchemas/";
+ public enum XMLSchemaVersion {
+ XMLSchema_1_0,
+ XMLSchema_1_1
+ }
+
public static ExternalResourceManagerEx getInstanceEx() {
return (ExternalResourceManagerEx)getInstance();
}
@@ -67,6 +72,10 @@
public abstract void setDefaultHtmlDoctype(@NotNull String defaultHtmlDoctype, @NotNull Project project);
+ public abstract XMLSchemaVersion getXmlSchemaVersion(@NotNull Project project);
+
+ public abstract void setXmlSchemaVersion(XMLSchemaVersion version, @NotNull Project project);
+
public abstract String getCatalogPropertiesFile();
public abstract void setCatalogPropertiesFile(@Nullable String filePath);
diff --git a/xml/xml-psi-impl/src/com/intellij/javaee/ExternalResourceManagerExImpl.java b/xml/xml-psi-impl/src/com/intellij/javaee/ExternalResourceManagerExImpl.java
index 93829e9..3a503bb 100644
--- a/xml/xml-psi-impl/src/com/intellij/javaee/ExternalResourceManagerExImpl.java
+++ b/xml/xml-psi-impl/src/com/intellij/javaee/ExternalResourceManagerExImpl.java
@@ -57,7 +57,9 @@
@NonNls public static final String J2EE_1_2 = "http://java.sun.com/j2ee/dtds/";
@NonNls public static final String J2EE_NS = "http://java.sun.com/xml/ns/j2ee/";
@NonNls public static final String JAVAEE_NS = "http://java.sun.com/xml/ns/javaee/";
+
private static final String CATALOG_PROPERTIES_ELEMENT = "CATALOG_PROPERTIES";
+ private static final String XSD_1_1 = new Resource("/standardSchemas/XMLSchema-1_1/XMLSchema.xsd", ExternalResourceManagerExImpl.class, null).getResourceUrl();
private final Map<String, Map<String, String>> myResources = new THashMap<String, Map<String, String>>();
private final Set<String> myResourceLocations = new THashSet<String>();
@@ -74,6 +76,7 @@
};
private String myDefaultHtmlDoctype = HTML5_DOCTYPE_ELEMENT;
+ private XMLSchemaVersion myXMLSchemaVersion = XMLSchemaVersion.XMLSchema_1_0;
private String myCatalogPropertiesFile;
private XMLCatalogManager myCatalogManager;
@@ -98,6 +101,7 @@
@NonNls private static final String LOCATION_ATTR = "location";
@NonNls private static final String IGNORED_RESOURCE_ELEMENT = "ignored-resource";
@NonNls private static final String HTML_DEFAULT_DOCTYPE_ELEMENT = "default-html-doctype";
+ @NonNls private static final String XML_SCHEMA_VERSION = "xml-schema-version";
private static final String DEFAULT_VERSION = "";
@@ -180,13 +184,22 @@
@Override
public String getResourceLocation(@NotNull @NonNls String url, @NotNull Project project) {
- String location = getProjectResources(project).getResourceLocation(url);
- return location == null || location.equals(url) ? getResourceLocation(url) : location;
+ return getResourceLocation(url, null, project);
}
- public String getResourceLocation(@NonNls String url, String version, @NotNull Project project) {
- String location = getProjectResources(project).getResourceLocation(url, version);
- return location == null || location.equals(url) ? getResourceLocation(url, version) : location;
+ private String getResourceLocation(@NonNls String url, String version, @NotNull Project project) {
+ ExternalResourceManagerExImpl projectResources = getProjectResources(project);
+ String location = projectResources.getResourceLocation(url, version);
+ if (location == null || location.equals(url)) {
+ if (projectResources.myXMLSchemaVersion == XMLSchemaVersion.XMLSchema_1_1) {
+ if (XmlUtil.XML_SCHEMA_URI.equals(url)) return XSD_1_1;
+ if ((XmlUtil.XML_SCHEMA_URI + ".xsd").equals(url)) return XSD_1_1;
+ }
+ return getResourceLocation(url, version);
+ }
+ else {
+ return location;
+ }
}
@Override
@@ -432,6 +445,11 @@
e.setText(myDefaultHtmlDoctype);
element.addContent(e);
}
+ if (myXMLSchemaVersion != XMLSchemaVersion.XMLSchema_1_0) {
+ Element e = new Element(XML_SCHEMA_VERSION);
+ e.setText(myXMLSchemaVersion.toString());
+ element.addContent(e);
+ }
if (myCatalogPropertiesFile != null) {
Element properties = new Element(CATALOG_PROPERTIES_ELEMENT);
properties.setText(myCatalogPropertiesFile);
@@ -471,6 +489,11 @@
}
myDefaultHtmlDoctype = text;
}
+ Element schemaElement = state.getChild(XML_SCHEMA_VERSION);
+ if (schemaElement != null) {
+ String text = schemaElement.getText();
+ myXMLSchemaVersion = XMLSchemaVersion.XMLSchema_1_1.toString().equals(text) ? XMLSchemaVersion.XMLSchema_1_1 : XMLSchemaVersion.XMLSchema_1_0;
+ }
Element catalogElement = state.getChild(CATALOG_PROPERTIES_ELEMENT);
if (catalogElement != null) {
myCatalogPropertiesFile = catalogElement.getTextTrim();
@@ -491,6 +514,7 @@
for (ExternalResourceListener listener : myListeners) {
listener.externalResourceChanged();
}
+ incModificationCount();
}
Collection<Map<String, Resource>> getStandardResources() {
@@ -524,6 +548,17 @@
}
@Override
+ public XMLSchemaVersion getXmlSchemaVersion(@NotNull Project project) {
+ return getProjectResources(project).myXMLSchemaVersion;
+ }
+
+ @Override
+ public void setXmlSchemaVersion(XMLSchemaVersion version, @NotNull Project project) {
+ getProjectResources(project).myXMLSchemaVersion = version;
+ fireExternalResourceChanged();
+ }
+
+ @Override
public String getCatalogPropertiesFile() {
return myCatalogPropertiesFile;
}
diff --git a/xml/xml-psi-impl/src/com/intellij/javaee/InternalResourceProvider.java b/xml/xml-psi-impl/src/com/intellij/javaee/InternalResourceProvider.java
index 3877792..f0e250f 100644
--- a/xml/xml-psi-impl/src/com/intellij/javaee/InternalResourceProvider.java
+++ b/xml/xml-psi-impl/src/com/intellij/javaee/InternalResourceProvider.java
@@ -30,8 +30,10 @@
impl.addInternalResource(XmlUtil.XSLT_URI,"xslt-1_0.xsd");
impl.addInternalResource(XmlUtil.XSLT_URI,"2.0", "xslt-2_0.xsd");
impl.addInternalResource(XmlUtil.XINCLUDE_URI,"xinclude.xsd");
+
impl.addInternalResource(XmlUtil.XML_SCHEMA_URI, "XMLSchema.xsd");
impl.addInternalResource(XmlUtil.XML_SCHEMA_URI + ".xsd", "XMLSchema.xsd");
+
impl.addInternalResource("http://www.w3.org/2001/XMLSchema.dtd", "XMLSchema.dtd");
impl.addInternalResource(XmlUtil.XML_SCHEMA_INSTANCE_URI, "XMLSchema-instance.xsd");
impl.addInternalResource("http://www.w3.org/2001/xml.xsd","xml.xsd");
diff --git a/xml/xml-psi-impl/src/com/intellij/lexer/_HtmlLexer.flex b/xml/xml-psi-impl/src/com/intellij/lexer/_HtmlLexer.flex
index c5d965d..028bf0d 100644
--- a/xml/xml-psi-impl/src/com/intellij/lexer/_HtmlLexer.flex
+++ b/xml/xml-psi-impl/src/com/intellij/lexer/_HtmlLexer.flex
@@ -52,7 +52,7 @@
DOCTYPE= "<!" (D|d)(O|o)(C|c)(T|t)(Y|y)(P|p)(E|e)
HTML= (H|h)(T|t)(M|m)(L|l)
PUBLIC= (P|p)(U|u)(B|b)(L|l)(I|i)(C|c)
-END_COMMENT="--"[ \n\r\t\f]*">"
+END_COMMENT="-->"
CONDITIONAL_COMMENT_CONDITION=({ALPHA})({ALPHA}|{WHITE_SPACE_CHARS}|{DIGIT}|"."|"("|")"|"|"|"!"|"&")*
%%
diff --git a/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlDocumentImpl.java b/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlDocumentImpl.java
index 3eed827..59c7d0b 100644
--- a/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlDocumentImpl.java
+++ b/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlDocumentImpl.java
@@ -41,6 +41,7 @@
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.util.CachedValue;
import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.util.CachedValuesManager;
import com.intellij.psi.xml.*;
import com.intellij.util.IncorrectOperationException;
import com.intellij.util.containers.ContainerUtil;
@@ -233,6 +234,17 @@
}
nsDescriptor = getDefaultNSDescriptor(htmlns, false);
}
+ final XmlFile descriptorFile = nsDescriptor.getDescriptorFile();
+ if (descriptorFile != null) {
+ final XmlNSDescriptor finalNsDescriptor = nsDescriptor;
+ return CachedValuesManager.getCachedValue(descriptorFile, new CachedValueProvider<XmlNSDescriptor>() {
+ @Nullable
+ @Override
+ public Result<XmlNSDescriptor> compute() {
+ return Result.<XmlNSDescriptor>create(new HtmlNSDescriptorImpl(finalNsDescriptor), descriptorFile);
+ }
+ });
+ }
return new HtmlNSDescriptorImpl(nsDescriptor);
}
else if (XmlUtil.XHTML_URI.equals(namespace)) {
diff --git a/xml/xml-psi-impl/src/com/intellij/xml/actions/validate/ValidateXmlActionHandler.java b/xml/xml-psi-impl/src/com/intellij/xml/actions/validate/ValidateXmlActionHandler.java
index 2e851e5..0079be2 100644
--- a/xml/xml-psi-impl/src/com/intellij/xml/actions/validate/ValidateXmlActionHandler.java
+++ b/xml/xml-psi-impl/src/com/intellij/xml/actions/validate/ValidateXmlActionHandler.java
@@ -20,6 +20,7 @@
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiManager;
import com.intellij.psi.xml.*;
@@ -76,9 +77,16 @@
myErrorReporter = errorReporter;
}
- public VirtualFile getFile(String publicId, String systemId) {
+ public VirtualFile getProblemFile(SAXParseException ex) {
+ String publicId = ex.getPublicId();
+ String systemId = ex.getSystemId();
if (publicId == null) {
if (systemId != null) {
+ if (systemId.startsWith("file:/")) {
+ VirtualFile file = VirtualFileManager.getInstance()
+ .findFileByUrl(systemId.startsWith("file://") ? systemId : systemId.replace("file:/", "file://"));
+ if (file != null) return file;
+ }
final String path = myXmlResourceResolver.getPathByPublicId(systemId);
if (path != null) return UriUtil.findRelativeFile(path,null);
final PsiFile file = myXmlResourceResolver.resolve(null, systemId);
@@ -95,7 +103,7 @@
public String buildMessageString(SAXParseException ex) {
String msg = "(" + ex.getLineNumber() + ":" + ex.getColumnNumber() + ") " + ex.getMessage();
- final VirtualFile file = getFile(ex.getPublicId(), ex.getSystemId());
+ final VirtualFile file = getProblemFile(ex);
if ( file != null && !file.equals(myFile.getVirtualFile())) {
msg = file.getName() + ":" + msg;
diff --git a/xml/xml-psi-impl/src/com/intellij/xml/impl/ExternalDocumentValidator.java b/xml/xml-psi-impl/src/com/intellij/xml/impl/ExternalDocumentValidator.java
index debb58a..71ad2d5 100644
--- a/xml/xml-psi-impl/src/com/intellij/xml/impl/ExternalDocumentValidator.java
+++ b/xml/xml-psi-impl/src/com/intellij/xml/impl/ExternalDocumentValidator.java
@@ -146,7 +146,7 @@
return;
}
- final VirtualFile errorFile = myHandler.getFile(e.getPublicId(), e.getSystemId());
+ final VirtualFile errorFile = myHandler.getProblemFile(e);
if (!Comparing.equal(errorFile, file.getVirtualFile()) && errorFile != null) {
return; // error in attached schema
}