Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Java Content Assist automatically inserts nonsens(Content Assist inserts totally unrelated text automatically)
Java Content Assist automatically inserts nonsens [message #1748468] Wed, 23 November 2016 12:08 Go to next message
Rene Dekker is currently offline Rene DekkerFriend
Messages: 9
Registered: July 2009
Junior Member
I like content assist, as a quick way to help me remember method/variable names, etc. But when using the content assist of Eclipse, it frequently inserts garbage when pressing space or '.'. For example, when typing 'i' followed by space, it automatically inserts 'isCorridor' (a method of my class), even though a local variable 'i' is also defined. I have tried different settings for Content Assist, but they do not seem to do anything, or switch off content assist altogether.

How do I prevent this behaviour?

I would like the content assist popup to come up, but it only to insert anything when I press TAB (or RETURN), and then only the common prefix of all suggestions. That, together with the option to select a specific suggestion from the list would work satisfactory.

Ideally, the common prefix of all the suggestions would be inserted already (in a different color) in the text, such that you type over it, and it would be accepted when pressing TAB.

If it makes a difference, I am using Eclipse 2.0.1 for Java on MacOS.

Re: Java Content Assist automatically inserts nonsens [message #1748503 is a reply to message #1748468] Wed, 23 November 2016 16:48 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hello Rene,

Eclipse 2.0.1? really?
The latest version is 4.6.1, so if it is really the correct version a lot of things might have changed since that time (several years ago)

Another possible cause is simply that the variable is not visible in the scope you are trying to use it. Can you double-check that the variable you are trying to use is in the correct scope?

Regards,


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: Java Content Assist automatically inserts nonsens [message #1748579 is a reply to message #1748503] Thu, 24 November 2016 17:13 Go to previous messageGo to next message
Rene Dekker is currently offline Rene DekkerFriend
Messages: 9
Registered: July 2009
Junior Member
Thanks for your answer, Aurelien.
I'm running an update now, but it tells me that the latest version available for the Eclipse Java IDE is 2.0.2. How do I install the newer version?

The variable is in scope, and it is in the list of options, but at the bottom. But that is actually not the main point: I want to avoid the automatic insertion of a suggestion when typing space. Is there a way to switch that off?
Re: Java Content Assist automatically inserts nonsens [message #1748591 is a reply to message #1748468] Thu, 24 November 2016 23:02 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Your version is too old to have an automatic update to the latest one.
You need to download a newer one from http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/neon1a Depending on your OS, you need to choose the correct lin at the right.
To Install the, just unzip and launch the executable.

For the space issue, it doesn't work like that with newer version, you should not have this issue.

regards,


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: Java Content Assist automatically inserts nonsens [message #1748658 is a reply to message #1748591] Fri, 25 November 2016 18:49 Go to previous messageGo to next message
Rene Dekker is currently offline Rene DekkerFriend
Messages: 9
Registered: July 2009
Junior Member
I have now installed the latest Eclipse (Neon.1a Release (4.6.1)), and that seems to run fine. However, I still have the same issue with content assist: pressing space still inserts a content assist suggestion. Do I need to change some settings to prevent that?

Thanks,
René
Re: Java Content Assist automatically inserts nonsens [message #1748749 is a reply to message #1748658] Mon, 28 November 2016 10:21 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hello René,

Do you have a single proposal in your case?
If yes, there is an option "Insert single proposals automatically" that you can deactivate in Windows->Preferences then Java -> Editor ->Content Assist

You can also choose to enable/disable or change time before auto-activation of the completion on the same page.

I hope that you will be able to configure as you wish from these preferences.

regards,


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: Java Content Assist automatically inserts nonsens [message #1748976 is a reply to message #1748749] Wed, 30 November 2016 16:22 Go to previous message
Rene Dekker is currently offline Rene DekkerFriend
Messages: 9
Registered: July 2009
Junior Member
It's not a single proposal in most cases, and the option you mention was already switched off.
And if I switch off auto-activation, then the proposals don't come up at all. I would like to still see the proposals automatically, and be able to choose one with arrow keys and RETURN / TAB. I would just like to get rid of the auto-insertion when I press SPACE or '.'.
But I guess I will have to live with that?
Previous Topic:org.eclipse.jdt.launching error
Next Topic:Package or folder icon?
Goto Forum:
  


Current Time: Thu Apr 25 00:19:15 GMT 2024

Powered by FUDForum. Page generated in 0.03534 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top