-
Notifications
You must be signed in to change notification settings - Fork 13k
remove whitespace in nav bar completions #11829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
// We ma get a string with newlines or other whitespace in the case of an object dereference | ||
// (eg: "app\n.onactivated"), so we should remove the whitespace for readabiltiy in the | ||
// navigation bar. | ||
return getFunctionOrClassName(<ArrowFunction | FunctionExpression | ClassExpression>node).replace(whiteSpaceRegex, ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would move this in getFunctionOrClassName
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
* | ||
* does not match. | ||
*/ | ||
const whiteSpaceRegex = /(\s|\t|\n|\r)+/g; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need to list other options except \s
.
per this
\s
Matches a single white space character, including space, tab, form feed, line feed and other Unicode spaces. Equivalent to [ \f\n\r\t\v\u00a0\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff].
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
//// .a = function() { }; | ||
//// })(); | ||
|
||
function navExact(name: string, kind: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this function for?
Fixes an issue where nav bar items in Visual Studio wouldn't remove whitespace (esp. newlines), making the nav bar add rows to accomodate the entries and waste screen real-estate.