QScintilla/Editor.py

changeset 4133
3d868439dddc
parent 4074
95c24977f68f
child 4142
7e138a214147
child 4171
97591cba48c0
equal deleted inserted replaced
4132:04f395eef728 4133:3d868439dddc
1559 # now set the lexer properties 1559 # now set the lexer properties
1560 self.lexer_.initProperties() 1560 self.lexer_.initProperties()
1561 1561
1562 # initialize the lexer APIs settings 1562 # initialize the lexer APIs settings
1563 api = self.vm.getAPIsManager().getAPIs(self.apiLanguage) 1563 api = self.vm.getAPIsManager().getAPIs(self.apiLanguage)
1564 if api is not None: 1564 if api is not None and not api.isEmpty():
1565 self.lexer_.setAPIs(api.getQsciAPIs()) 1565 self.lexer_.setAPIs(api.getQsciAPIs())
1566 self.acAPI = True 1566 self.acAPI = True
1567 else: 1567 else:
1568 self.acAPI = False 1568 self.acAPI = False
1569 self.autoCompletionAPIsAvailable.emit(self.acAPI) 1569 self.autoCompletionAPIsAvailable.emit(self.acAPI)
4625 4625
4626 @return function set by setCallTipHook() 4626 @return function set by setCallTipHook()
4627 """ 4627 """
4628 return self.__ctHookFunction 4628 return self.__ctHookFunction
4629 4629
4630 def canProvideCallTipps(self):
4631 """
4632 Public method to test the calltips availability.
4633
4634 @return flag indicating the availability of calltips (boolean)
4635 """
4636 return self.acAPI or self.__ctHookFunction is not None
4637
4638 def canProvideDynamicAutoCompletion(self):
4639 """
4640 Public method to test the dynamic auto-completion availability.
4641
4642 @return flag indicating the availability of dynamic auto-completion
4643 (boolean)
4644 """
4645 return self.acAPI or self.__acHookFunction is not None
4646
4630 ################################################################# 4647 #################################################################
4631 ## Methods needed by the context menu 4648 ## Methods needed by the context menu
4632 ################################################################# 4649 #################################################################
4633 4650
4634 def __marginNumber(self, xPos): 4651 def __marginNumber(self, xPos):
4747 def __showContextMenuAutocompletion(self): 4764 def __showContextMenuAutocompletion(self):
4748 """ 4765 """
4749 Private slot called before the autocompletion menu is shown. 4766 Private slot called before the autocompletion menu is shown.
4750 """ 4767 """
4751 self.menuActs["acDynamic"].setEnabled( 4768 self.menuActs["acDynamic"].setEnabled(
4752 self.acAPI or self.__acHookFunction is not None) 4769 self.canProvideDynamicAutoCompletion())
4753 self.menuActs["acAPI"].setEnabled(self.acAPI) 4770 self.menuActs["acAPI"].setEnabled(self.acAPI)
4754 self.menuActs["acAPIDocument"].setEnabled(self.acAPI) 4771 self.menuActs["acAPIDocument"].setEnabled(self.acAPI)
4755 self.menuActs["calltip"].setEnabled(self.acAPI) 4772 self.menuActs["calltip"].setEnabled(self.canProvideCallTipps())
4756 4773
4757 self.showMenu.emit("Autocompletion", self.autocompletionMenu, self) 4774 self.showMenu.emit("Autocompletion", self.autocompletionMenu, self)
4758 4775
4759 def __showContextMenuShow(self): 4776 def __showContextMenuShow(self):
4760 """ 4777 """

eric ide

mercurial