Komodo / KomodoEdit

Komodo Edit is a fast and free multi-language code editor. Written in JS, Python, C++ and based on the Mozilla platform.
http://www.komodoide.com/komodo-edit
Other
2.16k stars 303 forks source link

php + html wrong render ( detects javascript but there is no JavaScript ) #2322

Open babobski opened 7 years ago

babobski commented 7 years ago

Short Summary

When you work with a combination of php + html, Komodo seems to detect JavaScript at some point. Only this is incorrect and breaks the render of the file.

afbeelding

Steps to Reproduce

Work with php and html, the issue occurs occasionally, and only when working with the files. The issue only appears while editing, on file open the issue does not exist.

Platform Information

Windows 10 Komodo 10.1.4

Naatan commented 7 years ago

Please provide a code snippet that reproduces the issue.

babobski commented 7 years ago

@Naatan I emailed a example last week to support@activestate.com ( because it was company code ) addressed for @mitchell-as and for the issue #2018 as I commented about this issue there.

Also as I mentioned in the email, this bug only appears while editing. On file opening the syntax highlighting is correct, only while editing the syntax checking sometimes fails. As you can see screenshot the syntax is correct, everything is closed, but the syntax checking is wrong. To fix it I have to put the cursor in front of the element that has the wrong syntax checking indent/de-indent and the syntax checking is fine again.

mitchell-as commented 7 years ago

Hi @babobski thanks for sending your file over e-mail. Sorry I didn't have time to look at it earlier. I've played around with that file, removing things, adding things, and I have not managed to trigger the state you describe (I can trigger plenty of PHP syntax checking errors though.)

When it comes to complicated templating languages like PHP, any bad syntax, however temporary, can cause temporary mayhem, and these kinds of issues are really difficult to pin down. If you ever manage to find a reproducible test case, I'd be very interested to see it. Until then, I don't believe there is anything we can do.

Note to self: TicketID=60822

babobski commented 7 years ago

Just for keeping track, this time on file open, only when I close and reopen it te rendering is fine.

afbeelding

babobski commented 7 years ago

afbeelding

mitchell-as commented 7 years ago

Picture posts without context or annotations are meaningless to me. I don't even know what I'm looking at, in either of your 2 recent pictures.

Naatan commented 7 years ago

@babobski can you reproduce the bug while editing? Exact steps to reproduce would be very valuable.

babobski commented 7 years ago

@mitchell-as the last two pictures showing a broken highlighting. In the first the div's are rendered in the wrong highlighting, they should be completely yellow. In the second screenshot it is the same, the tags should be completely pink, also it is rendering the text as javascript, it is highlighting the in keyword in the text.

I don't want to bother you guys with meaningless pictures, but just wanted to keep track how many times I suffer of the wrong render. @Naatan I still can't reproduce, when I have the wrong render and save the file as new file, open the file the render is correct. It sometimes just fails on file open or on editing, but when I try to create a test case te render is fine. So it is pretty hard to create exact steps to reproduce. But I will keep trying.

mitchell-as commented 7 years ago

Okay, thank you for the clarification. Next time please put a "note to self:" type of annotation so that I can remember that it's not addressed to me :)

babobski commented 7 years ago

@mitchell-as thanks, will do

stramin commented 6 years ago

I always have this issue, even in Komodo 11, it is very usual in my codes, what I do is press "space bar" at the end of ?>

For example, I have this

image

pressing space at the end of ?> formats everything correctly:

image

Not a solution but a workaround.

The problem is for php files only, is not a javascript specific issue, this goes wrong with any html inside PHP where there is no \<html> tags (like included files)

A different workaround for this is printing at the begining of the file a \<html> tag in a impossible PHP condition like this:

image

(both workaround doesn't work always it is harder to fix for longer files where php tag opens and closes too many times).

I hope this give us some clues to solve the issue! :D

Naatan commented 6 years ago

Can you share a code snippet that reproduces the issue?