Added optional trailing slash regex

This commit is contained in:
Armando Aguirre 2019-08-23 15:42:03 -07:00
parent 25f609b3a2
commit a0c29fe4e5
2 changed files with 18 additions and 1 deletions

View file

@ -713,6 +713,6 @@ namespace ts.NavigationBar {
// \r - Carriage Return
// \u2028 - Line separator
// \u2029 - Paragraph separator
return text.replace(/\\(\r?\n|\r|\u2028|\u2029)/g, "");
return text.replace(/\\?(\r?\n|\r|\u2028|\u2029)/g, "");
}
}

View file

@ -8,6 +8,10 @@
//// const a = ' ''line1\
//// line2';
//// }
////
//// f(() => { }, `unterminated backtick 1
//// unterminated backtick 2
//// unterminated backtick 3
verify.navigationTree({
"text": "<global>",
@ -34,6 +38,10 @@ verify.navigationTree({
{
"text": "f(`line1line2line3`) callback",
"kind": "function"
},
{
"text": "f(`unterminated backtick 1unterminated backtick 2unterminated backtick 3) callback",
"kind": "function"
}
]
});
@ -54,6 +62,10 @@ verify.navigationBar([
{
"text": "f(`line1line2line3`) callback",
"kind": "function"
},
{
"text": "f(`unterminated backtick 1unterminated backtick 2unterminated backtick 3) callback",
"kind": "function"
}
]
},
@ -81,5 +93,10 @@ verify.navigationBar([
"text": "f(`line1line2line3`) callback",
"kind": "function",
"indent": 1
},
{
"text": "f(`unterminated backtick 1unterminated backtick 2unterminated backtick 3) callback",
"kind": "function",
"indent": 1
}
]);