syntax: Fix python syntax by adding a basic provider

This commit is contained in:
Andy Williams 2017-09-07 21:00:31 +01:00
parent d259a776a9
commit 7bb4a7cc24
2 changed files with 50 additions and 0 deletions

View File

@ -9,6 +9,7 @@
#include "edi_private.h"
#include "edi_language_provider_c.c"
#include "edi_language_provider_python.c"
#include "edi_language_provider_rust.c"
static Edi_Language_Provider _edi_language_provider_registry[] =
@ -18,6 +19,11 @@ static Edi_Language_Provider _edi_language_provider_registry[] =
_edi_language_c_mime_name, _edi_language_c_snippet_get,
_edi_language_c_lookup, _edi_language_c_lookup_doc
},
{
"python", _edi_language_python_add, _edi_language_python_refresh, _edi_language_python_del,
_edi_language_python_mime_name, _edi_language_python_snippet_get,
NULL, NULL
},
{
"rust", _edi_language_rust_add, _edi_language_rust_refresh, _edi_language_rust_del,
_edi_language_rust_mime_name, _edi_language_rust_snippet_get,
@ -47,6 +53,8 @@ Edi_Language_Provider *edi_language_provider_for_mime_get(const char *mime)
id = "c";
if (!strcasecmp(mime, "text/rust"))
id = "rust";
if (!strcasecmp(mime, "text/x-python"))
id = "python";
if (!id)
return NULL;

View File

@ -0,0 +1,42 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <Eina.h>
#include "edi_language_provider.h"
#include "edi_config.h"
#include "edi_private.h"
void
_edi_language_python_add(Edi_Editor *editor EINA_UNUSED)
{
}
void
_edi_language_python_refresh(Edi_Editor *editor EINA_UNUSED)
{
}
void
_edi_language_python_del(Edi_Editor *editor EINA_UNUSED)
{
}
const char *
_edi_language_python_mime_name(const char *mime)
{
if (!strcasecmp(mime, "text/x-python"))
return "Python source";
return NULL;
}
const char *
_edi_language_python_snippet_get(const char *key EINA_UNUSED)
{
return NULL;
}