简体   繁体   中英

Eclipse source line error mark doesn't go away after I fixed and saved

I'm using Eclipse for PHP developers v 3.0.2 on MacOS 10.7
This happens very frequently, I'm writing a line of code, eclipse marks an error, I finish the line, the code is correct, I save the file, but the mark remains.
It's not like a cache catches up in a few seconds and then removes the mark, no, the mark remains forever, even after saving.
Some times I delete the whole function, save, then paste the function again and then the mark doesn't appear again.
The code the screen cap shows is correct, there's no brace unbalancing from previous code, before creating the function the code was correct and ran correctly.
If I cut, save and paste the function, it goes away, if just delete the brace, it doesn't. What could it be?

屏幕截图

I know this question is old but for people who have a similar problem my solution was to re-build my project. Right-click->Build Project.

I can suggest something that can slightly reduce the annoyance. This, though not a fix, can remove the cross and ease your mind.

Also, my suggestion is based on experience with the Java Editor and not the PHP one. I imagine the two may behave differently.

There are three ways in which code errors are highlighted by eclipse.

  1. Overview Ruler
  2. Vertical Ruler
  3. Inline (ie by a squiggly line in the code)

If you remove one of them, the other two should suffice to tell you that there is an error in the code.

In your snapshot the ugly red cross is Eclipse telling you, via the Vertical Ruler, that there is a problem. To disable this behavior go to Eclipse -> Preferences -> General -> Editors -> Text Editors -> Annotations and uncheck 'Vertical Ruler' like so :

禁用垂直标尺注释

Update

Take a look at this screencast.

Right click and update the project

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM