From 44914aa8b9e70c0c4299f81573f8216de8424220 Mon Sep 17 00:00:00 2001 From: Karl Burtram Date: Sun, 18 Sep 2016 23:20:43 -0700 Subject: [PATCH] Move ParseBind out of locked block --- .../LanguageServices/LanguageService.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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)