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

single quotes in constants sometimes not properly ending #21

Open
gojimmypi opened this issue Apr 26, 2020 · 5 comments
Open

single quotes in constants sometimes not properly ending #21

gojimmypi opened this issue Apr 26, 2020 · 5 comments

Comments

@gojimmypi
Copy link
Owner

see picorv32.v line 532

note missing colorization after single quote:

image

@Risavk
Copy link
Contributor

Risavk commented Apr 27, 2020

Looks like could be caused by my fix ? Currently i don't have possibility to check.

Edit: Hm. Was able to test - and after removing my commit it still doesn't work properly - but on your screenshot from issue 14 it looks as it should be highlighted properly ... Strange if you ask me :)

Would be fun to mock editor object and write some test cases to verify syntax highlighting :)

@gojimmypi
Copy link
Owner Author

I'm pretty sure your fix did not break that. yes, there are a variety of "strange things" that happen. I had a chance over the weekend (such as #16) to find and fix a few more. Currently I am trying to figure out why typing in a big file such as picorv32.v causes sporadic incorrect highlighting. Perhaps this is related to my threaded process not completing in time. Indeed some test cases would be awesome!

If you are actively working on this, I can check in my recent code.

I appreciate you looking at this. Cheers

@Risavk
Copy link
Contributor

Risavk commented Apr 27, 2020

Got too much work stuff for now...

But, just for fun - try to comment out this line, just for fun... :

VerilogGlobals.IsContinuedBlockComment = IsOpenBlockComment(spans); // TODO - does spans always contain the full document? (appears perhaps not)

I tested your code with profiler and found, that this line consumes huuuge amount of resources/time.

With your existing code, open big verilog file - more then 2000 lines. Try to scroll it near end. It lags as hell. Then try to comment this line. I know, it will mess highlightning, but look at responsivness now. Scanning whole file, and calling CommentHelper for each line from the beginning, for EACH line step when scrolling is very, very time consuming...

As i remember about 90% time was just for this method.

I didn't found good solution yet (but got "some" solution). Eg. "windowed" scrolling, but it can mess things up too :)

@gojimmypi
Copy link
Owner Author

gojimmypi commented May 2, 2020

ya, I hear you on the "too much work". after a week of programming at the day job, here I am doing some relaxing coding on the weekend. ;)

I'm revisiting the performance issues today. when I first created this extension (and the gcode one)... I didn't know anything at all about extensions. it's still quite the learning opportunity.

One big problem is the re-parsing gets called way more often than needed... and rebuilds all the tags. it is particularly interesting for special characters like * and /. Do a "goto line" from the end back to the beginning, type a / in just the right spot, and the entire file is now a comment. But type a space... nothing. I need to better detect when the attributes actually change, and when perhaps they just need a little attention. Minimize the full reparsing.

you're right about performance on big files. I need to open a new issue on that and get serious about really fixing this.

@gojimmypi
Copy link
Owner Author

@Risavk heads up I've pushed all my latest code to development-interim branch: Some performance improvements, but nearly as much as I'd like. Still too much time spent re-parsing needlessly.

Handling of * and / has been improved.

Do you have any experience with callbacks? See #23 (comment)

gojimmypi added a commit that referenced this issue May 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants