LuckyGeck / YcmdCompletion

Sublime Text 3 plugin for C++ code completion and error highlighting, based on Ycmd server
MIT License
41 stars 17 forks source link

Handling UnknownExtraConf error correctly #8

Open hassec opened 9 years ago

hassec commented 9 years ago

Right now the file .ycm_extra_conf.py needs to be specified in the server configuration file or the location needs to be whitelisted for the ycmd-server to load it.
The Server automatically searches recursivly for these conf-files and responds with an http-error 500 of type UnknownExtraConf which includes the path of the first file found.
I think we should include a popup to ask the user if the file should be loaded.

In Addition one could maybe include a command to (re)load a conf-file that lies in the current project folder to partly solve #2.

LuckyGeck commented 9 years ago

Yeh, this idea is cool. But i don't understand, when we will get this type of notification. Maybe there is any documentation on this particular call?

hassec commented 9 years ago

the whole UnkownExtraConf was discussed here abingham/emacs-ycmd#19. But somethingelse you could try is to play with the example client that comes with ycmd. If you comment out the Load_Extra_Conf command watch the response the server sends.
So to do this we would need to add an errorhandler to the urlopen command and catch http errors. If it's an error 500 and has the type UnkownExtraConf we promt the user and ask if file should be loaded. For every other error we just procced as usual and notify via statusbar.

Hope this helps. If not feel free to ask again :)

hassec commented 9 years ago

Did you have a chance to look into this yet? If so what are your thoughts on how you would go about implementing this?

LuckyGeck commented 9 years ago

Sorry, I had no time to look through this yet. I suppose, that I'll have some free time at the end of this week.

hassec commented 9 years ago

Alright no Problem, I haven't had a lot of time either but I'm hoping that I might have time to try out a few things this weekend.