DotJoshJohnson / vscode-xml

XML Tools for Visual Studio Code
MIT License
325 stars 86 forks source link

XPath query shows no result when opened using keyboard shortcut #224

Closed ron-t closed 5 years ago

ron-t commented 6 years ago

Description When the query panel is opened using the keyboard shortcut (Ctrl + Shift + Alt + X) no result is shown when the query is run. This happens repeatedly until the cursor is placed in a different location in the XML file, after which it will correctly evaluate once and then revert back to showing no results again (until the cursor is again moved).

Extension Version 2.3.2

VS Code Version Version: 1.26.1 Commit: 493869ee8e8a846b0855873886fc79d480d342de Date: 2018-08-16T18:38:57.434Z Electron: 2.0.5 Chrome: 61.0.3163.100 Node.js: 8.9.3 V8: 6.1.534.41 Architecture: x64

Operating System Windows 10 Enterprise 10.0.16299 N/A Build 16299

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 6 years ago

This issue is being automatically closed because it has not had recent activity. Thank you for your contributions.

DotJoshJohnson commented 5 years ago

I am unable to reproduce this. Do you happen to have any other keyboard shortcuts (custom or extension-contributed) sharing this key combo?

dextreem commented 5 years ago

Hi, I found this issue while looking if anybody else has this issue :-D. Thanks to @ron-t for the workaround (selecting a different line), before that it felt like it happens randomly or time-dependently.

How to reproduce:

  1. Place your cursor somewhere in the document
  2. Press CTRL + ALT + SHIFT + X and type in the XPath String
  3. Press ENTER --> Output correct
  4. Press CTRL + ALT + SHIFT +X and type in an arbitrary Xpath String (doesn't matter if it differs from the prior String)
  5. Press ENTER --> No output found (Output shows only "XPath Query: [the query]" but no results).

If you click somewhere in the document before step 4, the results are outputted as expected. Furthermore, it does not occur when you use the plugin via command palette.

VSCode version: Version: 1.30.2 (user setup) Commit: 61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8 Date: 2019-01-07T22:54:13.295Z Electron: 2.0.12 Chrome: 61.0.3163.100 Node.js: 8.9.3 V8: 6.1.534.41 OS: Windows_NT x64 6.1.7601

Extension version: 2.4.0

OS: Win 7 Pro

DotJoshJohnson commented 5 years ago

@dextreem - Thanks for the details! I was able to reproduce using those steps. It appears VS Code is moving focus from the XML document to the output window when the command is run, which changes the active document to "nothing". When you attempt to use the keyboard shortcut again without selecting the XML document, the extension attempts to run the command against the active document, which is "nothing". I will look into this to see what options I have from my end to correct this.

Thanks again!

dextreem commented 5 years ago

@DotJoshJohnson You're welcome. BTW: Awesome work you did here. :-)

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 5 years ago

This issue is being automatically closed because it has not had recent activity. Thank you for your contributions.