Skip to content
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

Reporter doesn't highlight es6 arrow functions and popups don't always appear #61

Closed
Lokiem opened this issue Jul 23, 2018 · 5 comments
Closed
Assignees
Labels

Comments

@Lokiem
Copy link

Lokiem commented Jul 23, 2018

The regex for the highlighter requires the format of non-es6 anonymous functions.

lib/assets/scripts/plato-file.js line 55, if the regex is changed to '(function\\s*)?(\\()[^()]*\\)' then it should cover old and new anonymous functions. (Not familiar with Github so don't know what I'm doing with making changes myself!)

Another bug in the report js appears to be the popups when hovering over highlighted function markers, if it's at the top of the code window then it's cut off, and it appears to be fairly irregular for what functions it actually shows up for in general.

@the-simian the-simian self-assigned this Jul 23, 2018
@the-simian the-simian added the bug label Jul 23, 2018
@the-simian
Copy link
Owner

thanks for the report, @Lokiem , are these two separate issues?

@Lokiem
Copy link
Author

Lokiem commented Jul 23, 2018

They may be related, as the result of the regex match is used for the popover JS.

The popover being cutoff is related to the container property of the popover function (Currently not set, so I would assume it's defaulting to it's parent, which looks to be .CodeMirror as it has a overflow:hidden), if that property is set to body then the cutoff is fixed, though linespacing on the popover is a little larger.

I couldn't figure out what was causing the popover to irregularly not work, but I'm willing to assume it may have just been one of the tweaks I was making to get the other parts working. On running a clean plato, and just adding the small changes I've outlined I didn't have any issues with the popovers.

@the-simian
Copy link
Owner

Ok let me try out that regext - see if it catches all the functions. I want to see if I can reproduce the problem and the fix. Appreciate the feedback, @Lokiem

I can't get to it for a while; however, if you manage to make a Pull request with the proposed changes I will happily pull it in.

@the-simian
Copy link
Owner

@Lokiem I updated the deps and am doing some testing

@the-simian
Copy link
Owner

@Lokiem the deps are updated again, I'm closing this but if it is still giving you problems lmk and I'll repoen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants