QScintilla/Editor.py

changeset 5987
6e33e83b215d
parent 5969
584c21b6587a
child 6004
548a9ba8c970
child 6025
9dfb5a421a56
equal deleted inserted replaced
5986:1e78a1aa438b 5987:6e33e83b215d
4576 4576
4577 ################################################################# 4577 #################################################################
4578 ## auto-completion hook interfaces 4578 ## auto-completion hook interfaces
4579 ################################################################# 4579 #################################################################
4580 4580
4581 # TODO: document this hook in chapter 6.2 of plug-in document
4582 def addCompletionListHook(self, key, func, async=False): 4581 def addCompletionListHook(self, key, func, async=False):
4583 """ 4582 """
4584 Public method to set an auto-completion list provider. 4583 Public method to set an auto-completion list provider.
4585 4584
4586 @param key name of the provider 4585 @param key name of the provider
4615 if async: 4614 if async:
4616 self.__completionListAsyncHookFunctions[key] = func 4615 self.__completionListAsyncHookFunctions[key] = func
4617 else: 4616 else:
4618 self.__completionListHookFunctions[key] = func 4617 self.__completionListHookFunctions[key] = func
4619 4618
4620 # TODO: document this hook in chapter 6.2 of plug-in document
4621 def removeCompletionListHook(self, key): 4619 def removeCompletionListHook(self, key):
4622 """ 4620 """
4623 Public method to remove a previously registered completion list 4621 Public method to remove a previously registered completion list
4624 provider. 4622 provider.
4625 4623
4636 self.SCN_CHARADDED.disconnect(self.__charAdded) 4634 self.SCN_CHARADDED.disconnect(self.__charAdded)
4637 if self.autoCompletionThreshold() == 0: 4635 if self.autoCompletionThreshold() == 0:
4638 self.setAutoCompletionThreshold( 4636 self.setAutoCompletionThreshold(
4639 Preferences.getEditor("AutoCompletionThreshold")) 4637 Preferences.getEditor("AutoCompletionThreshold"))
4640 4638
4641 # TODO: document this hook in chapter 6.2 of plug-in document
4642 def getCompletionListHook(self, key): 4639 def getCompletionListHook(self, key):
4643 """ 4640 """
4644 Public method to get the registered completion list provider. 4641 Public method to get the registered completion list provider.
4645 4642
4646 @param key name of the provider 4643 @param key name of the provider
4719 self.completionsListReady(completions, self.__acText) 4716 self.completionsListReady(completions, self.__acText)
4720 4717
4721 if Preferences.getEditor("AutoCompletionScintillaOnFail"): 4718 if Preferences.getEditor("AutoCompletionScintillaOnFail"):
4722 self.__acWatchdog.start() 4719 self.__acWatchdog.start()
4723 4720
4724 # TODO: document this hook in chapter 6.2 of plug-in document
4725 def completionsListReady(self, completions, acText): 4721 def completionsListReady(self, completions, acText):
4726 """ 4722 """
4727 Public method to show the completions determined by a completions 4723 Public method to show the completions determined by a completions
4728 provider. 4724 provider.
4729 4725
4839 4835
4840 ################################################################# 4836 #################################################################
4841 ## call-tip hook interfaces 4837 ## call-tip hook interfaces
4842 ################################################################# 4838 #################################################################
4843 4839
4844 # TODO: document this hook in chapter 6.2 of plug-in document
4845 def addCallTipHook(self, key, func): 4840 def addCallTipHook(self, key, func):
4846 """ 4841 """
4847 Public method to set a calltip provider. 4842 Public method to set a calltip provider.
4848 4843
4849 @param key name of the provider 4844 @param key name of the provider
4865 .format(key)) 4860 .format(key))
4866 return 4861 return
4867 4862
4868 self.__ctHookFunctions[key] = func 4863 self.__ctHookFunctions[key] = func
4869 4864
4870 # TODO: document this hook in chapter 6.2 of plug-in document
4871 def removeCallTipHook(self, key): 4865 def removeCallTipHook(self, key):
4872 """ 4866 """
4873 Public method to remove a previously registered calltip provider. 4867 Public method to remove a previously registered calltip provider.
4874 4868
4875 @param key name of the provider 4869 @param key name of the provider
4876 @type str 4870 @type str
4877 """ 4871 """
4878 if key in self.__ctHookFunctions: 4872 if key in self.__ctHookFunctions:
4879 del self.__ctHookFunctions[key] 4873 del self.__ctHookFunctions[key]
4880 4874
4881 # TODO: document this hook in chapter 6.2 of plug-in document
4882 def getCallTipHook(self, key): 4875 def getCallTipHook(self, key):
4883 """ 4876 """
4884 Public method to get the registered calltip provider. 4877 Public method to get the registered calltip provider.
4885 4878
4886 @param key name of the provider 4879 @param key name of the provider

eric ide

mercurial