eric6/QScintilla/Editor.py

changeset 8000
47b15df088e4
parent 7998
cd41c844862f
child 8002
6002378278c9
equal deleted inserted replaced
7999:159689297bc0 8000:47b15df088e4
823 self.streamCommentLineOrSelection) 823 self.streamCommentLineOrSelection)
824 self.menuActs["BoxComment"] = self.menu.addAction( 824 self.menuActs["BoxComment"] = self.menu.addAction(
825 self.tr('Box Comment'), 825 self.tr('Box Comment'),
826 self.boxCommentLineOrSelection) 826 self.boxCommentLineOrSelection)
827 self.menu.addSeparator() 827 self.menu.addSeparator()
828 self.menuActs["Docstring"] = self.menu.addAction(
829 self.tr("Generate Docstring"),
830 self.__insertDocstring)
831 self.menu.addSeparator()
828 self.menu.addAction( 832 self.menu.addAction(
829 self.tr('Select to brace'), self.selectToMatchingBrace) 833 self.tr('Select to brace'), self.selectToMatchingBrace)
830 self.menu.addAction(self.tr('Select all'), self.__selectAll) 834 self.menu.addAction(self.tr('Select all'), self.__selectAll)
831 self.menu.addAction( 835 self.menu.addAction(
832 self.tr('Deselect all'), self.__deselectAll) 836 self.tr('Deselect all'), self.__deselectAll)
843 self.menuActs["SpellCheckRemove"] = self.menu.addAction( 847 self.menuActs["SpellCheckRemove"] = self.menu.addAction(
844 self.tr("Remove from dictionary"), 848 self.tr("Remove from dictionary"),
845 self.__removeFromSpellingDictionary) 849 self.__removeFromSpellingDictionary)
846 self.menuActs["SpellCheckLanguages"] = self.menu.addMenu( 850 self.menuActs["SpellCheckLanguages"] = self.menu.addMenu(
847 self.spellLanguagesMenu) 851 self.spellLanguagesMenu)
848 self.menu.addSeparator()
849 self.menuActs["Docstring"] = self.menu.addAction(
850 self.tr("Insert Docstring"),
851 self.__insertDocstring)
852 self.menu.addSeparator() 852 self.menu.addSeparator()
853 self.menu.addAction( 853 self.menu.addAction(
854 self.tr('Shorten empty lines'), self.shortenEmptyLines) 854 self.tr('Shorten empty lines'), self.shortenEmptyLines)
855 self.menu.addSeparator() 855 self.menu.addSeparator()
856 self.menuActs["Languages"] = self.menu.addMenu(self.languagesMenu) 856 self.menuActs["Languages"] = self.menu.addMenu(self.languagesMenu)
8662 DocstringGenerator.getDocstringGenerator(self) 8662 DocstringGenerator.getDocstringGenerator(self)
8663 ) 8663 )
8664 8664
8665 return self.__docstringGenerator 8665 return self.__docstringGenerator
8666 8666
8667 def insertDocstring(self):
8668 """
8669 Public method to generate and insert a docstring for the function under
8670 the cursor.
8671
8672 Note: This method is called via a keyboard shortcut or through the
8673 global 'Edit' menu.
8674 """
8675 generator = self.getDocstringGenerator()
8676 generator.insertDocstringFromShortcut(self.getCursorPosition())
8677
8667 @pyqtSlot() 8678 @pyqtSlot()
8668 def __insertDocstring(self): 8679 def __insertDocstring(self):
8669 """ 8680 """
8670 Private slot to generate and insert a docstring for the function under 8681 Private slot to generate and insert a docstring for the function under
8671 the cursor. 8682 the cursor.

eric ide

mercurial