Permalink
Browse files

initial import of git xqueryvim

  • Loading branch information...
0 parents commit 23916a6e46fc2a91852df3f37efc1d513a6f6342 @dlam26 committed Jul 2, 2012
32 HOWTOINSTALL
@@ -0,0 +1,32 @@
+
+
+-description-
+
+This plugin configures Vim to be a little more efficient at editing XQuery...!
+
+It also sets up Exuberant Ctags for XQuery, since it's not one of languages it supports out-of-the-box.
+
+ftplugin/xquery.vim:
+ -Makes keys like gd and <C-]> and i_CTRL-p work better when editing XQuery files by temporarily adding the hyphen - to the 'iskeyword' option
+ -Sets options useful when editing XQuery (like 'set comments')
+ -Sets a few variables to make matchit.vim and taglist.vim work better with XQuery
+
+xquerycomplete.vim:
+ -Completes W3C XQuery 'fn' functions, types and keywords.
+ -Also completes any MarkLogic functions I could find at... http://developer.marklogic.com/pubs/4.1/apidocs/All.html
+
+indent/xquery.vim:
+ - Attempts to indent according to the 'XQuery Style Conventions' here: http://xqdoc.org/xquery-style.html
+ - Typing out certain keywords (like for/let/where/order/return/else) will automatically indent to the correct location when typed out.
+
+
+-install details-
+
+ 1. Copy ftplugin/xquery.vim to $HOME/.vim/ftplugin or $HOME/vimfiles/ftplugin or $VIM/vimfiles/ftplugin (and set 'filetype plugin on')
+ 2. Copy autoload/xquerycomplete.vim to $HOME/.vim/autoload or $HOME/vimfiles/autoload or $VIM/vimfiles/autoload
+ 3. Copy indent/xquery.vim to $HOME/.vim/indent/ or $HOME/vimfiles/indent or $VIM/vimfiles/indent (and set 'filetype indent on')
+ 4. Copy _ctags to $HOME/.ctags (or one of the alternatives at http://ctags.sourceforge.net/ctags.html#FILES)
+ 5. Download Exuberant Ctags and put it on your path. Use 'ctags -R' to build a tags file for your XQuery source folder
+
+ The steps are mostly optional, so if you don't want automatic indentation for instance, you can just skip step #3.
+
52 HOWTO_VIMSCRIPT
@@ -0,0 +1,52 @@
+HOWTO VIMSCRIPT
+
+11/22/2010
+
+:h debug-scripts
+
+:h usr_41 (How to Write a Vim script)
+
+
+<lamdk> is there a key to paste the value of some setting into the buffer?
+ like the function name in 'set indentexpr?'
+<jamessan> lamdk: :help expr-option
+<MarcWeber> lamdk: <c-r>=vim-expr
+
+=======================================================
+=======================================================
+
+
+Q. How do I log a message to debug a script? (from $VIMRUNTIME/indent/GenericIndent.vim)
+A.
+ Using the Ex command 'echomsg'
+
+ --> echomsg "Here" . " is a cool message"
+
+ echo &indentexpr
+
+
+
+Q. How do I insert text into the buffer?
+A.
+ Using setline(lnum, text)
+
+ Ex. call setline(line('.'), "abc123")
+
+ call setline(line('.'), &tabstop)
+
+
+Q. How do I get the line ***NUMBER*** the cursor is currently on?
+A. line('.')
+
+
+Q. How do I get the line ***TEXT*** the cursor is currently on?
+A. getline('.')
+
+
+Q. Get the syntax name of the thing at the cursor?
+A. echo synIDattr(synID(line("."), col("."), 1), "name")
+
+Q. How do I see all vimscript builtin functions?
+A.
+ :h functions
+ :h function-list
148 TODO
@@ -0,0 +1,148 @@
+
+---FTPLUGIN TODO---
+
+ 6/3/2011 Bind a key that does [i and [I
+
+
+---INDENT TODO---
+---INDENT TODO---
+---INDENT TODO---
+
+
+ 9.) 9/22/2011 Last line with just the closing paren should align
+ with the start of the function name (a little after the :=) instead
+ of the start of the line:
+
+
+ for $e in $all-curr-scenario-entities
+ let $entity := util:default-if-empty(
+ xs:string($e/@rt:entity),
+ $RFETrack:DEFAULT-ENTITY
+ )
+
+ 8.) 8/23/2011 For some reason the 'else' here isn't aligning right. (without the parens it works
+
+
+ if(PermissionsManager:is-admin()) then (
+ $stuff-to-show-to-PM
+ )
+ else (
+ $stuff-to-show-otherwise
+ )
+
+
+ 7.) 7/20/2011 The first line of the comment here indents, when it should indent -1
+
+ declare variable $ranked-scenario-rfe-ids := (
+
+ (: filter out all ranked scenario rfes that have been either pushed
+ : to bugtrack already, or aren't 'new' or 'reviewed'
+ :)
+
+
+ 6.) The 'return' after the eval-q string aligns to previous keyword,
+ but shouldn't since it's in a string!
+
+ let $eval-q := "
+ declare namespace rt = 'http://marklogic.com/rfetrack';
+ declare variable $rt:entity as xs:string external;
+ declare variable $rt:id as xs:string? external;
+ declare variable $rt:entity-source as element() external;
+
+ xdmp:node-insert-child(
+ $rt:entity-source,
+ element { $list-element-name } {
+ element { $list-item-element-name } { $rt:entry-value }
+ }
+ )
+
+ "
+ return
+ xdmp:eval($eval-q, (
+ xs:QName("rt:entity"), $rt:entity,
+ xs:QName("rt:id"), $rt:id,
+ xs:QName("rt:entity-source"), RFEManager:get($rt:entity, $rt:entity-id)
+ ))
+
+ 5.) It thinks its in unction declaration on the last line here... 397
+
+ declare function RFETrack:compute-dateformat-options-from-settings(
+ $datetime-item as item()?
+ ) as xs:string*
+ {
+ if(fn:empty($datetime-item)) then (
+
+ )
+ else
+
+ 4.) It thinks the 4th line here is a line-wrapped-if-statement
+ line 296
+
+ let $entity := RFEManager:get($entity, $entity-id)
+ let $comments-local-name :=
+ if($entity = $RFETrack:ENTITY-RFE) then "rt:notes" else "rt:comments"
+ let $comments := RFEManager:get($entity, $entity-id)
+
+ 3.) 5/18/2011 The second return here dosent autoindent!
+
+ let $email-name-map := (
+ let $mp := map:map()
+ let $_put := (
+
+ )
+ return $mp
+ )
+ return
+
+
+ 2.) 5/16/2011 This line autoindents because of the comma, but should
+ be indented one &sw to the right...
+
+ xdmp:node-replace($field/rt:parameters,
+ element rt:parameters
+
+
+ 1.) 4/15/2011 The let here after the computed constructor indents to 'element'
+ instead of the let
+
+ declare function local:make-source-of-file(
+ $repository-name as xs:string,
+ $full-file-path as xs:string
+ )
+ {
+ let $source-element :=
+ element ham:source {
+ element ham:repository-name { $repository-name },
+ element ham:full-file-path { $full-file-path },
+ element ham:extension { local:parse-extension($full-file-path) },
+ element ham:created { fn:current-dateTime() },
+ element ham:raw {
+ ham:get-raw-source($repository-name, $full-file-path)
+ }
+ }
+ return
+ };
+
+ i. 3/31/2011 The anchor on the last line shouldn't autoindent
+
+ <form action="" method="post">
+ <input type="url" placeholder="The SVN URL"
+ name="{$ML-SVN-URL}" value="{$DEFAULT-SVN-URL}"/>
+ <a href
+
+
+ 21) 3/4/2011 The second line currently autoindents because the first
+ ends with a comma:
+
+ fn:concat("somestring",
+ $foo:bar-variable ,"=" , xdmp:url-encode($baz) )
+
+ 17) Seems like with 0} in 'indentkeys', and with cursor positioned
+ one line 3 below just before the <, it dosent indent correctly
+ when you type }. It works though if you ==
+
+ 1 <blah>{
+ 2
+ 3 }</blah>
+
+
5 _ctags
@@ -0,0 +1,5 @@
+--langdef=xquery
+--langmap=xquery:.xqy
+--regex-xquery=/^(declare|define)[ \t]*(private)?[ \t]*function[ \t]*([_a-zA-Z0-9:-]*:)?([_a-zA-Z0-9-]+)/\4/f,function/
+--regex-xquery=/^(declare|define)[ \t]*(private)?[ \t]*variable[ \t]*\$([_a-zA-Z0-9:-]*|[_a-zA-Z0-9-]+)/\3/v,variable/
+--regex-xquery=/^module namespace[ \t]*(\w+)[ \t]*=.*/\1/m,module/
29 _ctags.notes
@@ -0,0 +1,29 @@
+
+
+Good reference info
+
+--------------------------------------------------------------------------------
+
+http://ctags.sourceforge.net/ctags.html
+
+http://vim-taglist.sourceforge.net/extend.html
+
+
+---------------------------------------------------------------------------------
+
+for regex info (it uses POSIX regexes or watever):
+
+ man egrep
+
+
+ info regex
+
+
+
+
+------------
+
+
+originally xquery ctags things was just one line:
+
+--regex-xquery=/^(declare|define) function[ \t]*([_a-zA-Z0-9:-]+)/\2/f,function/
1,089 autoload/xquerycomplete.vim
@@ -0,0 +1,1089 @@
+" XQuery completion script
+" Language: XQuery
+" Maintainer: David Lam <dlam@dlam.me>
+" Last Change: 2011 June 2
+"
+" Notes:
+" Completes W3C XQuery 'fn' functions, types and keywords.
+"
+" Also completes all the MarkLogic functions I could find at...
+" http://developer.marklogic.com/pubs/4.1/apidocs/All.html
+"
+" Usage:
+" Generally, just start by typing it's namespace and then <CTRL-x><CTRL-o>
+"
+" fn<CTRL-x><CTRL-o>
+" -> list of functions in the 'fn' namespace
+"
+" fn:doc<CTRL-x><CTRL-o>
+" -> fn:doc(
+" fn:doc-available(
+" fn:document-uri(
+"
+" xs<CTRL-x><CTRL-o>
+" -> list of all xquery types
+"
+" decl<CTRL-x><CTRL-o>
+" -> declare
+" declare function
+" declare namespace
+" declare option
+" declare default
+"
+"
+" :h complete-functions
+" :h omnifunc
+" :h filetype-plugin-on
+
+
+if exists("b:did_xqueryomnicomplete")
+ "finish
+ delfunction xquerycomplete#CompleteXQuery
+endif
+let b:did_xqueryomnicomplete = 1
+
+function! xquerycomplete#CompleteXQuery(findstart, base)
+
+ if a:findstart
+ " locate the start of the word
+ let line = getline('.')
+ let start = col('.') - 1
+ let curline = line('.')
+ let compl_begin = col('.') - 2
+
+ " 5/29/2010 \| joins two regex branches! :h pattern
+ while start >= 0 && line[start - 1] =~ '\k\|:\|\-\|&'
+ let start -= 1
+ endwhile
+ let b:compl_context = getline('.')[0:compl_begin]
+
+ return start
+ else
+
+ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+ " "
+ " START START START COMPLETION LISTS START START START "
+ " "
+ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+ " http://developer.marklogic.com/pubs/4.1/apidocs/AdminLibrary.htm
+"{{{let admin_api_functions =
+ let admin_api_functions = [
+ \ 'appserver-add-namespace',
+ \ 'appserver-add-request-blackout',
+ \ 'appserver-add-schema',
+ \ 'appserver-copy',
+ \ 'appserver-delete',
+ \ 'appserver-delete-namespace',
+ \ 'appserver-delete-request-blackout',
+ \ 'appserver-delete-schema',
+ \ 'appserver-get-address',
+ \ 'appserver-get-authentication',
+ \ 'appserver-get-backlog',
+ \ 'appserver-get-collation',
+ \ 'appserver-get-compute-content-length',
+ \ 'appserver-get-concurrent-request-limit',
+ \ 'appserver-get-database',
+ \ 'appserver-get-debug-allow',
+ \ 'appserver-get-default-time-limit',
+ \ 'appserver-get-default-user',
+ \ 'appserver-get-default-xquery-version',
+ \ 'appserver-get-display-last-login',
+ \ 'appserver-get-enabled',
+ \ 'appserver-get-error-handler',
+ \ 'appserver-get-group-id',
+ \ 'appserver-get-host-ids',
+ \ 'appserver-get-id',
+ \ 'appserver-get-keep-alive-timeout',
+ \ 'appserver-get-last-login',
+ \ 'appserver-get-log-errors',
+ \ 'appserver-get-max-time-limit',
+ \ 'appserver-get-modules-database',
+ \ 'appserver-get-name',
+ \ 'appserver-get-namespaces',
+ \ 'appserver-get-output-encoding',
+ \ 'appserver-get-output-sgml-character-entities',
+ \ 'appserver-get-port',
+ \ 'appserver-get-pre-commit-trigger-depth',
+ \ 'appserver-get-pre-commit-trigger-limit',
+ \ 'appserver-get-privilege',
+ \ 'appserver-get-profile-allow',
+ \ 'appserver-get-request-blackouts',
+ \ 'appserver-get-request-timeout',
+ \ 'appserver-get-root',
+ \ 'appserver-get-schemas',
+ \ 'appserver-get-session-timeout',
+ \ 'appserver-get-ssl-allow-sslv3',
+ \ 'appserver-get-ssl-allow-tls',
+ \ 'appserver-get-ssl-certificate-authorities',
+ \ 'appserver-get-ssl-hostname',
+ \ 'appserver-get-ssl-require-client-certificate',
+ \ 'appserver-get-static-expires',
+ \ 'appserver-get-threads',
+ \ 'appserver-get-type',
+ \ 'appserver-get-url-rewriter',
+ \ 'appserver-one-time-request-blackout',
+ \ 'appserver-recurring-request-blackout',
+ \ 'appserver-set-address',
+ \ 'appserver-set-authentication',
+ \ 'appserver-set-backlog',
+ \ 'appserver-set-collation',
+ \ 'appserver-set-compute-content-length',
+ \ 'appserver-set-concurrent-request-limit',
+ \ 'appserver-set-database',
+ \ 'appserver-set-debug-allow',
+ \ 'appserver-set-time-limit',
+ \ 'appserver-set-default-user',
+ \ 'appserver-set-default-xquery-version',
+ \ 'appserver-set-display-last-login',
+ \ 'appserver-set-enabled',
+ \ 'appserver-set-error-handler',
+ \ 'appserver-set-keep-alive-timeout',
+ \ 'appserver-set-last-login',
+ \ 'appserver-set-log-errors',
+ \ 'appserver-set-max-time-limit',
+ \ 'appserver-set-modules-database',
+ \ 'appserver-set-name',
+ \ 'appserver-set-output-encoding',
+ \ 'appserver-set-output-sgml-character-entities',
+ \ 'appserver-set-port',
+ \ 'appserver-set-pre-commit-trigger-depth',
+ \ 'appserver-set-pre-commit-trigger-limit',
+ \ 'appserver-set-privilege',
+ \ 'appserver-set-profile-allow',
+ \ 'appserver-set-request-timeout',
+ \ 'appserver-set-root',
+ \ 'appserver-set-session-timeout',
+ \ 'appserver-set-ssl-allow-sslv3',
+ \ 'appserver-set-ssl-allow-tls',
+ \ 'appserver-set-ssl-certificate-template',
+ \ 'appserver-set-ssl-ciphers',
+ \ 'appserver-set-ssl-client-certificate-authorities',
+ \ 'appserver-set-ssl-hostname',
+ \ 'appserver-set-ssl-require-client-certificate',
+ \ 'appserver-set-static-expires',
+ \ 'appserver-set-threads',
+ \ 'appserver-set-url-rewriter',
+ \ 'database-add-backup',
+ \ 'database-add-element-attribute-word-lexicon',
+ \ 'database-add-element-word-lexicon',
+ \ 'database-add-element-word-query-through',
+ \ 'database-add-field',
+ \ 'database-add-field-excluded-element',
+ \ 'database-add-field-included-element',
+ \ 'database-add-field-word-lexicon',
+ \ 'database-add-fragment-parent',
+ \ 'database-add-fragment-root',
+ \ 'database-add-geospatial-element-attribute-pair-index',
+ \ 'database-add-geospatial-element-child-index',
+ \ 'database-add-geospatial-element-index',
+ \ 'database-add-merge-blackout',
+ \ 'database-add-phrase-around',
+ \ 'database-add-phrase-through',
+ \ 'database-add-range-element-attribute-index',
+ \ 'database-add-range-element-index',
+ \ 'database-add-word-lexicon',
+ \ 'database-add-word-query-excluded-element',
+ \ 'database-add-word-query-included-element',
+ \ 'database-attach-forest',
+ \ 'database-copy',
+ \ 'database-create',
+ \ 'database-daily-backup',
+ \ 'database-delete',
+ \ 'database-delete-backup',
+ \ 'database-delete-element-attribute-word-lexicon',
+ \ 'database-delete-element-word-lexicon',
+ \ 'database-delete-element-word-query-through',
+ \ 'database-delete-field',
+ \ 'database-delete-field-excluded-element',
+ \ 'database-delete-field-included-element',
+ \ 'database-delete-field-word-lexicon',
+ \ 'database-delete-fragment-parent',
+ \ 'database-delete-fragment-root',
+ \ 'database-delete-geospatial-element-attribute-pair-index',
+ \ 'database-delete-geospatial-element-child-index',
+ \ 'database-delete-geospatial-element-index',
+ \ 'database-delete-geospatial-element-pair-index',
+ \ 'database-delete-merge-blackout',
+ \ 'database-delete-phrase-around',
+ \ 'database-delete-range-element-attribute-index',
+ \ 'database-delete-range-element-index',
+ \ 'database-delete-word-lexicon',
+ \ 'database-delete-word-query-excluded-element',
+ \ 'database-delete-word-query-included-element',
+ \ 'database-detach-forest',
+ \ 'database-element-attribute-word-lexicon',
+ \ 'database-element-word-lexicon',
+ \ 'database-eleemnt-word-query-through',
+ \ 'database-excluded-element',
+ \ 'database-field',
+ \ 'database-fragment-parent',
+ \ 'database-fragment-root',
+ \ 'database-geospatial-element-attribute-pair-index',
+ \ 'database-geospatial-element-child-index',
+ \ 'database-geospatial-element-index',
+ \ 'database-geospatial-element-pair-index',
+ \ 'database-get-attached-forests',
+ \ 'database-get-attribute-value-positions',
+ \ 'database-get-backups',
+ \ 'database-get-collection-lexicon',
+ \ 'database-get-directory-creation',
+ \ 'database-get-element-attribute-word-lexicons',
+ \ 'database-get-element-value-positions',
+ \ 'database-get-element-word-lexicons',
+ \ 'database-get-element-word-positions',
+ \ 'database-get-element-word-query-throughs',
+ \ 'database-get-enabled',
+ \ 'database-get-expunge-locks',
+ \ 'database-get-fast-case-sensitive-searches',
+ \ 'database-get-fast-diacritic-sensitive-searches',
+ \ 'database-get-fast-element-character-searches',
+ \ 'database-get-fast-element-phrase-searches',
+ \ 'database-get-fast-element-trailing-wildcard-searches',
+ \ 'database-get-fast-element-word-searches',
+ \ 'database-get-fast-phrase-searches',
+ \ 'database-get-fast-reverse-searches',
+ \ 'database-get-field']
+ " end of xdmp_appserver_functions on 78
+
+ " and more TODO...
+"}}}
+
+
+ " http://developer.marklogic.com/pubs/4.1/apidocs/alerting.html
+ " let alertfunctions = ["{{{
+ let alertfunctions = [
+ \ 'action-get-description',
+ \ 'action-get-module',
+ \ 'action-get-module-db',
+ \ 'action-get-module-root',
+ \ 'action-get-name',
+ \ 'action-get-options',
+ \ 'action-insert',
+ \ 'action-remove',
+ \ 'action-set-description',
+ \ 'action-set-module',
+ \ 'action-set-module-db',
+ \ 'action-set-module-root',
+ \ 'action-set-name',
+ \ 'action-set-options',
+ \ 'config-delete',
+ \ 'config-get',
+ \ 'config-get-cpf-domain-ids',
+ \ 'config-get-cpf-domain-names',
+ \ 'config-get-description',
+ \ 'config-get-id',
+ \ 'config-get-name',
+ \ 'config-get-options',
+ \ 'config-get-trigger-ids',
+ \ 'config-get-uri',
+ \ 'config-insert',
+ \ 'config-set-cpf-domain-ids',
+ \ 'config-set-cpf-domain-names',
+ \ 'config-set-description',
+ \ 'config-set-name',
+ \ 'config-set-options',
+ \ 'config-set-trigger-ids',
+ \ 'create-triggers',
+ \ 'find-matching-rules',
+ \ 'get-actions',
+ \ 'get-all-rules',
+ \ 'get-my-rules',
+ \ 'invoke-matching-actions',
+ \ 'make-action',
+ \ 'make-config',
+ \ 'make-log-action',
+ \ 'make-rule',
+ \ 'remove-triggers',
+ \ 'rule-action-query',
+ \ 'rule-get-action',
+ \ 'rule-get-id',
+ \ 'rule-get-name',
+ \ 'rule-get-options',
+ \ 'rule-get-query',
+ \ 'rule-get-user-id',
+ \ 'rule-id-query',
+ \ 'rule-insert',
+ \ 'rule-name-query',
+ \ 'rule-remove',
+ \ 'rule-set-action',
+ \ 'rule-set-description',
+ \ 'rule-set-name',
+ \ 'rule-set-options',
+ \ 'rule-set-query',
+ \ 'rule-set-user-id',
+ \ 'rule-user-id-query',
+ \ 'spawn-matching-actions']
+ " end of alert: functions on line 71!
+"}}}
+
+
+ " http://developer.marklogic.com/pubs/4.1/apidocs/Classifier.html
+ let cts_classifier_functions = ['classify', 'thresholds', 'train']
+
+ " cts:
+ " http://developer.marklogic.com/pubs/4.1/apidocs/cts-query.html
+ " let cts_query_constructor_functions = [ "{{{
+ let cts_query_constructor_functions = [
+ \ 'and-not-query',
+ \ 'and-query',
+ \ 'collection-query',
+ \ 'directory-query',
+ \ 'document-query',
+ \ 'element-attribute-pair-geospatial-query',
+ \ 'element-attribute-range-query',
+ \ 'element-attribute-value-query',
+ \ 'element-attribute-word-query',
+ \ 'element-child-geospatial-query',
+ \ 'element-geospatial-query',
+ \ 'element-pair-geospatial-query',
+ \ 'element-query',
+ \ 'element-range-query',
+ \ 'element-value-query',
+ \ 'element-word-query',
+ \ 'field-word-query',
+ \ 'near-query',
+ \ 'not-query',
+ \ 'or-query',
+ \ 'properties-query',
+ \ 'query',
+ \ 'registered-query',
+ \ 'reverse-query',
+ \ 'similar-query',
+ \ 'word-query']
+ " end of cts query constructors on 142
+"}}}
+
+
+ " cts:
+ " http://developer.marklogic.com/pubs/4.1/apidocs/GeospatialBuiltins.html
+ " let ctsgeospatial_functions = ["{{{
+ let ctsgeospatial_functions = [
+ \ 'arc-intersection',
+ \ 'bearing',
+ \ 'box',
+ \ 'box-east',
+ \ 'box-north',
+ \ 'box-south',
+ \ 'box-west',
+ \ 'circle',
+ \ 'circle-center',
+ \ 'circle-radius',
+ \ 'destination',
+ \ 'distance',
+ \ 'point',
+ \ 'point-latitude',
+ \ 'point-longitude',
+ \ 'polygon',
+ \ 'polygon-vertices',
+ \ 'shortest-distance']
+"}}}
+
+
+ " cts:
+ " http://developer.marklogic.com/pubs/4.1/apidocs/GeospatialLexicons.html
+ " let ctsgeospatial_lexicons_functions = ["{{{
+ let ctsgeospatial_lexicons_functions = [
+ \ 'element-attribute-pair-geospatial-boxes',
+ \ 'element-attribute-pair-geospatial-value-match',
+ \ 'element-attribute-pair-geospatial-values',
+ \ 'element-attribute-value-geospatial-co-occurrences',
+ \ 'element-child-geospatial-boxes',
+ \ 'element-child-geospatial-value-match',
+ \ 'element-child-geospatial-values',
+ \ 'element-pair-geospatial-boxes',
+ \ 'element-pair-geospatial-value-match',
+ \ 'element-pair-geospatial-values',
+ \ 'element-value-geospatial-co-occurrences',
+ \ 'geospatial-co-occurrences']
+"}}}
+
+ " cts:
+ " http://developer.marklogic.com/pubs/4.1/apidocs/Lexicons.html
+ " let cts_lexicon_functions = ["{{{
+ let cts_lexicon_functions = [
+ \ 'collection-match',
+ \ 'collections',
+ \ 'element-attribute-value-co-occurrences',
+ \ 'element-attribute-value-match',
+ \ 'element-attribute-value-ranges',
+ \ 'element-attribute-values',
+ \ 'element-attribute-word-match',
+ \ 'element-attribute-words',
+ \ 'element-value-co-occurrences',
+ \ 'element-value-match',
+ \ 'element-value-ranges',
+ \ 'element-values',
+ \ 'element-word-match',
+ \ 'element-words',
+ \ 'field-word-match',
+ \ 'field-words',
+ \ 'frequency',
+ \ 'uri-match',
+ \ 'uris',
+ \ 'word-match',
+ \ 'words']
+"}}}
+
+ " cts:
+ " http://developer.marklogic.com/pubs/4.1/apidocs/SearchBuiltins.html
+ " let cts_search_functions = ["{{{
+ let cts_search_functions = [
+ \ 'confidence',
+ \ 'contains',
+ \ 'deregister',
+ \ 'entity-highlight',
+ \ 'fitness',
+ \ 'highlight',
+ \ 'quality',
+ \ 'register',
+ \ 'remainder',
+ \ 'score',
+ \ 'search',
+ \ 'stem',
+ \ 'tokenize',
+ \ 'walk']
+"}}}
+
+ let all_ctsfunctions =
+ \ cts_classifier_functions +
+ \ cts_query_constructor_functions +
+ \ cts_lexicon_functions +
+ \ cts_search_functions
+
+ " search:
+ " http://developer.marklogic.com/pubs/4.1/apidocs/SearchAPI.html
+ " let search_api_functions = ["{{{
+ let search_api_functions = [
+ \ 'check-options',
+ \ 'estimate',
+ \ 'get-default-options',
+ \ 'parse',
+ \ 'remove-constraint',
+ \ 'resolve',
+ \ 'resolve-nodes',
+ \ 'search',
+ \ 'snippet',
+ \ 'suggest',
+ \ 'unparse']
+"}}}
+
+ " admin:
+ " http://developer.marklogic.com/pubs/4.1/apidocs/AdminBuiltins.html
+ " let xdmp_admin_functions = ["{{{
+ let xdmp_admin_functions = [
+ \ 'database-backup',
+ \ 'database-backup-cancel',
+ \ 'database-backup-purge',
+ \ 'database-backup-validate',
+ \ 'database-restore',
+ \ 'database-restore-cancel',
+ \ 'database-restore-status',
+ \ 'database-restore-validate',
+ \ 'filesystem-directory',
+ \ 'filesystem-file',
+ \ 'forest-backup',
+ \ 'forest-clear',
+ \ 'forest-restart',
+ \ 'forest-restore',
+ \ 'merge-cancel',
+ \ 'restart',
+ \ 'shutdown']
+"}}}
+
+ " let xdmp_appserver_functions = ["{{{
+ let xdmp_appserver_functions = [
+ \ 'get-request-url',
+ \ 'add-response-header',
+ \ 'get-request-body',
+ \ 'get-request-client-address',
+ \ 'get-request-client-certificate',
+ \ 'get-request-field-content-type',
+ \ 'get-request-field-filename',
+ \ 'get-request-field-names',
+ \ 'get-request-header',
+ \ 'get-request-header-names',
+ \ 'get-request-method',
+ \ 'get-request-path',
+ \ 'get-request-protocol',
+ \ 'get-request-username',
+ \ 'get-response-code',
+ \ 'get-response-encoding',
+ \ 'get-session-field',
+ \ 'get-session-field-names',
+ \ 'login',
+ \ 'logout',
+ \ 'set-request-time-limit',
+ \ 'set-response-code',
+ \ 'set-response-content-type',
+ \ 'set-response-encoding',
+ \ 'set-session-field',
+ \ 'uri-is-file',
+ \ 'url-decode',
+ \ 'url-encode',
+ \ 'x509-certificate-extract']
+ " end of xdmp_appserver_functions on 110
+"}}}
+
+ " xdmp:
+ " http://developer.marklogic.com/pubs/4.1/apidocs/Document-Conversion.html
+ " let xdmp_document_conversion_functions = ["{{{
+ let xdmp_document_conversion_functions = [
+ \ 'excel-convert',
+ \ 'pdf-convert',
+ \ 'powerpoint-convert',
+ \ 'tidy',
+ \ 'word-convert',
+ \ 'zip-create',
+ \ 'zip-get',
+ \ 'zip-manifest']
+"}}}
+
+ " http://developer.marklogic.com/pubs/4.1/apidocs/Extension.html
+ " let xdmp_extension_functions = ["{{{
+ let xdmp_extension_functions = [
+ \ 'directory',
+ \ 'estimate',
+ \ 'node-uri',
+ \ 'invoke',
+ \ 'log',
+ \ 'set',
+ \ 'value',
+ \ 'document-get-collections',
+ \ 'document-get-properties',
+ \ 'access',
+ \ 'add64',
+ \ 'apply',
+ \ 'architecture',
+ \ 'base64-decode',
+ \ 'base64-encode',
+ \ 'castable-as',
+ \ 'collation-canonical-uri',
+ \ 'collection-locks',
+ \ 'collection-properties',
+ \ 'database',
+ \ 'database-forests',
+ \ 'database-name',
+ \ 'databases',
+ \ 'describe',
+ \ 'diacritic-less',
+ \ 'directory-locks',
+ \ 'directory-properties',
+ \ 'document-forest',
+ \ 'document-get',
+ \ 'document-get-quality',
+ \ 'document-locks',
+ \ 'document-properties',
+ \ 'elapsed-time',
+ \ 'element-content-type',
+ \ 'email',
+ \ 'eval',
+ \ 'eval-in',
+ \ 'exists',
+ \ 'forest',
+ \ 'forest-databases',
+ \ 'forest-name',
+ \ 'forests',
+ \ 'from-json',
+ \ 'function',
+ \ 'function-module',
+ \ 'function-name',
+ \ 'get',
+ \ 'group',
+ \ 'group-hosts',
+ \ 'group-name',
+ \ 'group-servers',
+ \ 'groups',
+ \ 'hash32',
+ \ 'hash64',
+ \ 'hex-to-integer',
+ \ 'host',
+ \ 'host-name',
+ \ 'hosts',
+ \ 'http-delete',
+ \ 'http-get',
+ \ 'http-head',
+ \ 'http-options',
+ \ 'http-post',
+ \ 'http-put',
+ \ 'integer-to-hex',
+ \ 'integer-to-octal',
+ \ 'invoke-in',
+ \ 'log-level',
+ \ 'md5',
+ \ 'modules-database',
+ \ 'modules-root',
+ \ 'mul64',
+ \ 'node-database',
+ \ 'node-kind',
+ \ 'octal-to-integer',
+ \ 'path',
+ \ 'platform',
+ \ 'pretty-print',
+ \ 'product-edition',
+ \ 'query-meters',
+ \ 'query-trace',
+ \ 'quote',
+ \ 'random',
+ \ 'request',
+ \ 'request-timestamp',
+ \ 'rethrow',
+ \ 'schema-database',
+ \ 'security-database',
+ \ 'server',
+ \ 'server-name',
+ \ 'servers',
+ \ 'sleep',
+ \ 'spawn',
+ \ 'spawn-in',
+ \ 'strftime',
+ \ 'subbinary',
+ \ 'to-json',
+ \ 'trace',
+ \ 'triggers-database',
+ \ 'unpath',
+ \ 'unquote',
+ \ 'uri-content-type',
+ \ 'uri-format',
+ \ 'user-last-login',
+ \ 'version',
+ \ 'with-namespaces',
+ \ 'xquery-version']
+ " end of xdmp_extension_functions on 110
+"}}}
+
+ " http://developer.marklogic.com/pubs/4.1/apidocs/Security.html
+ " let xdmp_security_functions = ["{{{
+ let xdmp_security_functions = [
+ \ 'document-get-permissions',
+ \ 'get-current-user',
+ \ 'get-request-user',
+ \ 'get-current-roles',
+ \ 'security-assert',
+ \ 'amp',
+ \ 'amp-roles',
+ \ 'can-grant-roles',
+ \ 'default-collections',
+ \ 'default-permissions',
+ \ 'has-privilege',
+ \ 'permission',
+ \ 'privilege',
+ \ 'privilege-roles',
+ \ 'role',
+ \ 'role-roles',
+ \ 'user',
+ \ 'user-roles']
+ " end of xdmp_security_functions on 252
+"}}}
+
+ " http://developer.marklogic.com/pubs/4.1/apidocs/ServerMonitoring.html
+ " let xdmp_server_monitoring_functions = ["{{{
+ let xdmp_server_monitoring_functions = [
+ \ 'forest-counts',
+ \ 'forest-status',
+ \ 'host-status',
+ \ 'request-cancel',
+ \ 'request-status',
+ \ 'server-status']
+"}}}
+
+ " http://developer.marklogic.com/pubs/4.1/apidocs/UpdateBuiltins.html
+ " let xdmp_update_functions = ["{{{
+ let xdmp_update_functions = [
+ \ 'document-delete',
+ \ 'document-load',
+ \ 'document-set-collections',
+ \ 'document-add-collections',
+ \ 'document-remove-collections',
+ \ 'document-set-permissions',
+ \ 'document-add-permissions',
+ \ 'document-remove-permissions',
+ \ 'document-set-properties',
+ \ 'document-add-properties',
+ \ 'document-remove-properties',
+ \ 'node-delete',
+ \ 'collection-delete',
+ \ 'directory-create',
+ \ 'directory-delete',
+ \ 'document-set-property',
+ \ 'document-set-quality',
+ \ 'load',
+ \ 'lock-acquire',
+ \ 'lock-release',
+ \ 'merge',
+ \ 'merging',
+ \ 'node-insert-after',
+ \ 'node-insert-before',
+ \ 'save']
+ "}}}
+
+ let COMMON_xdmp_functions = [
+ \ 'get-request-field',
+ \ 'document-insert',
+ \ 'node-replace',
+ \ 'node-insert-child',
+ \ 'node-delete',
+ \ 'redirect-response']
+
+ let all_xdmp_functions =
+ \ COMMON_xdmp_functions +
+ \ xdmp_extension_functions +
+ \ xdmp_update_functions +
+ \ xdmp_security_functions +
+ \ xdmp_admin_functions +
+ \ xdmp_appserver_functions +
+ \ xdmp_document_conversion_functions +
+ \ xdmp_server_monitoring_functions
+
+ " http://developer.marklogic.com/pubs/4.1/apidocs/W3C.html
+ " let fnfunctions = ["{{{
+ let fnfunctions = [
+ \ 'doc',
+ \ 'concat',
+ \ 'count',
+ \ 'empty',
+ \ 'exists',
+ \ 'abs',
+ \ 'adjust-date-to-timezone',
+ \ 'adjust-dateTime-to-timezone',
+ \ 'avg',
+ \ 'base-uri',
+ \ 'boolean',
+ \ 'ceiling',
+ \ 'codepoint-equal',
+ \ 'codepoints-to-string',
+ \ 'collection',
+ \ 'compare',
+ \ 'contains',
+ \ 'current-date',
+ \ 'current-dateTime',
+ \ 'current-time',
+ \ 'data',
+ \ 'day-from-date',
+ \ 'day-from-dateTime',
+ \ 'days-from-duration',
+ \ 'deep-equal',
+ \ 'default-collation',
+ \ 'distinct-nodes',
+ \ 'distinct-values',
+ \ 'doc-available',
+ \ 'document-uri',
+ \ 'encode-for-uri',
+ \ 'ends-with',
+ \ 'error',
+ \ 'escape-html-uri',
+ \ 'escape-uri',
+ \ 'exactly-one',
+ \ 'expanded-QName',
+ \ 'false',
+ \ 'floor',
+ \ 'hours-from-dateTime',
+ \ 'hours-from-duration',
+ \ 'hours-from-time',
+ \ 'id',
+ \ 'idref',
+ \ 'implicit-timezone',
+ \ 'in-scope-prefixes',
+ \ 'index-of',
+ \ 'insert-before',
+ \ 'iri-to-uri',
+ \ 'lang',
+ \ 'last',
+ \ 'local-name',
+ \ 'local-name-from-QName',
+ \ 'lower-case',
+ \ 'matches',
+ \ 'max',
+ \ 'min',
+ \ 'minutes-from-dateTime',
+ \ 'minutes-from-duration',
+ \ 'minutes-from-time',
+ \ 'month-from-date',
+ \ 'month-from-dateTime',
+ \ 'months-from-duration',
+ \ 'name',
+ \ 'namespace-uri',
+ \ 'namespace-uri-for-prefix',
+ \ 'namespace-uri-from-QName',
+ \ 'nilled',
+ \ 'node-kind',
+ \ 'node-name',
+ \ 'normalize-space',
+ \ 'normalize-unicode',
+ \ 'not',
+ \ 'number',
+ \ 'one-or-more',
+ \ 'position',
+ \ 'prefix-from-QName',
+ \ 'QName',
+ \ 'remove',
+ \ 'replace',
+ \ 'resolve-QName',
+ \ 'resolve-uri',
+ \ 'reverse',
+ \ 'root',
+ \ 'round',
+ \ 'round-half-to-even',
+ \ 'seconds-from-dateTime',
+ \ 'seconds-from-duration',
+ \ 'seconds-from-time',
+ \ 'starts-with',
+ \ 'static-base-uri',
+ \ 'string',
+ \ 'string-join',
+ \ 'string-length',
+ \ 'string-pad',
+ \ 'string-to-codepoints',
+ \ 'subsequence',
+ \ 'substring',
+ \ 'substring-after',
+ \ 'substring-before',
+ \ 'sum',
+ \ 'tokenize',
+ \ 'trace',
+ \ 'translate',
+ \ 'true',
+ \ 'unordered',
+ \ 'upper-case',
+ \ 'year-from-date',
+ \ 'year-from-dateTime',
+ \ 'years-from-duration',
+ \ 'zero-or-one']
+ " end of fn_functions on 226
+"}}}
+
+
+ " 8/6/2010 Putting variable types here
+
+ "
+ " see Walmsley:490 in index!
+ " atomicType chart? Walmsley:144
+ " generic sequence types? Walmsley:152
+ "
+ " wat about....
+ " comment()
+ " processing-instruction()
+ " document-node()
+ "
+ " let generic_types = ["{{{
+ let generic_types = [
+ \ 'item()',
+ \ 'node()',
+ \ 'text()',
+ \ 'empty-sequence()',
+ \ 'element()',
+ \ 'document()'
+ \ ]"}}}
+
+
+ " these are prefixed with xs:
+ " let atomic_types = ["{{{
+ let atomic_types = [
+ \ 'xs:string',
+ \ 'xs:dateTime',
+ \ 'xs:anyAtomicType',
+ \ 'xs:anyType',
+ \ 'xs:anyURI',
+ \ 'xs:base64Binary',
+ \ 'xs:boolean',
+ \ 'xs:date',
+ \ 'xs:dayTimeDuration',
+ \ 'xs:decimal',
+ \ 'xs:double',
+ \ 'xs:duration',
+ \ 'xs:float',
+ \ 'xs:gDay',
+ \ 'xs:gMonth',
+ \ 'xs:gMonthDay',
+ \ 'xs:gYearMonth',
+ \ 'xs:gYear',
+ \ 'xs:hexBinary',
+ \ 'xs:integer',
+ \ 'xs:negativeInteger',
+ \ 'xs:nonPositiveInteger',
+ \ 'xs:nonNegativeInteger',
+ \ 'xs:normalizedString',
+ \ 'xs:positiveInteger',
+ \ 'xs:time',
+ \ 'xs:QName',
+ \ 'xs:unsignedByte',
+ \ 'xs:unsignedInt',
+ \ 'xs:unsignedLong',
+ \ 'xs:unsignedShort',
+ \ 'xs:yearMonthDuration'
+ \ ]"}}}
+
+
+ let all_types = generic_types + atomic_types
+
+
+ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+ " "
+ " END END END END COMPLETION LISTS END END END END "
+ " "
+ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+ " 8/3/2010 leaving out XInclude stuff intentionally...
+
+ " TODO add option to include geospatial completions!
+ let geospatial_namespaces = ["geo", "georss", "gml", "kml", "mcgm"]
+
+ let library_modules_namespaces = ["admin", "alert", "dls", "entity", "pki", "search", "sec", "spell", "thsr", "trgr", "ooxml"]
+ let cpf_function_namespaces = ["cpf", "css", "dbk", "dom", "cvt", "lnk", "msword", "pdf", "p", "ppt", "xhtml"]
+ let builtin_function_namespaces = ["cts", "dbg", "fn", "map", "math", "prof", "xdmp"]
+
+ " From spec: 'Certain namespace prefixes are predeclared by XQuery and
+ " bound to fixed namespace URIs. These namespace prefixes are as follows:'
+ let predeclared_namespaces = ['fn', 'xs', 'local', 'xsi', 'xml']
+
+ let ALL_FUNCTION_NAMESPACES =
+ \ library_modules_namespaces +
+ \ cpf_function_namespaces +
+ \ builtin_function_namespaces +
+ \ predeclared_namespaces
+
+ " When completing a namespace, the user will almost
+ " always want the colon after it too!
+ "
+ " --> see javascriptcomplete.vim:583
+ call map(ALL_FUNCTION_NAMESPACES, 'v:val.":"')
+
+ let namespace = a:base
+ let function_completions = []
+ let final_menu = []
+
+ if namespace =~ 'xdmp'
+ call map(all_xdmp_functions, '"xdmp:" . v:val . "("')
+ let function_completions = copy(all_xdmp_functions)
+ elseif namespace =~ 'cts'
+ call map(all_ctsfunctions, '"cts:" . v:val . "("')
+ let function_completions = copy(all_ctsfunctions)
+ elseif namespace =~ 'fn'
+ call map(fnfunctions, '"fn:" . v:val . "("')
+ let function_completions = copy(fnfunctions)
+ elseif namespace =~ 'search'
+ call map(search_api_functions, '"search:" . v:val . "("')
+ let function_completions = copy(search_api_functions)
+ elseif namespace =~ 'admin'
+ call map(admin_api_functions, '"admin:" . v:val . "("')
+ let function_completions = copy(admin_api_functions)
+ elseif namespace =~ 'alert'
+ call map(alertfunctions, '"alert:" . v:val . "("')
+ let function_completions = copy(alertfunctions)
+ elseif namespace =~ 'xs'
+ let function_completions = atomic_types
+ endif
+
+
+
+ " see Walmsley p. 27 'Categories of Expressions'
+
+ "let keywords = ["{{{
+ let keywords = [
+ \ "for",
+ \ "let",
+ \ "where",
+ \ "order by",
+ \ "return",
+ \ "some",
+ \ "every",
+ \ "in",
+ \ "satisfies",
+ \ "to",
+ \ "union",
+ \ "intersect",
+ \ "except",
+ \ "instance of",
+ \ "typeswitch",
+ \ "cast as",
+ \ "castable as",
+ \ "treat",
+ \ 'variable',
+ \ "validate",
+ \ "div",
+ \ "idiv",
+ \ "mod",
+ \ "xquery version \"1.0-ml\";",
+ \ "xquery version \"0.9-ml\";",
+ \ "xquery version \"1.0\";",
+ \ "xquery version"
+ \ ]
+"}}}
+
+ " hmmm above ^^ dont have everything
+ "
+ " let morekeywords = ["{{{
+ let morekeywords = [
+ \ 'as',
+ \ 'declare',
+ \ 'declare function',
+ \ 'declare variable',
+ \ 'declare namespace',
+ \ 'declare option',
+ \ 'declare default',
+ \ 'default',
+ \ 'option',
+ \ 'collation',
+ \ 'element',
+ \ 'attribute',
+ \ 'function',
+ \ 'import',
+ \ 'import module',
+ \ 'import module namespace',
+ \ 'import schema',
+ \ 'module',
+ \ 'namespace',
+ \ 'module namespace',
+ \ 'external;',
+ \ 'encoding;',
+ \ 'ascending',
+ \ 'descending',
+ \ ]
+"}}}
+
+ " let evenmorekeywords = ["{{{
+ let evenmorekeywords = [
+ \ 'else',
+ \ 'else if',
+ \ 'then',
+ \ 'if'
+ \ ]
+"}}}
+
+ " let predefined_entity_references = ["{{{
+ " http://www.w3.org/TR/xquery/#dt-predefined-entity-reference
+ let predefined_entity_references = [
+ \ '&amp;',
+ \ '&lt;',
+ \ '&gt;',
+ \ '&quot;',
+ \ '&apos;'
+ \ ]
+"}}}
+
+
+ if(a:base =~ '&$')
+ "...the character right before the cursor is an ampersand"
+ return predefined_entity_references
+ else
+
+ let res = []
+ let res2 = []
+ let values = evenmorekeywords + keywords + morekeywords + function_completions + ALL_FUNCTION_NAMESPACES + generic_types + predefined_entity_references
+
+ for v in values
+ if v =~? '^'.a:base
+ call add(res, v)
+ elseif v =~? a:base
+ call add(res2, v)
+ endif
+ endfor
+
+ let final_menu = res + res2
+ return final_menu
+ endif
+ endif
+endfunction
+
+
+" vim:sw=4 fdm=marker tw=80
12 deploy.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+echo "Copying autoload/xquerycomplete.vim ~/.vim/autoload..."
+cp autoload/xquerycomplete.vim ~/.vim/autoload/
+
+echo "Copying ftplugin/xquery.vim ~/.vim/ftplugin..."
+cp ftplugin/xquery.vim ~/.vim/ftplugin/
+
+echo "Copying indent/xquery.vim ~/.vim/indent..."
+cp indent/xquery.vim ~/.vim/indent/
+
+echo "Done!"
5 diff.sh
@@ -0,0 +1,5 @@
+
+diff -u ftplugin/xquery.vim ~/.vim/ftplugin/xquery.vim
+diff -u indent/xquery.vim ~/.vim/indent/xquery.vim
+#diff -u syntax/xquery.vim ~/.vim/syntax/xquery.vim
+diff -u autoload/xquerycomplete.vim ~/.vim/autoload/xquerycomplete.vim
193 ftplugin/xquery.vim
@@ -0,0 +1,193 @@
+" Vim filetype plugin file
+" Language: XQuery
+" Maintainer: David Lam <dlam@dlam.me>
+" Last Change: 2011 Jun 2
+"
+" Notes:
+" -Makes keys like gd and <C-]> work better when editing XQuery files
+" by temporarily adding the hyphen - to the 'iskeyword' variable
+" (one could add it to 'iskeyword' permanently... but that makes the
+" basic movement keys move a bit too far)
+"
+" -Sets options that are useful when editing XQuery (like 'set comments')
+
+" -Sets a few variables to make matchit.vim and taglist.vim work
+" better with XQuery
+"
+" -Sets the omnicomplete function to xquerycomplete.vim, which completes
+" XQuery keywords and function names from
+" http://developer.marklogic.com/learn/4.1/api-reference
+"
+
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+" finish
+ delfunction xqueryft:XQueryTag
+ delfunction xqueryft:XQueryGotoDeclaration
+ delfunction xqueryft:Star
+ delfunction xqueryft:BracketI
+endif
+let b:did_ftplugin = 1
+
+" http://markmail.org/message/5vfzrb7ojvds5drx
+autocmd InsertEnter *.xqy,*.xql,*.xqe,*.xq set iskeyword+=-
+autocmd InsertLeave *.xqy,*.xql,*.xqe,*.xq set iskeyword-=-
+"imap <C-c> <ESC> "Because <C-c> dosent trigger InsertLeave (see help)
+inoremap <C-c> <C-c>:set isk-=-<cr>
+
+"12/1/2010 Because XQueryTag() does not trigger InsertLeave when you come back
+" to the buffer you made the jump in via i_Ctrl-T or i_Ctrl-O or something
+autocmd BufEnter *.xqy,*.xql,*.xqe,*.xq set iskeyword-=-
+
+if !exists("*xqueryft:XQueryTag")
+ function! xqueryft:XQueryTag(is_tjump)
+
+ set iskeyword+=-
+
+ let l:is_xqVariable = synIDattr(synID(line('.'), col('.'), 0), "name") == 'xqVariable'
+
+ let l:word_at_cursor = expand("<cword>")
+ let l:WORD_at_cursor = expand("<cWORD>")
+
+ "remove the namespace: part from word_at_cursor
+
+ let l:dollar_index = match(l:word_at_cursor, '$')
+ let l:colon_index = match(l:word_at_cursor, ':')
+ let l:word_at_cursor_without_namespace = strpart(word_at_cursor, l:colon_index)
+
+ " if l:word_at_cursor appears to be a function namespace, set it to be
+ " the function name so we can tagjump to it
+ "
+ if matchstr(l:WORD_at_cursor, l:word_at_cursor.':') != ""
+
+ let l:orig_col = getpos('.')[2]
+ call search(':')
+ let l:word_at_cursor = expand("<cword>")
+ " go back to where we were
+ call cursor(line('.'), l:orig_col)
+ endif
+
+ " finally... do the tag jump
+
+ let l:tagtojumpto = (colon_index != -1) ? l:word_at_cursor_without_namespace : l:word_at_cursor
+
+ exec (a:is_tjump ? "tjump " : "tag ") . l:tagtojumpto
+
+ set iskeyword-=-
+ endfunction
+endif
+
+" :h gd
+" :h searchdecl() searchdecl(expand("<cword>"), 0, 0)
+"
+if !exists("*xqueryft:XQueryGotoDeclaration")
+ function! xqueryft:XQueryGotoDeclaration(is_goto_global)
+ set iskeyword+=- | let @/='\<'.expand('<cword>').'\>' | set iskeyword-=-
+
+ if a:is_goto_global
+ call searchdecl(@/, 1, 0)
+ else
+ call searchdecl(@/, 0, 0)
+ endif
+
+ "execute "match Search /" . @/ . "/"
+ normal n
+ normal N
+ endfunction
+endif
+
+
+if !exists("*xqueryft:Star")
+ function! xqueryft:Star(goforward)
+ set iskeyword+=- | let @/='\<'.expand('<cword>').'\>' | set iskeyword-=-
+ if a:goforward
+ normal! n
+ else
+ normal! N
+ endif
+ endfunction
+endif
+
+if !exists("*xqueryft:BracketI")
+
+ function! xqueryft:BracketI(iscapital)
+ set iskeyword+=-
+
+ " TODO find function equivalent for [i and [I
+
+ set iskeyword-=-
+ endfunction
+endif
+
+
+" these from :h write-filetype-plugin
+"
+" Add mappings, unless the user didn't want this.
+if !exists("no_plugin_maps") && !exists("no_mail_maps")
+
+ if !hasmapto('xqueryft:XQueryTag')
+ noremap <buffer> <C-]> :call xqueryft:XQueryTag(0)<CR>
+ noremap <buffer> g<C-]> :call xqueryft:XQueryTag(1)<CR>
+ endif
+
+ if !hasmapto('xqueryft:XQueryGotoDeclaration')
+ noremap <buffer> gd :call xqueryft:XQueryGotoDeclaration(0)<CR>
+ noremap <buffer> gD :call xqueryft:XQueryGotoDeclaration(1)<CR>
+ endif
+
+ if !hasmapto('xqueryft:Star')
+ noremap <buffer> # :call xqueryft:Star(0)<CR>
+ noremap <buffer> * :call xqueryft:Star(1)<CR>
+ endif
+
+" if !hasmapto('xqueryft:BracketI')
+" noremap <buffer> [i :call xqueryft:BracketI(0)<CR>
+" noremap <buffer> [I :call xqueryft:BracketI(1)<CR>
+" endif
+
+endif
+
+" Comment blocks always start with a (: and end with a :)
+" Works for XQDoc style start comments like (:~ too.
+setlocal comments=s1:(:,mb::,ex::)
+setlocal commentstring=(:%s:)
+
+" Format comments to be up to 78 characters long (from vim.vim)
+" if &tw == 0
+" setlocal tw=78
+" endif
+
+" Set 'formatoptions' to break comment lines but not other lines,
+" and insert the comment leader when hitting <CR> or using "o".
+" see... :h fo-table
+setlocal formatoptions-=t formatoptions+=croql
+
+
+if exists('&ofu')
+ setlocal omnifunc=xquerycomplete#CompleteXQuery
+endif
+
+" from html.vim
+if exists("loaded_matchit")
+ let b:match_ignorecase = 1
+ let b:match_words = '<:>,' .
+ \ '(:),' .
+ \ '{:},' .
+ \ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' .
+ \ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' .
+ \ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
+endif
+
+" :h matchit-extend or... http://vim-taglist.sourceforge.net/extend.html
+"
+" Also, try 'ctags --list-kinds=all' to see all the params for different
+" languages that you can pass in to this variable!
+let tlist_xquery_settings = 'xquery;m:module;v:variable;f:function'
+
+let b:undo_ftplugin = 'setlocal formatoptions<'
+ \ . ' comments< commentstring< omnifunc<'
+ \ . ' shiftwidth< tabstop<'
+
+
+" vim:sw=4 fdm=marker tw=80
13 indent/test/1.in
@@ -0,0 +1,13 @@
+(: vi: ft=xquery sw=4
+
+ Test #1 - rhs FLOWR expression alignment
+:)
+
+let $starters := for $rule in $options/opt:grammar/opt:starter
+where contains($input, $rule) (: at quick first pass, throw out any starters that simply don't appear anywhere :)
+order by string-length($rule)
+return (map:put($startermap, $rule, ($rule, (empty($rule/@tokenize) or $rule/@tokenize ne 'word'))), string($rule))
+for $segment at $segnum in $qsplit
+return if ($segnum mod 2 eq 0)
+then ( (: this is a quoted part of the qtext :)
+
13 indent/test/1.solution
@@ -0,0 +1,13 @@
+(: vi: ft=xquery sw=4
+
+ Test #1 - rhs FLOWR expression alignment
+:)
+
+let $starters := for $rule in $options/opt:grammar/opt:starter
+ where contains($input, $rule) (: at quick first pass, throw out any starters that simply don't appear anywhere :)
+ order by string-length($rule)
+ return (map:put($startermap, $rule, ($rule, (empty($rule/@tokenize) or $rule/@tokenize ne 'word'))), string($rule))
+for $segment at $segnum in $qsplit
+return if ($segnum mod 2 eq 0)
+ then ( (: this is a quoted part of the qtext :)
+
9 indent/test/10.in
@@ -0,0 +1,9 @@
+(: vi: ft=xquery sw=4
+
+ Test #10 - Wrapped HTML tag indentation
+:)
+
+ <form action="" method="post">
+ <input type="url" placeholder="The SVN URL"
+ name="{$ML-SVN-URL}" value="{$DEFAULT-SVN-URL}"/>
+ <a href
9 indent/test/10.solution
@@ -0,0 +1,9 @@
+(: vi: ft=xquery sw=4
+
+ Test #10 - Wrapped HTML tag indentation
+:)
+
+<form action="" method="post">
+ <input type="url" placeholder="The SVN URL"
+ name="{$ML-SVN-URL}" value="{$DEFAULT-SVN-URL}"/>
+ <a href
13 indent/test/11.in
@@ -0,0 +1,13 @@
+(: vi: ft=xquery sw=4
+
+ Test #11 - Line wrapping for if statements should use double the
+ default indentation value
+:)
+
+if ((condition1 and condition2)
+or (condition3 and condition4)
+or (condition5 and condition6)) then
+do-something-about-it()
+else
+()
+
13 indent/test/11.solution
@@ -0,0 +1,13 @@
+(: vi: ft=xquery sw=4
+
+ Test #11 - Line wrapping for if statements should use double the
+ default indentation value
+:)
+
+if ((condition1 and condition2)
+ or (condition3 and condition4)
+ or (condition5 and condition6)) then
+ do-something-about-it()
+else
+ ()
+
20 indent/test/12.in
@@ -0,0 +1,20 @@
+(: vi: ft=xquery sw=4
+
+ Test #12 - XML indentation when syntax check dosen't work
+:)
+
+declare function test {
+
+layout:layout(
+"Configure",
+"configure.xqy",
+$layout:OPTIONS-NONE,
+
+<div id="content">
+
+
+
+</div>
+)
+
+}
20 indent/test/12.solution
@@ -0,0 +1,20 @@
+(: vi: ft=xquery sw=4
+
+ Test #12 - XML indentation when syntax check dosen't work
+:)
+
+declare function test {
+
+ layout:layout(
+ "Configure",
+ "configure.xqy",
+ $layout:OPTIONS-NONE,
+
+ <div id="content">
+
+
+
+ </div>
+ )
+
+}
19 indent/test/13.in
@@ -0,0 +1,19 @@
+(: vi: ft=xquery sw=4
+
+ Test #13 - previous keyword alignment should not pass through tags
+:)
+
+ <tr>
+ <td class="label"> Type </td>
+ <td class="stuff">
+ <select name="{$REQUEST-PARAM-REPOSITORY-TYPE}">
+ {
+ for $repo-type in $ham:ALL-REPOSITORY-TYPES
+ return
+ <option value="{$repo-type}">{ $repo-type }</option>
+ }
+ </select>
+ </td>
+
+ </tr>
+
19 indent/test/13.solution
@@ -0,0 +1,19 @@
+(: vi: ft=xquery sw=4
+
+ Test #13 - previous keyword alignment should not pass through tags
+:)
+
+<tr>
+ <td class="label"> Type </td>
+ <td class="stuff">
+ <select name="{$REQUEST-PARAM-REPOSITORY-TYPE}">
+ {
+ for $repo-type in $ham:ALL-REPOSITORY-TYPES
+ return
+ <option value="{$repo-type}">{ $repo-type }</option>
+ }
+ </select>
+ </td>
+
+</tr>
+
16 indent/test/14.in
@@ -0,0 +1,16 @@
+(: vi: ft=xquery sw=4
+
+ Test #14 - no-parens if-else if-else-return alignment
+:)
+
+for $line in fn:tokenize($diff-output, "\n")
+let $starts-with-plus := fn:starts-with($line, "+")
+let $starts-with-minus := fn:starts-with($line, "+")
+let $class :=
+if($starts-with-plus) then
+"plus"
+else if($starts-with-minus) then
+"minus"
+else
+""
+return (
16 indent/test/14.solution
@@ -0,0 +1,16 @@
+(: vi: ft=xquery sw=4
+
+ Test #14 - no-parens if-else if-else-return alignment
+:)
+
+for $line in fn:tokenize($diff-output, "\n")
+let $starts-with-plus := fn:starts-with($line, "+")
+let $starts-with-minus := fn:starts-with($line, "+")
+let $class :=
+ if($starts-with-plus) then
+ "plus"
+ else if($starts-with-minus) then
+ "minus"
+ else
+ ""
+return (
12 indent/test/15.in
@@ -0,0 +1,12 @@
+(: vi: ft=xquery sw=4
+
+ Test #15 - statement alignment in multi-line where clause
+:)
+
+let $foo := "foo"
+where (
+fn:not(util:is-empty($file-or-folder-name))
+ and $file-or-folder-name ne "./" (: for svn :)
+)
+return
+$foo
12 indent/test/15.solution
@@ -0,0 +1,12 @@
+(: vi: ft=xquery sw=4
+
+ Test #15 - statement alignment in multi-line where clause
+:)
+
+let $foo := "foo"
+where (
+ fn:not(util:is-empty($file-or-folder-name))
+ and $file-or-folder-name ne "./" (: for svn :)
+)
+return
+ $foo
11 indent/test/16.in
@@ -0,0 +1,11 @@
+(: vi: ft=xquery sw=4
+
+ Test #10 - Wrapped HTML tag indentation
+:)
+
+ import module namespace search = "http://marklogic.com/appservices/search"
+ at "/MarkLogic/appservices/search/search.xqy";
+
+ import module namespace log = "http://dlam.me/xquery/logger" at "../../logger.xqy";
+
+ declare
11 indent/test/16.solution
@@ -0,0 +1,11 @@
+(: vi: ft=xquery sw=4
+
+ Test #10 - Wrapped HTML tag indentation
+:)
+
+import module namespace search = "http://marklogic.com/appservices/search"
+ at "/MarkLogic/appservices/search/search.xqy";
+
+import module namespace log = "http://dlam.me/xquery/logger" at "../../logger.xqy";
+
+declare
7 indent/test/17.in
@@ -0,0 +1,7 @@
+(: vi: ft=xquery sw=4
+
+ Test #17 - basic 'open function call'
+:)
+
+fn:concat(somestring,
+$foo:bar-variable ,"=" , xdmp:url-encode($baz) )
7 indent/test/17.solution
@@ -0,0 +1,7 @@
+(: vi: ft=xquery sw=4
+
+ Test #17 - basic 'open function call'
+:)
+
+fn:concat(somestring,
+ $foo:bar-variable ,"=" , xdmp:url-encode($baz) )
16 indent/test/2.in
@@ -0,0 +1,16 @@
+(: vi: ft=xquery sw=4
+
+ Test #2 - embedded tags
+:)
+
+ let $test :=
+ <tags>
+ <dont>
+ <indent-right/>
+ <foo>
+ foo
+ </foo>
+ </dont>
+ </tags>
+ return
+ $test
16 indent/test/2.solution
@@ -0,0 +1,16 @@
+(: vi: ft=xquery sw=4
+
+ Test #2 - embedded tags
+:)
+
+let $test :=
+ <tags>
+ <dont>
+ <indent-right/>
+ <foo>
+ foo
+ </foo>
+ </dont>
+ </tags>
+return
+ $test
11 indent/test/3.in
@@ -0,0 +1,11 @@
+(: vi: ft=xquery sw=4
+
+ Test #3 - FLOWR statement alignment
+
+ 12/1/2010 The 2nd let statement should align with the first despite there
+ being a line in between.
+:)
+
+ let $some-variable-name :=
+ $thing/bt:foo/bt:bug/bt:bar/bt:bazi-nator
+ let $gaga := "gaaa"
11 indent/test/3.solution
@@ -0,0 +1,11 @@
+(: vi: ft=xquery sw=4
+
+ Test #3 - FLOWR statement alignment
+
+ 12/1/2010 The 2nd let statement should align with the first despite there
+ being a line in between.
+:)
+
+let $some-variable-name :=
+ $thing/bt:foo/bt:bug/bt:bar/bt:bazi-nator
+let $gaga := "gaaa"
10 indent/test/4.in
@@ -0,0 +1,10 @@
+(: vi: ft=xquery sw=4
+
+ Test #4 - Basic nested FLOWR Expression
+:)
+
+let $dood := let $foo := 'asdf'
+order by $somethingelse
+return 'adsF'
+let $googogo := <hello> 2 </hello>
+let $dog := "dog"
10 indent/test/4.solution
@@ -0,0 +1,10 @@
+(: vi: ft=xquery sw=4
+
+ Test #4 - Basic nested FLOWR Expression
+:)
+
+let $dood := let $foo := 'asdf'
+ order by $somethingelse
+ return 'adsF'
+let $googogo := <hello> 2 </hello>
+let $dog := "dog"
17 indent/test/5.in
@@ -0,0 +1,17 @@
+(: vi: ft=xquery sw=4
+
+ Test #5 - FLOWR alignment, let -> function call -> for
+:)
+
+let $release-names :=
+fn:distinct-values(
+for $pre-release in $task-list-tasks//etl:pre-release-values/child::*
+let $dood :=
+"dooooooooood"
+return
+fn:local-name($pre-release)
+)
+for $release-name in $release-names
+order by $release-name
+return
+$release-name
17 indent/test/5.solution
@@ -0,0 +1,17 @@
+(: vi: ft=xquery sw=4
+
+ Test #5 - FLOWR alignment, let -> function call -> for
+:)
+
+let $release-names :=
+ fn:distinct-values(
+ for $pre-release in $task-list-tasks//etl:pre-release-values/child::*
+ let $dood :=
+ "dooooooooood"
+ return
+ fn:local-name($pre-release)
+ )
+for $release-name in $release-names
+order by $release-name
+return
+ $release-name
14 indent/test/6.in
@@ -0,0 +1,14 @@
+(: vi: ft=xquery sw=4
+
+ Test #6 - rhs FLOWR expression alignment
+:)
+
+typeswitch($customer/billing-address)
+case $a as element(*,USAddress)
+return $a/state
+case $a as element(*,CanadaAddress)
+return $a/province
+case $a as element(*,JapanAddress)
+return $a/prefecture
+default
+return “unknown”
14 indent/test/6.solution
@@ -0,0 +1,14 @@
+(: vi: ft=xquery sw=4
+
+ Test #6 - rhs FLOWR expression alignment
+:)
+
+typeswitch($customer/billing-address)
+ case $a as element(*,USAddress)
+ return $a/state
+ case $a as element(*,CanadaAddress)
+ return $a/province
+ case $a as element(*,JapanAddress)
+ return $a/prefecture
+ default
+ return “unknown”
14 indent/test/7.in
@@ -0,0 +1,14 @@
+(: vi: ft=xquery sw=4
+
+ test #7 - function declaration argument alignment (from xqdoc.org pdf p.26)
+:)
+
+declare function multiply-operands($operand1 as xs:integer,
+$operand2 as xs:integer)
+as xs:integer
+{
+let $product := $operand1 * $operand2 (: multiply the values :)
+return
+$product
+};
+
14 indent/test/7.solution
@@ -0,0 +1,14 @@
+(: vi: ft=xquery sw=4
+
+ test #7 - function declaration argument alignment (from xqdoc.org pdf p.26)
+:)
+
+declare function multiply-operands($operand1 as xs:integer,
+ $operand2 as xs:integer)
+as xs:integer
+{
+ let $product := $operand1 * $operand2 (: multiply the values :)
+ return
+ $product
+};
+
31 indent/test/8.in
@@ -0,0 +1,31 @@
+(: vi: ft=xquery sw=4
+
+ test #8 - searchpairpos() and function param alignment
+:)
+
+ if($blah) then (
+
+ if( 1 eq 1) then (
+
+ let $dude := ( $something,
+ $hello, $aaaa-bbb,
+ $peace
+ )
+ let $http-get :=
+ xdmp:http-get($get-url,
+ <options xmlns="xdmp:http">
+ </options>
+ )
+ let $hello := "hello"
+ return
+ $hello
+ )
+ else if($blahblah) then (
+
+ ) else (
+
+ )
+ )
+ else (
+
+ )
31 indent/test/8.solution
@@ -0,0 +1,31 @@
+(: vi: ft=xquery sw=4
+
+ test #8 - searchpairpos() and function param alignment
+:)
+
+if($blah) then (
+
+ if( 1 eq 1) then (
+
+ let $dude := ( $something,
+ $hello, $aaaa-bbb,
+ $peace
+ )
+ let $http-get :=
+ xdmp:http-get($get-url,
+ <options xmlns="xdmp:http">
+ </options>
+ )
+ let $hello := "hello"
+ return
+ $hello
+ )
+ else if($blahblah) then (
+
+ ) else (
+
+ )
+)
+else (
+
+)
18 indent/test/9.in
@@ -0,0 +1,18 @@
+(: vi: ft=xquery sw=4
+
+ Test #9 - nested FLOWR return keyword alignment
+:)
+
+for $something in $things
+return
+let $svn-directories := fn:tokenize($content, "\n")
+return (
+
+for $dir in $svn-directories
+return
+<div>
+{
+$dir
+}
+</div>
+)
18 indent/test/9.solution
@@ -0,0 +1,18 @@
+(: vi: ft=xquery sw=4
+
+ Test #9 - nested FLOWR return keyword alignment
+:)
+
+for $something in $things
+return
+ let $svn-directories := fn:tokenize($content, "\n")
+ return (
+
+ for $dir in $svn-directories
+ return
+ <div>
+ {
+ $dir
+ }
+ </div>
+ )
219 indent/test/INDENT_TESTS
@@ -0,0 +1,219 @@
+vi:ft=xquery indentexpr=
+
+INDENT TESTS
+
+1.solution) rhs FLOWR alignment
+2.solution) Embeeded tags
+3.solution) FLOWR let statement alignment
+4.solution) Basic nested FLOWR expression
+5.solution) FLOWR alignment w/funciton call let -> function call -> for
+6.solution) Typeswitch
+7.solution) Function declaration argument alignment (from xqdoc.org pdf p.26)
+8.solution) searchpairpos() and function param alignment
+
+===============================================================================
+===============================================================================
+===============================================================================
+===============================================================================
+
+
+
+
+23) 3/21/2011 The second return here aligns with the previous word
+starting with a keyword ('return', or if thats not there, 'order by'),
+but it really should align with the first line / let expression
+
+ let $dood := let $foo := "asdf"
+ let $dude := "Dude"
+ order by $somethingelse
+ return $foo
+ return
+ $dood
+
+25) Indents to keyword when it shouldnt!
+
+ let $dood := (
+ let $foo := "asdf"
+ order by $somethingelse
+ return
+ "adsF"
+ )
+ return $dood
+
+
+24) Make sure XQueryIndentGet doesn't interfere with 'set comments'
+
+ (:~
+ : Comment at start of file
+ :
+ :)
+
+
+ let $something :=
+ $foo/bar/baz/goo/doo/text()
+ let $hello := (
+
+ )
+ return (
+
+ (:~
+ : hit enter in block comments to set it 'set comments' still works
+ :
+ :)
+
+ )
+
+23) The final return here, should not use XmlIndentGet just because there's
+ a tag there
+
+ declare function flow-util:destination-count(
+ $ticket-id as xs:string,
+ $pubdb as xs:string
+ ) as element(destinationCount)
+ {
+ let $database-id :=
+ try { xdmp:database($pubdb)}
+ catch ($e) { xdmp:log($e) }
+ let $query :=
+ "declare variable $ticket-id as xs:string external;
+ xdmp:estimate(collection($ticket-id))"
+ let $vars := (xs:QName("ticket-id"),$ticket-id)
+ let $opts :=
+ <options xmlns="xdmp:eval">
+ <database>{$database-id}</database>
+ </options>
+ let $count :=
+ if ($database-id) then
+ amped-common:appservices-eval($query,$vars,$opts)
+ else ()
+ return <destinationCount type="number">{ $count }</destinationCount>
+ };
+
+
+22)
+
+ declare function double:if-block-indentation()
+ {
+ if ((condition1 and condition2)
+ or (condition3 and conditin4)
+ or (condition5 and condition6)) then (
+
+ (: here is a comment that tests PrevnonblankIgnoringComments works :)
+
+ let $hello := 2+2
+ let $dude := "asdf"
+ let Gahh := (
+ "2asdf"
+ )
+ return
+ $dude
+ )
+ else
+ ()
+ }
+
+
+21)
+
+ let $test := if($something-is-true) then
+ 'yes'
+ else
+ 'no'
+ let $something-else := ...
+ return
+
+
+20) (open assignment)
+ This line should indent under 'element', but instead indents under the 'let'
+
+
+ let $password-reset-instance := element ea:password-reset {
+ 'blah blah'
+
+18) searchpair() dosent seem to work with the following structure:
+
+ Ex. 1
+
+ if($blah) then (
+ if( 1 eq 1) then (
+
+ )
+ else if($blahblah) then (
+
+ ) else (
+
+ )
+ )
+ else (
+
+ )
+
+ Ex. 2
+
+ if(fn:not(fn:matches($email, $eamt:EMAIL-REGEX))) then (
+ eamt:set-notification-message($eamt:MESSAGE-TYPE-VALIDATION, (
+ if(eamt:is-empty($email)) then
+ "Email is required"
+ else
+ fn:concat('"', $email, '" dosent look like a valid email address.')
+ ))
+ )
+ else if
+
+
+21) 3/4/2011 The second line currently autoindents because the first
+ ends with a comma:
+
+ fn:concat("somestring",
+ $foo:bar-variable ,"=" , xdmp:url-encode($baz) )
+
+
+13) Commments shouldn't interfere with finding the 'real' indentation context
+
+ Ex.1
+
+ let $some-value := for $thing in fn:doc()
+ return (
+
+ (: a comment shouldn't intefere with indentation :)
+ $some-value
+
+ Ex.2 (not workin)
+
+ <p xmlns="http://www.w3.org/1999/xhtml">
+ {
+ (: list current tasks here...
+ :
+ : see preview.xqy:75
+ :)
+
+ if(fn:empty($task-list-tasks)) then (
+ <h3> No tasks yet. </h3>
+ )
+ }
+ </p>
+
+
+15) The 'return' at the bottom indents to the previous line,
+when it really should indent to the closest FLOWR keyword(?)
+Also, should add '=return' to 'indentkeys'
+
+ declare function local:foo(
+ $bar as xs:string,
+ $baz as xs:string
+ )
+ {
+ let $boz := pm:get-bbb($bar)
+
+ let $boop :=
+ pm:zeeeeepo($aaa, $bbb, $ccc, $ddd,
+ $long-variable-name-here)
+ return
+
+16) The second line of this function call should indent
+to the start of its parameter list, but instead 'autoindent's
+
+ pm:email($invitation-message,
+ pm:build-invitation-message($name, $company, $email, $cc, $participant-hash)
+
+
87 indent/test/go.sh
@@ -0,0 +1,87 @@
+#!/bin/bash
+
+#
+# Runs XQuery indent tests.
+#
+# If a test fails, it'll leave a .diff in the directory
+#
+#
+# test # | what is it
+# ----------------------------
+