mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-13 17:23:02 -05:00
Reuse existing ServerConnection in PeekDefinition (#209)
This commit is contained in:
@@ -62,12 +62,9 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
|
||||
{
|
||||
try
|
||||
{
|
||||
// Get server object from connection
|
||||
SqlConnection sqlConn = new SqlConnection(this.serverConnection.ConnectionString);
|
||||
sqlConn.Open();
|
||||
ServerConnection peekConnection = new ServerConnection(sqlConn);
|
||||
Server server = new Server(peekConnection);
|
||||
this.database = new Database(server, peekConnection.DatabaseName);
|
||||
// Reuse existing connection
|
||||
Server server = new Server(this.serverConnection);
|
||||
this.database = new Database(server, this.serverConnection.DatabaseName);
|
||||
}
|
||||
catch (ConnectionFailureException cfe)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user