You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a few code conventions that I'm sure nobody else needs in their definitions, but wanted to be able to extend the definitions to add them. I also see several language requests here; I'm sure that having the ability to add your own definitions would help some folks out.
I hacked out my own solution to this, which basically involves merging a user-defined regex set onto the base regex set. In my solution, I also converted the regex files to CSON as I believe they don't need the ability to execute any arbitrary code as full blown coffeescript.
Note: This would add an extensions folder to the package, which should not be tracked by git. Also, adding styles for new list items would be up to the user in styles.less, but perhaps a default style could be given.
Excerpt of lib/symbols-list.coffee:
{$} =require('atom-space-pen-views')
CSON=require('cson')
path=require'path'# Load System and User regexRegexListBase=CSON.load(path.join(__dirname, ".", "symbols-list-regex.cson"))
tryRegexListExt=CSON.load(path.join(__dirname, "..", "extensions", "symbols-list-regex.cson")) catch e thenRegexListExt= {}
RegexList=$.extend(true, {}, RegexListBase, RegexListExt)
Example overrides file extensions/symbols-list-regex.cson:
#Removes todo and fixme; Adds a custom item used to denote sections in codetext:html:php:regex:todo:falsefixme:falsecomment_heading:/\/\/[ ]![ ]*(.+?)(?:[\r\n])/gmi
I'm happy to submit a pull request for this, if interested.
The text was updated successfully, but these errors were encountered:
I'm exactly also looking on solution to change the defaults according development needs -- sometimes you want to see less, sometimes more (or add some specific to you extensions, etc.) and such a feature will perfectly cover this !
I have a few code conventions that I'm sure nobody else needs in their definitions, but wanted to be able to extend the definitions to add them. I also see several language requests here; I'm sure that having the ability to add your own definitions would help some folks out.
I hacked out my own solution to this, which basically involves merging a user-defined regex set onto the base regex set. In my solution, I also converted the regex files to CSON as I believe they don't need the ability to execute any arbitrary code as full blown coffeescript.
Note: This would add an
extensions
folder to the package, which should not be tracked by git. Also, adding styles for new list items would be up to the user instyles.less
, but perhaps a default style could be given.Excerpt of
lib/symbols-list.coffee
:Example overrides file
extensions/symbols-list-regex.cson
:I'm happy to submit a pull request for this, if interested.
The text was updated successfully, but these errors were encountered: