Here's how to set it up nicely :
1) The SlickEdit completion features are wonderful - better than Visual Studio IMHO, in particular the features by-default bound to Ctrl-Shift-, and Ctrl-Shift-. and Ctrl-Shift-Space. The first two match words before and after the current cursor position. The word that is being used as the source of the completion is highlighted, and each time you press them, it moves backwards and forwards choosing a different match in your buffer. Ctrl-Shift-Space extends the match to more words following the current source word each time you press these keys.
To enable matching for any text, go to "Tools->Macro->Set Macro Variable". Enter def_complete_vars as the variable and a value of 0. This means that completion works not just for code symbols, but any text. See vslick\macros\compword.e for further info.
2) Its not well documented, but SlickEdit will provide further assistance in editing XML if it is given a schema. It works for DTDs and XSD's. NAnt's schema is given at http://nant.sf.net/release/0.85-rc4/nant.xsd.
You have to add a URL mapping in "Tools->Options->URL Mappings". But first download the schema from above URL and save it somewhere local. Then add this URL in the From field and put your local copy in the To field.
You also need certain attribute in your document. Here is a minimal NAnt .build file that SlickEdit understands :
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<project
name = "BuildProj"
basedir="."
xmlns="http://nant.sf.net/release/0.85-rc4/nant.xsd"
xmlns:nant="http://nant.sf.net/release/0.85-rc4/nant.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://nant.sf.net/release/0.85-rc4/nant.xsd R:\thirdparty\NAnt\schema\nant.xsd"
xsi:noNamespaceSchemaLocation="http://nant.sf.net/release/0.85-rc4/nant.xsd">
<target name="Build">
Do Stuff Here...
</target>
</project>
After creating this file, click the yellow XML tick on the toolbar to ensure it is "Well formed" (fix any errors). Then click the grey XML tick to check your file against the schema. I regularly get "Error Schema in http://nant.sf.net/release/0.85-rc4/nant.xsd has a different target namespace from the one specified in the instance document." which I have been succesfully ignoring.
Now save, close and reload this file to see the assistance features in action.
- typing a < will show a drop down list of all the NAnt commands you could use.
- when between the < and > it will show applicable attributes for the current tag.
- typing </ will be completed to close the closest previous open tag.
- recognised tags will be coloured differently to unrecognised ones.
You can also use the Project "Execute" feature and the Build shell window to run NAnt with your file.
All in all, SlickEdit makes a nice general purpose IDE.
No comments:
Post a Comment