-
Notifications
You must be signed in to change notification settings - Fork 52
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
Asynchronous requests to Tern Server (Issue #171) #232
Conversation
Additional changes: - refactoring of completion proposals collection - introduced a record object to hold all information relevant to a completion item - refactoring of collectors API - collection algorithms have been moved out of *TernServer classes and placed in singletons Genuitec bugs: 21189, 27330, 27532, 27560, 27606, 27639, 27747, 27900
@angelozerr the code is not yet tested as I stumbled upon some troubles with launching eclipse with Tern. Really weird. Anyway, I wanted you to have a look at number of changes done, so that we can already talk about them and test a bit later. Most of the code related to synchronization has been copied from MyEclipse and that code was tested well. Collectors API refactoring is a new thing, not yet tested. I've made that change, as I don't like methods args to be so unstable, especially when we patch them a bit ;) I hope that you like it! I am sure it will work well for you as well, when adding new collectors. |
Thanks @piotrtomiak ! Wow it's a big PR! I will integrate it for 0.9.0. I have few questions :
|
@piotrtomiak do you know if there will have compilation problem with AngularJS Eclipse? |
Mostly because I had to have a clear code for asynchronous collectors support. That support had to be done in a single method, not replicated in several request methods. Also, I felt that with so many collectors, making a separate request method for each of them wasn't elegant and resulted in a very unstable API. And it looks like you are going to add more collectors in a future ;)
We can sure add such a functionality, though I don't see much point in it. It's like giving a user ability to freeze IDE for several seconds ;) Anyway, it shouldn't be a big deal to add it, so let me know if you want it.
Yes, there are compilation problems with AngularJS and I have a commit to push as PR. I haven't pushed it yet, since this one is not done. |
@piotrtomiak many thanks for your answer!
If you can do it, it should be very cool. By default this preference can be setted to asynch. If there are some bugs with asynch completion (even if I trust you in 100%), user could unactivate this feature by waiting a fix.
Could you create a PR please. I have tested AngularJS with your asynch compeltion by using your github and it seems that it works (I have tested quickly). |
Ok. I now have to take care of urgent stuff in MyEclipse, so I guess I will be able to finish on Friday along with some testing.
Well, I am surprised that it actually works. I have not been able to run it in eclipse yet (problems with launching), so this code is totally not tested and should have some bugs in it. I'll create the PR today. What I am concerned about is that HTML file is being removed from the server when you switch from HTML editor to other editor or view. That's cool, so that you don't get completion proposals in JS files from HTML files you've opened, however it may interfere with AngularJS, for which I am do not know how model is built. This thing is totally optional and can be commented out. |
@piotrtomiak I would like to move the whole tern plugins in a project, so I must change some code. What do you prefer?
|
Sounds like in this case accepting this PR would be better. I don't want to move so much of the code around ;) I will create PR for Angular immediatley |
I understand :) As it's a big PR, are you OK to help me to fix problem if they have a problem and improve angular? |
Definitely yes :) And of course, if there is any bug resulting from this contribution I will fix it. I will be able to get into this again on Friday. |
All right, it looks like everything works as it should be. Once you merge the PR, I will integrate this code with MyEclipse and we will perform tests in MyEclipse. If we find out any problems related to this contribution we will provide you with the fixes. I will now add that preference for synchronous content assist invocation. |
@angelozerr as I think of it now... Where would you put such a preference? It is common to all servers and all request types, that is, if you have AngularJS requests, if collector implements appropriate interface it can also run asynch. So the only location I can think of is the "Tern" main page. Would you agree? |
Yes I think it's the best place. I would liek to tell you 2 things :
|
Yes, I saw your JavaEditorTracker. If you feel it's ok, you can later on integrate it with mine; I wouldn't feel sure enough to do it myself, though I can do it of course if you want. The other way is not possible as through our tests it turned out that the listener has to be installed only if workbench is initialized and there are already windows, otherwise a workbench window might appear too fast.
Right! This is something I kept forgetting about adding to ME code. I'll add it. |
Ok @piotrtomiak thanks for your answer. Tell me when I can accept this PR. |
@angelozerr I have added the changes you wanted. As for me, you can merge it :D |
Asynchronous requests to Tern Server (Issue #171)
We will see if users (and me) will find problems. Anyway Thanks @piotrtomiak for your great PR! |
You're welcome :) MyEclipse QA team will start testing this on Monday or Tuesday, so we will have more input. I don't expect any issues though :) Thanks! |
Cool! For your information, I will try to integrate ESLint #234 I will see if we could merge our tracker. |
This pull request covers following improvements: