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

Chaning the logic of how server-functions are called #9

Closed hassec closed 9 years ago

hassec commented 9 years ago

As was already discussed in #6 the current method of getting a server handle
cli = http_client.YcmdClient(...)
should be changed. I would suggest that these functions be directly called via the LOCAL_SERVER instance. This would only require assigning a ycmd handle with the server location etc. from the settings to LOCAL_SERVER in the case that the server is not started automatically. If it is started automatically it's set anyway.
This would render alot of calls to read_settings() obsolete.

LuckyGeck commented 9 years ago

Some improvements have been committed to master. See get_client function.

hassec commented 9 years ago

What do you think about getting rid of the whole get client logic and instead initializing a global variable SERVER with an instance of http_client.YcmdClient(...) ? This way we could just call all server functions with SERVER.function() and would not read the settings and create a new client instance everytime we need to call a server function.