diff --git a/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/AutoCompleteHelper.cs b/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/AutoCompleteHelper.cs
index b01b9f73..bef773fe 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/AutoCompleteHelper.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/AutoCompleteHelper.cs
@@ -332,7 +332,7 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
///
/// Gets a static instance of an empty completion list to avoid
- // unneeded memory allocations
+ /// unneeded memory allocations
///
internal static CompletionItem[] EmptyCompletionList
{
@@ -345,9 +345,22 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
///
/// Retrieves the reserved word list
///
- public static string[] GetReservedWordList()
+ internal static string[] GetReservedWordList
{
- return DefaultCompletionText;
+ get
+ {
+ return AutoCompleteHelper.DefaultCompletionText;
+ }
+ }
+
+ ///
+ /// Checks whether a given word is in the reserved
+ /// word list or not
+ ///
+ internal static bool IsReservedWord(string text)
+ {
+ int pos = Array.IndexOf(DefaultCompletionText, text.ToLower());
+ return pos > -1;
}
///
diff --git a/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/Completion/SqlCompletionItem.cs b/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/Completion/SqlCompletionItem.cs
index 33108d97..49e3fd44 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/Completion/SqlCompletionItem.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/Completion/SqlCompletionItem.cs
@@ -46,7 +46,7 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices.Completion
{
InsertText = GetCompletionItemInsertName();
Label = DeclarationTitle;
- if (StartsWithBracket(TokenText) || IsReservedWord(InsertText))
+ if (StartsWithBracket(TokenText) || AutoCompleteHelper.IsReservedWord(InsertText))
{
Label = WithBracket(Label);
InsertText = WithBracket(InsertText);
@@ -203,12 +203,5 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices.Completion
return text;
}
}
-
- private bool IsReservedWord(string text)
- {
- string[] ReservedWords = AutoCompleteHelper.GetReservedWordList();
- int pos = Array.IndexOf(ReservedWords, text.ToLower());
- return pos > -1 ? true : false;
- }
}
}