Merge remote-tracking branch 'origin/master'
authorAnna Kozlova <anna.kozlova@jetbrains.com>
Wed, 10 Sep 2014 10:18:26 +0000 (14:18 +0400)
committerAnna Kozlova <anna.kozlova@jetbrains.com>
Wed, 10 Sep 2014 10:18:26 +0000 (14:18 +0400)
49 files changed:
.gitignore
.idea/libraries/asm_tools.xml [new file with mode: 0644]
.idea/libraries/bouncy_castle.xml [new file with mode: 0644]
.idea/libraries/builder_model.xml [new file with mode: 0644]
.idea/libraries/commons_compress.xml [new file with mode: 0644]
.idea/libraries/easymock_tools.xml [new file with mode: 0644]
.idea/libraries/freemarker_2_3_20.xml [new file with mode: 0644]
.idea/libraries/guava_tools.xml [new file with mode: 0644]
.idea/libraries/javawriter.xml [new file with mode: 0644]
.idea/libraries/kxml2.xml [new file with mode: 0644]
.idea/libraries/lombok_ast.xml [new file with mode: 0644]
.idea/libraries/mockito.xml [new file with mode: 0644]
.idea/modules.xml
.idea/vcs.xml
build/scripts/layouts.gant
getPlugins.bat [new file with mode: 0644]
getPlugins.sh [new file with mode: 0755]
java/java-impl/src/com/intellij/ide/projectView/impl/ClassesTreeStructureProvider.java
platform/editor-ui-ex/src/com/intellij/psi/impl/cache/impl/id/PlatformIdTableBuilding.java
platform/editor-ui-ex/src/com/intellij/psi/impl/cache/impl/todo/TodoIndex.java
platform/indexing-api/src/com/intellij/lang/cacheBuilder/DefaultWordsScanner.java
platform/indexing-api/src/com/intellij/lang/cacheBuilder/SimpleWordsScanner.java
platform/indexing-api/src/com/intellij/lang/cacheBuilder/VersionedWordsScanner.java [new file with mode: 0644]
platform/indexing-impl/src/com/intellij/psi/impl/cache/impl/id/FileTypeIdIndexer.java
platform/indexing-impl/src/com/intellij/psi/impl/cache/impl/id/IdTableBuilding.java
platform/indexing-impl/src/com/intellij/psi/impl/cache/impl/todo/LexerBasedTodoIndexer.java
platform/indexing-impl/src/com/intellij/psi/impl/cache/impl/todo/VersionedTodoIndexer.java [new file with mode: 0644]
platform/lang-api/src/com/intellij/psi/codeStyle/autodetect/IndentOptionsDetector.java [new file with mode: 0644]
platform/lang-api/src/com/intellij/psi/codeStyle/autodetect/IndentUsageInfo.java [new file with mode: 0644]
platform/lang-api/src/com/intellij/psi/codeStyle/autodetect/IndentUsageStatistics.java [new file with mode: 0644]
platform/lang-api/src/com/intellij/psi/codeStyle/autodetect/IndentUsageStatisticsImpl.java [new file with mode: 0644]
platform/lang-api/src/com/intellij/psi/codeStyle/autodetect/LineIndentInfo.java [new file with mode: 0644]
platform/lang-api/src/com/intellij/psi/codeStyle/autodetect/LineIndentInfoBuilder.java [new file with mode: 0644]
platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java
platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/InspectionsConfigTreeTable.java
platform/lang-impl/src/com/intellij/psi/impl/cache/impl/id/IdIndexImpl.java
platform/platform-impl/src/com/intellij/ide/actions/CreateLauncherScriptAction.java
platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/NoUpdatesPanel.form
platform/platform-resources/src/launcher.py
platform/platform-tests/testData/codeStyle/autodetect/manyComments.java [new file with mode: 0644]
platform/platform-tests/testData/codeStyle/autodetect/manyZeroRelativeIndent.java [new file with mode: 0644]
platform/platform-tests/testData/codeStyle/autodetect/simpleIndent.java [new file with mode: 0644]
platform/platform-tests/testSrc/com/intellij/psi/autodetect/IndentAutoDetectionTest.java [new file with mode: 0644]
plugins/github/src/org/jetbrains/plugins/github/api/GithubUser.java
plugins/github/src/org/jetbrains/plugins/github/api/GithubUserDetailed.java
plugins/github/src/org/jetbrains/plugins/github/api/GithubUserRaw.java
plugins/github/src/org/jetbrains/plugins/github/tasks/GithubComment.java
plugins/github/src/org/jetbrains/plugins/github/tasks/GithubRepository.java
plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/PropertiesImplUtil.java

index e1a3e405ef99c08b890c07ed86d348cb2035ce34..3fb1a17163fc66fc6825b47bfe4170b88d2c87d1 100644 (file)
@@ -1,3 +1,4 @@
+/android
 /config
 /system
 .idea/workspace.xml
diff --git a/.idea/libraries/asm_tools.xml b/.idea/libraries/asm_tools.xml
new file mode 100644 (file)
index 0000000..9435a42
--- /dev/null
@@ -0,0 +1,11 @@
+<component name="libraryTable">
+  <library name="asm-tools">
+    <CLASSES>
+      <root url="jar://$PROJECT_DIR$/android/android/lib/asm-4.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/android/android/lib/asm-analysis-4.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/android/android/lib/asm-tree-4.0.jar!/" />
+    </CLASSES>
+    <JAVADOC />
+    <SOURCES />
+  </library>
+</component>
\ No newline at end of file
diff --git a/.idea/libraries/bouncy_castle.xml b/.idea/libraries/bouncy_castle.xml
new file mode 100644 (file)
index 0000000..4e4673a
--- /dev/null
@@ -0,0 +1,10 @@
+<component name="libraryTable">
+  <library name="bouncy-castle">
+    <CLASSES>
+      <root url="jar://$PROJECT_DIR$/android/android/lib/bcpkix-jdk15on-1.48.jar!/" />
+      <root url="jar://$PROJECT_DIR$/android/android/lib/bcprov-jdk15on-1.48.jar!/" />
+    </CLASSES>
+    <JAVADOC />
+    <SOURCES />
+  </library>
+</component>
\ No newline at end of file
diff --git a/.idea/libraries/builder_model.xml b/.idea/libraries/builder_model.xml
new file mode 100644 (file)
index 0000000..e50dabd
--- /dev/null
@@ -0,0 +1,11 @@
+<component name="libraryTable">
+  <library name="builder-model">
+    <CLASSES>
+      <root url="jar://$PROJECT_DIR$/android/android/lib/builder-model-0.12.0.jar!/" />
+    </CLASSES>
+    <JAVADOC />
+    <SOURCES>
+      <root url="jar://$PROJECT_DIR$/android/android/lib/src/builder-model-0.12.0-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>
\ No newline at end of file
diff --git a/.idea/libraries/commons_compress.xml b/.idea/libraries/commons_compress.xml
new file mode 100644 (file)
index 0000000..a77ee36
--- /dev/null
@@ -0,0 +1,9 @@
+<component name="libraryTable">
+  <library name="commons-compress">
+    <CLASSES>
+      <root url="jar://$PROJECT_DIR$/android/android/lib/commons-compress-1.0.jar!/" />
+    </CLASSES>
+    <JAVADOC />
+    <SOURCES />
+  </library>
+</component>
\ No newline at end of file
diff --git a/.idea/libraries/easymock_tools.xml b/.idea/libraries/easymock_tools.xml
new file mode 100644 (file)
index 0000000..c996385
--- /dev/null
@@ -0,0 +1,10 @@
+<component name="libraryTable">
+  <library name="easymock-tools">
+    <CLASSES>
+      <root url="jar://$PROJECT_DIR$/lib/dev/easymockclassextension.jar!/" />
+      <root url="jar://$PROJECT_DIR$/lib/dev/easymock.jar!/" />
+    </CLASSES>
+    <JAVADOC />
+    <SOURCES />
+  </library>
+</component>
\ No newline at end of file
diff --git a/.idea/libraries/freemarker_2_3_20.xml b/.idea/libraries/freemarker_2_3_20.xml
new file mode 100644 (file)
index 0000000..831297d
--- /dev/null
@@ -0,0 +1,9 @@
+<component name="libraryTable">
+  <library name="freemarker-2.3.20">
+    <CLASSES>
+      <root url="jar://$PROJECT_DIR$/android/android/lib/freemarker-2.3.20.jar!/" />
+    </CLASSES>
+    <JAVADOC />
+    <SOURCES />
+  </library>
+</component>
\ No newline at end of file
diff --git a/.idea/libraries/guava_tools.xml b/.idea/libraries/guava_tools.xml
new file mode 100644 (file)
index 0000000..b492cf4
--- /dev/null
@@ -0,0 +1,11 @@
+<component name="libraryTable">
+  <library name="guava-tools">
+    <CLASSES>
+      <root url="jar://$PROJECT_DIR$/lib/guava-17.0.jar!/" />
+    </CLASSES>
+    <JAVADOC />
+    <SOURCES>
+      <root url="jar://$PROJECT_DIR$/lib/src/guava-17.0-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>
\ No newline at end of file
diff --git a/.idea/libraries/javawriter.xml b/.idea/libraries/javawriter.xml
new file mode 100644 (file)
index 0000000..1d73b23
--- /dev/null
@@ -0,0 +1,11 @@
+<component name="libraryTable">
+  <library name="javawriter">
+    <CLASSES>
+      <root url="jar://$PROJECT_DIR$/android/android/lib/javawriter-2.2.1.jar!/" />
+    </CLASSES>
+    <JAVADOC />
+    <SOURCES>
+      <root url="jar://$PROJECT_DIR$/android/android/lib/src/javawriter-2.2.1-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>
\ No newline at end of file
diff --git a/.idea/libraries/kxml2.xml b/.idea/libraries/kxml2.xml
new file mode 100644 (file)
index 0000000..fe007f5
--- /dev/null
@@ -0,0 +1,9 @@
+<component name="libraryTable">
+  <library name="kxml2">
+    <CLASSES>
+      <root url="jar://$PROJECT_DIR$/android/android/lib/kxml2-2.3.0.jar!/" />
+    </CLASSES>
+    <JAVADOC />
+    <SOURCES />
+  </library>
+</component>
\ No newline at end of file
diff --git a/.idea/libraries/lombok_ast.xml b/.idea/libraries/lombok_ast.xml
new file mode 100644 (file)
index 0000000..9fe1aa4
--- /dev/null
@@ -0,0 +1,16 @@
+<component name="libraryTable">
+  <library name="lombok-ast">
+    <CLASSES>
+      <root url="jar://$PROJECT_DIR$/android/android/lib/lombok-ast-0.2.2.jar!/" />
+    </CLASSES>
+    <JAVADOC />
+    <SOURCES>
+      <root url="jar://$PROJECT_DIR$/android/android/lib/src/lombok-ast-0.2.2-src.zip!/src/main" />
+      <root url="jar://$PROJECT_DIR$/android/android/lib/src/lombok-ast-0.2.2-src.zip!/src/printer" />
+      <root url="jar://$PROJECT_DIR$/android/android/lib/src/lombok-ast-0.2.2-src.zip!/src/template" />
+      <root url="jar://$PROJECT_DIR$/android/android/lib/src/lombok-ast-0.2.2-src.zip!/src/ecjTransformer" />
+      <root url="jar://$PROJECT_DIR$/android/android/lib/src/lombok-ast-0.2.2-src.zip!/src/javacTransformer" />
+      <root url="jar://$PROJECT_DIR$/android/android/lib/src/lombok-ast-0.2.2-src.zip!/build/lombok.ast_generatedSource" />
+    </SOURCES>
+  </library>
+</component>
\ No newline at end of file
diff --git a/.idea/libraries/mockito.xml b/.idea/libraries/mockito.xml
new file mode 100644 (file)
index 0000000..a1ae9af
--- /dev/null
@@ -0,0 +1,11 @@
+<component name="libraryTable">
+  <library name="mockito">
+    <CLASSES>
+      <root url="jar://$PROJECT_DIR$/android/android/lib/mockito-all-1.9.5.jar!/" />
+    </CLASSES>
+    <JAVADOC />
+    <SOURCES>
+      <root url="jar://$PROJECT_DIR$/android/android/lib/mockito-all-1.9.5.jar!/" />
+    </SOURCES>
+  </library>
+</component>
\ No newline at end of file
index 0322352e9df9763deb9509575d8ae0b4bdea89d4..f23cddeafc3c42b8cc9751bf9fd805f4972cf40f 100644 (file)
       <module fileurl="file://$PROJECT_DIR$/plugins/IntelliLang/IntelliLang-xml.iml" filepath="$PROJECT_DIR$/plugins/IntelliLang/IntelliLang-xml.iml" group="plugins/IntelliLang" />
       <module fileurl="file://$PROJECT_DIR$/RegExpSupport/RegExpSupport.iml" filepath="$PROJECT_DIR$/RegExpSupport/RegExpSupport.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/plugins/ShortcutPromoter/ShortcutPromoter.iml" filepath="$PROJECT_DIR$/plugins/ShortcutPromoter/ShortcutPromoter.iml" group="plugins" />
+      <module fileurl="file://$PROJECT_DIR$/android/adt-branding/adt-branding.iml" filepath="$PROJECT_DIR$/android/adt-branding/adt-branding.iml" group="android" />
       <module fileurl="file://$PROJECT_DIR$/platform/analysis-api/analysis-api.iml" filepath="$PROJECT_DIR$/platform/analysis-api/analysis-api.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/platform/analysis-impl/analysis-impl.iml" filepath="$PROJECT_DIR$/platform/analysis-impl/analysis-impl.iml" group="platform" />
+      <module fileurl="file://$PROJECT_DIR$/android/android/android.iml" filepath="$PROJECT_DIR$/android/android/android.iml" group="android" />
+      <module fileurl="file://$PROJECT_DIR$/android/android/common/android-common.iml" filepath="$PROJECT_DIR$/android/android/common/android-common.iml" group="android" />
+      <module fileurl="file://$PROJECT_DIR$/android/android-gradle-jps/android-gradle-jps.iml" filepath="$PROJECT_DIR$/android/android-gradle-jps/android-gradle-jps.iml" group="android" />
+      <module fileurl="file://$PROJECT_DIR$/android/android/jps-plugin/android-jps-plugin.iml" filepath="$PROJECT_DIR$/android/android/jps-plugin/android-jps-plugin.iml" group="android" />
+      <module fileurl="file://$PROJECT_DIR$/android/android/rt/android-rt.iml" filepath="$PROJECT_DIR$/android/android/rt/android-rt.iml" group="android" />
       <module fileurl="file://$PROJECT_DIR$/platform/annotations/annotations.iml" filepath="$PROJECT_DIR$/platform/annotations/annotations.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/plugins/ant/ant.iml" filepath="$PROJECT_DIR$/plugins/ant/ant.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/plugins/ant/jps-plugin/ant-jps-plugin.iml" filepath="$PROJECT_DIR$/plugins/ant/jps-plugin/ant-jps-plugin.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/jps/antLayout/antlayout.iml" filepath="$PROJECT_DIR$/jps/antLayout/antlayout.iml" group="jps" />
       <module fileurl="file://$PROJECT_DIR$/plugins/google-app-engine/runtime/appEngine-runtime.iml" filepath="$PROJECT_DIR$/plugins/google-app-engine/runtime/appEngine-runtime.iml" group="plugins/GAE" />
+      <module fileurl="file://$PROJECT_DIR$/android/tools-base/asset-studio/assetstudio.iml" filepath="$PROJECT_DIR$/android/tools-base/asset-studio/assetstudio.iml" group="android/sdktools" />
       <module fileurl="file://$PROJECT_DIR$/platform/boot/boot.iml" filepath="$PROJECT_DIR$/platform/boot/boot.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/platform/bootstrap/bootstrap.iml" filepath="$PROJECT_DIR$/platform/bootstrap/bootstrap.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/build/build.iml" filepath="$PROJECT_DIR$/build/build.iml" />
       <module fileurl="file://$PROJECT_DIR$/colorSchemes/colorSchemes.iml" filepath="$PROJECT_DIR$/colorSchemes/colorSchemes.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/plugins/commander/commander.iml" filepath="$PROJECT_DIR$/plugins/commander/commander.iml" group="plugins" />
+      <module fileurl="file://$PROJECT_DIR$/android/tools-base/common/common.iml" filepath="$PROJECT_DIR$/android/tools-base/common/common.iml" group="android/sdktools" />
       <module fileurl="file://$PROJECT_DIR$/plugins/eclipse/common-eclipse-util/common-eclipse-util.iml" filepath="$PROJECT_DIR$/plugins/eclipse/common-eclipse-util/common-eclipse-util.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/plugins/javaFX/common-javaFX-plugin/common-javaFX-plugin.iml" filepath="$PROJECT_DIR$/plugins/javaFX/common-javaFX-plugin/common-javaFX-plugin.iml" group="plugins/JavaFX" />
       <module fileurl="file://$PROJECT_DIR$/community-main.iml" filepath="$PROJECT_DIR$/community-main.iml" />
@@ -39,6 +47,7 @@
       <module fileurl="file://$PROJECT_DIR$/build/cucumber-test-runner/cucumber-test-runner.iml" filepath="$PROJECT_DIR$/build/cucumber-test-runner/cucumber-test-runner.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/plugins/cvs/cvs-core/cvs-core.iml" filepath="$PROJECT_DIR$/plugins/cvs/cvs-core/cvs-core.iml" group="plugins/VCS/cvs" />
       <module fileurl="file://$PROJECT_DIR$/plugins/cvs/cvs-plugin/cvs-plugin.iml" filepath="$PROJECT_DIR$/plugins/cvs/cvs-plugin/cvs-plugin.iml" group="plugins/VCS/cvs" />
+      <module fileurl="file://$PROJECT_DIR$/android/tools-base/ddmlib/ddmlib.iml" filepath="$PROJECT_DIR$/android/tools-base/ddmlib/ddmlib.iml" group="android/sdktools" />
       <module fileurl="file://$PROJECT_DIR$/java/debugger/impl/debugger-impl.iml" filepath="$PROJECT_DIR$/java/debugger/impl/debugger-impl.iml" group="java" />
       <module fileurl="file://$PROJECT_DIR$/java/debugger/openapi/debugger-openapi.iml" filepath="$PROJECT_DIR$/java/debugger/openapi/debugger-openapi.iml" group="java" />
       <module fileurl="file://$PROJECT_DIR$/plugins/devkit/devkit.iml" filepath="$PROJECT_DIR$/plugins/devkit/devkit.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/xml/dom-impl/dom-impl.iml" filepath="$PROJECT_DIR$/xml/dom-impl/dom-impl.iml" group="xml" />
       <module fileurl="file://$PROJECT_DIR$/xml/dom-openapi/dom-openapi.iml" filepath="$PROJECT_DIR$/xml/dom-openapi/dom-openapi.iml" group="xml" />
       <module fileurl="file://$PROJECT_DIR$/xml/dom-tests/dom-tests.iml" filepath="$PROJECT_DIR$/xml/dom-tests/dom-tests.iml" group="xml" />
+      <module fileurl="file://$PROJECT_DIR$/android/tools-base/draw9patch/draw9patch.iml" filepath="$PROJECT_DIR$/android/tools-base/draw9patch/draw9patch.iml" group="android/sdktools" />
       <module fileurl="file://$PROJECT_DIR$/platform/duplicates-analysis/duplicates-analysis.iml" filepath="$PROJECT_DIR$/platform/duplicates-analysis/duplicates-analysis.iml" />
+      <module fileurl="file://$PROJECT_DIR$/platform/dvcs-api/dvcs-api.iml" filepath="$PROJECT_DIR$/platform/dvcs-api/dvcs-api.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/platform/dvcs-impl/dvcs-impl.iml" filepath="$PROJECT_DIR$/platform/dvcs-impl/dvcs-impl.iml" group="platform" />
-      <module fileurl="file://$PROJECT_DIR$/platform/dvcs-api/dvcs-api.iml" filepath="$PROJECT_DIR$/platform/dvcs-api/dvcs-api.iml" group="platform"/>
+      <module fileurl="file://$PROJECT_DIR$/android/tools-base/device_validator/dvlib/dvlib.iml" filepath="$PROJECT_DIR$/android/tools-base/device_validator/dvlib/dvlib.iml" group="android/sdktools" />
       <module fileurl="file://$PROJECT_DIR$/plugins/eclipse/eclipse.iml" filepath="$PROJECT_DIR$/plugins/eclipse/eclipse.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/plugins/eclipse/jps-plugin/eclipse-jps-plugin.iml" filepath="$PROJECT_DIR$/plugins/eclipse/jps-plugin/eclipse-jps-plugin.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/platform/editor-ui-api/editor-ui-api.iml" filepath="$PROJECT_DIR$/platform/editor-ui-api/editor-ui-api.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/platform/editor-ui-ex/editor-ui-ex.iml" filepath="$PROJECT_DIR$/platform/editor-ui-ex/editor-ui-ex.iml" group="platform" />
+      <module fileurl="file://$PROJECT_DIR$/plugins/editorconfig/editorconfig.iml" filepath="$PROJECT_DIR$/plugins/editorconfig/editorconfig.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/java/execution/impl/execution-impl.iml" filepath="$PROJECT_DIR$/java/execution/impl/execution-impl.iml" group="java" />
       <module fileurl="file://$PROJECT_DIR$/java/execution/openapi/execution-openapi.iml" filepath="$PROJECT_DIR$/java/execution/openapi/execution-openapi.iml" group="java" />
       <module fileurl="file://$PROJECT_DIR$/platform/extensions/extensions.iml" filepath="$PROJECT_DIR$/platform/extensions/extensions.iml" group="platform" />
@@ -66,6 +78,7 @@
       <module fileurl="file://$PROJECT_DIR$/plugins/google-app-engine/google-app-engine.iml" filepath="$PROJECT_DIR$/plugins/google-app-engine/google-app-engine.iml" group="plugins/GAE" />
       <module fileurl="file://$PROJECT_DIR$/plugins/google-app-engine/jps-plugin/google-app-engine-jps-plugin.iml" filepath="$PROJECT_DIR$/plugins/google-app-engine/jps-plugin/google-app-engine-jps-plugin.iml" group="plugins/GAE" />
       <module fileurl="file://$PROJECT_DIR$/plugins/gradle/gradle.iml" filepath="$PROJECT_DIR$/plugins/gradle/gradle.iml" group="community/plugins/gradle" />
+      <module fileurl="file://$PROJECT_DIR$/android/tools-base/gradle-import/gradle-import.iml" filepath="$PROJECT_DIR$/android/tools-base/gradle-import/gradle-import.iml" group="android/sdktools" />
       <module fileurl="file://$PROJECT_DIR$/plugins/gradle/jps-plugin/gradle-jps-plugin.iml" filepath="$PROJECT_DIR$/plugins/gradle/jps-plugin/gradle-jps-plugin.iml" group="community/plugins/gradle" />
       <module fileurl="file://$PROJECT_DIR$/plugins/gradle/tooling-extension-api/gradle-tooling-extension-api.iml" filepath="$PROJECT_DIR$/plugins/gradle/tooling-extension-api/gradle-tooling-extension-api.iml" group="community/plugins/gradle" />
       <module fileurl="file://$PROJECT_DIR$/plugins/gradle/tooling-extension-impl/gradle-tooling-extension-impl.iml" filepath="$PROJECT_DIR$/plugins/gradle/tooling-extension-impl/gradle-tooling-extension-impl.iml" group="community/plugins/gradle" />
       <module fileurl="file://$PROJECT_DIR$/plugins/junit_rt/junit_rt.iml" filepath="$PROJECT_DIR$/plugins/junit_rt/junit_rt.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/platform/lang-api/lang-api.iml" filepath="$PROJECT_DIR$/platform/lang-api/lang-api.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/platform/lang-impl/lang-impl.iml" filepath="$PROJECT_DIR$/platform/lang-impl/lang-impl.iml" group="platform" />
+      <module fileurl="file://$PROJECT_DIR$/android/tools-base/layoutlib-api/layoutlib-api.iml" filepath="$PROJECT_DIR$/android/tools-base/layoutlib-api/layoutlib-api.iml" group="android/sdktools" />
+      <module fileurl="file://$PROJECT_DIR$/android/tools-base/lint/libs/lint-api/lint-api.iml" filepath="$PROJECT_DIR$/android/tools-base/lint/libs/lint-api/lint-api.iml" group="android/sdktools" />
+      <module fileurl="file://$PROJECT_DIR$/android/tools-base/lint/libs/lint-checks/lint-checks.iml" filepath="$PROJECT_DIR$/android/tools-base/lint/libs/lint-checks/lint-checks.iml" group="android/sdktools" />
       <module fileurl="file://$PROJECT_DIR$/platform/lvcs-api/lvcs-api.iml" filepath="$PROJECT_DIR$/platform/lvcs-api/lvcs-api.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/platform/lvcs-impl/lvcs-impl.iml" filepath="$PROJECT_DIR$/platform/lvcs-impl/lvcs-impl.iml" group="platform" />
+      <module fileurl="file://$PROJECT_DIR$/android/android/main_AndroidStudio.iml" filepath="$PROJECT_DIR$/android/android/main_AndroidStudio.iml" group="android" />
       <module fileurl="file://$PROJECT_DIR$/python/main_idea_python_plugin.iml" filepath="$PROJECT_DIR$/python/main_idea_python_plugin.iml" group="python" />
       <module fileurl="file://$PROJECT_DIR$/python/main_pycharm_ce.iml" filepath="$PROJECT_DIR$/python/main_pycharm_ce.iml" group="python" />
       <module fileurl="file://$PROJECT_DIR$/python/edu/main_pycharm_edu.iml" filepath="$PROJECT_DIR$/python/edu/main_pycharm_edu.iml" group="python/educational" />
       <module fileurl="file://$PROJECT_DIR$/java/manifest/manifest.iml" filepath="$PROJECT_DIR$/java/manifest/manifest.iml" group="java" />
+      <module fileurl="file://$PROJECT_DIR$/android/tools-base/build-system/manifest-merger/manifest-merger.iml" filepath="$PROJECT_DIR$/android/tools-base/build-system/manifest-merger/manifest-merger.iml" group="android/sdktools" />
       <module fileurl="file://$PROJECT_DIR$/plugins/maven/maven.iml" filepath="$PROJECT_DIR$/plugins/maven/maven.iml" group="plugins/maven" />
       <module fileurl="file://$PROJECT_DIR$/plugins/maven/artifact-resolver-m2/maven-artifact-resolver-m2.iml" filepath="$PROJECT_DIR$/plugins/maven/artifact-resolver-m2/maven-artifact-resolver-m2.iml" group="plugins/maven" />
       <module fileurl="file://$PROJECT_DIR$/plugins/maven/artifact-resolver-m3/maven-artifact-resolver-m3.iml" filepath="$PROJECT_DIR$/plugins/maven/artifact-resolver-m3/maven-artifact-resolver-m3.iml" group="plugins/maven" />
       <module fileurl="file://$PROJECT_DIR$/plugins/maven/maven-server-api/maven-server-api.iml" filepath="$PROJECT_DIR$/plugins/maven/maven-server-api/maven-server-api.iml" group="plugins/maven" />
       <module fileurl="file://$PROJECT_DIR$/plugins/maven/maven2-server-impl/maven2-server-impl.iml" filepath="$PROJECT_DIR$/plugins/maven/maven2-server-impl/maven2-server-impl.iml" group="plugins/maven" />
       <module fileurl="file://$PROJECT_DIR$/plugins/maven/maven3-server-impl/maven3-server-impl.iml" filepath="$PROJECT_DIR$/plugins/maven/maven3-server-impl/maven3-server-impl.iml" group="plugins/maven" />
+      <module fileurl="file://$PROJECT_DIR$/android/tools-base/ninepatch/ninepatch.iml" filepath="$PROJECT_DIR$/android/tools-base/ninepatch/ninepatch.iml" group="android/sdktools" />
       <module fileurl="file://$PROJECT_DIR$/java/openapi/openapi.iml" filepath="$PROJECT_DIR$/java/openapi/openapi.iml" group="java" />
+      <module fileurl="file://$PROJECT_DIR$/android/tools-base/perflib/perflib.iml" filepath="$PROJECT_DIR$/android/tools-base/perflib/perflib.iml" group="android/sdktools" />
       <module fileurl="file://$PROJECT_DIR$/platform/platform-api/platform-api.iml" filepath="$PROJECT_DIR$/platform/platform-api/platform-api.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/platform/platform-impl/platform-impl.iml" filepath="$PROJECT_DIR$/platform/platform-impl/platform-impl.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/platform/platform-main/platform-main.iml" filepath="$PROJECT_DIR$/platform/platform-main/platform-main.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/python/rest/rest.iml" filepath="$PROJECT_DIR$/python/rest/rest.iml" group="python" />
       <module fileurl="file://$PROJECT_DIR$/platform/script-debugger/backend/script-debugger-backend.iml" filepath="$PROJECT_DIR$/platform/script-debugger/backend/script-debugger-backend.iml" group="platform/script-debugger" />
       <module fileurl="file://$PROJECT_DIR$/platform/script-debugger/debugger-ui/script-debugger-ui.iml" filepath="$PROJECT_DIR$/platform/script-debugger/debugger-ui/script-debugger-ui.iml" group="platform/script-debugger" />
+      <module fileurl="file://$PROJECT_DIR$/android/tools-base/sdk-common/sdk-common.iml" filepath="$PROJECT_DIR$/android/tools-base/sdk-common/sdk-common.iml" group="android/sdktools" />
+      <module fileurl="file://$PROJECT_DIR$/android/tools-base/sdklib/sdklib.iml" filepath="$PROJECT_DIR$/android/tools-base/sdklib/sdklib.iml" group="android/sdktools" />
       <module fileurl="file://$PROJECT_DIR$/platform/smRunner/smRunner.iml" filepath="$PROJECT_DIR$/platform/smRunner/smRunner.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/plugins/cvs/smartcvs-src/smartcvs-src.iml" filepath="$PROJECT_DIR$/plugins/cvs/smartcvs-src/smartcvs-src.iml" group="plugins/VCS/cvs" />
       <module fileurl="file://$PROJECT_DIR$/spellchecker/spellchecker.iml" filepath="$PROJECT_DIR$/spellchecker/spellchecker.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/plugins/testng/testng.iml" filepath="$PROJECT_DIR$/plugins/testng/testng.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/plugins/testng_rt/testng_rt.iml" filepath="$PROJECT_DIR$/plugins/testng_rt/testng_rt.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/platform/testFramework/bootstrap/tests_bootstrap.iml" filepath="$PROJECT_DIR$/platform/testFramework/bootstrap/tests_bootstrap.iml" group="platform" />
+      <module fileurl="file://$PROJECT_DIR$/android/tools-base/testutils/testutils.iml" filepath="$PROJECT_DIR$/android/tools-base/testutils/testutils.iml" group="android/sdktools" />
       <module fileurl="file://$PROJECT_DIR$/java/typeMigration/typeMigration.iml" filepath="$PROJECT_DIR$/java/typeMigration/typeMigration.iml" />
       <module fileurl="file://$PROJECT_DIR$/plugins/ui-designer/ui-designer.iml" filepath="$PROJECT_DIR$/plugins/ui-designer/ui-designer.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/plugins/ui-designer-core/ui-designer-core.iml" filepath="$PROJECT_DIR$/plugins/ui-designer-core/ui-designer-core.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/plugins/xslt-debugger/engine/xslt-debugger-engine.iml" filepath="$PROJECT_DIR$/plugins/xslt-debugger/engine/xslt-debugger-engine.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/plugins/xslt-debugger/engine/impl/xslt-debugger-engine-impl.iml" filepath="$PROJECT_DIR$/plugins/xslt-debugger/engine/impl/xslt-debugger-engine-impl.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/plugins/xpath/xslt-rt/xslt-rt.iml" filepath="$PROJECT_DIR$/plugins/xpath/xslt-rt/xslt-rt.iml" group="plugins" />
-      <module fileurl="file://$PROJECT_DIR$/plugins/editorconfig/editorconfig.iml" filepath="$PROJECT_DIR$/plugins/editorconfig/editorconfig.iml" group="plugins"/>
-
     </modules>
   </component>
 </project>
index 275077f82558f02f5c5151cc5c676b9f5f60dce3..a1b9ce94e9025cd85107ab98e5cc2068916c2cbe 100644 (file)
@@ -2,6 +2,8 @@
 <project version="4">
   <component name="VcsDirectoryMappings">
     <mapping directory="" vcs="Git" />
+    <mapping directory="$PROJECT_DIR$/android" vcs="Git" />
+    <mapping directory="$PROJECT_DIR$/android/tools-base" vcs="Git" />
   </component>
 </project>
 
index 7d5698fc9aee3f8a55646d0795500fc371951e62..6eb85a76a4ae437619e90b2a54488ebb48a2b72a 100644 (file)
@@ -254,9 +254,7 @@ def layoutFull(String home, String targetDirectory, String patchedDescriptorDir
 }
 
 public def layoutCommunityPlugins(String home) {
-  if (isDefined("androidPluginHome")) {
-    layoutAndroid(p("androidPluginHome"))
-  }
+  layoutAndroid("$home/android")
 
   dir("plugins") {
     def simplePlugins = ["commander", "copyright", "java-i18n", "hg4idea", "github"] //, "tasks-time-tracking"]
diff --git a/getPlugins.bat b/getPlugins.bat
new file mode 100644 (file)
index 0000000..3cd8b97
--- /dev/null
@@ -0,0 +1,2 @@
+call git clone git://git.jetbrains.org/idea/android.git android
+call git clone git://git.jetbrains.org/idea/adt-tools-base.git android/tools-base
diff --git a/getPlugins.sh b/getPlugins.sh
new file mode 100755 (executable)
index 0000000..9afcebd
--- /dev/null
@@ -0,0 +1,2 @@
+git clone git://git.jetbrains.org/idea/android.git android
+git clone git://git.jetbrains.org/idea/adt-tools-base.git android/tools-base
index 7e05157266101633710a33529858b44dd2a28de3..ef745b3aaa8bbe44c19da8d96ebd6ee44db31167 100644 (file)
@@ -62,8 +62,9 @@ public class ClassesTreeStructureProvider implements SelectableTreeStructureProv
             if (originalElement instanceof PsiFile) {
               PsiFile classFile = (PsiFile)originalElement;
               final VirtualFile virtualClassFile = classFile.getVirtualFile();
-              if (virtualClassFile != null && fileIndex.isInLibraryClasses(virtualClassFile) &&
-                  classOwner.getManager().areElementsEquivalent(classOwner.getContainingDirectory(), classFile.getContainingDirectory())) {
+              if (virtualClassFile != null && fileIndex.isInLibraryClasses(virtualClassFile)
+                  && !classOwner.getManager().areElementsEquivalent(classOwner, classFile)
+                  && classOwner.getManager().areElementsEquivalent(classOwner.getContainingDirectory(), classFile.getContainingDirectory())) {
                 continue;
               }
             }
index 6a3dd82b237ea3f058b80c68699fa43153afea43..b1669144551a905097c21cf461c4bd7345e17b33 100644 (file)
@@ -23,17 +23,21 @@ import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.editor.ex.util.LexerEditorHighlighter;
 import com.intellij.openapi.editor.highlighter.EditorHighlighter;
 import com.intellij.openapi.editor.highlighter.HighlighterIterator;
-import com.intellij.openapi.fileTypes.*;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.fileTypes.InternalFileType;
+import com.intellij.openapi.fileTypes.LanguageFileType;
+import com.intellij.openapi.fileTypes.PlainTextFileType;
 import com.intellij.openapi.fileTypes.impl.CustomSyntaxTableFileType;
 import com.intellij.openapi.util.Key;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.CustomHighlighterTokenType;
-import com.intellij.psi.impl.cache.impl.BaseFilterLexer;
 import com.intellij.psi.impl.cache.CacheUtil;
+import com.intellij.psi.impl.cache.impl.BaseFilterLexer;
 import com.intellij.psi.impl.cache.impl.IndexPatternUtil;
 import com.intellij.psi.impl.cache.impl.OccurrenceConsumer;
 import com.intellij.psi.impl.cache.impl.todo.TodoIndexEntry;
 import com.intellij.psi.impl.cache.impl.todo.TodoIndexers;
+import com.intellij.psi.impl.cache.impl.todo.VersionedTodoIndexer;
 import com.intellij.psi.search.IndexPattern;
 import com.intellij.psi.tree.IElementType;
 import com.intellij.psi.tree.TokenSet;
@@ -116,7 +120,7 @@ public abstract class PlatformIdTableBuilding {
     return ourTodoIndexers.containsKey(fileType) || TodoIndexers.INSTANCE.forFileType(fileType) != null || fileType instanceof InternalFileType;
   }
 
-  private static class CompositeTodoIndexer implements DataIndexer<TodoIndexEntry, Integer, FileContent> {
+  private static class CompositeTodoIndexer extends VersionedTodoIndexer {
     private final DataIndexer<TodoIndexEntry, Integer, FileContent>[] indexers;
 
     public CompositeTodoIndexer(@NotNull DataIndexer<TodoIndexEntry, Integer, FileContent>... indexers) {
@@ -139,9 +143,18 @@ public abstract class PlatformIdTableBuilding {
       }
       return result;
     }
+
+    @Override
+    public int getVersion() {
+      int version = super.getVersion();
+      for(DataIndexer dataIndexer:indexers) {
+        version += dataIndexer instanceof VersionedTodoIndexer ? ((VersionedTodoIndexer)dataIndexer).getVersion() : 0xFF;
+      }
+      return version;
+    }
   }
 
-  private static class TokenSetTodoIndexer implements DataIndexer<TodoIndexEntry, Integer, FileContent> {
+  private static class TokenSetTodoIndexer extends VersionedTodoIndexer {
     @NotNull private final TokenSet myCommentTokens;
     private final VirtualFile myFile;
 
@@ -201,7 +214,7 @@ public abstract class PlatformIdTableBuilding {
     }
   }
 
-  public static class PlainTextTodoIndexer implements DataIndexer<TodoIndexEntry, Integer, FileContent> {
+  public static class PlainTextTodoIndexer extends VersionedTodoIndexer {
     @Override
     @NotNull
     public Map<TodoIndexEntry, Integer> map(@NotNull final FileContent inputData) {
index d955354cca7faebe68341baa2f7457cb597ab6d4..109ec0c3f9715edd4b4377f3dac931980f233a65 100644 (file)
@@ -20,8 +20,10 @@ import com.intellij.lang.Language;
 import com.intellij.lang.LanguageParserDefinitions;
 import com.intellij.lang.ParserDefinition;
 import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.fileTypes.FileTypeRegistry;
 import com.intellij.openapi.fileTypes.LanguageFileType;
 import com.intellij.openapi.fileTypes.impl.CustomSyntaxTableFileType;
+import com.intellij.openapi.util.Comparing;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.impl.cache.impl.id.PlatformIdTableBuilding;
 import com.intellij.psi.search.IndexPatternProvider;
@@ -39,7 +41,9 @@ import java.beans.PropertyChangeListener;
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
+import java.util.Arrays;
 import java.util.Collections;
+import java.util.Comparator;
 import java.util.Map;
 
 /**
@@ -49,7 +53,10 @@ import java.util.Map;
 public class TodoIndex extends FileBasedIndexExtension<TodoIndexEntry, Integer> {
   @NonNls public static final ID<TodoIndexEntry, Integer> NAME = ID.create("TodoIndex");
 
-  public TodoIndex(MessageBus messageBus) {
+  private final FileTypeRegistry myFileTypeManager;
+
+  public TodoIndex(MessageBus messageBus, FileTypeRegistry manager) {
+    myFileTypeManager = manager;
     messageBus.connect().subscribe(IndexPatternProvider.INDEX_PATTERNS_CHANGED, new PropertyChangeListener() {
       @Override
       public void propertyChange(PropertyChangeEvent evt) {
@@ -127,7 +134,27 @@ public class TodoIndex extends FileBasedIndexExtension<TodoIndexEntry, Integer>
 
   @Override
   public int getVersion() {
-    return 8;
+    int version = 8;
+    FileType[] types = myFileTypeManager.getRegisteredFileTypes();
+    Arrays.sort(types, new Comparator<FileType>() {
+      @Override
+      public int compare(FileType o1, FileType o2) {
+        return Comparing.compare(o1.getName(), o2.getName());
+      }
+    });
+
+    for(FileType fileType:types) {
+      DataIndexer<TodoIndexEntry, Integer, FileContent> indexer = TodoIndexers.INSTANCE.forFileType(fileType);
+      if (indexer == null) continue;
+
+      if (!(indexer instanceof VersionedTodoIndexer)) {
+        int a = 1;
+      }
+
+      int versionFromIndexer = indexer instanceof VersionedTodoIndexer ? (((VersionedTodoIndexer)indexer).getVersion()) : 0xFF;
+      version = version * 31 + (versionFromIndexer ^ indexer.getClass().getName().hashCode());
+    }
+    return version;
   }
 
   @Override
index c4a3062867087e68e9e13124cee02c057e7110c5..824202fd0807f64acd416e077058db0f9cbf6161 100644 (file)
@@ -27,7 +27,7 @@ import org.jetbrains.annotations.NotNull;
  * @author max
  */
 
-public class DefaultWordsScanner implements WordsScanner {
+public class DefaultWordsScanner extends VersionedWordsScanner {
   private final Lexer myLexer;
   private final TokenSet myIdentifierTokenSet;
   private final TokenSet myCommentTokenSet;
index 6273654982a9afaf7ea1139fcc78cb4f8b8d5214..069c8643ae19053bd7b1a17db0adac6c1c90f310 100644 (file)
@@ -25,7 +25,7 @@ import com.intellij.util.text.CharArrayUtil;
  *
  * @author max
  */
-public class SimpleWordsScanner implements WordsScanner {
+public class SimpleWordsScanner extends VersionedWordsScanner {
   public void processWords(CharSequence fileText, Processor<WordOccurrence> processor) {
     int index = 0;
     WordOccurrence occurrence = null;
diff --git a/platform/indexing-api/src/com/intellij/lang/cacheBuilder/VersionedWordsScanner.java b/platform/indexing-api/src/com/intellij/lang/cacheBuilder/VersionedWordsScanner.java
new file mode 100644 (file)
index 0000000..f8d2782
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * 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.intellij.lang.cacheBuilder;
+
+public abstract class VersionedWordsScanner implements WordsScanner {
+  public int getVersion() {
+    return 1;
+  }
+}
index f770ac1d5d973c21bf4af73788b63fb2a22d2979..5c1246c7a50b3f7927366457a69b93a5931a6336 100644 (file)
@@ -24,4 +24,7 @@ import com.intellij.util.indexing.FileContent;
  *         Date: Jan 16, 2008
  */
 public abstract class FileTypeIdIndexer implements DataIndexer<IdIndexEntry, Integer, FileContent> {
+  public int getVersion() {
+    return 1;
+  }
 }
index 8519453e3e6c47dfcb05ae5bd010b034a678b4d7..c2ea447400ccaf3d1ec9a9151d153fee788d2b2d 100644 (file)
@@ -161,6 +161,11 @@ public class IdTableBuilding {
       });
       return consumer.getResult();
     }
+
+    @Override
+    public int getVersion() {
+      return myScanner instanceof VersionedWordsScanner ? ((VersionedWordsScanner)myScanner).getVersion() : -1;
+    }
   }
 
   public static void scanWords(final ScanWordProcessor processor, final CharSequence chars, final int startOffset, final int endOffset) {
index b05ef6a9853a922e6a4827a4656efad831d52336..04e27e91dc63e2519c644776be2458228f4d9c7b 100644 (file)
@@ -18,7 +18,6 @@ package com.intellij.psi.impl.cache.impl.todo;
 
 import com.intellij.psi.impl.cache.impl.BaseFilterLexerUtil;
 import com.intellij.psi.impl.cache.impl.IdAndToDoScannerBasedOnFilterLexer;
-import com.intellij.util.indexing.DataIndexer;
 import com.intellij.util.indexing.FileContent;
 import org.jetbrains.annotations.NotNull;
 
@@ -28,8 +27,7 @@ import java.util.Map;
  * @author Eugene Zhuravlev
  *         Date: Jan 20, 2008
  */
-public abstract class LexerBasedTodoIndexer implements DataIndexer<TodoIndexEntry, Integer, FileContent>,
-                                                       IdAndToDoScannerBasedOnFilterLexer {
+public abstract class LexerBasedTodoIndexer extends VersionedTodoIndexer implements IdAndToDoScannerBasedOnFilterLexer {
   @Override
   @NotNull
   public Map<TodoIndexEntry,Integer> map(@NotNull final FileContent inputData) {
diff --git a/platform/indexing-impl/src/com/intellij/psi/impl/cache/impl/todo/VersionedTodoIndexer.java b/platform/indexing-impl/src/com/intellij/psi/impl/cache/impl/todo/VersionedTodoIndexer.java
new file mode 100644 (file)
index 0000000..028c24b
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * 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.intellij.psi.impl.cache.impl.todo;
+
+import com.intellij.util.indexing.DataIndexer;
+import com.intellij.util.indexing.FileContent;
+
+public abstract class VersionedTodoIndexer implements DataIndexer<TodoIndexEntry, Integer, FileContent> {
+  public int getVersion() {
+    return 1;
+  }
+}
diff --git a/platform/lang-api/src/com/intellij/psi/codeStyle/autodetect/IndentOptionsDetector.java b/platform/lang-api/src/com/intellij/psi/codeStyle/autodetect/IndentOptionsDetector.java
new file mode 100644 (file)
index 0000000..457a285
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * 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.intellij.psi.codeStyle.autodetect;
+
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+import static com.intellij.psi.codeStyle.CommonCodeStyleSettings.*;
+
+public class IndentOptionsDetector {
+  private static Logger LOG = Logger.getInstance("#com.intellij.psi.codeStyle.CommonCodeStyleSettings.IndentOptionsDetector");
+
+  private static final double RATE_THRESHOLD = 0.8;
+  private static final int MIN_LINES_THRESHOLD = 50;
+  private static int MAX_INDENT_TO_DETECT = 8;
+
+  private final PsiFile myFile;
+  private final Project myProject;
+  private final Document myDocument;
+
+  public IndentOptionsDetector(@NotNull PsiFile file) {
+    myFile = file;
+    myProject = file.getProject();
+    myDocument = PsiDocumentManager.getInstance(myProject).getDocument(myFile);
+  }
+
+  @NotNull
+  public IndentOptions getIndentOptions() {
+    IndentOptions indentOptions = (IndentOptions)CodeStyleSettingsManager.getSettings(myProject).getIndentOptions(myFile.getFileType()).clone();
+
+    if (myDocument != null) {
+      List<LineIndentInfo> linesInfo = new LineIndentInfoBuilder(myDocument.getCharsSequence()).build();
+      IndentUsageStatistics stats = new IndentUsageStatisticsImpl(linesInfo);
+      adjustIndentOptions(indentOptions, stats);
+    }
+
+    return indentOptions;
+  }
+
+  private void adjustIndentOptions(@NotNull IndentOptions indentOptions, @NotNull IndentUsageStatistics stats) {
+    int linesWithTabs = stats.getTotalLinesWithLeadingTabs();
+    int linesWithWhiteSpaceIndent = stats.getTotalLinesWithLeadingSpaces();
+
+    int totalLines = linesWithTabs + linesWithWhiteSpaceIndent;
+    double lineWithTabsRate = (double)linesWithTabs / totalLines;
+
+    if (linesWithTabs > MIN_LINES_THRESHOLD && lineWithTabsRate > RATE_THRESHOLD) {
+      if (!indentOptions.USE_TAB_CHARACTER) {
+        indentOptions.USE_TAB_CHARACTER = true;
+        LOG.info("Detected tab usage in" + myFile);
+      }
+    }
+    else if (linesWithWhiteSpaceIndent > MIN_LINES_THRESHOLD && (1 - lineWithTabsRate) > RATE_THRESHOLD) {
+      int newIndentSize = getPositiveIndentSize(stats);
+      if (newIndentSize > 0 && indentOptions.INDENT_SIZE != newIndentSize) {
+        indentOptions.INDENT_SIZE = newIndentSize;
+        LOG.info("Detected indent size: " + newIndentSize + " for file " + myFile);
+      }
+    }
+  }
+
+  private static int getPositiveIndentSize(@NotNull IndentUsageStatistics stats) {
+    int totalIndentSizesDetected = stats.getTotalIndentSizesDetected();
+    if (totalIndentSizesDetected == 0) return -1;
+
+    IndentUsageInfo maxUsedIndentInfo = stats.getKMostUsedIndentInfo(0);
+    int maxUsedIndentSize = maxUsedIndentInfo.getIndentSize();
+
+    if (maxUsedIndentSize == 0) {
+      if (totalIndentSizesDetected < 1) return -1;
+
+      maxUsedIndentInfo = stats.getKMostUsedIndentInfo(1);
+      maxUsedIndentSize = maxUsedIndentInfo.getIndentSize();
+    }
+
+    if (maxUsedIndentSize <= MAX_INDENT_TO_DETECT) {
+      int totalUsagesWithoutZeroIndent = stats.getTotalLinesWithLeadingSpaces() - stats.getTimesIndentUsed(0);
+      double usageRate = (double)maxUsedIndentInfo.getTimesUsed() / totalUsagesWithoutZeroIndent;
+      if (usageRate > RATE_THRESHOLD) {
+        return maxUsedIndentSize;
+      }
+    }
+
+    return -1;
+  }
+}
diff --git a/platform/lang-api/src/com/intellij/psi/codeStyle/autodetect/IndentUsageInfo.java b/platform/lang-api/src/com/intellij/psi/codeStyle/autodetect/IndentUsageInfo.java
new file mode 100644 (file)
index 0000000..a600483
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * 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.intellij.psi.codeStyle.autodetect;
+
+public class IndentUsageInfo {
+  private final int indentSize;
+  private final int timesUsed;
+
+  public IndentUsageInfo(int indentSize, int timesUsed) {
+    this.indentSize = indentSize;
+    this.timesUsed = timesUsed;
+  }
+
+  public int getIndentSize() {
+    return indentSize;
+  }
+
+  public int getTimesUsed() {
+    return timesUsed;
+  }
+
+  @Override
+  public String toString() {
+    return "indent: " + indentSize + ", used " + timesUsed;
+  }
+}
diff --git a/platform/lang-api/src/com/intellij/psi/codeStyle/autodetect/IndentUsageStatistics.java b/platform/lang-api/src/com/intellij/psi/codeStyle/autodetect/IndentUsageStatistics.java
new file mode 100644 (file)
index 0000000..7e3bee7
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * 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.intellij.psi.codeStyle.autodetect;
+
+public interface IndentUsageStatistics {
+
+  int getTotalLinesWithLeadingTabs();
+
+  int getTotalLinesWithLeadingSpaces();
+
+  IndentUsageInfo getKMostUsedIndentInfo(int k);
+
+  int getTotalIndentSizesDetected();
+
+  int getTimesIndentUsed(int indent);
+
+}
diff --git a/platform/lang-api/src/com/intellij/psi/codeStyle/autodetect/IndentUsageStatisticsImpl.java b/platform/lang-api/src/com/intellij/psi/codeStyle/autodetect/IndentUsageStatisticsImpl.java
new file mode 100644 (file)
index 0000000..6578b5f
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * 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.intellij.psi.codeStyle.autodetect;
+
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.containers.Stack;
+import gnu.trove.TIntIntHashMap;
+import gnu.trove.TIntIntIterator;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Comparator;
+import java.util.List;
+
+public class IndentUsageStatisticsImpl implements IndentUsageStatistics {
+  private static final Comparator<IndentUsageInfo> DECREASING_ORDER = new Comparator<IndentUsageInfo>() {
+    @Override
+    public int compare(@NotNull IndentUsageInfo o1, @NotNull IndentUsageInfo o2) {
+      return o1.getTimesUsed() < o2.getTimesUsed() ? 1 : o1.getTimesUsed() == o2.getTimesUsed() ? 0 : -1;
+    }
+  };
+
+  private List<LineIndentInfo> myLineInfos;
+
+  private int myPreviousLineIndent;
+  private int myPreviousRelativeIndent;
+
+  private int myTotalLinesWithTabs = 0;
+  private int myTotalLinesWithWhiteSpaces = 0;
+
+  private TIntIntHashMap myIndentToUsages = new TIntIntHashMap();
+  private List<IndentUsageInfo> myIndentUsages = ContainerUtil.newArrayList();
+  private Stack<IndentData> myParentIndents = ContainerUtil.newStack(new IndentData(0, 0));
+
+  public IndentUsageStatisticsImpl(@NotNull List<LineIndentInfo> lineInfos) {
+    myLineInfos = lineInfos;
+    buildIndentToUsagesMap();
+    myIndentUsages = toIndentUsageList(myIndentToUsages);
+    ContainerUtil.sort(myIndentUsages, DECREASING_ORDER);
+  }
+
+  @NotNull
+  private static List<IndentUsageInfo> toIndentUsageList(@NotNull TIntIntHashMap indentToUsages) {
+    List<IndentUsageInfo> indentUsageInfos = ContainerUtil.newArrayList();
+    TIntIntIterator it = indentToUsages.iterator();
+    while (it.hasNext()) {
+      it.advance();
+      indentUsageInfos.add(new IndentUsageInfo(it.key(), it.value()));
+    }
+    return indentUsageInfos;
+  }
+
+  public void buildIndentToUsagesMap() {
+    myPreviousLineIndent = 0;
+    myPreviousRelativeIndent = 0;
+
+    for (LineIndentInfo lineInfo : myLineInfos) {
+      if (lineInfo.isLineWithTabs()) {
+        myTotalLinesWithTabs++;
+      }
+      else if (lineInfo.isLineWithWhiteSpaceIndent()) {
+        handleWhiteSpaceIndent(lineInfo.getIndentSize());
+      }
+    }
+  }
+
+  @NotNull
+  private IndentData findParentIndent(int indent) {
+    while (myParentIndents.size() != 1 && myParentIndents.peek().indent > indent) {
+      myParentIndents.pop();
+    }
+    return myParentIndents.peek();
+  }
+
+  private void handleWhiteSpaceIndent(int currentIndent) {
+    int relativeIndent = currentIndent - myPreviousLineIndent;
+    if (relativeIndent < 0) {
+      IndentData indentData = findParentIndent(currentIndent);
+      myPreviousLineIndent = indentData.indent;
+      myPreviousRelativeIndent = indentData.relativeIndent;
+      relativeIndent = currentIndent - myPreviousLineIndent;
+    }
+
+    if (relativeIndent == 0) {
+      relativeIndent = myPreviousRelativeIndent;
+    }
+    else {
+      myParentIndents.push(new IndentData(currentIndent, relativeIndent));
+    }
+
+    increaseIndentUsage(relativeIndent);
+
+    myPreviousRelativeIndent = relativeIndent;
+    myPreviousLineIndent = currentIndent;
+    myTotalLinesWithWhiteSpaces++;
+  }
+
+  private void increaseIndentUsage(int relativeIndent) {
+    int timesUsed = myIndentToUsages.get(relativeIndent);
+    myIndentToUsages.put(relativeIndent, ++timesUsed);
+  }
+
+  @Override
+  public int getTotalLinesWithLeadingTabs() {
+    return myTotalLinesWithTabs;
+  }
+
+  @Override
+  public int getTotalLinesWithLeadingSpaces() {
+    return myTotalLinesWithWhiteSpaces;
+  }
+
+  @Override
+  public IndentUsageInfo getKMostUsedIndentInfo(int k) {
+    return myIndentUsages.get(k);
+  }
+
+  @Override
+  public int getTimesIndentUsed(int indent) {
+    return myIndentToUsages.get(indent);
+  }
+
+  @Override
+  public int getTotalIndentSizesDetected() {
+    return myIndentToUsages.size();
+  }
+
+  private static class IndentData {
+    public final int indent;
+    public final int relativeIndent;
+
+    public IndentData(int indent, int relativeIndent) {
+      this.indent = indent;
+      this.relativeIndent = relativeIndent;
+    }
+  }
+}
diff --git a/platform/lang-api/src/com/intellij/psi/codeStyle/autodetect/LineIndentInfo.java b/platform/lang-api/src/com/intellij/psi/codeStyle/autodetect/LineIndentInfo.java
new file mode 100644 (file)
index 0000000..67b1865
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * 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.intellij.psi.codeStyle.autodetect;
+
+import org.jetbrains.annotations.NotNull;
+
+public class LineIndentInfo {
+  public static LineIndentInfo EMPTY_LINE = new LineIndentInfo(LineType.EMPTY_LINE, -1);
+  public static LineIndentInfo LINE_WITH_COMMENT = new LineIndentInfo(LineType.LINE_WITH_COMMENT, -1);
+  public static LineIndentInfo LINE_WITH_TABS = new LineIndentInfo(LineType.LINE_WITH_TABS, -1);
+
+  private final int myIndentSize;
+  private final LineType myType;
+
+  private LineIndentInfo(@NotNull LineType type, int indentSize) {
+    myType = type;
+    myIndentSize = indentSize;
+  }
+
+  @NotNull
+  public static LineIndentInfo newWhiteSpaceIndent(int indentSize) {
+    return new LineIndentInfo(LineType.LINE_WITH_WHITESPACE_INDENT, indentSize);
+  }
+
+  public int getIndentSize() {
+    return myIndentSize;
+  }
+
+  public boolean isLineWithWhiteSpaceIndent() {
+    return myType == LineType.LINE_WITH_WHITESPACE_INDENT;
+  }
+
+  public boolean isLineWithTabs() {
+    return myType == LineType.LINE_WITH_TABS;
+  }
+
+  private enum LineType {
+    EMPTY_LINE,
+    LINE_WITH_COMMENT,
+    LINE_WITH_TABS,
+    LINE_WITH_WHITESPACE_INDENT
+  }
+}
diff --git a/platform/lang-api/src/com/intellij/psi/codeStyle/autodetect/LineIndentInfoBuilder.java b/platform/lang-api/src/com/intellij/psi/codeStyle/autodetect/LineIndentInfoBuilder.java
new file mode 100644 (file)
index 0000000..8efbbc4
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * 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.intellij.psi.codeStyle.autodetect;
+
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.text.CharArrayUtil;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+public class LineIndentInfoBuilder {
+  private static final int MAX_LINES_TO_PROCESS = 500;
+
+  private final CharSequence myText;
+  private final int myLength;
+
+  public LineIndentInfoBuilder(@NotNull CharSequence text) {
+    myText = text;
+    myLength = text.length();
+  }
+
+  @NotNull
+  public List<LineIndentInfo> build() {
+    List<LineIndentInfo> lineIndentInfos = ContainerUtil.newArrayList();
+
+    int lineStartOffset = 0;
+    int currentLine = 0;
+
+    while (lineStartOffset < myText.length() && currentLine < MAX_LINES_TO_PROCESS) {
+      int lineEndOffset = getLineEndOffset(lineStartOffset);
+      int textStartOffset = CharArrayUtil.shiftForward(myText, lineStartOffset, lineEndOffset, " \t");
+
+      if (textStartOffset != lineEndOffset) {
+        lineIndentInfos.add(createInfoFromWhiteSpaceRange(lineStartOffset, textStartOffset));
+      } else {
+        lineIndentInfos.add(LineIndentInfo.EMPTY_LINE);
+      }
+
+      lineStartOffset = lineEndOffset + 1;
+      currentLine++;
+    }
+
+    return lineIndentInfos;
+  }
+
+  @NotNull
+  private LineIndentInfo createInfoFromWhiteSpaceRange(int lineStartOffset, int textStartOffset) {
+    if (myText.charAt(textStartOffset) == '*') {
+      return LineIndentInfo.LINE_WITH_COMMENT;
+    }
+    else if (CharArrayUtil.indexOf(myText, "\t", lineStartOffset, textStartOffset) > 0) {
+      return LineIndentInfo.LINE_WITH_TABS;
+    }
+    else {
+      int indentSize = textStartOffset - lineStartOffset;
+      return LineIndentInfo.newWhiteSpaceIndent(indentSize);
+    }
+  }
+
+  private int getLineEndOffset(int lineStartOffset) {
+    int lineEndOffset = CharArrayUtil.indexOf(myText, "\n", lineStartOffset, myLength);
+    if (lineEndOffset < 0) {
+      lineEndOffset = myText.length();
+    }
+    return lineEndOffset;
+  }
+}
index 81d0bf651688e67bc2146007e059c3f920163f0d..2320d059c1468abff969d7ac6cd3e0f65f3d3014 100644 (file)
@@ -1005,11 +1005,10 @@ public class SingleInspectionProfilePanel extends JPanel {
     northPanel.add(createTreeToolbarPanel().getComponent(), new GridBagConstraints(1, 0, 1, 1, 0.5, 1, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
     treePanel.add(northPanel, BorderLayout.NORTH);
 
-    myMainSplitter = new Splitter(false);
+    myMainSplitter = new Splitter(false, myProperties.getFloat(VERTICAL_DIVIDER_PROPORTION, 0.5f), 0.01f, 0.99f);
     myMainSplitter.setFirstComponent(treePanel);
     myMainSplitter.setSecondComponent(myRightSplitter);
     myMainSplitter.setHonorComponentsMinimumSize(false);
-    myMainSplitter.setProportion(myProperties.getFloat(VERTICAL_DIVIDER_PROPORTION, 0.5f));
 
     final JPanel panel = new JPanel(new BorderLayout());
     panel.add(myMainSplitter, BorderLayout.CENTER);
index 5607816ad13cd883433eecb8aa1170f4449094fa..fe36408cf61a2a01465542b19c8ddc596511f7b9 100644 (file)
@@ -220,7 +220,7 @@ public class InspectionsConfigTreeTable extends TreeTable {
     @Override
     public void setValueAt(final Object aValue, final Object node, final int column) {
       LOG.assertTrue(column == IS_ENABLED_COLUMN);
-      LOG.assertTrue(aValue != null);
+      LOG.assertTrue(aValue != null, "node = " + node);
       final boolean doEnable = (Boolean) aValue;
       for (final InspectionConfigTreeNode aNode : InspectionsAggregationUtil.getInspectionsNodes((InspectionConfigTreeNode) node)) {
         final String toolId = aNode.getKey().toString();
index 537d997e5a502a799e6180117200853f68e939f7..1773a260a70676d94eaf14330db8564a7d56abfb 100644 (file)
@@ -15,6 +15,9 @@
  */
 package com.intellij.psi.impl.cache.impl.id;
 
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.fileTypes.FileTypeRegistry;
+import com.intellij.openapi.util.Comparing;
 import com.intellij.openapi.util.ThreadLocalCachedIntArray;
 import com.intellij.util.indexing.CustomInputsIndexFileBasedIndexExtension;
 import com.intellij.util.io.DataExternalizer;
@@ -27,9 +30,35 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Comparator;
 
 public class IdIndexImpl extends IdIndex implements CustomInputsIndexFileBasedIndexExtension<IdIndexEntry> {
   private static final ThreadLocalCachedIntArray spareBufferLocal = new ThreadLocalCachedIntArray();
+  private final FileTypeRegistry myFileTypeManager;
+
+  public IdIndexImpl(FileTypeRegistry manager) {
+    myFileTypeManager = manager;
+  }
+
+  @Override
+  public int getVersion() {
+    FileType[] types = myFileTypeManager.getRegisteredFileTypes();
+    Arrays.sort(types, new Comparator<FileType>() {
+      @Override
+      public int compare(FileType o1, FileType o2) {
+        return Comparing.compare(o1.getName(), o2.getName());
+      }
+    });
+
+    int version = super.getVersion();
+    for(FileType fileType:types) {
+      if (!isIndexable(fileType)) continue;
+      FileTypeIdIndexer indexer = IdIndexers.INSTANCE.forFileType(fileType);
+      if (indexer == null) continue;
+      version = version * 31 + (indexer.getVersion() ^ indexer.getClass().getName().hashCode());
+    }
+    return version;
+  }
 
   @NotNull
   @Override
index 411f2d9d93bbdb1a110432c1f371e5aa80ffe5d8..0b696c8f44960007abfd18bc441adaba39263276 100644 (file)
@@ -134,12 +134,12 @@ public class CreateLauncherScriptAction extends DumbAwareAction {
 
   private static File createLauncherScriptFile() throws IOException, ExecutionException {
     String runPath = PathManager.getHomePath();
+    final String productName = ApplicationNamesInfo.getInstance().getProductName().toLowerCase();
     if (!SystemInfo.isMac) {
       // for Macs just use "*.app"
-      final String productName = ApplicationNamesInfo.getInstance().getProductName().toLowerCase();
       runPath += "/bin/" + productName + ".sh";
     } else if (runPath.endsWith(CONTENTS)) {
-      runPath = runPath.substring(0, runPath.length() - CONTENTS.length());
+      runPath += "/MacOS/" + productName;
     }
     String launcherContents = ExecUtil.loadTemplate(CreateLauncherScriptAction.class.getClassLoader(), "launcher.py",
                                                           newHashMap(asList("$CONFIG_PATH$", "$RUN_PATH$"),
index 2cee5d3e03f908119731cd99ab78dca300753199..be22623c21429b1e563c3a9a68dcd36b2d7ab4b9 100644 (file)
@@ -25,7 +25,6 @@
         </constraints>
         <properties>
           <contentType value="text/html"/>
-          <text value="&lt;html&gt;&#10;  &lt;head&gt;&#10;&#10;  &lt;/head&gt;&#10;  &lt;body&gt;&#10;    &lt;p style=&quot;margin-top: 0&quot;&gt;&#10;      &#10;    &lt;/p&gt;&#10;  &lt;/body&gt;&#10;&lt;/html&gt;&#10;"/>
         </properties>
       </component>
       <vspacer id="bf1d9">
index f04a26cb2c83df70ea2445fee0d4c9d4718f2e19..440f716f8ebf7dfeb0c73d4936b477b9be2daece 100644 (file)
@@ -18,30 +18,19 @@ for i, arg in enumerate(sys.argv[1:]):
         print(('Usage:\n' + \
                '  {0} -h |-? | --help\n' + \
                '  {0} [-l|--line line] file[:line]\n' + \
-               '  {0} diff <left> <right>\n' + \
-               '  {0} merge <left> <right> [base] <result>').format(sys.argv[0]))
+               '  {0} diff <left> <right>' + \
+               '  {0} merge <local> <remote> [base] <merged>').format(sys.argv[0]))
         exit(0)
-    elif arg == 'diff' and i == 0:
-        args.append(arg)
-    elif arg == 'merge' and i == 0:
-        args.append(arg)
-    elif arg == '-l' or arg == '--line':
-        args.append(arg)
-        skip_next = True
-    elif skip_next:
-        args.append(arg)
-        skip_next = False
-    else:
-        if ':' in arg:
-            file_path, line_number = arg.rsplit(':', 1)
-            if line_number.isdigit():
-              args.append('-l')
-              args.append(line_number)
-              args.append(os.path.abspath(file_path))
-            else:
-              args.append(os.path.abspath(arg))
+    elif ':' in arg:
+        file_path, line_number = arg.rsplit(':', 1)
+        if line_number.isdigit():
+          args.append('-l')
+          args.append(line_number)
+          args.append(file_path)
         else:
-            args.append(os.path.abspath(arg))
+          args.append(arg)
+    else:
+        args.append(arg)
 
 def launch_with_port(port):
     found = False
@@ -57,7 +46,6 @@ def launch_with_port(port):
         try:
             path_len = struct.unpack(">h", s.recv(2))[0]
             path = s.recv(path_len)
-            path = os.path.abspath(path)
             if os.path.abspath(path) == os.path.abspath(CONFIG_PATH):
                 found = True
                 break
@@ -90,13 +78,5 @@ if port == -1:
 else:
     if launch_with_port(port): exit()
 
-if sys.platform == "darwin":
-    # Mac OS: RUN_PATH is *.app path
-    if len(args):
-        args.insert(0, "--args")
-    os.execvp("open", ["-a", RUN_PATH] + args)
-else:
-    # unix common
-    bin_dir, bin_file = os.path.split(RUN_PATH)
-    os.chdir(bin_dir)
-    os.execv(bin_file, [bin_file] + args)
\ No newline at end of file
+bin_dir, bin_file = os.path.split(RUN_PATH)
+os.execv(RUN_PATH, [bin_file] + args)
\ No newline at end of file
diff --git a/platform/platform-tests/testData/codeStyle/autodetect/manyComments.java b/platform/platform-tests/testData/codeStyle/autodetect/manyComments.java
new file mode 100644 (file)
index 0000000..7bc7a3a
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ */
+
+
+public interface Doable {
+
+
+  /*
+   *
+   *
+   *
+   *
+   *
+   *
+   *
+   *
+   *
+   *
+   */
+  public void count() {
+  }
+
+
+  /*
+   *
+   *
+   *
+   *
+   *
+   *
+   *
+   *
+   *
+   *
+   */
+  public void test() {
+  }
+}
diff --git a/platform/platform-tests/testData/codeStyle/autodetect/manyZeroRelativeIndent.java b/platform/platform-tests/testData/codeStyle/autodetect/manyZeroRelativeIndent.java
new file mode 100644 (file)
index 0000000..2ee4c59
--- /dev/null
@@ -0,0 +1,31 @@
+class Test {
+
+  public void test() {
+    // boolean function-available(string)
+    addFunction(decls, new FunctionImpl("function-available", XPathType.BOOLEAN,
+                new Parameter(XPathType.STRING, Parameter.Kind.REQUIRED)));
+
+    // node-set current()
+    addFunction(decls, new FunctionImpl("current", XPathType.NODESET));
+
+    // EXSLT (http://www.exslt.org) extensions supported by Xalan & Saxon
+    addFunction(decls, EXSLT_DATE_TIME, new FunctionImpl("date", XPathType.STRING, optional_string));
+    addFunction(decls, EXSLT_DATE_TIME, new FunctionImpl("date-time", XPathType.STRING));
+    addFunction(decls, EXSLT_DATE_TIME, new FunctionImpl("day-abbreviation", XPathType.STRING, optional_string));
+    addFunction(decls, EXSLT_DATE_TIME, new FunctionImpl("day-in-month", XPathType.NUMBER, optional_string));
+    addFunction(decls, EXSLT_DATE_TIME, new FunctionImpl("day-in-week", XPathType.NUMBER, optional_string));
+    addFunction(decls, EXSLT_DATE_TIME, new FunctionImpl("day-in-year", XPathType.NUMBER, optional_string));
+    addFunction(decls, EXSLT_DATE_TIME, new FunctionImpl("day-name", XPathType.STRING, optional_string));
+    addFunction(decls, EXSLT_DATE_TIME, new FunctionImpl("day-of-week-in-month", XPathType.NUMBER, optional_string));
+    addFunction(decls, EXSLT_DATE_TIME, new FunctionImpl("hour-in-day", XPathType.NUMBER, optional_string));
+    addFunction(decls, EXSLT_DATE_TIME, new FunctionImpl("leap-year", XPathType.BOOLEAN, optional_string));
+    addFunction(decls, EXSLT_DATE_TIME, new FunctionImpl("minute-in-hour", XPathType.NUMBER, optional_string));
+    addFunction(decls, EXSLT_DATE_TIME, new FunctionImpl("month-abbreviation", XPathType.STRING, optional_string));
+    addFunction(decls, EXSLT_DATE_TIME, new FunctionImpl("month-in-year", XPathType.NUMBER, optional_string));
+    addFunction(decls, EXSLT_DATE_TIME, new FunctionImpl("month-name", XPathType.STRING, optional_string));
+    addFunction(decls, EXSLT_DATE_TIME, new FunctionImpl("second-in-minute", XPathType.NUMBER, optional_string));
+    addFunction(decls, EXSLT_DATE_TIME, new FunctionImpl("time", XPathType.STRING, optional_string));
+    addFunction(decls, EXSLT_DATE_TIME, new FunctionImpl("week-in-year", XPathType.NUMBER, optional_string));
+    addFunction(decls, EXSLT_DATE_TIME, new FunctionImpl("year", XPathType.NUMBER, optional_string));
+  }
+}
diff --git a/platform/platform-tests/testData/codeStyle/autodetect/simpleIndent.java b/platform/platform-tests/testData/codeStyle/autodetect/simpleIndent.java
new file mode 100644 (file)
index 0000000..c4cd369
--- /dev/null
@@ -0,0 +1,14 @@
+public class A {
+
+    public void test() {
+      int a = 2;
+      int c = 2;
+      int r = 3;
+      int rq = 3;
+      int rw = 3;
+      int re = 3;
+    }
+
+    public void a() {
+    }
+}
diff --git a/platform/platform-tests/testSrc/com/intellij/psi/autodetect/IndentAutoDetectionTest.java b/platform/platform-tests/testSrc/com/intellij/psi/autodetect/IndentAutoDetectionTest.java
new file mode 100644 (file)
index 0000000..4b59416
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ * 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.intellij.psi.autodetect;
+
+import com.intellij.openapi.editor.Document;
+import com.intellij.psi.codeStyle.autodetect.*;
+import com.intellij.testFramework.LightPlatformCodeInsightTestCase;
+import com.intellij.testFramework.PlatformTestCase;
+import com.intellij.testFramework.PlatformTestUtil;
+import org.jetbrains.annotations.NotNull;
+import org.junit.Assert;
+
+import java.io.File;
+import java.util.List;
+
+public class IndentAutoDetectionTest extends LightPlatformCodeInsightTestCase {
+  private static final String BASE_PATH = "codeStyle/autodetect/";
+
+  static {
+    PlatformTestCase.initPlatformLangPrefix();
+  }
+
+  public void testSimpleIndent() {
+    doTestMaxUsedIndent(2, 6);
+  }
+
+  public void testManyComments() {
+    doTestMaxUsedIndent(2, 6);
+  }
+
+  public void testManyZeroRelativeIndent() {
+    doTestMaxUsedIndent(2);
+  }
+
+  public void testSpacesToNumbers() throws Exception {
+    String text = "     i\n" +
+                  "    a\n" +
+                  "          t\n";
+    doTestLineToIndentMapping(text, 5, 4, 10);
+  }
+
+  public void testEmptyLines() throws Exception {
+    doTestLineToIndentMapping("     \n\n\n", -1, -1, -1);
+  }
+
+  public void testSpacesInSimpleClass() {
+    doTestLineToIndentMapping(
+      "public class A {\n" +
+      "\n" +
+      "    public void test() {\n" +
+      "      int a = 2;\n" +
+      "    }\n" +
+      "\n" +
+      "    public void a() {\n" +
+      "    }\n" +
+      "}",
+      0, -1, 4, 6, 4, -1, 4, 4, 0
+    );
+  }
+
+  public void testComplexIndents() {
+    doTestLineToIndentMapping(
+      "class Test\n" +
+      "{\n" +
+      "  int a;\n" +
+      "  int b;\n" +
+      "  \n" +
+      "  public void test() {\n" +
+      "    int c;\n" +
+      "  }\n" +
+      "  \n" +
+      "  public void run() {\n" +
+      "    Runnable runnable = new Runnable() {\n" +
+      "      @Override\n" +
+      "      public void run() {\n" +
+      "        System.out.println(\"Hello!\");\n" +
+      "      }\n" +
+      "    };\n" +
+      "  }\n" +
+      "}",
+      0, 0, 2, 2, -1, 2, 4, 2, -1, 2, 4, 6, 6, 8, 6, 4, 2, 0
+    );
+  }
+
+  public void doTestMaxUsedIndent(int indentExpected, int timesUsedExpected) {
+    IndentUsageInfo maxIndentExpected = new IndentUsageInfo(indentExpected, timesUsedExpected);
+    IndentUsageInfo indentInfo = getMaxUsedIndentInfo();
+    Assert.assertEquals("Indent size mismatch", maxIndentExpected.getIndentSize(), indentInfo.getIndentSize());
+    Assert.assertEquals("Indent size usage number mismatch", maxIndentExpected.getTimesUsed(), indentInfo.getTimesUsed());
+  }
+
+  public void doTestMaxUsedIndent(int indentExpected) {
+    IndentUsageInfo indentInfo = getMaxUsedIndentInfo();
+    Assert.assertEquals("Indent size mismatch", indentExpected, indentInfo.getIndentSize());
+  }
+
+  @NotNull
+  private IndentUsageInfo getMaxUsedIndentInfo() {
+    configureByFile(getTestName(true) + ".java");
+    Document document = getDocument(myFile);
+    List<LineIndentInfo> lines = new LineIndentInfoBuilder(document.getCharsSequence()).build();
+    IndentUsageStatistics statistics = new IndentUsageStatisticsImpl(lines);
+    return statistics.getKMostUsedIndentInfo(0);
+  }
+
+  private static void doTestLineToIndentMapping(@NotNull CharSequence text, int... spacesForLine) {
+    List<LineIndentInfo> list = new LineIndentInfoBuilder(text).build();
+    Assert.assertEquals(list.size(), spacesForLine.length);
+    for (int i = 0; i < spacesForLine.length; i++) {
+      int indentSize = list.get(i).getIndentSize();
+      Assert.assertEquals("Mismatch on line " + i, spacesForLine[i], indentSize);
+    }
+  }
+
+  @Override
+  @NotNull
+  public String getTestDataPath() {
+    return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/')
+           + "/platform/platform-tests/testData/"
+           + BASE_PATH;
+  }
+}
index 29ef1acdfd78889604dd37980e20492cf2d363b9..bf81b8d6250215c62c01925a1e72974ae1b06401 100644 (file)
@@ -26,12 +26,12 @@ public class GithubUser {
 
   @NotNull private final String myHtmlUrl;
 
-  @Nullable private final String myGravatarId;
+  @Nullable private final String myAvatarUrl;
 
-  public GithubUser(@NotNull String login, @NotNull String htmlUrl, @Nullable String gravatarId) {
+  public GithubUser(@NotNull String login, @NotNull String htmlUrl, @Nullable String avatarUrl) {
     myLogin = login;
     myHtmlUrl = htmlUrl;
-    myGravatarId = gravatarId;
+    myAvatarUrl = avatarUrl;
   }
 
   @NotNull
@@ -45,7 +45,7 @@ public class GithubUser {
   }
 
   @Nullable
-  public String getGravatarId() {
-    return myGravatarId;
+  public String getAvatarUrl() {
+    return myAvatarUrl;
   }
 }
index 2c82c078e339551b4aa35aa46da553d56e04dc16..3940b80f360a73de4ebc38b8861d2ec9b3d9d53a 100644 (file)
@@ -55,13 +55,13 @@ public class GithubUserDetailed extends GithubUser {
 
   public GithubUserDetailed(@NotNull String login,
                             @NotNull String htmlUrl,
-                            @Nullable String gravatarId,
+                            @Nullable String avatarUrl,
                             @Nullable String name,
                             @Nullable String email,
                             @Nullable Integer ownedPrivateRepos,
                             @Nullable String type,
                             @Nullable UserPlan plan) {
-    super(login, htmlUrl, gravatarId);
+    super(login, htmlUrl, avatarUrl);
     myName = name;
     myEmail = email;
     myOwnedPrivateRepos = ownedPrivateRepos;
index 04d642f8eb2e4c9913459f00be344f81f8e3a14b..0bc673299847e3162db17017b7003cad52e6ef0f 100644 (file)
@@ -74,14 +74,14 @@ class GithubUserRaw implements DataConstructor {
   @SuppressWarnings("ConstantConditions")
   @NotNull
   public GithubUser createUser() {
-    return new GithubUser(login, htmlUrl, gravatarId);
+    return new GithubUser(login, htmlUrl, avatarUrl);
   }
 
   @SuppressWarnings("ConstantConditions")
   @NotNull
   public GithubUserDetailed createUserDetailed() {
     GithubUserDetailed.UserPlan plan = this.plan == null ? null : this.plan.create();
-    return new GithubUserDetailed(login, htmlUrl, gravatarId, name, email, ownedPrivateRepos, type, plan);
+    return new GithubUserDetailed(login, htmlUrl, avatarUrl, name, email, ownedPrivateRepos, type, plan);
   }
 
   @SuppressWarnings("unchecked")
index d65a95044a9c42ebfdc693f8f39cb03a3390f128..e3115f71975c7d40998c2853c7dff20cca6afec1 100644 (file)
@@ -26,16 +26,16 @@ import java.util.Date;
  * @author Dennis.Ushakov
  */
 public class GithubComment extends SimpleComment {
-  @Nullable private final String myGravatarId;
+  @Nullable private final String myAvatarUrl;
   @NotNull private final String myUserHtmlUrl;
 
   public GithubComment(@Nullable Date date,
                        @Nullable String author,
                        @NotNull String text,
-                       @Nullable String gravatarId,
+                       @Nullable String avatarUrl,
                        @NotNull String userHtmlUrl) {
     super(date, author, text);
-    myGravatarId = gravatarId;
+    myAvatarUrl = avatarUrl;
     myUserHtmlUrl = userHtmlUrl;
   }
 
@@ -43,9 +43,9 @@ public class GithubComment extends SimpleComment {
     builder.append("<hr>");
     builder.append("<table>");
     builder.append("<tr><td>");
-    if (myGravatarId != null) {
-        builder.append("<img src=\"").append("http://www.gravatar.com/avatar/").append(myGravatarId).append("?s=40\"/><br>");
-      }
+    if (myAvatarUrl != null) {
+      builder.append("<img src=\"").append(myAvatarUrl).append("\" height=\"40\" width=\"40\"/><br>");
+    }
     builder.append("</td><td>");
     if (getAuthor() != null) {
       builder.append("<b>Author:</b> <a href=\"").append(myUserHtmlUrl).append("\">").append(getAuthor()).append("</a><br>");
index 39a97184fe72ca7bb44e1480d51e6b4cfc57d188..a8445b7f76acbbdc8900b3e840a19c58ff90c7f7 100644 (file)
@@ -240,7 +240,7 @@ public class GithubRepository extends BaseRepositoryImpl {
         @Override
         public Comment fun(GithubIssueComment comment) {
           return new GithubComment(comment.getCreatedAt(), comment.getUser().getLogin(), comment.getBodyHtml(),
-                                   comment.getUser().getGravatarId(),
+                                   comment.getUser().getAvatarUrl(),
                                    comment.getUser().getHtmlUrl());
         }
       });
index 15e73791f8ead5c9b9bec22d0d7246f698e59cff..502d9b4dc4995ec461cf33f0129b8f45cca780e1 100644 (file)
@@ -15,7 +15,6 @@
  */
 package com.intellij.lang.properties;
 
-import com.intellij.lang.HtmlScriptContentProvider;
 import com.intellij.lang.properties.psi.PropertiesFile;
 import com.intellij.lang.properties.psi.PropertyKeyIndex;
 import com.intellij.lang.properties.xml.XmlPropertiesFileImpl;
@@ -79,7 +78,13 @@ public class PropertiesImplUtil extends PropertiesUtil {
   private static ResourceBundle getResourceBundle(@NotNull final String baseName, @NotNull final PsiDirectory baseDirectory) {
     PropertiesFile defaultPropertiesFile = null;
     final ResourceBundleManager bundleBaseNameManager = ResourceBundleManager.getInstance(baseDirectory.getProject());
-    for (final PsiFile psiFile : baseDirectory.getFiles()) {
+    final PsiFile[] psiFiles = ApplicationManager.getApplication().runReadAction(new Computable<PsiFile[]>() {
+      @Override
+      public PsiFile[] compute() {
+        return baseDirectory.getFiles();
+      }
+    });
+    for (final PsiFile psiFile : psiFiles) {
       if (baseName.equals(bundleBaseNameManager.getBaseName(psiFile))) {
         final PropertiesFile propertiesFile = getPropertiesFile(psiFile);
         if (propertiesFile != null) {
@@ -147,4 +152,4 @@ public class PropertiesImplUtil extends PropertiesUtil {
     }
     return getResourceBundle(baseName, baseDirectory);
   }
-}
+}
\ No newline at end of file