mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 10:58:30 -05:00
Merge pull request #228 from Microsoft/bug/DisableEscapingForTempTables
temp tables not escaped any more
This commit is contained in:
@@ -18,7 +18,7 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices.Completion
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class SqlCompletionItem
|
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 BracketedIdentifiers = new DelimitedIdentifier { Start = "[", End = "]"};
|
||||||
private static DelimitedIdentifier[] DelimitedIdentifiers =
|
private static DelimitedIdentifier[] DelimitedIdentifiers =
|
||||||
new DelimitedIdentifier[] { BracketedIdentifiers, new DelimitedIdentifier {Start = "\"", End = "\"" } };
|
new DelimitedIdentifier[] { BracketedIdentifiers, new DelimitedIdentifier {Start = "\"", End = "\"" } };
|
||||||
|
|||||||
@@ -524,6 +524,21 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.LanguageServer
|
|||||||
Assert.Equal(completionItem.Detail, expected);
|
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]
|
[Fact]
|
||||||
public void KindShouldBeModuleGivenSchemaDeclarationType()
|
public void KindShouldBeModuleGivenSchemaDeclarationType()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user