electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » ChucK programming language
Notepad++ Syntax Highlighter
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [11 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
vadimred13



Joined: Mar 09, 2009
Posts: 17
Location: Albany, NY

PostPosted: Tue Mar 10, 2009 7:27 am    Post subject: Notepad++ Syntax Highlighter Reply with quote  Mark this post and the followings unread

I've configured a ChucK syntax highlighter for Notepad++:

Download

To use - download the XML to your Notepad++ Application Data folder. For windows, this is C:\Documents and Settings\<user>\Application Data\Notepad++
If you already have a custom language definition in Notepad++, you're gonna have to do some XML merging (fun stuff). Enjoy!
Back to top
View user's profile Send private message
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Tue Mar 10, 2009 10:48 am    Post subject: Reply with quote  Mark this post and the followings unread

Great! I have a NP++ setup that works but I was -so far- unable to get it out of there. I'll try yours as well.

Lovely first post, welcome on board!

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vadimred13



Joined: Mar 09, 2009
Posts: 17
Location: Albany, NY

PostPosted: Wed Mar 11, 2009 9:08 pm    Post subject: Updated Reply with quote  Mark this post and the followings unread

I've configured AutoComplete functionality for Notepad++.

Download

Copy this XML file into your APIs folder in your Notepad++ install directory. For Windows, this is: C:\Program Files\Notepad++\plugins\APIs
Make sure that you have AutoComplete enabled in your Notepad++ preferences.

I've also updated the syntax highlighter (from the first post) to also highlight functions in the Std, Math, and Machine libraries.
Back to top
View user's profile Send private message
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Thu Mar 12, 2009 7:07 am    Post subject: Reply with quote  Mark this post and the followings unread

That's really nice! Did you find a way to have keyboard shortcuts for running ChucK from NP++ as well?
_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vadimred13



Joined: Mar 09, 2009
Posts: 17
Location: Albany, NY

PostPosted: Thu Mar 12, 2009 11:35 am    Post subject: Running ChucK from Notepad++ Reply with quote  Mark this post and the followings unread

Well, since you ask - yes. Copy this batch file to your drive:

Download

Then edit it to point to your chuck.exe. In Notepad++, navigate to Run, Run... (or hit F5) to bring up the Run... dialog. Once there, paste this command in there:

"location_of_where_you_saved_the_above_script" "$(CURRENT_DIRECTORY)" "$(FILE_NAME)"

From there, if you click Save, you can bind this command to a key/key combination.

So, for me the command is:

"C:\ChucK\runChucK.bat" "$(CURRENT_DIRECTORY)" "$(FILE_NAME)"

because my runChucK script lives in C:\ChucK

It actually shouldn't be too difficult to set up some kind of script/macro, or even write a little launcher program to be able to add/remove/replace shreds on the virtual machine from within Notepad++, but I'm at work right now, so I'll work on that when I get home. It definitely would be useful...at least until the new version of miniAudicle comes out...if it ever does Smile

Cheers
Back to top
View user's profile Send private message
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Thu Mar 12, 2009 12:15 pm    Post subject: Re: Running ChucK from Notepad++ Reply with quote  Mark this post and the followings unread

vadimred13 wrote:

It actually shouldn't be too difficult to set up some kind of script/macro, or even write a little launcher program to be able to add/remove/replace shreds on the virtual machine from within Notepad++, but I'm at work right now, so I'll work on that when I get home. It definitely would be useful...at least until the new version of miniAudicle comes out...if it ever does Smile


Way cool.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Mon Apr 20, 2009 10:23 am    Post subject: Reply with quote  Mark this post and the followings unread

Finally got round to playing with these.

Some issues; In your language highlight settings the "folder" operators never seem to mark the end of the folding block. I use "{" and "}" for those and that way it works for me. Does this work for you?

Also; I can't get the auto completion to work right; it will recognise words I used elsewhere in the code and offer those as well as some that seem to come from some other language but not "SinOsc" and so on. Any idea on what I might've done wrong there?

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vadimred13



Joined: Mar 09, 2009
Posts: 17
Location: Albany, NY

PostPosted: Mon Apr 20, 2009 11:25 am    Post subject: Reply with quote  Mark this post and the followings unread

Unfortunately, when it comes to code folding, Notepad++ makes you choose one of 2 solutions. Either enable code folding, but give up that lovely brace matching/highlighting functionality, or the other way around. As long as you specify '{' and '}' as activated operators - code folding will not happen. If you unspecify them, and add them to the folding open and close symbols - folding will happen (at the cost of matching braces). I chose to give up folding, because I'd rather have the matching braces. Let me know if you get both folding and brace matching working...

As for the auto-completiong not working - make sure that in your autocomplete settings, you have Function completion selected (not word completion). In my settings, I checked the Enable Auto-Completion on each input and the Function parameters hint on input checkboxes, and selected the Function completion radio button

Let me know if that doesn't do it for you.

-Vadim
Back to top
View user's profile Send private message
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Tue Apr 21, 2009 4:38 am    Post subject: Reply with quote  Mark this post and the followings unread

vadimred13 wrote:
Unfortunately, when it comes to code folding, Notepad++ makes you choose one of 2 solutions.


Yes, I think you are right. I don't see why it needs to be that "either/or". Anyway, I like folding better than brace matching, I think. Sometimes I make it fold and find the missing/extra brace based on that.

Quote:

As for the auto-completiong not working - make sure that in your autocomplete settings, you have Function completion selected (not word completion). In my settings, I checked the Enable Auto-Completion on each input and the Function parameters hint on input checkboxes, and selected the Function completion radio button


It works now, I had to update NP++; my version was quite old already, I had no idea there were that many updates to it, it looked quite mature to me.

BTW, what is your word-list based on? I think it lists a few things, like "super" and "implements" that I don't think are used in ChucK.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vadimred13



Joined: Mar 09, 2009
Posts: 17
Location: Albany, NY

PostPosted: Tue Apr 21, 2009 11:00 am    Post subject: Reply with quote  Mark this post and the followings unread

It's based on the reserved keywords from the ChucK language spec.

No, they don't do anything yet, but I'm guessing that they are reserved for possible future use.
Back to top
View user's profile Send private message
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Tue Apr 21, 2009 11:10 am    Post subject: Reply with quote  Mark this post and the followings unread

Ah, yes.

Yeah, the development of the whole class system was always on The List behind garbage collection and GC took a bit longer to arrive than anyone thought. It seems quite tricky.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [11 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » ChucK programming language
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
emSynth

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use