Merge pull request #228 from Microsoft/bug/DisableEscapingForTempTables

temp tables not escaped any more
This commit is contained in:
Aditya Bist
2017-02-10 12:04:05 -08:00
committed by GitHub
2 changed files with 16 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices.Completion
/// </summary>
public class SqlCompletionItem
{
private static Regex ValidSqlNameRegex = new Regex(@"^[\p{L}_@][\p{L}\p{N}@$#_]{0,127}$");
private static Regex ValidSqlNameRegex = new Regex(@"^[\p{L}_@#][\p{L}\p{N}@$#_]{0,127}$");
private static DelimitedIdentifier BracketedIdentifiers = new DelimitedIdentifier { Start = "[", End = "]"};
private static DelimitedIdentifier[] DelimitedIdentifiers =
new DelimitedIdentifier[] { BracketedIdentifiers, new DelimitedIdentifier {Start = "\"", End = "\"" } };

View File

@@ -524,6 +524,21 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.LanguageServer
Assert.Equal(completionItem.Detail, expected);
}
[Fact]
public void TempTablesShouldNotBeEscaped()
{
string declarationTitle = "#TestTable";
string expected = declarationTitle;
DeclarationType declarationType = DeclarationType.Table;
string tokenText = "";
SqlCompletionItem item = new SqlCompletionItem(declarationTitle, declarationType, tokenText);
CompletionItem completionItem = item.CreateCompletionItem(0, 1, 2);
Assert.Equal(completionItem.Label, expected);
Assert.Equal(completionItem.InsertText, expected);
Assert.Equal(completionItem.Detail, expected);
}
[Fact]
public void KindShouldBeModuleGivenSchemaDeclarationType()
{