Red code errors not showing up? - eclipse

I am having trouble trying to activate(?) red error codes in MyEclipse Pro 2014 (I have the same problem in Eclipse Luna). I just downloaded it today and whenever I make an error, even on purpose like a misspelled keyword, MyEclipse won't show red marks on the side like how IDEs usually do. Is there any way I can fix this? Also, content assist doesn't work for me neither. Any help would be greatly appreciated!

Check that you have the Java editor configured in preferences, file associations, as the default editor for Java files. If you're using the text editor, then content assist won't be available although errors should show up after saving the file. However, if you have disabled or removed the Java builder (in the project's properties Builders page), then no marks will show up. Try a new project in a new workspace to check if the problem persists.

Related

Stop Eclipse from autocompleting variable names on declaration

Edit: I am a dumbass who repeatedly went into CA for JavaScript instead of Java. This is what happens when you blindly use the search box, folks.
I know this question has been asked and answered here before, but there's a problem. The solution just isn't there anymore.
I have the exact same problem as this good fella. I saw the answers, they say it's been patched in the 2018-12 release, which I assume is about 18 months old (I've only recently started using eclipse). I'm on the 2020-03 release and, as I said, the Disable insertion triggers except 'Enter' just isn't there anymore. See below:
Eclipse Preferences->Editor->Content Assist Window in 2020-03 release:
I tried looking for it elsewhere in Preferences but I can't find it. When I try to google it all that comes is this same solution, and nothing useful comes up if I filter the searches for time. Does someone know where this option went or if there is another way I can fix this? It's driving me nuts.
Your screenshot shows the JavaScript, not the Java content assist preference page where this setting has never existed:
Window (macOS: Eclipse) > Prefences: JavaScript > Editor > Content Assist
The Java content assist setting described in the mentioned answer can still be found at the same place:
Window (macOS: Eclipse) > Prefences: Java > Editor > Content Assist

"Eclipse for PHP Developers" highlight color

I've just installed Eclipse for PHP Developers and for the most part it works fine, but I seem to have a problem with the highlighter:
If you hold control and then roll-over a method, eclipse shows a pop-up of the first few lines of source of the method (That's obviously not as useful as JavaDoc, but whatever). The problem is that the background of this popup is black and I can't seem to figure out which preference to set to change this.
Bonus points, BTW, if you can tell me how to adjust the PHP Eclipse colors.
In the Eclipse Preferences, select PHP -> Editor -> Syntax Coloring to change the colors.
By the way... some people say Netbeans is much better for PHP development currently.
This is a bug which actually has to do with Ubuntu as well as Eclipse: https://bugs.launchpad.net/ubuntu/+source/light-themes/+bug/540332
I've not gotten it to work locally yet, but this is a good head start.

eclipse libraries no longer working

i had put two libraries on the build path of my project, and then i closed eclipse for the night. when i re-opened eclipse, and opened the same workspace, the libraries "aren't working" in that eclipse isn't doing any of the helpful things it was previously doing, like underlining bad syntax with red squigglies, reporting things that didn't get imported, etc. anyone have an idea of what happened?
Maybe you have disabled "Project->Build Automatically"?
Try Project->Clean. Perhaps the perspective has changed, e.g. from one language to another so it isn'd doing any syntax highlighting

Setting breakpoint w/Eclipse PDT

I am SOOOOO discouraged. This seems so simple, but being a complete novice in Drupal and Eclipse PDT I have absolutely no idea where to look. My DAYS of searching seems to indicate that I am the only person on the planet with this problem.
Eclipse IDE for PHP Developers (1.2.1.20090918-0703)
WampServer Version 2.0
Apache 2.2.11
PHP 5.2.9-2
MySQL 5.1.33
Drupal 6.15
xDebug php_xdebug-2.0.5-5.2.dll
I setup my project in Eclipse to point to my Drupal directory (C:\wamp\www\drupal-6.15). I start the debugger (xdebug) and I stop at the first line of code. I can step through the code line by line -- so I think I am in the debugger, and when I terminate the app, I see the xdebug termination message in the tab heading.
But I cannot set a breakpoint in any of the PHP code files -- specifically a new .module file.
When I right click in the breakpoint column on the left in index.php (main) I see "toggle breakpoint" and the little blue circle next to the line of code...so I think I know how to set a breakpoint. But when I try to set a breakpoint in my .module, I see a menu that asks me to "add a bookmark" and no option to set a breakpoint.
Why can I not set a breakpoint in this file? Is my project path not set up correctly? Do I need to amend my include path? I can't get Eclipse to recognize even core modules not just site/all modules. I've seen posts about "importing" files into the project, and making sure the correct php.ini file is used for configuring xdebug. I'm lost.
There are so many posts about using Eclipst PDT and xDebug and they all end with "have fun debugging" or "just set some breakpoints and off you go" -- but what if you CAN'T set a breakpoint? Any ideas about where Eclipse is lost? Where in Eclipse can you get a list of files it has included in its build?
I think I just need to know understand why Eclipse cannot find these modules within the project (i.e. drupal application) path to allow me to set breakpoints. Then I think I can carry on. So discouraging...
Thanks to anyone listening.
Thanks for the tip. I think I had seen your similar response in another post somewhere.
Actually, the solution for me was to make sure to include all of the standard Drupal file extensions in the Eclipse file associations preferences: Preferences->General->Content Types->Text->PHP Content Type. The defaults are various *.php, *.phpX, *.phtml extensions, but not the extensions used in Drupal modules -- *.info, *.inc, *.module, *.install, etc.
Simple and obvious once you figure it out. I'm surprised with all the Eclipse-xDebug-Drupal setup instructions out there that this had not shown up. Lots of details about matching project paths with server paths, but nothing about this.
I hope my struggle helps someone. I did learn a lot about Eclipse PDT along the way :-). Good luck.
Breakpoints are tricky in PDT projects:
for php files, you need to be careful
One thing that gets me a lot is that there a lot of "invalid" places where you set breakpoints. You can put the dot there in the IDE, but the debugger won't stop at it:
blank/non-code lines
on switch statements
in some types of callbacks (for example, preg_replace)
But for breakpoints in .module files, this should be related to a setup issue.
I made the following changes to my setup:
Upgraded from php 5.2.1 to php 5.2.3
Installed the Zend debugger client in Eclipse/PDT (theoretically not necessary from what I understand, but I decided to give it a try)
Made sure that the Drupal files were fully imported into my project, not just referenced as include libraries.
I did that last step after I created a tiny test case and discovered that I could get the debugger to stop on a breakpoint in an externally included file only if that file was imported into the project, not if it was referenced as part of an include library directory.
To my mind this seems like a bug - the debugger could certainly see that the files in the include library directories were source files and it let me set breakpoints in them, so it seems that it should stop on them.
(For comparison from a separate (java) IDE, IntelliJ will let you define breakpoints in jar files as long as you tell it where the source is. Once you've defined it, it will stop on it.)
I think it was principally that last step that did the trick, so I'd suggest that anyone else with a similar problem make sure that isn't an issue in their setup first, and then try the other steps.
check whether you opened your java file in java editor mode.
ie ctrl+shift+R, in this popup check the button beside OPEN option and select java editor.
The problem of not being able to set a breakpoint can occur if you have recently created a file. You must close and re-open the file for it to be recognised as a source file that can be debugged, and to enable the code highlighting.

Eclipse's WTP translation output

How can I view the intermediate translation done to JSP and JSPX pages by WTP? I'm getting weird syntax errors in my Problems tab of Eclipse in a project that has plenty of .jspx pages. They don't affect anything in the running application (Tomcat 6.0) and they appeared only over the last 2 weeks, after an update.
The reason why I'd like to view the output is that I'm using the Stripes framework at http://stripesframework.org and the errors disappear for a particular .jspx file after I remove the <stripes:errors /> line of that file. At the same time, the syntax errors only appeared after I did recent fresh install of Eclipse at work, but then an update of Eclipse at home shortly therafter. I'd like to see the output to determine whose problem this should be (WTP, Stripes, or maybe just me :).
Remember that this issue is somewhat cosmetic, as it doesn't affect anything functionally. It simply spams my Problems tab in Eclipse and shows the little red X icons in the project explorer.
Right now you'd have to add the separate automated tests download to do this, and only in the 3.1 branch, but it enables a "Show Translation" command through Ctrl+Shift+9. Beware that the translation generated isn't 100% the same as the server would create at runtime--it's not intended to be executed. Also, the most recent 3.0.3 builds contain fixes to the translator that should clear up these kinds of problems (NESTED variables + self-closing tags). 3.0.3 is due in November and should update cleanly into Ganymede SR1.
I've seen the eclipse JSP editor get really confused over almost nothing. You said the problem goes away if you remove the tag. Does it come back if you put the tag back? I know that Eclipse 3.3 sometimes had some issues with JSP files where opening them, and forcing a save would clear the file of error messages (I haven't tried 3.4 yet). Maybe that's what's happening to you. Other than that, do you have all the proper includes / xml namespaces defined in the files?
I'm having exactly same problem with JSP and <stripes:errors/> tag in Ganymede. With Europa, there were no errors. Now it displays a couple of weird syntax errors on the problems pane. But as Silvaran stated it's just cosmetic, since the project builds correctly and works. It's still annoying though.