sublime-codemap
sublime-codemap copied to clipboard
Ruby support
Hi all, thanks for this great plugin! It was a little hard to find but I really appreciate it.
For those looking to add Ruby support, all I needed to do was copy the default settings to user settings and modify the syntaxes
key as follows:
"syntaxes": [
["universal", ""],
["text", "txt"],
["python", "py"],
["ruby", "rb"],
["Settings", "sublime-settings"],
["Syntax", "sublime-syntax"],
["Ini", "ini"],
],
then duplicate the python
section and rename to ruby
, modifying as follows:
"ruby": {
"regex":
[
[
"^(class |def ).*$",
"[(:].*$",
"",
false
]
],
"indent": 2,
"obligatory indent": false,
"empty line in map before": "class",
"line numbers before": false,
"prefix": "",
"suffix": "()",
"syntax": "Packages/Ruby/Ruby.tmLanguage"
},
And presto, it works! Ruby and python have very similar class/method syntax
Great. Thank you. I have reopened this as an enhancement. I will put it in the very next release so it comes out of the box.
Great! Also, any tips on regexp to use with JavaScript? A bit tricky since there are multiple patterns for declaring functions.
Done. The release is published. Probably not indexed yet. But since you are using User settings your environment will function exactly as it is rights now.
...any tips on regexp to use with JavaScript?
Sorry. Not really. I am always struggling with it 😄 I normally find the first online Regex tester and use it as a playground
Ah, ok. I'll post a new issue if I come up with something workable.
And thanks for the great plugin by the way! Surprising that there's nothing else that does this; code mapping is the main thing I miss from IDEs.
I know :)
That's why I implemented the same functionality for VSCode.
https://marketplace.visualstudio.com/items?itemName=oleg-shilo.codemap
is this fixed...? why is the issue open
By mistake :) Closing it now