I’m relatively new to Nova and I’m trying to port/rewrite some extensions I miss from VSCode. One of them is the console.log wrap where a given piece of text is selected and it will create a console.log on the next line that has the text selected as a string, and then the selected text (for JavaScript/TypeScript).
And while I have it basically working, I was hoping there was an easy way to determine how far indented in a line is. I assume, if I must, I could getLineRangeForRange
, do a regex on the text in that range until I hit the first non-space character, and prepend that text to the beginning of my new line, but I’m hoping there’s an easier way.
Also, this is my first extension, so I welcome feedback: GitHub - craveytrain/nova-console-log-it
Thank you