Author Topic: SlickEdit Tutorials  (Read 31438 times)

acklenx

  • Guest
SlickEdit Tutorials
« on: August 17, 2006, 08:50:37 PM »
Are there any SlickEdit tutorials out there?  In general any repository or list of available tutorials would be great a great resource.

More specifically tutorials along the lines of getting up and developing/debugging in Java with Struts/Tiles would be really nice.  And likewise I would think other common combinations would be helpful for others.

My specific problem arises because I was introduced to SlickEdit by someone, that as soon as I got hooked (about two seconds after seeing the script support), left the company.  So I had no real resource for getting setup up and all the tricks of the IDE and real world functional scenarios.  I'm always the only person using SE (everyone else is on Eclipse - but it's a dog - I just can't stand how slow it is, and it doesn't support my languages anywhere near as well as SE).

I'm a front-end developer that spends most of my time writing javascript and dhtml components that are the tags used in widget driven development (usually anything with tags, jsp, jsf, even some .Net stuff).  Basically I figure out what needs to be generated, and then I make it so that it can be generated (templates, tiles, components, xsl, etc.).  More and more  I'm being pulled towards writing java, which is easy enough (it's a lot more straight forward than javascript), but I don't have SE configured for it.  So it's little more than notepad when it comes to java.  I know it's got power there, but I just don't know how to unleash it.  If I was at least solid in my Java development with experience in other IDE's it might be a little easier to stumble through the setup and find the features that I liked in my other IDE, but I don't know what to look for, or even why to look for it.

I found one tutorial( http://www.devx.com/webdev­/Article/31562/0/page/1 ), but the problem is if one little thing is different or wrong or assumed, I can't extrapolate or interpolate.  I need another data point - another tutorial.  The more the merry, even seemingly unrelated tutorials would be of assistance.

jeffcobb

  • Community Member
  • Posts: 23
  • Hero Points: 1
Re: SlickEdit Tutorials
« Reply #1 on: August 18, 2006, 05:20:54 PM »
I would like to second that motion.  Note that there are some tutorials in the help sysmtem but they are so simplistic as to not really be helpful. The problem is that the tutorials are about the wrong things it seems. What they illustrate is how to use some of the various wizards in the system and what is really needed are tutorials on stuff *not* covered by a wizard; learning how to click next is a skill I bypassed years ago with Windows 3.0 and OS/2 1.1.

So while the parent poster would like to see more web-oriented tutorials, I would like to chime in with a more general request for tutorials that show how to do things that we cannot get in the multitude of free editors out there, more examples of scripting or more to the point, how to use scripting to solve real-world problems, that sort of thing. It would seem that this would transcend any given programming language and be useful to all.

ScottW, VP of Dev

  • Senior Community Member
  • Posts: 1471
  • Hero Points: 64
Re: SlickEdit Tutorials
« Reply #2 on: August 21, 2006, 08:18:11 PM »
Great suggestion!  We are always working on the documentation and trying to make it more useful. One of the planned items for v12 is more detail in setting up projects. Until then, here is a little more help...

Projects are the key to getting the most out of SlickEdit. You can define a Workspace with a single project or multiple projects. Typically, each project will represent a subsystem. In C/C++, you might define a separate project for each compilation target that produces a DLL or executable. In Java, you may only need a single project. Use projects when you only want to build a portion of the overall codebase or if there are dependencies between modules. Be sure to create your project using the correct type. Select Project > New and pick the appropriate type from the list on the left. You can't change a Java project into a C/C++ project.

SlickEdit tags the files in your workspace and uses this information to help you navigate your files and provide completions. Add files to a project by selecting Project > Project Properties, and then select the Files tab. To simplify the process of adding files to your projects, use Add Tree or Add Wildcard. Add Wildcard is particularly useful if you are working with others who are not using SlickEdit. With this, SlickEdit searches the specified paths each time it starts to look for new files of the specified type to add to your projects. So, you would do a Get or Update from your source control and then start SlickEdit, and it will find all the new files added by other developers.

When you installed SlickEdit, it should have prompted you to auto-tag your Java and C/C++ libraries. If you skipped that step, select Tools > Tag Files and click the Auto Tag button. Select the appropriate compiler/JDK and let it run.

Once your files are tagged, you can use Ctrl+Dot to jump from a symbol to its definition and Ctrl+/ to jump from a symbol to a reference. Ctrl+Comma will bring you back. These are using the CUA emulation. Bindings may differ in other emulations. See the help system and look for push-tag and push-ref.  You will also see comprehensive completions for function names, members, parameters, etc.

I've never used Struts or Tiles, so I can't help you with that, but maybe some of the other users here can post some pointers. You should look through the items under Help > Cool Features. These describe many of the features you should be using. Each has a recorded demo to show you the feature in action.  If you have more specific questions, please post the forums and I'll do my best to answer them.

As for Scripting, Jeff, be sure to read through the Slick-C Macro Programming Guide (Help > Contents, expand "Slick-C Macro Programming Guide"). This includes a few samples and should help you get going. Post specific questions in the Slick-C Macro Programming forum and you'll find people who can point you in the right direction. As we see commonly asked questions, we'll use these to add more information to the guide.

Hope this helps!

--Scott

pearish

  • Community Member
  • Posts: 11
  • Hero Points: 0
Re: SlickEdit Tutorials
« Reply #3 on: November 22, 2006, 12:37:37 AM »
Scott,

I'm new to SlickEdit, and would appreciate advice on how to set up my projects/workspace(s). You say that, "...projects are the key to getting the most out of SlickEdit.." which I believe, yet there is precious little information I have found that describes the differences between projects and workspaces, in concrete terms. For example, what are the pro's and con's of having lots of projects? What can, or can't you do with 2 projects that you can or can't do with a single project containing all the same files? What is the purpose of marking 1 project "dependent" on another project?

In my particular case, I have a large body of code that is roughly divided into a foundation/framework layer, and lots of applications on top. The foundation is also composed of several modules. Based on this organization, I would assume that the most appropriate organization in SlickEdit would be to create one, umbrella workspace, filled with projects; one per module/application. And I need symbol lookups to work between projects.

I've already encountered the bug/limitation in SlickEdit where include file location does not use the tag data, so you have to add every possible include directory manually  :-\  and I haven't found a way to "duplicate" a project's properties, so I would have to add all the include directories manually, to every single project I create -  yuck!

~jeff

ScottW, VP of Dev

  • Senior Community Member
  • Posts: 1471
  • Hero Points: 64
Re: SlickEdit Tutorials
« Reply #4 on: November 28, 2006, 08:12:07 PM »
Good questions. We are trying to beef up the documentation in this area for v12, but I haven't got more than an outline complete at this point. So, I'll have to wing it to get you going.

Workspaces contain projects. You can have a workspace without any projects, but it would not build nor have any build-related settings. A project may belong to any number of workspaces. You can add an existing project to a workspace by selecting Project > Workspace Proprieties, then click the Add button.

Projects represent a grouping of files. In general, you should create a separate project for each build target in your system. So, if you have a program that is comprised of a number of DLLs and and EXE, you would create a project for each DLL and one for the EXE. In Java, I typically only create one project. This is particularly useful if you are using the SlickEdit build system. Even if you're not, it will allow you to group your files in a way that reflects the logical organization of your program, or you may elect to just add all of the files to a single project. You can specify project dependencies (also from Project > Workspace Proprieties). This will cause SlickEdit to build project B before building project A, if A depends on B.

You might also create a project to represent a set of files that comprise a library. You can then import that project into any number of workspaces. If you never edit the code, you can tag it without adding it to a workspace. To do so, select Tools > Tag Files to bring up the Tag Files dialog. This is divided into 2 panes. The left pane is a tree of your tag files. The right pane lists the source files in the selected tag file. To tag a library, add a new tag file. It's important to add the file to the correct location, though. If the tag file is needed only for this workspace, add it to the Workspace Tag File folder. If it is to be used by any workspace using this language, like C, then add it to the corresponding language folder. Assuming you are tagging a C or C++ library, you would select '"C" Compiler Configuration Tag Files", then click the "Add Tag File" button. Then select the correct source type to be tagged. Yes, it would be nice if the dialog knew that we just specified that we were adding a C/C++ tag file, but it doesn't. Be sure to check Generate References to create symbol cross references--that should probably be on by default.

Now it gets tricky. You are presented with a dialog that looks like you should choose a tag file. Instead, type the name of the new tag file into the "File name" field, like "GreatScott.vtg". Give it a name that is representative of the library being tagged. If you're tagging the Boost libraries, you might call this "boost.vtg". Then click the Open button. Now you should see the "Add Tree" dialog. Browse to the root of the library and specify the appropriate file types. SlickEdit will add all of the files matching the specified extensions.

In your specific case, I would create projects for the foundation/framework layer (one or more depending on the number of build targets, etc.) and a separate workspace for each application. SlickEdit is quick about switching workspaces, so there's not much benefit to putting all of your applications into a single workspace.

I'll have to talk to one of the developers about the include issue. Though the GUI doesn't provide a method for copying include information, our project files are just XML. So you can copy the include information from one project to another by opening the .vpj file and copying the information in the Includes node.

I hope this helps. I'll see what I can find out about the includes. Please let me know if you have more questions.

--Scott




Dennis

  • Senior Community Member
  • Posts: 3955
  • Hero Points: 515
Re: SlickEdit Tutorials
« Reply #5 on: December 05, 2006, 03:18:22 PM »
Two suggestions with respect to includes.  First option, you could create your own custom project type that encapsulates your prototypical project settings.

1) Go to Project > New, Click on Customize...
2) Click on New...
3) Provide a name for your custom project type
4) Select the project type that you usually use, hit OK.
5) You now have a copy of that project template, that you can customize.
6) Add all of your include paths to project template
7) Make other project customizations you typically do (Tools, etc)
8) Click OK when done to save your changes and get back to the Project > New... dialog
9) Select your custom project and start creating quicky projects for your apps.

Suggestion 2:  SlickEdit will search the current workspace in order to find include files, as a last ditch effort, when the project include paths are not set up correctly.  This is similar to your suggestion of using tagging, at least, at the workspace level.  However, do expect to be prompted for the path, at least the first time, because finding a file whose name matches the #include is merely a guess, we have to prompt for confirmation.  We could add a secondary last ditch effort to search extension specific tag files for a matching files, I will file this as a feature request.

Anyway, back to the original point, if you create sub-projects for the various third party libraries that you are adding to your include path, and add those to your workspace, then the files will be in your workspace, and the existing last-ditch effort of searching workspace files will help you jump to the #includes.

pearish

  • Community Member
  • Posts: 11
  • Hero Points: 0
Re: SlickEdit Tutorials
« Reply #6 on: December 07, 2006, 04:33:06 AM »
Thank you Dennis, and ScottW. Your information was very much appreciated. Adding just the information you provided here, to SlickEdit's Help system, would probably help a lot of new users!

Now that I think I understand the basics, I've set up my projects and workspace, created tag files, and.... tagging isn't working for me. I'm pretty sure it is pilot error  :-\.

Here's how I've organized my tag files (as displayed in the Tag Files dialog):
Workspace Tag File
---tag file that appears to contain all the .c and .h files in all the projects "contained" in the workspace.
Auto-Updated Tag Files
---nothing
"C" Compiler Configuration Tag Files
---GCC tag file, which contains no source because I'm cross compiling and this is the only work-around I know of to keep it
from being rebuilt
---GCC cross compiler tag file that contains all the header files under ..../usr/include/
"C" Tag Files
---empty

The issue is that the only symbols I'm able to find are those that come from a file covered by the workspace tag file. If I place the cursor over, say, "fprintf", SlickEdit doesn't display its declaration in the symbol pane, and I can't navigate to it with "Cntl-." - even though "fprintf" is declared in the header files included in the Gcc cross-compiler tag file.

What might I be doing wrong?

Thanks.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: SlickEdit Tutorials
« Reply #7 on: December 07, 2006, 08:04:20 AM »
@pearish
It turned out (at least for me) that for cross dev. workspaces the cross-compiler (global) stuff should be added to the 'Auto Updated' tagfile.
With this setup the cross-compiler tags are associated to this cross-dev. workspace and you avoid 'false' tag matches in your other workspaces using self-hosted dev.envs.
BTW: This is how my cross-dev. workspaces are configured.
IIRC it should be also fine to the add cross-compiler tags to the (globally visible) 'C-Tag' file section (e.g. if all / most of your workspaces are setup for cross-dev.).
This was my setup before the 'Auto-Updated Tag File' feature appeared and before I knew the great benefit of it ;)
I've to admit that I didn't try to integrate my cross-compiler tags to the 'C-Compiler' tags section. But it's also not applicable for my development work b/c I explicitely want to keep these (cross-)tags associated to the appropriate (cross-)workspaces.
Check your 'C-Preprocessor' setup (Tag files -> Options -> *) if you still don't get tag matches for known symbols. Maybe your cross-compiler headers are heavily #ifdef'd ...
If you need to change sth. there you should mark all files and 'Retag src files' b/c Slick needs to perform a complete re-build of the tag file.

Good luck,

HS2

PS: The (unmatched) support for cross-development was the original reason for me to move to Slick...

Dennis

  • Senior Community Member
  • Posts: 3955
  • Hero Points: 515
Re: SlickEdit Tutorials
« Reply #8 on: December 07, 2006, 02:59:30 PM »
The Class Browser test is a good way to figure out why symbols are not found.  Open the "Classes" tool window and try to find fprintf() there.  If it is there, and where you expect it to be (either a global function or under the 'std' namespace), then tagging should be able to show you the declaration.

If not, then there is either a problem with preprocessing (most likely), or the file containing it's declaration is not tagged.  Hopefully your cross compiler doesn't have fprintf() hidden in an extensionless header file.

To configure C/C++ preprocessing, go to Tools > Options > File Extension Setup..., select the "c" extensions, click on Options, click on the "Other" tab, and then click "C/C++ Preprocessing..."

Also, make sure that the active compiler configuration selected for your project is the cross compiler one, and not the GCC tag file that you emptied out.  To do this, go to Project > Project Properties..., Compile/Link tab, and check which compiler you have selected.

pearish

  • Community Member
  • Posts: 11
  • Hero Points: 0
Re: SlickEdit Tutorials
« Reply #9 on: December 08, 2006, 09:21:24 PM »
Dennis,

Your suggestion to use the Class Browser highlighted the problem immediately - the compiler tagfile group heading was listed, but there was nothing under it. Oddly enough, there was nothing in it even after I went to the tag files dialog, selected the tag file, and chose "Rebuild tag file".

What did seem to work, was to go to Tools->Tag Files...->Auto Tag..., then Browse... , then I entered the path to what amounts to my /usr/include directory in the "Built-in Compiler Include Directories" field, and chose "Build Tag File...". A dialog warned me that a file by that name already existed, and do I want to overwrite it, and I chose yes.  BTW: what is supposed to be entered in the "Header File:" field?

I don't understand the difference between how this new tag file was created, versus the previous version, i.e. why did simply rebuilding the compiler tag file work?

I also don't understand the "Auto Tag..." feature, and whether or not it is related to the "Auto-updated Tag Files" section.

Slowly, but surely, I'm getting SlickEdit configured, and useful  :)

Thanks for your help (and patience ;-)

pearish

  • Community Member
  • Posts: 11
  • Hero Points: 0
Re: SlickEdit Tutorials
« Reply #10 on: December 08, 2006, 09:24:37 PM »
[snip]
1) Go to Project > New, Click on Customize...
2) Click on New...
3) Provide a name for your custom project type
4) Select the project type that you usually use, hit OK.
5) You now have a copy of that project template, that you can customize.
6) Add all of your include paths to project template
7) Make other project customizations you typically do (Tools, etc)
8) Click OK when done to save your changes and get back to the Project > New... dialog
9) Select your custom project and start creating quicky projects for your apps.
[snip]

Fantastic suggestion - exactly what I needed.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: SlickEdit Tutorials
« Reply #11 on: December 09, 2006, 10:20:27 AM »
@pearish:
'Auto tag' means that Slick build tagfiles for these (standard) things automatically for you w/o any further user interaction.
It's related to 'Compiler Config. tagfiles' rather than 'Auto-updated tagfiles' which are setup explicitely by the user.

The 'header file' needed for building the compiler tagfiles contains the set of #defines needed for proper pre-processing the compiler sources/headers (analogous to conditional compilation).
You may create and use your own (e.g. based on an existing one in '<Slick install dir>/sysconfig/vsparser/') that matches your specific (cross-)compiler env.

HS2