tildebyte / ChucK-plugin-for-ST3

A Sublime Text 3 plugin for ChucK (http://chuck.cs.princeton.edu).
19 stars 2 forks source link

open File under cursor to open the file associated with a class reference file also if file doesn't exist yet #39

Open zeffii opened 10 years ago

zeffii commented 10 years ago

Additional functionality to let us write something like

CrazyUnit cu;

open File could assume this refers to a .ck called CrazyUnit.ck, and try to open it, but also if the file doesn't exist it can write the template of a public class with that name into the file for instant workflow.

On a good day it could even write the machine.add line to the initialize.ck, maybe if there's a switch on the line like CrazyUnit cu; // to init

...thinking out loud here, I may not do this

tildebyte commented 10 years ago

+1

zeffii commented 10 years ago

it's already brought a few smiles to my face just being able to open a file straight from initialize is incredibly sweet. I think it makes more structural sense to generate a public class from CrazyUnit cu than it would to auto generate a class file purely from the file reference in intialize because:

in initialize if I have something like someutility.ck , sure, i probably want that to be a class if it doesn't exist.. but score.ck wouldn't need the public class { } inserted automagically.

zeffii commented 10 years ago

the current workflow is to go to an initialize.ck file and type:
ma , which expands to Machine.add( ....) and you type in the class name, then ctrl+shift+o to jump to that new file (even if it doesn't exist yet) then type pu and the completions will auto suggest a public class with the name of the current file.

This description doesn't do the workflow justice, it is very easy.

Altho, the addition of // to init is certainly worth investigating.