You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if applying a Java snippet imports all the classes that it references without requiring the user to organize imports.
Angelo discussed one method of doing this here: #338 (comment).
The idea is that once we implement handling cursor context, we could get the location of the end of the import list in the same request. Then, we could add an additional text edit in the language server that adds the necessary class import(s) to the Java file.
One limitation of this approach is that it doesn't handle the case where the classes are already imported. Also, the imports will not be ordered alphabetically. However, there might be ways to overcome some of these limitations.
The text was updated successfully, but these errors were encountered:
If you are interested in working on this issue, go right ahead! Just as a fair warning, it might get complex. Feel free to ask questions, I will do my best to answer. I also have a work in progress branch for this that I can share. I'll link to it when I finish rebasing it. never mind, it didn't contain anything useful
It would be nice if applying a Java snippet imports all the classes that it references without requiring the user to organize imports.
Angelo discussed one method of doing this here: #338 (comment).
The idea is that once we implement handling cursor context, we could get the location of the end of the import list in the same request. Then, we could add an additional text edit in the language server that adds the necessary class import(s) to the Java file.
One limitation of this approach is that it doesn't handle the case where the classes are already imported. Also, the imports will not be ordered alphabetically. However, there might be ways to overcome some of these limitations.
The text was updated successfully, but these errors were encountered: