diff --git a/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/LanguageService.cs b/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/LanguageService.cs index a87ab5b7..fd1afba4 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/LanguageService.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/LanguageService.cs @@ -358,20 +358,20 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices // get or create the current parse info object ScriptParseInfo parseInfo = GetScriptParseInfo(scriptFile.ClientFilePath, createIfNotExists: true); - // parse current SQL file contents to retrieve a list of errors - ParseResult parseResult = Parser.IncrementalParse( - scriptFile.Contents, - parseInfo.ParseResult, - parseInfo.ParseOptions); - - parseInfo.ParseResult = parseResult; - if (parseInfo.BuildingMetadataEvent.WaitOne(LanguageService.FindCompletionsTimeout)) { try { parseInfo.BuildingMetadataEvent.Reset(); + // parse current SQL file contents to retrieve a list of errors + ParseResult parseResult = Parser.IncrementalParse( + scriptFile.Contents, + parseInfo.ParseResult, + parseInfo.ParseOptions); + + parseInfo.ParseResult = parseResult; + if (connInfo != null && parseInfo.IsConnected) { try @@ -427,7 +427,7 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices scriptInfo.Binder = BinderProvider.CreateBinder(scriptInfo.MetadataProvider); scriptInfo.ServerConnection = new ServerConnection(sqlConn.GetUnderlyingConnection()); scriptInfo.IsConnected = true; - AddOrUpdateScriptParseInfo(info.OwnerUri, scriptInfo); + //AddOrUpdateScriptParseInfo(info.OwnerUri, scriptInfo); } } catch (Exception)