AvinZarlez / unity-tools

A Visual Studio Code Extension to provide some tools for Unity development
https://marketplace.visualstudio.com/items?itemName=Tobiah.unity-tools
MIT License
31 stars 8 forks source link

[BUG] Unity docs keyword for search is not what was selected #57

Closed miltoncandelero closed 5 years ago

miltoncandelero commented 5 years ago

Describe the bug When I highlight something and select "Unity Tools: Open documentation for selection" the website that opens has the wrong search word. Instead of searching for what I selected it searches for "Looking" or "Starting"

To Reproduce Steps to reproduce the behavior:

  1. Create an Empty MonoBehaviour
  2. Select the word "MonoBehaviour"
  3. Right Click and pick Unity Tools: Open documentation for selection (Or use the shortcut Ctrl + ')
  4. The website opened is not https://docs.unity3d.com/ScriptReference/30_search.html?q=MonoBehaviour as it should

Expected behavior The website opened should append the selection after https://docs.unity3d.com/ScriptReference/30_search.html?q=

VSCode (please complete the following information):

AvinZarlez commented 5 years ago

Interesting... What is the behavior you are seeing instead? What website is opened for you?

On my system, everything works as expected and https://docs.unity3d.com/ScriptReference/30_search.html?q=MonoBehaviour is opened

AvinZarlez commented 5 years ago

I have no idea how "Looking" or "Starting" can somehow replace the selection.

I'm using search.openUnityDocs(textEditor.document.lineAt(range.start.line).text, range.start.character, range.end.character);

It should detect if you are selecting multiple lines. I checked and my error message still throws for me.

AvinZarlez commented 5 years ago

I assume using the latest 1.1.1 version of the extension?

miltoncandelero commented 5 years ago

unitywtf Version is 1.1.1

miltoncandelero commented 5 years ago

Ok, this is weird. I closed and re opened vscode and I got errors that "no text was selected". Closing and re opening wouldn't fix it. Uninstalled and reinstalled the extension, tried and it searched for "Starting" Closed and re opened, now searched for "Looking" Closed and re opened, now is working properly.

Edit: After doing this, I tried once more time and now it searches for "Discord". I do have my discord open. Maybe it's electron going crazy? I am at complete awe.

Edit2: shortly after my vscode threw a popup saying that the install was corrupted. I reinstalled vscode and everything seems to work fine.

AvinZarlez commented 5 years ago

Super weird! Yeah seems like it was some kind of VS Code error with your selection (especially if it was picking up "discord")

I'm glad VSCode seemed to figure out it was corrupted. I hope the problem is solved for you now.

Thank you for the detailed writeup/bug report btw!