Small items for code review iteration

* Removing unused OutputType and OutputWrittenEventArgs classes
* Adding class comment blocks
* Tweaking a couple comment blocks as per @kcunanne comments
This commit is contained in:
Benjamin Russell
2016-07-25 13:33:04 -07:00
parent 6664de2252
commit 639ab4f205
7 changed files with 22 additions and 113 deletions

View File

@@ -15,7 +15,9 @@ using Microsoft.SqlTools.ServiceLayer.Hosting.Protocol.Channel;
namespace Microsoft.SqlTools.ServiceLayer.Hosting
{
/// <summary>
/// SQL Tools VS Code Language Server request handler
/// SQL Tools VS Code Language Server request handler. Provides the entire JSON RPC
/// implementation for sending/receiving JSON requests and dispatching the requests to
/// handlers that are registered prior to startup.
/// </summary>
public sealed class ServiceHost : ServiceHostBase
{

View File

@@ -18,7 +18,8 @@ using System.Linq;
namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
{
/// <summary>
/// Main class for Language Service functionality
/// Main class for Language Service functionality including anything that reqires knowledge of
/// the language to perfom, such as definitions, intellisense, etc.
/// </summary>
public sealed class LanguageService
{

View File

@@ -1,41 +0,0 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
namespace Microsoft.SqlTools.EditorServices
{
/// <summary>
/// Enumerates the types of output lines that will be sent
/// to an IConsoleHost implementation.
/// </summary>
public enum OutputType
{
/// <summary>
/// A normal output line, usually written with the or Write-Host or
/// Write-Output cmdlets.
/// </summary>
Normal,
/// <summary>
/// A debug output line, written with the Write-Debug cmdlet.
/// </summary>
Debug,
/// <summary>
/// A verbose output line, written with the Write-Verbose cmdlet.
/// </summary>
Verbose,
/// <summary>
/// A warning output line, written with the Write-Warning cmdlet.
/// </summary>
Warning,
/// <summary>
/// An error output line, written with the Write-Error cmdlet or
/// as a result of some error during SqlTools pipeline execution.
/// </summary>
Error
}
}

View File

@@ -1,65 +0,0 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System;
namespace Microsoft.SqlTools.EditorServices
{
/// <summary>
/// Provides details about output that has been written to the
/// SqlTools host.
/// </summary>
public class OutputWrittenEventArgs
{
/// <summary>
/// Gets the text of the output.
/// </summary>
public string OutputText { get; private set; }
/// <summary>
/// Gets the type of the output.
/// </summary>
public OutputType OutputType { get; private set; }
/// <summary>
/// Gets a boolean which indicates whether a newline
/// should be written after the output.
/// </summary>
public bool IncludeNewLine { get; private set; }
/// <summary>
/// Gets the foreground color of the output text.
/// </summary>
public ConsoleColor ForegroundColor { get; private set; }
/// <summary>
/// Gets the background color of the output text.
/// </summary>
public ConsoleColor BackgroundColor { get; private set; }
/// <summary>
/// Creates an instance of the OutputWrittenEventArgs class.
/// </summary>
/// <param name="outputText">The text of the output.</param>
/// <param name="includeNewLine">A boolean which indicates whether a newline should be written after the output.</param>
/// <param name="outputType">The type of the output.</param>
/// <param name="foregroundColor">The foreground color of the output text.</param>
/// <param name="backgroundColor">The background color of the output text.</param>
public OutputWrittenEventArgs(
string outputText,
bool includeNewLine,
OutputType outputType,
ConsoleColor foregroundColor,
ConsoleColor backgroundColor)
{
this.OutputText = outputText;
this.IncludeNewLine = includeNewLine;
this.OutputType = outputType;
this.ForegroundColor = foregroundColor;
this.BackgroundColor = backgroundColor;
}
}
}

View File

@@ -7,6 +7,9 @@ using System;
namespace Microsoft.SqlTools.ServiceLayer.SqlContext
{
/// <summary>
/// Context for SQL Tools
/// </summary>
public class SqlToolsContext
{
/// <summary>

View File

@@ -3,6 +3,9 @@ using Microsoft.SqlTools.EditorServices.Utility;
namespace Microsoft.SqlTools.ServiceLayer.SqlContext
{
/// <summary>
/// Class for serialization and deserialization of the settings the SQL Tools Service needs.
/// </summary>
public class SqlToolsSettings
{
// TODO: Is this needed? I can't make sense of this comment.
@@ -30,6 +33,9 @@ namespace Microsoft.SqlTools.ServiceLayer.SqlContext
}
}
/// <summary>
/// Sub class for serialization and deserialization of script analysis settings
/// </summary>
public class ScriptAnalysisSettings
{
public bool? Enable { get; set; }

View File

@@ -15,6 +15,14 @@ using Microsoft.SqlTools.ServiceLayer.WorkspaceServices.Contracts;
namespace Microsoft.SqlTools.ServiceLayer.WorkspaceServices
{
/// <summary>
/// Class for handling requests/events that deal with the state of the workspace, including the
/// opening and closing of files, the changing of configuration, etc.
/// </summary>
/// <typeparam name="TConfig">
/// The type of the class used for serializing and deserializing the configuration. Must be the
/// actual type of the instance otherwise deserialization will be incomplete.
/// </typeparam>
public class WorkspaceService<TConfig> where TConfig : class, new()
{
@@ -135,9 +143,6 @@ namespace Microsoft.SqlTools.ServiceLayer.WorkspaceServices
/// <summary>
/// Handles text document change events
/// </summary>
/// <param name="textChangeParams"></param>
/// <param name="eventContext"></param>
/// <returns></returns>
protected Task HandleDidChangeTextDocumentNotification(
DidChangeTextDocumentParams textChangeParams,
EventContext eventContext)
@@ -187,8 +192,6 @@ namespace Microsoft.SqlTools.ServiceLayer.WorkspaceServices
/// <summary>
/// Handles the configuration change event
/// </summary>
/// <param name="configChangeParams"></param>
/// <param name="eventContext"></param>
protected async Task HandleDidChangeConfigurationNotification(
DidChangeConfigurationParams<TConfig> configChangeParams,
EventContext eventContext)