Visual Studio Add In

0 views
Skip to first unread message

Joao Caxaria

unread,
Mar 31, 2008, 9:41:04 AM3/31/08
to STDL
This weekend I created a small VS addin to help generate the stdl
files. Currently it's only generating the init and the function
headers on the stdl file, ignoring any values for the parameters.

It is a very small add-in, as I used it as an excuse to use the VS SDK
but, if you find it usefull, I could put the source online and improve
it according to your feedback.

My idea was making the stdl file generation as easy as possible, in
order to attract as much developers as possible. As a next step, maybe
showing a small UI where the user could set some args for the methods
to test (filtering methods, adding regex for strings, etc) and, who
knows, using the stdl exe to compile the stdl files directly to .cs?

You can find the compiled dll and addIn file on a zip in the group
files (for vs2005 and 2008). Still havent done a installer so manual
install is required:
- Tools->Options->AddIn/Macros Security/Add...
- Point to correct directory
- Restart VS

Regards,
Joao Caxaria

Neville Grech Neville Grech

unread,
Mar 31, 2008, 3:59:22 PM3/31/08
to st...@googlegroups.com
Great work dude! The STDL ide bundled with 0.1 (scite for stdl) is really just a hack. I took the syntax highlighting, code folding etc... from the python version and just renamed the keywords :)

The workflow I was thinking about was as follows:

developers define the interface of the methods and classes
generate stdl for all the params and attribs (instance vars) automatically
generate default values (for example an int gets 0, string gets empty string etc...) automatically
developer can then give semantic meaning to all parameters, attributes etc.. by altering the code

what do you think?

There also has to be a way to "compile" the stdl into cs. CS can get generated (for example) automatically whenever the user saves the stdl source file (like the way static source code analysis works in VS). The user also has to have the possibility of seeing any errors in the stdl to CS conversion.

The stdl generation step can later on be enhanced such that the developer can specify the parameters you were mentioning.

A less important aspect is the actual editor. STDL syntax is very similar to python syntax as far as editors are concerned, so take a look at ironpythonstudio if you'd like to add more developer friendly features like sytax highlighting and code folding. http://www.codeplex.com/IronPythonStudio

FYI, the following are the keywords of the language:

param attrib assert dependsOn init valid invalid error out var returns throws test method

dependsOn shall probably be removed for version 0.2 (more on this later)

For code folding, code folds are performed if the line is not a comment and if it ends with a ':'

Integration with VS will make usability much better than having to open up another application. I look forward to replace the SciTE working environment with a totally integrated environment like the one you're working on. We can also create an installer which installs the VS extension together with the actual STDL compiler.

keep up the good work
--
Regards,
Neville Grech

Joao Caxaria

unread,
Mar 31, 2008, 6:29:32 PM3/31/08
to st...@googlegroups.com
Hi,

Please see my reply in blue.

 
Regards,
João


On Mon, Mar 31, 2008 at 8:59 PM, Neville Grech Neville Grech <nevill...@gmail.com> wrote:
Great work dude! The STDL ide bundled with 0.1 (scite for stdl) is really just a hack. I took the syntax highlighting, code folding etc... from the python version and just renamed the keywords :)

The workflow I was thinking about was as follows:

developers define the interface of the methods and classes
generate stdl for all the params and attribs (instance vars) automatically
generate default values (for example an int gets 0, string gets empty string etc...) automatically
developer can then give semantic meaning to all parameters, attributes etc.. by altering the code

what do you think?
Yep, seems like a good idea. I didnt do that because I was not sure of how to build complex types on the parameters (user defined classes), but I can do the primitive types with default values for now and tackle that issue further down the road.


There also has to be a way to "compile" the stdl into cs. CS can get generated (for example) automatically whenever the user saves the stdl source file (like the way static source code analysis works in VS). The user also has to have the possibility of seeing any errors in the stdl to CS conversion.
Let me check the events I can hook up in the VS SDK to do that... but I think it won't be a issue... We could compile in the background and see the errors in a output window. Who knows for version 1.1, have the errors imediatly on the stdl code file :)


The stdl generation step can later on be enhanced such that the developer can specify the parameters you were mentioning.
Fair enough.


A less important aspect is the actual editor. STDL syntax is very similar to python syntax as far as editors are concerned, so take a look at ironpythonstudio if you'd like to add more developer friendly features like sytax highlighting and code folding. http://www.codeplex.com/IronPythonStudio

FYI, the following are the keywords of the language:

param attrib assert dependsOn init valid invalid error out var returns throws test method

dependsOn shall probably be removed for version 0.2 (more on this later)

For code folding, code folds are performed if the line is not a comment and if it ends with a ':'
Ok, I'll also check how to do highlight on the code file. With this maybe we can also tackle the issue of error highlight in the editor.


Integration with VS will make usability much better than having to open up another application. I look forward to replace the SciTE working environment with a totally integrated environment like the one you're working on. We can also create an installer which installs the VS extension together with the actual STDL compiler.
Yep, I felt the same. I was going to do a stdl generator like Reflector, where the dll's get loaded after compiled but having it integrated would allow me to better use stdl's for TDD... :)
the code is not brilliant as I spent 80% of the time trying to figure out the VS SDK but now I'll spend a couple of hours refactoring and I'll place the code online. Should I do a separate sourceforge project or do you want to add it to the STDL under a new dev tree?


keep up the good work
 
Thanks, you too

Neville Grech Neville Grech

unread,
Apr 1, 2008, 7:09:35 AM4/1/08
to st...@googlegroups.com
Great. I think the best way to proceed is to add it in svn. I added you (caxaria) as a developer in STDL sourceforge so that you have svn commit access. Currently there are no branches in svn. Since the project is small, you might add it as a separate folder in the root.

Yesterday I was working on some stdl docs. I'm thinking about starting this task as a wiki/CMS. What do you think? Any suggestions?
--
Regards,
Neville Grech

Joao Caxaria

unread,
Apr 1, 2008, 4:16:51 PM4/1/08
to st...@googlegroups.com
Yeah, I would say a wiki would be the best platform for colaborating documentation.. but right now you're the only one who can do it :D So... your choice I guess.

Joao Caxaria

unread,
Apr 1, 2008, 4:31:39 PM4/1/08
to st...@googlegroups.com
I uploaded the code but unfortunatly the solution is from version VS2008... It is fully compatible with VS2005 but, as I only have VS2005 installed on a VMWare, I just used the one in hand...
 
I'll do a downgrade of the solution files somewhere along the way to get the code available to the max number of ppl. If you want to compile it right away on VS2005, just do a new empty class project and add the files.
I'll be working on them later on today, trying to get the stdl files more integrated on VS as previously discussed.
 
João

Neville Grech Neville Grech

unread,
Apr 2, 2008, 1:18:10 PM4/2/08
to st...@googlegroups.com
I myself have no issue if you would like to concentrate on getting the addin working properly on visual studio 2008. I think that as time goes by, more and more people will start adopting visual studio 08.

I have the following comments to add:
I changed the folder structure such that we have an src folder and under it we have the addin and the actual stdl compiler.
I'm thinking that when the addin is compiled it can put the dll and the .addin file under the root folder under bin. I can also set the bin of stdl to compile to that folder.

                    root
               /            \
          src                bin
          /    \               /    \
vsaddin   stdl    vsaddin   stdl

With this folder structure we can get more organised. What do you say?

Also, try to include more doc strings with the methods and classes in the addin. I myself also need more discipline in commenting my code.

Well done.
--
Regards,
Neville Grech

Joao Caxaria

unread,
Apr 2, 2008, 5:04:17 PM4/2/08
to st...@googlegroups.com
Yes, I agree.
And I'll start to do more comments... although it goes somewhat against what I think of what code should look like: "If it needs comments, refactor it" :)
Reply all
Reply to author
Forward
0 new messages