Skip to content
Browse files

Las changes before refactor python autocomplete plugin

  • Loading branch information...
1 parent ff2e52a commit 6b7990d22a5094caa84562fd5ed098ba31238ad0 @goinnn committed
View
2 kate_plugins/kate_plugins.py
@@ -2,7 +2,7 @@
from jste_plugins.jquery_plugins import *
from jste_plugins.json_plugins import *
-from pyte_plugins.autocomplete import *
+from pyte_plugins.autocomplete.autocomplete import *
from pyte_plugins.djte_plugins.class_plugins import *
from pyte_plugins.djte_plugins.text_plugins import *
from pyte_plugins.text_plugins import *
View
20 kate_plugins/pyte_plugins/autocomplete/autocomplete.py
@@ -95,6 +95,14 @@ def executeCompletionItem(self, doc, word, row):
return
return super(PythonCodeCompletionModel, self).executeCompletionItem(doc, word, row)
+ def parse_line(self, line):
+ line = super(PythonCodeCompletionModel, self).parse_line(line)
+ if "'" in line or '"' in line:
+ return line
+ if ";" in line:
+ return self.parse_line(line.split(";")[-1])
+ return line
+
def autoCompleteImport(self, view, word, line):
mfb = from_first_module.match(line) or import_complete.match(line)
if mfb:
@@ -137,14 +145,6 @@ def autoCompleteInThisFile(self, view, word, line):
text = self._parse_text(view, word, line)
return self.getTextInfo(text, self.resultList)
- def parse_line(self, line):
- line = super(PythonCodeCompletionModel, self).parse_line(line)
- if "'" in line or '"' in line:
- return line
- if ";" in line:
- return self.parse_line(line.split(";")[-1])
- return line
-
def _parse_text(self, view, word, line):
doc = view.document()
text_list = unicode(doc.text()).split("\n")
@@ -265,7 +265,7 @@ def getPythonPath(cls):
return python_path
python_path = sys.path
try:
- from pyte_plugins import autocomplete_path
+ from pyte_plugins.autocomplete import autocomplete_path
doc = kate.activeDocument()
view = doc.activeView()
python_path = autocomplete_path.path(doc, view) + python_path
@@ -375,7 +375,7 @@ def createSignalAutocompleteDocument(view, *args, **kwargs):
#http://code.google.com/p/lilykde/source/browse/trunk/frescobaldi/python/frescobaldi_app/mainapp.py#1391
#http://api.kde.org/4.0-api/kdelibs-apidocs/kate/html/katecompletionmodel_8cpp_source.html
#https://svn.reviewboard.kde.org/r/1640/diff/?expand=1
- PythonCodeCompletionModel.getPythonPath()
+ PythonCodeCompletionModel.getTopLevelModules()
cci = view.codeCompletionInterface()
cci.registerCompletionModel(codecompletationmodel)
View
0 kate_plugins/pyte_plugins/autocomplete/pyplete.py
No changes.

0 comments on commit 6b7990d

Please sign in to comment.
Something went wrong with that request. Please try again.