Add tests for the language service diagnostics

This commit is contained in:
Karl Burtram
2016-07-23 17:05:49 -07:00
parent 7119db3bcd
commit 3a55333598
2 changed files with 132 additions and 5 deletions

View File

@@ -106,6 +106,13 @@ namespace Microsoft.SqlTools.EditorServices
#region Constructors
/// <summary>
/// Add a default constructor for testing
/// </summary>
public ScriptFile()
{
}
/// <summary>
/// Creates a new ScriptFile instance by reading file contents from
/// the given TextReader.
@@ -433,11 +440,11 @@ namespace Microsoft.SqlTools.EditorServices
return new BufferRange(startPosition, endPosition);
}
#endregion
#region Private Methods
private void SetFileContents(string fileContents)
/// <summary>
/// Set the script files contents
/// </summary>
/// <param name="fileContents"></param>
public void SetFileContents(string fileContents)
{
// Split the file contents into lines and trim
// any carriage returns from the strings.
@@ -451,6 +458,10 @@ namespace Microsoft.SqlTools.EditorServices
this.ParseFileContents();
}
#endregion
#region Private Methods
/// <summary>
/// Parses the current file contents to get the AST, tokens,
/// and parse errors.