From bce387842f3550bdfc4d4b9817b98f9ccd6dc793 Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Mon, 2 Mar 2020 15:39:37 -0800 Subject: [PATCH] Correctly skip intellisense for non-MSSQL language flavors (#910) --- .../LanguageServices/LanguageService.cs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/LanguageService.cs b/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/LanguageService.cs index 2e12b38b..df7350a9 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/LanguageService.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/LanguageService.cs @@ -434,26 +434,23 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices { try { + var scriptFile = CurrentWorkspace.GetFile(textDocumentPosition.TextDocument.Uri); + if (scriptFile == null) + { + await requestContext.SendResult(null); + return; + } // check if Intellisense suggestions are enabled - if (ShouldSkipIntellisense(textDocumentPosition.TextDocument.Uri)) + if (ShouldSkipIntellisense(scriptFile.ClientUri)) { await requestContext.SendResult(null); } else { // get the current list of completion items and return to client - var scriptFile = CurrentWorkspace.GetFile( - textDocumentPosition.TextDocument.Uri); - if (scriptFile == null) - { - await requestContext.SendResult(null); - return; - } - - ConnectionInfo connInfo; ConnectionServiceInstance.TryFindConnection( scriptFile.ClientUri, - out connInfo); + out ConnectionInfo connInfo); var completionItems = await GetCompletionItems( textDocumentPosition, scriptFile, connInfo);