[gnome-builder/wip/chergert/perspective] jedi: merge preference into code insight page
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/chergert/perspective] jedi: merge preference into code insight page
- Date: Sat, 7 Nov 2015 20:10:16 +0000 (UTC)
commit e87952df2075230f534326669ebaa9e327331e55
Author: Christian Hergert <chergert redhat com>
Date: Sat Nov 7 12:09:53 2015 -0800
jedi: merge preference into code insight page
plugins/jedi/jedi_plugin.py | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/plugins/jedi/jedi_plugin.py b/plugins/jedi/jedi_plugin.py
index b71d7a2..e0d8594 100644
--- a/plugins/jedi/jedi_plugin.py
+++ b/plugins/jedi/jedi_plugin.py
@@ -27,6 +27,8 @@ gi.require_version('Gtk', '3.0')
gi.require_version('GtkSource', '3.0')
gi.require_version('Ide', '1.0')
+from gettext import gettext as _
+
from gi.importer import DynamicImporter
from gi.module import IntrospectionModule
from gi.module import FunctionInfo
@@ -517,3 +519,17 @@ def JediSnippet(proposal):
snippet.add_chunk(Ide.SourceSnippetChunk(text=')', text_set=True))
return snippet
+
+
+class JediPreferences(GObject.Object, Ide.PreferencesAddin):
+ def do_load(self, prefs):
+ self.completion_id = prefs.add_switch(
+ 'code-insight', 'completion',
+ 'org.gnome.builder.extension-type', 'enabled', '/',
+ None,
+ _("Suggest Python completions"),
+ _("Use Jedi to provide completions for the Python language"),
+ None, 30)
+
+ def do_unload(self, prefs):
+ self.prefs.remove(self.completion_id)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]