Merge pull request #148 from atilaneves/issue138

Fix issue #138: Make sure that RequestKind.addImport carries on analysin...
This commit is contained in:
Brian Schott 2014-08-03 22:18:17 +00:00
commit acbe6e26aa
2 changed files with 3 additions and 1 deletions

View File

@ -225,6 +225,8 @@ AutocompleteResponse getResponse(TcpSocket socket)
auto bytesReceived = socket.receive(buffer); auto bytesReceived = socket.receive(buffer);
if (bytesReceived == Socket.ERROR) if (bytesReceived == Socket.ERROR)
throw new Exception("Incorrect number of bytes received"); throw new Exception("Incorrect number of bytes received");
if (bytesReceived == 0)
throw new Exception("Server closed the connection, 0 bytes received");
AutocompleteResponse response; AutocompleteResponse response;
msgpack.unpack(buffer[0..bytesReceived], response); msgpack.unpack(buffer[0..bytesReceived], response);
return response; return response;

View File

@ -157,7 +157,7 @@ int main(string[] args)
} }
if (request.kind & RequestKind.addImport) if (request.kind & RequestKind.addImport)
ModuleCache.addImportPaths(request.importPaths); ModuleCache.addImportPaths(request.importPaths);
else if (request.kind & RequestKind.autocomplete) if (request.kind & RequestKind.autocomplete)
{ {
Log.info("Getting completions"); Log.info("Getting completions");
AutocompleteResponse response = complete(request); AutocompleteResponse response = complete(request);