mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 01:25:40 -05:00
Make nullable warnings a per file opt-in (#1842)
* Make nullable warnings a per file opt-in * Remove unneeded compiler directives * Remove compiler directive for User Data
This commit is contained in:
@@ -3,4 +3,6 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
#nullable disable
|
||||
|
||||
[assembly: NUnit.Framework.NonParallelizable]
|
||||
@@ -3,6 +3,8 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using Microsoft.Data.SqlClient;
|
||||
using System.Diagnostics;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using Microsoft.SqlTools.ServiceLayer.BatchParser;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
#nullable disable
|
||||
|
||||
using Microsoft.SqlTools.ManagedBatchParser.IntegrationTests.TSQLExecutionEngine;
|
||||
using Microsoft.SqlTools.ManagedBatchParser.IntegrationTests.Utility;
|
||||
using Microsoft.SqlTools.ServiceLayer.BatchParser;
|
||||
@@ -276,11 +278,11 @@ namespace Microsoft.SqlTools.ManagedBatchParser.UnitTests.BatchParser
|
||||
|
||||
Token token = new Token(LexerTokenType.Text, new PositionStruct(), new PositionStruct(), message, "test");
|
||||
|
||||
BatchParserException batchParserException = new BatchParserException(ErrorCode.VariableNotDefined, token, message);
|
||||
|
||||
Assert.AreEqual(batchParserException.ErrorCode.ToString(), ErrorCode.VariableNotDefined.ToString());
|
||||
Assert.AreEqual(message, batchParserException.Text);
|
||||
Assert.AreEqual(LexerTokenType.Text.ToString(), batchParserException.TokenType.ToString());
|
||||
BatchParserException batchParserException = new BatchParserException(ErrorCode.VariableNotDefined, token, message);
|
||||
|
||||
Assert.AreEqual(batchParserException.ErrorCode.ToString(), ErrorCode.VariableNotDefined.ToString());
|
||||
Assert.AreEqual(message, batchParserException.Text);
|
||||
Assert.AreEqual(LexerTokenType.Text.ToString(), batchParserException.TokenType.ToString());
|
||||
}
|
||||
|
||||
// Verify whether the executionEngine execute script
|
||||
@@ -385,11 +387,11 @@ GO";
|
||||
using (TestExecutor testExecutor = new TestExecutor(sqlCmdQuery, sqlConn, condition))
|
||||
{
|
||||
testExecutor.Run();
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(testExecutor.ParserExecutionError, Is.False, "Parse Execution error should be false");
|
||||
Assert.That(testExecutor.ResultCountQueue.Count, Is.EqualTo(1), "Unexpected number of ResultCount items");
|
||||
Assert.That(testExecutor.ErrorMessageQueue, Is.Empty, "Unexpected error messages from test executor");
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(testExecutor.ParserExecutionError, Is.False, "Parse Execution error should be false");
|
||||
Assert.That(testExecutor.ResultCountQueue.Count, Is.EqualTo(1), "Unexpected number of ResultCount items");
|
||||
Assert.That(testExecutor.ErrorMessageQueue, Is.Empty, "Unexpected error messages from test executor");
|
||||
});
|
||||
}
|
||||
|
||||
@@ -399,8 +401,8 @@ GO";
|
||||
testExecutor.Run();
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.True(testExecutor.ParserExecutionError, "Parse Execution error should be true");
|
||||
Assert.That(testExecutor.ErrorMessageQueue, Has.Member("Incorrect syntax was encountered while -u was being parsed."), "error message expected");
|
||||
Assert.True(testExecutor.ParserExecutionError, "Parse Execution error should be true");
|
||||
Assert.That(testExecutor.ErrorMessageQueue, Has.Member("Incorrect syntax was encountered while -u was being parsed."), "error message expected");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using Microsoft.SqlTools.ServiceLayer.BatchParser;
|
||||
using Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
// 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;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Data.SqlClient;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Data.SqlClient;
|
||||
@@ -317,11 +319,11 @@ namespace Microsoft.SqlTools.ManagedBatchParser.IntegrationTests.TSQLExecutionEn
|
||||
public void ExecutionEngineTest_HaltOnError()
|
||||
{
|
||||
string sqlStatement = "select * from authors\n go\n select * from sysbojects \n go \n";
|
||||
ExecutionEngineConditions conditions = new ExecutionEngineConditions
|
||||
{
|
||||
IsTransactionWrapped = true,
|
||||
IsParseOnly = false,
|
||||
IsHaltOnError = true
|
||||
ExecutionEngineConditions conditions = new ExecutionEngineConditions
|
||||
{
|
||||
IsTransactionWrapped = true,
|
||||
IsParseOnly = false,
|
||||
IsHaltOnError = true
|
||||
};
|
||||
|
||||
TestExecutor executor = new TestExecutor(sqlStatement, connection, conditions);
|
||||
|
||||
@@ -3,13 +3,15 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Data.SqlClient;
|
||||
using System.Threading;
|
||||
using Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode;
|
||||
using Microsoft.SqlTools.Utility;
|
||||
|
||||
|
||||
namespace Microsoft.SqlTools.ManagedBatchParser.IntegrationTests.TSQLExecutionEngine
|
||||
{
|
||||
internal class TestExecutor : IDisposable
|
||||
@@ -322,13 +324,13 @@ namespace Microsoft.SqlTools.ManagedBatchParser.IntegrationTests.TSQLExecutionEn
|
||||
private static void OnBatchParserExecutionFinished(object sender, BatchParserExecutionFinishedEventArgs e)
|
||||
{
|
||||
Console.WriteLine("ON_BATCH_PARSER_EXECUTION_FINISHED : Done executing batch \n\t{0}\n\t with result... {1} ", e.Batch.Text, e.ExecutionResult);
|
||||
if (execResult == ScriptExecutionResult.All)
|
||||
{
|
||||
execResult = e.ExecutionResult;
|
||||
if (execResult == ScriptExecutionResult.All)
|
||||
{
|
||||
execResult = e.ExecutionResult;
|
||||
}
|
||||
else
|
||||
{
|
||||
execResult |= e.ExecutionResult;
|
||||
else
|
||||
{
|
||||
execResult |= e.ExecutionResult;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -355,13 +357,13 @@ namespace Microsoft.SqlTools.ManagedBatchParser.IntegrationTests.TSQLExecutionEn
|
||||
Console.WriteLine("ON_EXECUTION_FINISHED : Script execution done with result ..." + e.ExecutionResult);
|
||||
_isFinished = true;
|
||||
|
||||
if (execResult == ScriptExecutionResult.All)
|
||||
{
|
||||
execResult = e.ExecutionResult;
|
||||
if (execResult == ScriptExecutionResult.All)
|
||||
{
|
||||
execResult = e.ExecutionResult;
|
||||
}
|
||||
else
|
||||
{
|
||||
execResult |= e.ExecutionResult;
|
||||
else
|
||||
{
|
||||
execResult |= e.ExecutionResult;
|
||||
}
|
||||
|
||||
resultCounts = eventHandler.ResultCounts;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System.IO;
|
||||
|
||||
namespace Microsoft.SqlTools.ManagedBatchParser.IntegrationTests.Utility
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using Microsoft.Data.SqlClient;
|
||||
using System.IO;
|
||||
|
||||
Reference in New Issue
Block a user