2011-09-14 17:41:56 +02:00
|
|
|
#ifndef completion_hh_INCLUDED
|
|
|
|
#define completion_hh_INCLUDED
|
|
|
|
|
|
|
|
#include <vector>
|
2011-10-11 00:38:58 +02:00
|
|
|
#include <functional>
|
2011-09-14 17:41:56 +02:00
|
|
|
|
2012-04-14 03:17:09 +02:00
|
|
|
#include "string.hh"
|
|
|
|
|
2011-09-14 17:41:56 +02:00
|
|
|
namespace Kakoune
|
|
|
|
{
|
|
|
|
|
2013-02-18 14:00:43 +01:00
|
|
|
struct Context;
|
2012-08-06 21:37:43 +02:00
|
|
|
|
2012-04-14 03:17:09 +02:00
|
|
|
typedef std::vector<String> CandidateList;
|
2011-09-14 17:41:56 +02:00
|
|
|
|
|
|
|
struct Completions
|
|
|
|
{
|
|
|
|
CandidateList candidates;
|
2012-10-11 00:41:48 +02:00
|
|
|
ByteCount start;
|
|
|
|
ByteCount end;
|
2011-09-14 17:41:56 +02:00
|
|
|
|
2011-09-14 21:15:09 +02:00
|
|
|
Completions()
|
|
|
|
: start(0), end(0) {}
|
|
|
|
|
2012-10-11 00:41:48 +02:00
|
|
|
Completions(ByteCount start, ByteCount end)
|
2011-09-14 17:41:56 +02:00
|
|
|
: start(start), end(end) {}
|
|
|
|
};
|
|
|
|
|
2012-08-06 21:37:43 +02:00
|
|
|
typedef std::function<Completions (const Context&,
|
2012-10-11 00:41:48 +02:00
|
|
|
const String&, ByteCount)> Completer;
|
2011-10-11 00:38:58 +02:00
|
|
|
|
2012-08-06 21:37:43 +02:00
|
|
|
inline Completions complete_nothing(const Context& context,
|
2012-10-11 00:41:48 +02:00
|
|
|
const String&, ByteCount cursor_pos)
|
2011-10-11 00:38:58 +02:00
|
|
|
{
|
2011-11-10 21:57:25 +01:00
|
|
|
return Completions(cursor_pos, cursor_pos);
|
|
|
|
}
|
2011-10-11 00:38:58 +02:00
|
|
|
|
2011-09-14 17:41:56 +02:00
|
|
|
}
|
|
|
|
#endif // completion_hh_INCLUDED
|