def __init__(self): KoLanguageBase.__init__(self) self._style_info.update( _block_comment_styles = [sci_constants.SCE_C_COMMENT, sci_constants.SCE_C_COMMENTDOC, sci_constants.SCE_C_COMMENTDOCKEYWORD, sci_constants.SCE_C_COMMENTDOCKEYWORDERROR], _variable_styles = [components.interfaces.ISciMoz.SCE_C_IDENTIFIER] ) self._setupIndentCheckSoftChar() self._fastCharData = \ FastCharData(trigger_char=";", style_list=(sci_constants.SCE_C_OPERATOR,), skippable_chars_by_style={ sci_constants.SCE_C_OPERATOR : "])",}, for_check=True) # And add the new default prefs if they don't exist globalPrefs = components.classes["@activestate.com/koPrefService;1"]\ .getService(components.interfaces.koIPrefService).prefs # Chunk adding prefs based on which ones they were added with. if not globalPrefs.hasPref("gocodeDefaultLocation"): globalPrefs.setStringPref("gocodeDefaultLocation", "") if not globalPrefs.hasPref("godefDefaultLocation"): globalPrefs.setStringPref("godefDefaultLocation", "") if not globalPrefs.hasPref("golangDefaultLocation"): globalPrefs.setStringPref("golangDefaultLocation", "") globalPrefs.setStringPref("Go/newEncoding", "utf-8") globalPrefs.setLongPref("Go/indentWidth", 8) globalPrefs.setBooleanPref("Go/useTabs", True)
def __init__(self): KoLanguageBase.__init__(self) self._fastCharData = \ ErlangFastCharData(trigger_char=".", style_list=(sci_constants.SCE_ERLANG_OPERATOR,), skippable_chars_by_style={ sci_constants.SCE_ERLANG_OPERATOR : "])", })
def __init__(self): KoLanguageBase.__init__(self) self._style_info.update( _block_comment_styles=[ sci_constants.SCE_C_COMMENT, sci_constants.SCE_C_COMMENTDOC, sci_constants.SCE_C_COMMENTDOCKEYWORD, sci_constants.SCE_C_COMMENTDOCKEYWORDERROR, ], _variable_styles=[components.interfaces.ISciMoz.SCE_C_IDENTIFIER], ) self._setupIndentCheckSoftChar() self._fastCharData = FastCharData( trigger_char=";", style_list=(sci_constants.SCE_C_OPERATOR,), skippable_chars_by_style={sci_constants.SCE_C_OPERATOR: "])"}, for_check=True, ) # And add the new default prefs if they don't exist globalPrefs = ( components.classes["@activestate.com/koPrefService;1"] .getService(components.interfaces.koIPrefService) .prefs ) # Chunk adding prefs based on which ones they were added with. if not globalPrefs.hasPref("gocodeDefaultLocation"): globalPrefs.setStringPref("gocodeDefaultLocation", "") if not globalPrefs.hasPref("godefDefaultLocation"): globalPrefs.setStringPref("godefDefaultLocation", "") if not globalPrefs.hasPref("golangDefaultLocation"): globalPrefs.setStringPref("golangDefaultLocation", "") globalPrefs.setStringPref("Go/newEncoding", "utf-8") globalPrefs.setLongPref("Go/indentWidth", 8) globalPrefs.setBooleanPref("Go/useTabs", True)
def __init__(self): KoLanguageBase.__init__(self) self._fastCharData = ErlangFastCharData( trigger_char=".", style_list=(sci_constants.SCE_ERLANG_OPERATOR,), skippable_chars_by_style={sci_constants.SCE_ERLANG_OPERATOR: "])"}, )
def _keyPressed(self, ch, scimoz, style_info): # This returns True if it did something.... try: self._keyPressedAux(ch, scimoz, style_info) except: log.exception("_keyPressed threw an exception") # Always have the base class do its thing KoLanguageBase._keyPressed(self, ch, scimoz, style_info)
def __init__(self): # Same as JavaScript's KoLanguageBase.__init__(self) self._style_info.update( _block_comment_styles = [sci_constants.SCE_C_COMMENT, sci_constants.SCE_C_COMMENTDOC, sci_constants.SCE_C_COMMENTDOCKEYWORD, sci_constants.SCE_C_COMMENTDOCKEYWORDERROR], _variable_styles = [sci_constants.SCE_C_IDENTIFIER] ) self._setupIndentCheckSoftChar()
def __init__(self): # Same as JavaScript's KoLanguageBase.__init__(self) self._style_info.update( _block_comment_styles=[ sci_constants.SCE_C_COMMENT, sci_constants.SCE_C_COMMENTDOC, sci_constants.SCE_C_COMMENTDOCKEYWORD, sci_constants.SCE_C_COMMENTDOCKEYWORDERROR ], _variable_styles=[sci_constants.SCE_C_IDENTIFIER]) self._setupIndentCheckSoftChar()
def computeIndent(self, scimoz, indentStyle, continueComments, calculatedData=None): """ calculatedData: a dict containing info already calculated by a lower method """ if continueComments: return KoLanguageBase.computeIndent(self, scimoz, indentStyle, continueComments) # Don't end up calling a subclass routine. indent = KoLanguageKeywordBase._computeIndent(self, scimoz, indentStyle, continueComments, self._style_info, calculatedData) if indent is not None: return indent return KoLanguageBase._computeIndent(self, scimoz, indentStyle, continueComments, self._style_info)
def __init__(self, call_super=True): if call_super: KoLanguageBase.__init__(self) if not self._style_info._default_styles: self._style_info._default_styles = [0] self.prefService = components.classes["@activestate.com/koPrefService;1"].\ getService(components.interfaces.koIPrefService) self._prefs = self.prefService.prefs self._dedent_on_last_char = self._prefs.getBooleanPref("edit.indent.keyword.dedent_on_last_char") self._editAutoIndentStyle = self._prefs.getStringPref("editAutoIndentStyle") try: self._prefs.prefObserverService.addObserver(self, "edit.indent.keyword.dedent_on_last_char", 0) self._prefs.prefObserverService.addObserver(self, "editAutoIndentStyle", 0) except Exception, e: print e
def _keyPressed(self, ch, scimoz, style_info): # This returns True if it did something.... try: self._keyPressedAux(ch, scimoz, style_info) except: log.exception("_keyPressed threw an exception") # Always have the base class do its thing return KoLanguageBase._keyPressed(self, ch, scimoz, style_info)
def __init__(self): KoLanguageBase.__init__(self) self._style_info.update( _block_comment_styles=[ sci_constants.SCE_C_COMMENT, sci_constants.SCE_C_COMMENTDOC, sci_constants.SCE_C_COMMENTDOCKEYWORD, sci_constants.SCE_C_COMMENTDOCKEYWORDERROR ], _variable_styles=[components.interfaces.ISciMoz.SCE_C_IDENTIFIER]) self._setupIndentCheckSoftChar() self._fastCharData = \ FastCharData(trigger_char=";", style_list=(sci_constants.SCE_C_OPERATOR,), skippable_chars_by_style={ sci_constants.SCE_C_OPERATOR : "])",}, for_check=True) # Add extensible items (available in komodo 9 and higher). if 'koIInterpolationService' in components.interfaces.keys(): interpolateSvc = components.classes["@activestate.com/koInterpolationService;1"].\ getService(components.interfaces.koIInterpolationService) try: interpolateSvc.addCode('go', self) except Exception: log.warn("Unable to add 'go' interpolation shortcut")
def __init__(self): KoLanguageBase.__init__(self) self._style_info.update( _block_comment_styles = [sci_constants.SCE_C_COMMENT, sci_constants.SCE_C_COMMENTDOC, sci_constants.SCE_C_COMMENTDOCKEYWORD, sci_constants.SCE_C_COMMENTDOCKEYWORDERROR], _variable_styles = [components.interfaces.ISciMoz.SCE_C_IDENTIFIER] ) self._setupIndentCheckSoftChar() self._fastCharData = \ FastCharData(trigger_char=";", style_list=(sci_constants.SCE_C_OPERATOR,), skippable_chars_by_style={ sci_constants.SCE_C_OPERATOR : "])",}, for_check=True) # Add extensible items (available in komodo 9 and higher). if 'koIInterpolationService' in components.interfaces.keys(): interpolateSvc = components.classes["@activestate.com/koInterpolationService;1"].\ getService(components.interfaces.koIInterpolationService) try: interpolateSvc.addCode('go', self) except Exception: log.warn("Unable to add 'go' interpolation shortcut")
def getLanguageService(self, iid): return KoLanguageBase.getLanguageService(self, iid)
def __init__(self): KoLanguageBase.__init__(self) self._style_info.update( _block_comment_styles=[ sci_constants.SCE_C_COMMENT, sci_constants.SCE_C_COMMENTDOC, sci_constants.SCE_C_COMMENTDOCKEYWORD, sci_constants.SCE_C_COMMENTDOCKEYWORDERROR, ], _variable_styles=[components.interfaces.ISciMoz.SCE_C_IDENTIFIER], ) self._setupIndentCheckSoftChar() self._fastCharData = FastCharData( trigger_char=";", style_list=(sci_constants.SCE_C_OPERATOR,), skippable_chars_by_style={sci_constants.SCE_C_OPERATOR: "])"}, for_check=True, ) # And add the new default prefs if they don't exist globalPrefs = ( components.classes["@activestate.com/koPrefService;1"] .getService(components.interfaces.koIPrefService) .prefs ) # Chunk adding prefs based on which ones they were added with. if not globalPrefs.hasPref("gocodeDefaultLocation"): globalPrefs.setStringPref("gocodeDefaultLocation", "") if not globalPrefs.hasPref("godefDefaultLocation"): globalPrefs.setStringPref("godefDefaultLocation", "") if not globalPrefs.hasPref("golangDefaultLocation"): globalPrefs.setStringPref("golangDefaultLocation", "") globalPrefs.setStringPref("Go/newEncoding", "utf-8") globalPrefs.setLongPref("Go/indentWidth", 8) globalPrefs.setBooleanPref("Go/useTabs", True) # Add the go formatter. if not globalPrefs.getBoolean("haveInstalledGoFormatter", False): if globalPrefs.hasPref("configuredFormatters"): formatters = globalPrefs.getPref("configuredFormatters") go_formatter_prefset = components.classes["@activestate.com/koPreferenceSet;1"].createInstance( components.interfaces.koIPreferenceSet ) uuid = "{cf500001-ec59-4047-86e7-369d257f4b80}" go_formatter_prefset.id = uuid go_formatter_prefset.setStringPref("lang", "Go") go_formatter_prefset.setStringPref("name", "GoFmt") go_formatter_prefset.setStringPref("uuid", uuid) go_formatter_prefset.setStringPref("formatter_name", "generic") args_prefset = components.classes["@activestate.com/koPreferenceSet;1"].createInstance( components.interfaces.koIPreferenceSet ) args_prefset.id = "genericFormatterPrefs" args_prefset.setStringPref("executable", "%(go)fmt") args_prefset.setStringPref("arguments", "-w=false") go_formatter_prefset.setPref("genericFormatterPrefs", args_prefset) formatters.appendString(uuid) globalPrefs.setPref(uuid, go_formatter_prefset) globalPrefs.setBoolean("haveInstalledGoFormatter", True) # Add extensible items (available in komodo 9 and higher). if "koIInterpolationService" in components.interfaces.keys(): interpolateSvc = components.classes["@activestate.com/koInterpolationService;1"].getService( components.interfaces.koIInterpolationService ) try: interpolateSvc.addCode("go", self) except Exception: log.warn("Unable to add 'go' interpolation shortcut")