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

autocomplete didn't show all public method when coding Java swing #1072

Closed
ymyh opened this issue Sep 22, 2019 · 8 comments
Closed

autocomplete didn't show all public method when coding Java swing #1072

ymyh opened this issue Sep 22, 2019 · 8 comments

Comments

@ymyh
Copy link

ymyh commented Sep 22, 2019

[provide a description of the issue]

Environment
  • Operating System: win10 1909
  • JDK version: 1.8
  • Visual Studio Code version: 1.38.1
  • Java extension version: latest

didn't show more item inside awt.
image

didn't show actionListener even I import java.awt.event.* manually.
image

didn't show the method add(). But if I write it down manually and hover the mouse on it, vscode shows me details as usual.
image

Expected Result

show all public method

Additional Informations

Working well few days ago, it seems didn't work suddenly.

@fbricon
Copy link
Collaborator

fbricon commented Sep 22, 2019

This is due to java.awt.* packages now being excluded from autocompletion/import by default (See #710).
Simply remove java.awt.* from the list of excluded packages in java.completion.filteredTypes in your settings.json.

@ymyh ymyh closed this as completed Sep 22, 2019
@xendren
Copy link

xendren commented Jan 15, 2020

I am having the same problem with javax.swing.* components. I have checked my settings file, and there aren't any "java.completion.filteredTypes" entries in my settings files. I do not see the default value of "java.awt.*" as indicated in the last post.

@ymyh
Copy link
Author

ymyh commented Jan 15, 2020

I am having the same problem with javax.swing.* components. I have checked my settings file, and there aren't any "java.completion.filteredTypes" entries in my settings files. I do not see the default value of "java.awt.*" as indicated in the last post.

You should type "java.completion" first, then you will see it.

@xendren
Copy link

xendren commented Jan 15, 2020

Interesting. So the setting will not show unless you add it first? That's odd behavior. Once I add it, it defaults only the "java.awt." and "com.sun." classes. Neither of those entries should be filtering the javax.swing.* class methods. If I import "javax.swing.JTextField", for instance, create a new instance and type "myField.setName", the method does not show in code completion box. It seems most of the setters and getters are missing.

@ymyh
Copy link
Author

ymyh commented Jan 15, 2020

Interesting. So the setting will not show unless you add it first? That's odd behavior. Once I add it, it defaults only the "java.awt." and "com.sun." classes. Neither of those entries should be filtering the javax.swing.* class methods. If I import "javax.swing.JTextField", for instance, create a new instance and type "myField.setName", the method does not show in code completion box. It seems most of the setters and getters are missing.

well... I don't know this time.

@omokolataiwo
Copy link

Interesting. So the setting will not show unless you add it first? That's odd behavior. Once I add it, it defaults only the "java.awt." and "com.sun." classes. Neither of those entries should be filtering the javax.swing.* class methods. If I import "javax.swing.JTextField", for instance, create a new instance and type "myField.setName", the method does not show in code completion box. It seems most of the setters and getters are missing.

You also need to increase the value of Java>Completion:Max Results. It is defaulted to 50 for performance reasons.

@MuhammadimYusoff
Copy link

This is due to java.awt.* packages now being excluded from autocompletion/import by default (See #710).
Simply remove java.awt.* from the list of excluded packages in java.completion.filteredTypes in your settings.json.

I cant understand this because I have issues with the 'javax.swing.*' and GUI related Libraries.
Can someone explain this step-by-step on how to do this?
Maybe some screenshot?

@Marian-Tataru
Copy link

Since the file settings.json is read-only puroposes , to remove the package java.awt.* from the java.completion.filteredTypes you have to do the following : 1) press ctrl + shift + P 2) write : open user settings 3) ctrl +f and search for java.completion.filteredTypes . Then you can edit json and exclude java.awt.* .

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

6 participants