Permalink
Browse files

updates for eclim

  • Loading branch information...
1 parent c116253 commit 03a21b718326e94ab0720a659252531b98c4db50 pghosh committed Aug 6, 2012
Showing with 31,619 additions and 0 deletions.
  1. +6 −0 aliases
  2. +3 −0 vim/.netrwhist
  3. +344 −0 vim/eclim/autoload/eclim.vim
  4. +218 −0 vim/eclim/autoload/eclim/client/nailgun.vim
  5. +214 −0 vim/eclim/autoload/eclim/client/python/nailgun.py
  6. +115 −0 vim/eclim/autoload/eclim/client/python/nailgun.vim
  7. +241 −0 vim/eclim/autoload/eclim/common/buffers.vim
  8. +332 −0 vim/eclim/autoload/eclim/common/history.vim
  9. +58 −0 vim/eclim/autoload/eclim/common/largefile.vim
  10. +87 −0 vim/eclim/autoload/eclim/common/license.vim
  11. +633 −0 vim/eclim/autoload/eclim/common/locate.vim
  12. +237 −0 vim/eclim/autoload/eclim/common/template.vim
  13. +190 −0 vim/eclim/autoload/eclim/common/util.vim
  14. +95 −0 vim/eclim/autoload/eclim/css/complete.vim
  15. +51 −0 vim/eclim/autoload/eclim/css/validate.vim
  16. +88 −0 vim/eclim/autoload/eclim/cygwin.vim
  17. +101 −0 vim/eclim/autoload/eclim/display/menu.vim
  18. +374 −0 vim/eclim/autoload/eclim/display/signs.vim
  19. +378 −0 vim/eclim/autoload/eclim/display/window.vim
  20. +196 −0 vim/eclim/autoload/eclim/dltk/buildpath.vim
  21. +111 −0 vim/eclim/autoload/eclim/dltk/interpreter.vim
  22. +128 −0 vim/eclim/autoload/eclim/eclipse.vim
  23. +163 −0 vim/eclim/autoload/eclim/help.vim
  24. +59 −0 vim/eclim/autoload/eclim/html/complete.vim
  25. +135 −0 vim/eclim/autoload/eclim/html/util.vim
  26. +66 −0 vim/eclim/autoload/eclim/html/validate.vim
  27. +144 −0 vim/eclim/autoload/eclim/java/ant/complete.vim
  28. +171 −0 vim/eclim/autoload/eclim/java/ant/doc.vim
  29. +31 −0 vim/eclim/autoload/eclim/java/ant/ivy.vim
  30. +36 −0 vim/eclim/autoload/eclim/java/ant/util.vim
  31. +76 −0 vim/eclim/autoload/eclim/java/bean.vim
  32. +67 −0 vim/eclim/autoload/eclim/java/checkstyle.vim
  33. +190 −0 vim/eclim/autoload/eclim/java/classpath.vim
  34. +177 −0 vim/eclim/autoload/eclim/java/complete.vim
  35. +59 −0 vim/eclim/autoload/eclim/java/constructor.vim
  36. +151 −0 vim/eclim/autoload/eclim/java/correct.vim
  37. +126 −0 vim/eclim/autoload/eclim/java/delegate.vim
  38. +130 −0 vim/eclim/autoload/eclim/java/doc.vim
  39. +58 −0 vim/eclim/autoload/eclim/java/format.vim
  40. +147 −0 vim/eclim/autoload/eclim/java/hierarchy.vim
  41. +241 −0 vim/eclim/autoload/eclim/java/impl.vim
  42. +570 −0 vim/eclim/autoload/eclim/java/import.vim
  43. +247 −0 vim/eclim/autoload/eclim/java/junit.vim
  44. +124 −0 vim/eclim/autoload/eclim/java/logging.vim
  45. +237 −0 vim/eclim/autoload/eclim/java/maven.vim
  46. +346 −0 vim/eclim/autoload/eclim/java/refactor.vim
  47. +449 −0 vim/eclim/autoload/eclim/java/search.vim
  48. +132 −0 vim/eclim/autoload/eclim/java/test.vim
  49. +259 −0 vim/eclim/autoload/eclim/java/tools.vim
  50. +446 −0 vim/eclim/autoload/eclim/java/util.vim
  51. +37 −0 vim/eclim/autoload/eclim/javascript/complete.vim
  52. +128 −0 vim/eclim/autoload/eclim/javascript/util.vim
  53. +313 −0 vim/eclim/autoload/eclim/lang.vim
  54. +129 −0 vim/eclim/autoload/eclim/project/problems.vim
  55. +491 −0 vim/eclim/autoload/eclim/project/tree.vim
  56. +1,313 −0 vim/eclim/autoload/eclim/project/util.vim
  57. +36 −0 vim/eclim/autoload/eclim/ruby/complete.vim
  58. +63 −0 vim/eclim/autoload/eclim/ruby/interpreter.vim
  59. +97 −0 vim/eclim/autoload/eclim/ruby/project.vim
  60. +111 −0 vim/eclim/autoload/eclim/ruby/search.vim
  61. +33 −0 vim/eclim/autoload/eclim/taglisttoo/lang/commonsvalidator.vim
  62. +32 −0 vim/eclim/autoload/eclim/taglisttoo/lang/eclimhelp.vim
  63. +39 −0 vim/eclim/autoload/eclim/taglisttoo/lang/forrest.vim
  64. +33 −0 vim/eclim/autoload/eclim/taglisttoo/lang/gant.vim
  65. +37 −0 vim/eclim/autoload/eclim/taglisttoo/lang/hibernate.vim
  66. +33 −0 vim/eclim/autoload/eclim/taglisttoo/lang/junit.vim
  67. +33 −0 vim/eclim/autoload/eclim/taglisttoo/lang/spring.vim
  68. +43 −0 vim/eclim/autoload/eclim/taglisttoo/lang/webxml.vim
  69. +48 −0 vim/eclim/autoload/eclim/taglisttoo/lang/wsdl.vim
  70. +1,236 −0 vim/eclim/autoload/eclim/tree.vim
  71. +1,417 −0 vim/eclim/autoload/eclim/util.vim
  72. +82 −0 vim/eclim/autoload/eclim/vimplugin.vim
  73. +233 −0 vim/eclim/autoload/eclim/web.vim
  74. +89 −0 vim/eclim/autoload/eclim/xml/complete.vim
  75. +79 −0 vim/eclim/autoload/eclim/xml/definition.vim
  76. +200 −0 vim/eclim/autoload/eclim/xml/format.vim
  77. +137 −0 vim/eclim/autoload/eclim/xml/util.vim
  78. +82 −0 vim/eclim/autoload/eclim/xml/validate.vim
  79. +21 −0 vim/eclim/bin/bash_complete
  80. +81 −0 vim/eclim/compiler/eclim_ant.vim
  81. +48 −0 vim/eclim/compiler/eclim_javac.vim
  82. +48 −0 vim/eclim/compiler/eclim_javadoc.vim
  83. +56 −0 vim/eclim/compiler/eclim_make.vim
  84. +61 −0 vim/eclim/compiler/eclim_maven.vim
  85. +51 −0 vim/eclim/compiler/eclim_mvn.vim
  86. +39 −0 vim/eclim/compiler/eclim_xmllint.vim
  87. +32 −0 vim/eclim/dict/java
  88. +1,087 −0 vim/eclim/doc/changes.txt
  89. +68 −0 vim/eclim/doc/contribute.txt
  90. +39 −0 vim/eclim/doc/development/architecture.txt
  91. +14 −0 vim/eclim/doc/development/index.txt
  92. +49 −0 vim/eclim/doc/documentation.txt
  93. +29 −0 vim/eclim/doc/download.txt
  94. +374 −0 vim/eclim/doc/eclimd.txt
  95. +189 −0 vim/eclim/doc/features.txt
  96. +349 −0 vim/eclim/doc/gettingstarted.txt
  97. +164 −0 vim/eclim/doc/guides/development.txt
  98. +125 −0 vim/eclim/doc/guides/headless.txt
  99. +27 −0 vim/eclim/doc/guides/index.txt
  100. +280 −0 vim/eclim/doc/guides/install.txt
  101. +81 −0 vim/eclim/doc/guides/multi_workspace.txt
  102. +214 −0 vim/eclim/doc/guides/troubleshoot.txt
  103. +51 −0 vim/eclim/doc/guides/uninstall.txt
  104. +393 −0 vim/eclim/doc/index.txt
  105. +21 −0 vim/eclim/doc/irc.txt
  106. +9 −0 vim/eclim/doc/translations/index.txt
  107. +9 −0 vim/eclim/doc/translations/zh_TW/index.txt
  108. +234 −0 vim/eclim/doc/translations/zh_TW/vim/cheatsheet.txt
  109. +35 −0 vim/eclim/doc/vim/c/complete.txt
  110. +48 −0 vim/eclim/doc/vim/c/hierarchy.txt
  111. +21 −0 vim/eclim/doc/vim/c/index.txt
  112. +67 −0 vim/eclim/doc/vim/c/project.txt
  113. +157 −0 vim/eclim/doc/vim/c/search.txt
  114. +38 −0 vim/eclim/doc/vim/c/validate.txt
  115. +437 −0 vim/eclim/doc/vim/cheatsheet.txt
  116. +60 −0 vim/eclim/doc/vim/code_completion.txt
  117. +94 −0 vim/eclim/doc/vim/common/history.txt
  118. +15 −0 vim/eclim/doc/vim/common/index.txt
  119. +498 −0 vim/eclim/doc/vim/common/project.txt
  120. +233 −0 vim/eclim/doc/vim/common/util.txt
  121. +139 −0 vim/eclim/doc/vim/common/web.txt
  122. +26 −0 vim/eclim/doc/vim/css/complete.txt
  123. +11 −0 vim/eclim/doc/vim/css/index.txt
  124. +36 −0 vim/eclim/doc/vim/css/validate.txt
  125. +62 −0 vim/eclim/doc/vim/dltk/buildpath.txt
  126. +14 −0 vim/eclim/doc/vim/dltk/index.txt
  127. +9 −0 vim/eclim/doc/vim/dtd/index.txt
  128. +36 −0 vim/eclim/doc/vim/dtd/validate.txt
  129. +201 −0 vim/eclim/doc/vim/faq.txt
  130. +38 −0 vim/eclim/doc/vim/html/complete.txt
  131. +13 −0 vim/eclim/doc/vim/html/index.txt
  132. +14 −0 vim/eclim/doc/vim/html/util.txt
  133. +36 −0 vim/eclim/doc/vim/html/validate.txt
  134. +76 −0 vim/eclim/doc/vim/index.txt
  135. +83 −0 vim/eclim/doc/vim/issues.txt
  136. +30 −0 vim/eclim/doc/vim/java/ant/complete.txt
  137. +47 −0 vim/eclim/doc/vim/java/ant/doc.txt
  138. +105 −0 vim/eclim/doc/vim/java/ant/execute.txt
  139. +15 −0 vim/eclim/doc/vim/java/ant/index.txt
  140. +47 −0 vim/eclim/doc/vim/java/ant/validate.txt
  141. +58 −0 vim/eclim/doc/vim/java/bean.txt
  142. +54 −0 vim/eclim/doc/vim/java/checkstyle.txt
  143. +300 −0 vim/eclim/doc/vim/java/classpath.txt
  144. +36 −0 vim/eclim/doc/vim/java/complete.txt
  145. +58 −0 vim/eclim/doc/vim/java/constructor.txt
  146. +47 −0 vim/eclim/doc/vim/java/correct.txt
  147. +80 −0 vim/eclim/doc/vim/java/delegate.txt
  148. +82 −0 vim/eclim/doc/vim/java/format.txt
  149. +53 −0 vim/eclim/doc/vim/java/hierarchy.txt
  150. +80 −0 vim/eclim/doc/vim/java/impl.txt
  151. +106 −0 vim/eclim/doc/vim/java/import.txt
  152. +81 −0 vim/eclim/doc/vim/java/index.txt
  153. +117 −0 vim/eclim/doc/vim/java/java.txt
  154. +132 −0 vim/eclim/doc/vim/java/javadoc.txt
  155. +149 −0 vim/eclim/doc/vim/java/junit.txt
  156. +9 −0 vim/eclim/doc/vim/java/log4j/index.txt
  157. +35 −0 vim/eclim/doc/vim/java/log4j/validate.txt
  158. +64 −0 vim/eclim/doc/vim/java/logging.txt
  159. +29 −0 vim/eclim/doc/vim/java/maven/dependencies.txt
  160. +57 −0 vim/eclim/doc/vim/java/maven/execute.txt
  161. +11 −0 vim/eclim/doc/vim/java/maven/index.txt
  162. +171 −0 vim/eclim/doc/vim/java/refactor.txt
  163. +273 −0 vim/eclim/doc/vim/java/search.txt
  164. +45 −0 vim/eclim/doc/vim/java/testng.txt
  165. +38 −0 vim/eclim/doc/vim/java/tools.txt
  166. +46 −0 vim/eclim/doc/vim/java/validate.txt
  167. +9 −0 vim/eclim/doc/vim/java/webxml/index.txt
  168. +35 −0 vim/eclim/doc/vim/java/webxml/validate.txt
  169. +9 −0 vim/eclim/doc/vim/javascript/index.txt
  170. +65 −0 vim/eclim/doc/vim/javascript/validate.txt
  171. +142 −0 vim/eclim/doc/vim/mappings.txt
  172. +14 −0 vim/eclim/doc/vim/php/buildpath.txt
  173. +33 −0 vim/eclim/doc/vim/php/complete.txt
  174. +19 −0 vim/eclim/doc/vim/php/index.txt
  175. +127 −0 vim/eclim/doc/vim/php/search.txt
  176. +41 −0 vim/eclim/doc/vim/php/validate.txt
  177. +27 −0 vim/eclim/doc/vim/python/complete.txt
  178. +262 −0 vim/eclim/doc/vim/python/django.txt
  179. +74 −0 vim/eclim/doc/vim/python/index.txt
  180. +68 −0 vim/eclim/doc/vim/python/search.txt
  181. +55 −0 vim/eclim/doc/vim/python/validate.txt
  182. +14 −0 vim/eclim/doc/vim/ruby/buildpath.txt
  183. +31 −0 vim/eclim/doc/vim/ruby/complete.txt
  184. +19 −0 vim/eclim/doc/vim/ruby/index.txt
  185. +136 −0 vim/eclim/doc/vim/ruby/search.txt
  186. +38 −0 vim/eclim/doc/vim/ruby/validate.txt
  187. +203 −0 vim/eclim/doc/vim/settings.txt
  188. +26 −0 vim/eclim/doc/vim/xml/complete.txt
  189. +28 −0 vim/eclim/doc/vim/xml/definition.txt
  190. +28 −0 vim/eclim/doc/vim/xml/format.txt
  191. +15 −0 vim/eclim/doc/vim/xml/index.txt
  192. +45 −0 vim/eclim/doc/vim/xml/validate.txt
  193. +9 −0 vim/eclim/doc/vim/xsd/index.txt
  194. +36 −0 vim/eclim/doc/vim/xsd/validate.txt
  195. +60 −0 vim/eclim/ftplugin/ant.vim
  196. +35 −0 vim/eclim/ftplugin/commonsvalidator.vim
  197. +60 −0 vim/eclim/ftplugin/css.vim
  198. +52 −0 vim/eclim/ftplugin/dtd.vim
  199. +37 −0 vim/eclim/ftplugin/eclimhelp.vim
  200. +82 −0 vim/eclim/ftplugin/eclipse_buildpath.vim
  201. +88 −0 vim/eclim/ftplugin/eclipse_classpath.vim
  202. +37 −0 vim/eclim/ftplugin/forrestdocument.vim
  203. +37 −0 vim/eclim/ftplugin/forreststatus.vim
  204. +35 −0 vim/eclim/ftplugin/gant.vim
  205. +48 −0 vim/eclim/ftplugin/hibernate.vim
  206. +64 −0 vim/eclim/ftplugin/html.vim
  207. +52 −0 vim/eclim/ftplugin/ivy.vim
  208. +250 −0 vim/eclim/ftplugin/java.vim
  209. +55 −0 vim/eclim/ftplugin/javascript.vim
  210. +35 −0 vim/eclim/ftplugin/junitresult.vim
  211. +67 −0 vim/eclim/ftplugin/log4j.vim
  212. +32 −0 vim/eclim/ftplugin/make.vim
  213. +39 −0 vim/eclim/ftplugin/maven_project.vim
  214. +59 −0 vim/eclim/ftplugin/mvn_pom.vim
  215. +77 −0 vim/eclim/ftplugin/ruby.vim
  216. +40 −0 vim/eclim/ftplugin/spring.vim
  217. +32 −0 vim/eclim/ftplugin/strutsconfig.vim
  218. +40 −0 vim/eclim/ftplugin/tld.vim
  219. +81 −0 vim/eclim/ftplugin/webxml.vim
  220. +37 −0 vim/eclim/ftplugin/wsdl.vim
  221. +63 −0 vim/eclim/ftplugin/xml.vim
  222. +30 −0 vim/eclim/ftplugin/xml_complete.vim
  223. +55 −0 vim/eclim/ftplugin/xsd.vim
  224. +73 −0 vim/eclim/indent/css.vim
  225. +73 −0 vim/eclim/indent/dtd.vim
  226. +175 −0 vim/eclim/indent/html.vim
  227. +683 −0 vim/eclim/indent/indentanything.vim
  228. +146 −0 vim/eclim/indent/javascript.vim
  229. +169 −0 vim/eclim/indent/xml.vim
  230. +32 −0 vim/eclim/plugin/ant.vim
  231. +318 −0 vim/eclim/plugin/eclim.vim
  232. +101 −0 vim/eclim/plugin/ftdetect.vim
  233. +28 −0 vim/eclim/plugin/ftdetect_dltk.vim
  234. +57 −0 vim/eclim/plugin/ftdetect_jdt.vim
  235. +38 −0 vim/eclim/plugin/java_tools.vim
  236. +36 −0 vim/eclim/plugin/maven.vim
  237. +204 −0 vim/eclim/plugin/project.vim
  238. +38 −0 vim/eclim/plugin/vimplugin.vim
  239. +64 −0 vim/eclim/syntax/ant.vim
  240. +27 −0 vim/eclim/syntax/commonsvalidator.vim
  241. +47 −0 vim/eclim/syntax/css.vim
  242. +29 −0 vim/eclim/syntax/eclimhelp.vim
  243. +27 −0 vim/eclim/syntax/eclipse_buildpath.vim
  244. +27 −0 vim/eclim/syntax/eclipse_classpath.vim
  245. +27 −0 vim/eclim/syntax/forrestdocument.vim
  246. +27 −0 vim/eclim/syntax/forreststatus.vim
  247. +33 −0 vim/eclim/syntax/gant.vim
  248. +31 −0 vim/eclim/syntax/groovy_simple_template.vim
  249. +48 −0 vim/eclim/syntax/hg.vim
  250. +27 −0 vim/eclim/syntax/hibernate.vim
  251. +39 −0 vim/eclim/syntax/html.vim
  252. +27 −0 vim/eclim/syntax/ivy.vim
  253. +36 −0 vim/eclim/syntax/java.vim
  254. +25 −0 vim/eclim/syntax/junitresult.vim
  255. +49 −0 vim/eclim/syntax/log4j.vim
  256. +27 −0 vim/eclim/syntax/maven_project.vim
  257. +27 −0 vim/eclim/syntax/mvn_pom.vim
  258. +45 −0 vim/eclim/syntax/mysql.vim
  259. +38 −0 vim/eclim/syntax/perl.vim
  260. +27 −0 vim/eclim/syntax/spring.vim
  261. +50 −0 vim/eclim/syntax/sql.vim
  262. +27 −0 vim/eclim/syntax/strutsconfig.vim
  263. +27 −0 vim/eclim/syntax/tld.vim
  264. +27 −0 vim/eclim/syntax/webxml.vim
  265. +27 −0 vim/eclim/syntax/wsdl.vim
  266. +37 −0 vim/eclim/syntax/xml.vim
  267. +176 −0 vim/plugin/eclim.vim
View
@@ -70,3 +70,9 @@ token=`mongo --quiet sli --eval 'db.userSession.find({"body.principal.externalId
response=`curl -s -H "Content-type: application/json" -H "accept: application/${format}" -H "Authorization: bearer $token" $url`
echo $response | python -mjson.tool
}
+
+#jenkins run
+alias jenkins='java -jar /usr/local/Cellar/jenkins/1.464/libexec/jenkins.war --httpPort=9000'
+
+#set veriable
+SLI_HOME=/Users/pghosh/codebase/sli/sli
View
@@ -0,0 +1,3 @@
+let g:netrw_dirhistmax =10
+let g:netrw_dirhist_cnt =1
+let g:netrw_dirhist_1='/Users/pghosh/.vim'
@@ -0,0 +1,344 @@
+" Author: Eric Van Dewoestine
+"
+" Description: {{{
+" Plugin that integrates vim with the eclipse plugin eclim (ECLipse
+" IMproved).
+"
+" This plugin contains shared functions that can be used regardless of the
+" current file type being edited.
+"
+" License:
+"
+" Copyright (C) 2005 - 2011 Eric Van Dewoestine
+"
+" This program is free software: you can redistribute it and/or modify
+" it under the terms of the GNU General Public License as published by
+" the Free Software Foundation, either version 3 of the License, or
+" (at your option) any later version.
+"
+" This program is distributed in the hope that it will be useful,
+" but WITHOUT ANY WARRANTY; without even the implied warranty of
+" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+" GNU General Public License for more details.
+"
+" You should have received a copy of the GNU General Public License
+" along with this program. If not, see <http://www.gnu.org/licenses/>.
+"
+" }}}
+
+" Global Variables {{{
+ if !exists("g:EclimShowErrors")
+ let g:EclimShowErrors = 1
+ endif
+" }}}
+
+" Script Variables {{{
+ let s:command_ping = '-command ping'
+ let s:command_settings = '-command settings'
+ let s:command_settings_update = '-command settings_update -s "<settings>"'
+ let s:command_shutdown = "-command shutdown"
+ let s:connect= '^connect: .*$'
+
+ " list of commands that may fail using system() call, so using a temp file
+ " instead.
+ let s:exec_commands = ['java_complete']
+
+ let g:eclimd_running = 1
+" }}}
+
+" ExecuteEclim(command, [port]) {{{
+" Executes the supplied eclim command.
+function! eclim#ExecuteEclim(command, ...)
+ if exists('g:EclimDisabled')
+ return
+ endif
+
+ " eclimd appears to be down, so exit early if in an autocmd
+ if !g:eclimd_running && expand('<amatch>') != ''
+ " check for file created by eclimd to signal that it is running.
+ if !eclim#EclimAvailable()
+ return
+ endif
+ endif
+
+ let g:eclimd_running = 1
+
+ let command = '-editor vim ' . a:command
+
+ " encode special characters
+ " http://www.w3schools.com/TAGS/ref_urlencode.asp
+ let command = substitute(command, '\*', '%2A', 'g')
+ let command = substitute(command, '\$', '%24', 'g')
+ let command = substitute(command, '<', '%3C', 'g')
+ let command = substitute(command, '>', '%3E', 'g')
+
+ " execute the command.
+ let port = len(a:000) > 0 ? a:000[0] : eclim#client#nailgun#GetNgPort()
+ let [retcode, result] = eclim#client#nailgun#Execute(port, command)
+ let result = substitute(result, '\n$', '', '')
+
+ " not sure this is the best place to handle this, but when using the python
+ " client, the result has a trailing ctrl-m on windows. also account for
+ " running under cygwin vim.
+ if has('win32') || has('win64') || has('win32unix')
+ let result = substitute(result, "\<c-m>$", '', '')
+ endif
+
+ " an echo during startup causes an annoying issue with vim.
+ "call eclim#util#Echo(' ')
+
+ " check for errors
+ let error = ''
+ if result =~ '^[^\n]*Exception:\?[^\n]*\n\s\+\<at\> ' ||
+ \ result =~ '^[^\n]*ResourceException(.\{-})\[[0-9]\+\]:[^\n]*\n\s\+\<at\> '
+ let error = substitute(result, '\(.\{-}\)\n.*', '\1', '')
+ elseif retcode
+ let error = result
+ endif
+
+ if retcode || error != ''
+ if g:EclimShowErrors
+ if error =~ s:connect
+ " eclimd is not running, disable further eclimd calls
+ let g:eclimd_running = 0
+
+ " if we are not in an autocmd or the autocmd is for an acwrite buffer,
+ " alert the user that eclimd is not running.
+ if expand('<amatch>') == '' || &buftype == 'acwrite'
+ call eclim#util#EchoWarning(
+ \ "unable to connect to eclimd (port: " . port . ") - " . error)
+ endif
+ else
+ let error = error . "\n" .
+ \ 'while executing command (port: ' . port . '): ' . command
+ " if we are not in an autocmd or in a autocmd for an acwrite buffer,
+ " echo the error, otherwise just log it.
+ if expand('<amatch>') == '' || &buftype == 'acwrite'
+ call eclim#util#EchoError(error)
+ else
+ call eclim#util#EchoDebug(error)
+ endif
+ endif
+ endif
+ return
+ endif
+
+ return result != '' ? eval(result) : result
+endfunction " }}}
+
+" Disable() {{{
+" Temporarily disables communication with eclimd.
+function! eclim#Disable()
+ if !exists('g:EclimDisabled')
+ let g:EclimDisabled = 1
+ endif
+endfunction " }}}
+
+" Enable() {{{
+" Re-enables communication with eclimd.
+function! eclim#Enable()
+ if exists('g:EclimDisabled')
+ unlet g:EclimDisabled
+ endif
+endfunction " }}}
+
+" EclimAvailable() {{{
+function! eclim#EclimAvailable()
+ let instances = eclim#UserHome() . '/.eclim/.eclimd_instances'
+ return filereadable(instances)
+endfunction " }}}
+
+" PingEclim(echo, [workspace]) {{{
+" Pings the eclimd server.
+" If echo is non 0, then the result is echoed to the user.
+function! eclim#PingEclim(echo, ...)
+ let workspace_found = 1
+ if len(a:000) > 0 && a:1 != ''
+ let workspace = substitute(a:1, '\', '/', 'g')
+ let workspace .= workspace !~ '/$' ? '/' : ''
+ if !eclim#util#ListContains(eclim#eclipse#GetAllWorkspaceDirs(), workspace)
+ let workspace_found = 0
+ endif
+ let port = eclim#client#nailgun#GetNgPort(workspace)
+ else
+ let workspace = eclim#eclipse#ChooseWorkspace()
+ let port = eclim#client#nailgun#GetNgPort(workspace)
+ endif
+
+ if a:echo
+ if !workspace_found
+ call eclim#util#Echo('eclimd instance for workspace not found: ' . workspace)
+ return
+ endif
+
+ let result = eclim#ExecuteEclim(s:command_ping, port)
+ if type(result) == g:DICT_TYPE
+ call eclim#util#Echo(
+ \ 'eclim ' . result.eclim . "\n" .
+ \ 'eclipse ' . result.eclipse)
+ endif
+ else
+ if !workspace_found
+ return
+ endif
+
+ let savedErr = g:EclimShowErrors
+ let savedLog = g:EclimLogLevel
+ let g:EclimShowErrors = 0
+ let g:EclimLogLevel = 0
+
+ let result = eclim#ExecuteEclim(s:command_ping, port)
+
+ let g:EclimShowErrors = savedErr
+ let g:EclimLogLevel = savedLog
+
+ return type(result) == g:DICT_TYPE
+ endif
+endfunction " }}}
+
+" ParseSettingErrors() {{{
+function! eclim#ParseSettingErrors(errors)
+ let errors = []
+ for error in a:errors
+ let setting = substitute(error, '^\(.\{-}\): .*', '\1', '')
+ let message = substitute(error, '^.\{-}: \(.*\)', '\1', '')
+ let line = search('^\s*' . setting . '\s*=', 'cnw')
+ call add(errors, {
+ \ 'bufnr': bufnr('%'),
+ \ 'lnum': line > 0 ? line : 1,
+ \ 'text': message,
+ \ 'type': 'e'
+ \ })
+ endfor
+ return errors
+endfunction " }}}
+
+" SaveSettings(command, project, [port]) {{{
+function! eclim#SaveSettings(command, project, ...)
+ " don't check modified since undo seems to not set the modified flag
+ "if &modified
+ let tempfile = substitute(tempname(), '\', '/', 'g')
+
+ " get all lines, filtering out comments and blank lines
+ let lines = filter(getline(1, line('$')), 'v:val !~ "^\\s*\\(#\\|$\\)"')
+
+ " convert lines into a settings dict
+ let index = 0
+ let settings = {}
+ let pattern = '^\s*\([[:alnum:]_.-]\+\)\s*=\s*\(.*\)'
+ while index < len(lines)
+ if lines[index] =~ pattern
+ let name = substitute(lines[index], pattern, '\1', '')
+ let value = substitute(lines[index], pattern, '\2', '')
+ while value =~ '\\$'
+ let index += 1
+ let value = substitute(value, '\\$', '', '')
+ let value .= substitute(lines[index], '^\s*', '', '')
+ endwhile
+ let settings[name] = value
+ endif
+ let index += 1
+ endwhile
+ call writefile([string(settings)], tempfile)
+
+ if has('win32unix')
+ let tempfile = eclim#cygwin#WindowsPath(tempfile)
+ endif
+
+ let command = a:command
+ let command = substitute(command, '<project>', a:project, '')
+ let command = substitute(command, '<settings>', tempfile, '')
+
+ if len(a:000) > 0
+ let port = a:000[0]
+ let result = eclim#ExecuteEclim(command, port)
+ else
+ let result = eclim#ExecuteEclim(command)
+ endif
+
+ if type(result) == g:LIST_TYPE
+ call eclim#util#EchoError
+ \ ("Operation contained errors. See location list for details.")
+ call eclim#util#SetLocationList(eclim#ParseSettingErrors(result))
+ else
+ call eclim#util#ClearLocationList()
+ call eclim#util#Echo(result)
+ endif
+
+ setlocal nomodified
+ "endif
+endfunction " }}}
+
+" Settings(workspace) {{{
+" Opens a window that can be used to edit the global settings.
+function! eclim#Settings(workspace)
+ let workspace = a:workspace
+ if workspace == ''
+ let workspace = eclim#eclipse#ChooseWorkspace()
+ if workspace == '0'
+ return
+ endif
+ endif
+
+ let port = eclim#client#nailgun#GetNgPort(workspace)
+
+ let settings = eclim#ExecuteEclim(s:command_settings, port)
+ if type(settings) != g:LIST_TYPE
+ return
+ endif
+
+ let content = ['# Global settings for workspace: ' . workspace, '']
+ let path = ''
+ for setting in settings
+ if setting.path != path
+ if path != ''
+ let content += ['# }', '']
+ endif
+ let path = setting.path
+ call add(content, '# ' . path . ' {')
+ endif
+ let description = split(setting.description, '\n')
+ let content += map(description, "'\t# ' . v:val")
+ call add(content, "\t" . setting.name . '=' . setting.value)
+ endfor
+ if path != ''
+ call add(content, '# }')
+ endif
+
+ call eclim#util#TempWindow("Eclim_Global_Settings", content)
+ setlocal buftype=acwrite
+ setlocal filetype=jproperties
+ setlocal noreadonly
+ setlocal modifiable
+ setlocal foldmethod=marker
+ setlocal foldmarker={,}
+
+ augroup eclim_settings
+ autocmd! BufWriteCmd <buffer>
+ exec 'autocmd BufWriteCmd <buffer> ' .
+ \ 'call eclim#SaveSettings(s:command_settings_update, "", ' . port . ')'
+ augroup END
+endfunction " }}}
+
+" ShutdownEclim() {{{
+" Shuts down the eclimd server.
+function! eclim#ShutdownEclim()
+ let workspace = eclim#eclipse#ChooseWorkspace()
+ if workspace != '0'
+ let port = eclim#client#nailgun#GetNgPort()
+ call eclim#ExecuteEclim(s:command_shutdown, port)
+ endif
+endfunction " }}}
+
+" UserHome() {{{
+function! eclim#UserHome()
+ let home = expand('$HOME')
+ if has('win32unix')
+ let home = eclim#cygwin#WindowsHome()
+ elseif has('win32') || has('win64')
+ let home = expand('$USERPROFILE')
+ endif
+ return substitute(home, '\', '/', 'g')
+endfunction " }}}
+
+" vim:ft=vim:fdm=marker
Oops, something went wrong.

0 comments on commit 03a21b7

Please sign in to comment.