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