Sublime Forum

Editing Existing Plugin - XQuery

#1

Hello SublimeText Folks,

I’m looking at adding some additional functionality to the XQuery plugin. I work with MarkLogic quite a bit and I would like to add a few tweaks. In particular I would like to add the keyword “private” to function declarations (MarkLogic specific, I believe) and I would like to add support for listing the variables and functions in the ctrl-R menu.

I think I can figure out the “private” keyword piece, I believe that I just need to edit the expressions in the XQuery.tmLanguage file.

However, to add support for the ctrl-R menu, I think I need to create a file called function.tmProperties and add references there. I tried this and have had no luck.

This is what I have tried for the tmPrefernces file:

<plist version="1.0">
  <dict>
        <key>name</key>
        <string>Symbols List: Functions</string>
        <key>scope</key>
        <string>entity.name.function.xquery</string>
        <key>settings</key>
        <dict>
                <key>showInSymbolList</key>
                <integer>1</integer>
        </dict>
        <key>uuid</key>
        <string>5157F71C-2801-4385-92EA-3D0B22AEE7C5</string>
  </dict>
</plist>

Any pointers? I’ve never tried this with a text editor before, so I’m rather new at this. I think it would be fun to get this working and submit the changes to the original author.

0 Likes

#2

Perhaps I should simplify and refine my question…

How do I add a language pattern to the symbol list? You can see my attempt in my prior post.

In this case, I would like to add XQuery functions to the symbol list.

0 Likes

#3

Hi,

New to Sublime and looking for the same things - I came across this post and also this Textmate bundle:

github.com/paxtonhare/xQuery.tmbundle

Just dropping it into Packages/ automatically gets some nice xquery syntax happening - looks like snippets and commands might take some tweaking.

If anyone else has Xquery and/or Marklogic specific stuff happening with Sublime, it would be awesome to know, and use Sublime for everything.

Colin

0 Likes