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:
Karl Burtram
2023-02-03 18:10:07 -08:00
committed by GitHub
parent 735517a503
commit f288bee294
1020 changed files with 2299 additions and 273 deletions

View File

@@ -3,6 +3,8 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
#nullable disable
using System.Diagnostics;
namespace Microsoft.SqlTools.ServiceLayer.Workspace.Contracts

View File

@@ -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.Diagnostics;

View File

@@ -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.Hosting.Protocol.Contracts;
namespace Microsoft.SqlTools.ServiceLayer.Workspace.Contracts

View File

@@ -3,6 +3,8 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
#nullable disable
namespace Microsoft.SqlTools.ServiceLayer.Workspace.Contracts
{
/// <summary>

View File

@@ -3,6 +3,8 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
#nullable disable
namespace Microsoft.SqlTools.ServiceLayer.Workspace.Contracts
{
/// <summary>

View File

@@ -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 System.IO;

View File

@@ -3,6 +3,8 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
#nullable disable
namespace Microsoft.SqlTools.ServiceLayer.Workspace.Contracts
{
/// <summary>

View File

@@ -3,6 +3,8 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
#nullable disable
//using System.Management.Automation.Language;
namespace Microsoft.SqlTools.ServiceLayer.Workspace.Contracts

View File

@@ -3,6 +3,8 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
#nullable disable
using System.Diagnostics;
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
@@ -156,35 +158,35 @@ namespace Microsoft.SqlTools.ServiceLayer.Workspace.Contracts
/// <summary>
/// Gets or sets the zero-based column number.
/// </summary>
public int Character { get; set; }
/// <summary>
/// Overrides the base equality method
/// </summary>
/// <param name="obj"></param>
public int Character { get; set; }
/// <summary>
/// Overrides the base equality method
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public override bool Equals(object obj)
{
if (obj == null || (obj as Position == null))
{
return false;
}
Position p = (Position) obj;
bool result = (Line == p.Line) && (Character == p.Character);
return result;
}
/// <summary>
/// Overrides the base GetHashCode method
/// </summary>
public override bool Equals(object obj)
{
if (obj == null || (obj as Position == null))
{
return false;
}
Position p = (Position) obj;
bool result = (Line == p.Line) && (Character == p.Character);
return result;
}
/// <summary>
/// Overrides the base GetHashCode method
/// </summary>
/// <returns></returns>
public override int GetHashCode()
{
int hash = 17;
hash = hash * 23 + Line.GetHashCode();
hash = hash * 23 + Character.GetHashCode();
return hash;
public override int GetHashCode()
{
int hash = 17;
hash = hash * 23 + Line.GetHashCode();
hash = hash * 23 + Character.GetHashCode();
return hash;
}
}
@@ -201,35 +203,35 @@ namespace Microsoft.SqlTools.ServiceLayer.Workspace.Contracts
/// </summary>
public Position End { get; set; }
/// <summary>
/// Overrides the base equality method
/// </summary>
/// <param name="obj"></param>
/// <summary>
/// Overrides the base equality method
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public override bool Equals(object obj)
{
if (obj == null || !(obj is Range))
{
return false;
}
Range range = (Range) obj;
bool sameStart = range.Start.Equals(Start);
bool sameEnd = range.End.Equals(End);
return (sameStart && sameEnd);
public override bool Equals(object obj)
{
if (obj == null || !(obj is Range))
{
return false;
}
Range range = (Range) obj;
bool sameStart = range.Start.Equals(Start);
bool sameEnd = range.End.Equals(End);
return (sameStart && sameEnd);
}
/// <summary>
/// Overrides the base GetHashCode method
/// </summary>
/// <summary>
/// Overrides the base GetHashCode method
/// </summary>
/// <returns></returns>
public override int GetHashCode()
{
int hash = 17;
hash = hash * 23 + Start.GetHashCode();
hash = hash * 23 + End.GetHashCode();
return hash;
public override int GetHashCode()
{
int hash = 17;
hash = hash * 23 + Start.GetHashCode();
hash = hash * 23 + End.GetHashCode();
return hash;
}
}
@@ -246,33 +248,33 @@ namespace Microsoft.SqlTools.ServiceLayer.Workspace.Contracts
/// </summary>
public Range Range { get; set; }
/// <summary>
/// Overrides the base equality method
/// </summary>
/// <param name="obj"></param>
/// <summary>
/// Overrides the base equality method
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public override bool Equals(object obj)
{
if (obj == null || (obj as Location == null))
{
return false;
}
Location loc = (Location)obj;
bool sameUri = string.Equals(loc.Uri, Uri);
bool sameRange = loc.Range.Equals(Range);
return (sameUri && sameRange);
}
/// <summary>
/// Overrides the base GetHashCode method
/// </summary>
public override bool Equals(object obj)
{
if (obj == null || (obj as Location == null))
{
return false;
}
Location loc = (Location)obj;
bool sameUri = string.Equals(loc.Uri, Uri);
bool sameRange = loc.Range.Equals(Range);
return (sameUri && sameRange);
}
/// <summary>
/// Overrides the base GetHashCode method
/// </summary>
/// <returns></returns>
public override int GetHashCode()
{
int hash = 17;
hash = hash * 23 + Uri.GetHashCode();
hash = hash * 23 + Range.GetHashCode();
return hash;
public override int GetHashCode()
{
int hash = 17;
hash = hash * 23 + Uri.GetHashCode();
hash = hash * 23 + Range.GetHashCode();
return hash;
}
}

View File

@@ -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.Hosting.Protocol.Contracts;
namespace Microsoft.SqlTools.ServiceLayer.Workspace.Contracts

View File

@@ -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 System.IO;

View File

@@ -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 System.Diagnostics;