Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DevTools] Make Functions Clickable to Jump to Definition (#30769)
Currently you can jump to definition of a function by right clicking through the context menu. However, it's pretty difficult to discover. This makes the functions clickable to jump to definition - like links. This uses the same styling as we do for links (which are btw only clickable if they're not editable). Including cursor: pointer. I added a background on hover which follows the same pattern as the owners list. I also dropped the ƒ prefix when displaying functions. This is a cute short cut and there's precedence in how Chrome prints functions in the console *if* the function's toString would've had a function prefix like if it was a function declaration or expression. It does not do this for arrow functions or object methods. Elsewhere in the JS ecosystem this isn't really used anywhere. It invites more questions than it answers. The parenthesis and curlies are enough. There's no ambiguity here since strings have quotations. It looks better with just its object method form. Keeping it simple seems best. To my eyes this flows better because I'm used to looking at function syntax but not weird "f"s. Before: <img width="433" alt="Screenshot 2024-08-20 at 11 55 09 PM" src="https:/user-attachments/assets/9dd50da6-598f-4291-9e24-1cdc7200dc9e"> After: <img width="388" alt="Screenshot 2024-08-20 at 11 46 01 PM" src="https:/user-attachments/assets/dd988e14-412e-4deb-8c8c-26a54be8331f"> After (Hover): <img width="389" alt="Screenshot 2024-08-20 at 11 46 31 PM" src="https:/user-attachments/assets/6fb4ebed-5dc1-448a-8e4d-b6d4f3903329">
- Loading branch information