mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 18:47:57 -05:00
Move ParseBind out of locked block
This commit is contained in:
@@ -358,20 +358,20 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
|
|||||||
// get or create the current parse info object
|
// get or create the current parse info object
|
||||||
ScriptParseInfo parseInfo = GetScriptParseInfo(scriptFile.ClientFilePath, createIfNotExists: true);
|
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))
|
if (parseInfo.BuildingMetadataEvent.WaitOne(LanguageService.FindCompletionsTimeout))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
parseInfo.BuildingMetadataEvent.Reset();
|
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)
|
if (connInfo != null && parseInfo.IsConnected)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -427,7 +427,7 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
|
|||||||
scriptInfo.Binder = BinderProvider.CreateBinder(scriptInfo.MetadataProvider);
|
scriptInfo.Binder = BinderProvider.CreateBinder(scriptInfo.MetadataProvider);
|
||||||
scriptInfo.ServerConnection = new ServerConnection(sqlConn.GetUnderlyingConnection());
|
scriptInfo.ServerConnection = new ServerConnection(sqlConn.GetUnderlyingConnection());
|
||||||
scriptInfo.IsConnected = true;
|
scriptInfo.IsConnected = true;
|
||||||
AddOrUpdateScriptParseInfo(info.OwnerUri, scriptInfo);
|
//AddOrUpdateScriptParseInfo(info.OwnerUri, scriptInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
|||||||
Reference in New Issue
Block a user