Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selecting partial query and hitting Cmd or Ctrl+C opens terminal with Error message #717

Closed
Code-DJ opened this issue Feb 16, 2018 · 12 comments · Fixed by #720
Closed

Selecting partial query and hitting Cmd or Ctrl+C opens terminal with Error message #717

Code-DJ opened this issue Feb 16, 2018 · 12 comments · Fixed by #720

Comments

@Code-DJ
Copy link

Code-DJ commented Feb 16, 2018

  • SQL Operations Studio Version: 0.26.6

Steps to Reproduce:
Open New Query
Type a query
Highlight a portion (not all) of the query
Hit Ctrl+C on Windows or Cmd on Mac
Terminal opens with the following text:

[Error - 11:27:43 AM] Request textDocument/definition failed.
  Message: Operation timed out.
  Code: 0

In some situations, you get the following:

[Error - 11:35:26 AM] Request textDocument/definition failed.
  Message: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRange_IndexException()
   at Babel.ParserGenerator.MinimalList`1.get_Item(Int32 index)
   at Babel.ParserGenerator.ModifiedMinimalList`1.get_Item(Int32 index)
   at Microsoft.SqlServer.Management.SqlParser.Parser.TokenManager.GetToken(Int32 tokenNumber)
   at Microsoft.SqlTools.ServiceLayer.LanguageServices.Completion.ScriptDocumentInfo.GetPeekDefinitionTokens(ScriptParseInfo scriptParseInfo, Int32 startLine, Int32 startColumn) in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\LanguageServices\ScriptDocumentInfo.cs:line 158
   at Microsoft.SqlTools.ServiceLayer.LanguageServices.LanguageService.GetDefinition(TextDocumentPosition textDocumentPosition, ScriptFile scriptFile, ConnectionInfo connInfo) in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\LanguageServices\LanguageService.cs:line 1194
   at Microsoft.SqlTools.ServiceLayer.LanguageServices.LanguageService.<HandleDefinitionRequest>d__50.MoveNext() in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\LanguageServices\LanguageService.cs:line 377
  Code: 0 
@Code-DJ Code-DJ changed the title Selecting partial query and hitting Cmd or Ctrl+C throws exception Selecting partial query and hitting Cmd or Ctrl+C opens terminal with Error message Feb 16, 2018
@Code-DJ
Copy link
Author

Code-DJ commented Feb 16, 2018

To be more specific use the following sample query - doesn't matter if you have this table:
SELECT * FROM Person WHERE PersonID = 1

Highlight partial query above "SELECT * FROM Person WH". This will open terminal with the error.
If you select "SELECT * FROM Person" or "SELECT * FROM Person WHERE" i.e. complete words, you don't get the error.

@kburtram
Copy link
Member

@anthonydresser this looks similar to the other "Output Window" popping up on language client errors issue you were looking at. Do know if the fix you submitted was supposed to fix this?

@kburtram
Copy link
Member

@Code-DJ I'm having trouble repro'ing this issue, but we investigated a similar issue where non-user impacting internal errors were being (annoyingly) logged in the Output window. This commit fixed the scenarios we had repro's for 6f21d6e.

Let me keep investigating. Please let me know if there are any additional steps to narrow down the repro.

@kburtram
Copy link
Member

@Code-DJ nevermind, it seems like if I hit Ctrl-C several times in a row quickly using your repro I can get the error. Let me see why the previous commit isn't preventing this pop-up.

@kburtram kburtram added this to the February Hotfix milestone Feb 16, 2018
@Code-DJ
Copy link
Author

Code-DJ commented Feb 16, 2018

@kburtram on macOS I am able to consistently recreate by pressing Cmd first, then dragging the mouse to select a portion of the query. As soon as you let go of the mouse, the terminal comes up with the error. Additionally, if you select the entire query and Cmd click it, the error pops up.

Same on Windows.

This is not how I intend to use the app, was just trying to recreate the issue several different ways. Also, this is in addition to the original issue I reported.

@jiskim
Copy link

jiskim commented Feb 16, 2018

i get this error too on windows.

Just to add a bit i get those error too from the same window, wich one show up depend on if im connected to a server or not...

if my connection is closed

[Error - 3:03:27 PM] Request textDocument/definition failed.
  	Message: Please connect to a server.
  	Code: 0 

if im connected i get one of those ( including the one in op message ).

[Error - 3:03:07 PM] Request textDocument/definition failed.
  	Message: No results were found.
  	Code: 0 
[Error - 10:55:11 AM] Request textDocument/definition failed.
	Message: This object type is currently not supported by this feature.
	Code: 0 

thanks, i was going crazy thinking i was the only one getting those!

@anthonydresser
Copy link
Contributor

What is the output channel it is pushing these messages to?

@jiskim
Copy link

jiskim commented Feb 16, 2018

its getting pushed to SQLToolService ( not the init one )

@kburtram
Copy link
Member

@Code-DJ @jiskim I'm going to publish a Feb Hotfix Build with the fix for this later today.

@kburtram
Copy link
Member

kburtram commented Feb 16, 2018

The 0.26.7 builds for Windows, macOS and Linux are available at https://github.com/Microsoft/sqlopsstudio/releases/tag/0.26.6 which contains the proposed fix for this issue.

I'll update the auto-update feeds once all the builds are posted and we've completed build verification testing.

Note, if you do install 0.26.7 before I update the auto-update feed, please don't do the auto-update inside 0.26.7 as it will take you back to 0.26.6. This won't be an issue once the feeds are updated.

@kburtram
Copy link
Member

The hotfix for this issue has been published to the auto-update feeds and the download page fwlinks have been updated. Sorry for the inconvenience of needing to update again so frequently. Please reopen the issue if the issue persists on the 0.26.7 build. Thanks!

@Code-DJ
Copy link
Author

Code-DJ commented Feb 16, 2018

Thanks. Updated it. So far so good.

@adsbot adsbot bot locked and limited conversation to collaborators Mar 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants