Closed Toubef closed 7 years ago
Hi Toube,
Sorry to hear that you are having trouble.
You shouldn't need to define any keybindings to be able to use this plugin. It should just be a case of opening the Command Palette (Tools menu) and selecting a choice beginning with XPath:
like Query Document
. These entries only show up if the XML syntax highlighting is active for the current file.
If they still aren't appearing, please could you open the ST console (View menu) and check for errors. Maybe paste the whole log here, as the more information we have, the easier it is to debug :)
Thanks
Hi Keith,
thanks for pointing this out, It works :)
Any idea why I can't get the keyboard shortcut to work, ctrl+shift+alt+q?
{ "keys": ["ctrl+shift+alt+q"], "command": "query_xpath", "args": { "prefill_query": "//text()", // an XPath query to put into the input box by default - can omit and use "prefill_path_at_cursor": true instead to use the path of the node under the first cursor "live_mode": true, // as per settings "normalize_whitespace_in_preview": false, // as per settings "intelligent_auto_complete": true, // as per settings "goto_element": "names", // same options available as for goto_relative "goto_attribute": "value", // options are name, value, entire "max_results_to_show": 1000 // as per settings }
Br, Toube
I just tried putting the following in my Packages/User/Default (Windows).sublime-keymap
file and it worked for me:
{ "keys": ["ctrl+shift+alt+q"], "command": "query_xpath", "args": { "prefill_query": "//text()",
"live_mode": true,
"normalize_whitespace_in_preview": false,
"intelligent_auto_complete": true,
"goto_element": "names",
"goto_attribute": "value",
"max_results_to_show": 1000
}}
the differences from yours are:
}
at the endDoes that help? If not, open the ST console and type sublime.log_input(True)
Enter and sublime.log_commands(True)
Enter and then click back in your XML document and press ctrl+shift+alt+q and check the console. It should show:
key evt: shift+control+alt+q
command: query_xpath {"goto_attribute": "value", "goto_element": "names", "intelligent_auto_complete": true, "live_mode": true, "max_results_to_show": 1000, "normalize_whitespace_in_preview": false, "prefill_query": "//text()"}
if it shows something else, that something else might give us a clue where it is going wrong ;)
Hi, aah now I get it, I have edited the wrong sublime-keymap settings file :) Edited the right one and now it works. Thanks for your help, appreciated it 👍
Br, Toube
Hi,
I been trying to get this up and running with ST3 but I can't get the xpath query window to show up. I have setup the following from your example:
`[ // NOTE: because this file is named Example, and doesn't end in: (Windows) or (OSX) or (Linux), it is ignored by ST3. // NOTE: not including an arg will use the value from your user preferences, if present, otherwise the default settings
]`
What am I doing wrong?
Br, Toube