mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 10:58:30 -05:00
Servicehost cleanup (#1)
Merge some code clean ups. Find+Replace 'PowerShell' with 'SQL Tools'. Enable logger in ServiceHost project.
This commit is contained in:
@@ -7,7 +7,7 @@ using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.PowerShell.EditorServices.Utility
|
||||
namespace Microsoft.SqlTools.EditorServices.Utility
|
||||
{
|
||||
/// <summary>
|
||||
/// Simplifies the setup of a SynchronizationContext for the use
|
||||
|
||||
@@ -7,7 +7,7 @@ using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.PowerShell.EditorServices.Utility
|
||||
namespace Microsoft.SqlTools.EditorServices.Utility
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides a simplified interface for creating a new thread
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.PowerShell.EditorServices.Utility
|
||||
namespace Microsoft.SqlTools.EditorServices.Utility
|
||||
{
|
||||
/// <summary>
|
||||
/// Restricts the invocation of an operation to a specified time
|
||||
|
||||
@@ -7,7 +7,7 @@ using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.PowerShell.EditorServices.Utility
|
||||
namespace Microsoft.SqlTools.EditorServices.Utility
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides a simple wrapper over a SemaphoreSlim to allow
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.PowerShell.EditorServices.Utility
|
||||
namespace Microsoft.SqlTools.EditorServices.Utility
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides a synchronized queue which can be used from within async
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.PowerShell.EditorServices.Utility
|
||||
namespace Microsoft.SqlTools.EditorServices.Utility
|
||||
{
|
||||
internal static class ObjectExtensions
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
namespace Microsoft.PowerShell.EditorServices.Utility
|
||||
namespace Microsoft.SqlTools.EditorServices.Utility
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the level indicators for log messages.
|
||||
@@ -54,7 +54,7 @@ namespace Microsoft.PowerShell.EditorServices.Utility
|
||||
/// Optional. Specifies the minimum log message level to write to the log file.
|
||||
/// </param>
|
||||
public static void Initialize(
|
||||
string logFilePath = "EditorServices.log",
|
||||
string logFilePath = "SqlToolsService.log",
|
||||
LogLevel minimumLogLevel = LogLevel.Normal)
|
||||
{
|
||||
if (logWriter != null)
|
||||
@@ -118,32 +118,25 @@ namespace Microsoft.PowerShell.EditorServices.Utility
|
||||
this.minimumLogLevel = minimumLogLevel;
|
||||
|
||||
// Ensure that we have a usable log file path
|
||||
// if (!Path.IsPathRooted(logFilePath))
|
||||
// {
|
||||
// logFilePath =
|
||||
// Path.Combine(
|
||||
// #if NanoServer
|
||||
// AppContext.BaseDirectory,
|
||||
// #else
|
||||
// AppDomain.CurrentDomain.BaseDirectory,
|
||||
// #endif
|
||||
// logFilePath);
|
||||
// }
|
||||
if (!Path.IsPathRooted(logFilePath))
|
||||
{
|
||||
logFilePath =
|
||||
Path.Combine(
|
||||
AppContext.BaseDirectory,
|
||||
logFilePath);
|
||||
}
|
||||
|
||||
// if (!this.TryOpenLogFile(logFilePath, deleteExisting))
|
||||
// {
|
||||
// // If the log file couldn't be opened at this location,
|
||||
// // try opening it in a more reliable path
|
||||
// this.TryOpenLogFile(
|
||||
// Path.Combine(
|
||||
// #if NanoServer
|
||||
// Environment.GetEnvironmentVariable("TEMP"),
|
||||
// #else
|
||||
// Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
|
||||
// #endif
|
||||
// Path.GetFileName(logFilePath)),
|
||||
// deleteExisting);
|
||||
// }
|
||||
|
||||
if (!this.TryOpenLogFile(logFilePath, deleteExisting))
|
||||
{
|
||||
// If the log file couldn't be opened at this location,
|
||||
// try opening it in a more reliable path
|
||||
this.TryOpenLogFile(
|
||||
Path.Combine(
|
||||
Environment.GetEnvironmentVariable("TEMP"),
|
||||
Path.GetFileName(logFilePath)),
|
||||
deleteExisting);
|
||||
}
|
||||
}
|
||||
|
||||
public void Write(
|
||||
|
||||
@@ -7,7 +7,7 @@ using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Threading;
|
||||
|
||||
namespace Microsoft.PowerShell.EditorServices.Utility
|
||||
namespace Microsoft.SqlTools.EditorServices.Utility
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides a SynchronizationContext implementation that can be used
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.PowerShell.EditorServices.Utility
|
||||
namespace Microsoft.SqlTools.EditorServices.Utility
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides common validation methods to simplify method
|
||||
|
||||
Reference in New Issue
Block a user