function mgr:on_python_completion(doc, status, helper)
	-- Python 自动补全
	-- 0 popup
	-- 1 commit	with enter
	-- 2 typing
	-- 3 dismiss completion list
	-- 4 dismiss completion tip
	-- 5 item selected
	-- 6 commit with tab
	-- 0x1001 LSP update list
	-- print("python complete ", status);
	-- 得到当前行
	local text = doc.get_text(doc.cursor_line, 0, doc.cursor_column) or "";
	-- 取得最后一部分
	text = text:match("([._%w]+)$") or "";
	if status ~= 0 and (text == nil or text == "") then
		helper.cancel_completion();
		lsp:cleanup_completion(doc);
		return 0;
	end ;

	if status == 1 then
		lsp:commit_completion(doc, helper, 0);
		return 1;
	end;

	if status == 6 then
		lsp:commit_completion(doc, helper, 1);
		return 1;
	end;

	if status == 5 then
		lsp:update_completion_tip(doc, helper);
		return 1;
	end;

	if status == 0 then
		lsp:do_completion(doc, helper);
		return 1;
	end;
	
	if status == 2 or status == 0x1001 then
		text = text:match("([_%w]+)$") or "";
		helper.select_item(text);
		helper.redraw();
		return 1;
	end;

	return 0;
end;
