Feature/autocomp options (#63)

* Enable IntelliSense settings

* Fix up some bugs in the IntelliSense settings.

* Code cleans for PR

* Fix a couple exceptions that are breaks query execute and intellisense.

* Add useLowerCase flag and settings tests
This commit is contained in:
Karl Burtram
2016-09-25 12:53:28 -07:00
committed by GitHub
parent 27e092d370
commit 806220c4b5
8 changed files with 341 additions and 128 deletions

View File

@@ -0,0 +1,53 @@
//
// 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.ServiceLayer.SqlContext
{
/// <summary>
/// Class for serialization and deserialization of IntelliSense settings
/// </summary>
public class IntelliSenseSettings
{
/// <summary>
/// Initialize the IntelliSense settings defaults
/// </summary>
public IntelliSenseSettings()
{
this.EnableSuggestions = true;
this.LowerCaseSuggestions = false;
this.EnableDiagnostics = true;
}
/// <summary>
/// Gets or sets a flag determining if suggestions are enabled
/// </summary>
/// <returns></returns>
public bool? EnableSuggestions { get; set; }
/// <summary>
/// Gets or sets a flag determining if built-in suggestions should be lowercase
/// </summary>
public bool? LowerCaseSuggestions { get; set; }
/// <summary>
/// Gets or sets a flag determining if diagnostics are enabled
/// </summary>
public bool? EnableDiagnostics { get; set; }
/// <summary>
/// Update the Intellisense settings
/// </summary>
/// <param name="settings"></param>
public void Update(IntelliSenseSettings settings)
{
if (settings != null)
{
this.EnableSuggestions = settings.EnableSuggestions;
this.LowerCaseSuggestions = settings.LowerCaseSuggestions;
this.EnableDiagnostics = settings.EnableDiagnostics;
}
}
}
}