Anonymous committed 2264bec

Cleanup NeoVimConnector a bit

- Add some comments
- Removed FIXME for neovimObject(), not needed anymore
- methods setError() and parseParameterTypes() are now protected

  • Participants
  • Parent commits fa424e4

Comments (0)

Files changed (2)

File src/neovimconnector.cpp

 	return res;
+ * Call function 0 to request metadata from NeoVim
+ */
 void NeoVimConnector::discoverMetadata()
 	NeoVimRequest *r = startRequestUnchecked(0, 0);
 NeoVim* NeoVimConnector::neovimObject()
-	// FIXME: return NULL if we have not check the metadata
 	if ( !m_neovimobj ) {
 		m_neovimobj = new NeoVim(this);

File src/neovimconnector.h

 namespace NeoVimQt {
+ * NeoVimRequest objects track RPC calls
+ * to Neovim
+ */
 class NeoVimRequest: public QObject {
 	NeoVimConnector(QIODevice* s);
-	QList<QByteArray> parseParameterTypes(const msgpack_object&);
 	NeoVimError error();
 	QString errorString();
 	Position to_Position(const msgpack_object&, bool *failed=NULL);
 	Object to_Object(const msgpack_object& msg, bool *failed=NULL);
-	// These are all to_Integer
+	// These are all the same as to_Integer
 	Integer to_Integer(const msgpack_object&, bool *failed=NULL);
 	Buffer to_Buffer(const msgpack_object&, bool *failed=NULL);
 	Window to_Window(const msgpack_object&, bool *failed=NULL);
 	BufferArray to_BufferArray(const msgpack_object& msg, bool *failed=NULL);
 	TabpageArray to_TabpageArray(const msgpack_object& msg, bool *failed=NULL);
-	//static QVariant toVariant(const msgpack_object&);
 	NeoVim* neovimObject();
 	void error(NeoVimError);
+	void setError(NeoVimError err, const QString& msg);
+	// Message handlers
 	void dispatch(msgpack_object& obj);
 	void dispatchRequest(msgpack_object& obj);
 	void dispatchResponse(msgpack_object& obj);
 	void dispatchNotification(msgpack_object& obj);
 	void sendError(const msgpack_object& req, const QString& msg);
+	// Function table
 	void addFunction(const msgpack_object& ftable);
 	void addFunctions(const msgpack_object& ftable);
 	void addClasses(const msgpack_object& ftable);
-	void setError(NeoVimError err, const QString& msg);
+	QList<QByteArray> parseParameterTypes(const msgpack_object&);
 protected slots:
 	void discoverMetadata();