mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 17:23:27 -05:00
* Make nullable warnings a per file opt-in * Remove unneeded compiler directives * Remove compiler directive for User Data
36 lines
1.1 KiB
C#
36 lines
1.1 KiB
C#
//
|
|
// Copyright (c) Microsoft. All rights reserved.
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
//
|
|
|
|
#nullable disable
|
|
|
|
using System.Text;
|
|
using Microsoft.SqlTools.ServiceLayer.BatchParser;
|
|
using Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode;
|
|
|
|
namespace Microsoft.SqlTools.ManagedBatchParser.UnitTests.BatchParser
|
|
{
|
|
internal sealed class TestVariableResolver : IVariableResolver
|
|
{
|
|
private StringBuilder outputString;
|
|
private BatchParserSqlCmd batchParserSqlCmd;
|
|
|
|
public TestVariableResolver(StringBuilder outputString)
|
|
{
|
|
this.outputString = outputString;
|
|
batchParserSqlCmd = new BatchParserSqlCmd();
|
|
}
|
|
|
|
public string GetVariable(PositionStruct pos, string name)
|
|
{
|
|
return batchParserSqlCmd.GetVariable(pos, name);
|
|
}
|
|
|
|
public void SetVariable(PositionStruct pos, string name, string value)
|
|
{
|
|
outputString.AppendFormat("Setting variable {0} to [{1}]\n", name, value);
|
|
batchParserSqlCmd.SetVariable(pos, name, value);
|
|
}
|
|
}
|
|
} |