RE: [nbusers] Custom Syntax Coloring

Tor Norbye <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.tasklist.devel
Organization Sun Microsystems, Inc
Message-ID <1041323291.23987.25.camel__35633.9707541794$1054569856@proto>
On Mon, 2002-12-30 at 13:32, Miguel Munoz wrote:
> I want to add words to the syntax coloring, and I'd like to see a good,
> simple interface to do this in NetBeans. For example, I have a bad habit of
> typing the following:
> 
>   instanceOf
>   HashTable
>   Hashmap
>   hashcode
>   subString

Interesting problem. I can't help you with the editor, but I just
(as a result of your above post) added a new feature to the tasklist
module which catches 4 of the above 5 cases (it doesn't catch the
first one - the wrongly cased keyword).

NetBeans 3.4 and above has a feature which runs background compilation.
The tasklist module will list the errors found by the background
compilation for you, and (when it can) offer suggestions for how the
error can be fixed. By double clicking on the suggestion it will perform
the fix for you.

Back to the above problem.

When it finds an unresolved method or class name, it will now check for
to see if there are other methods or classes with the same name, but
different capitalization. If one is found, it offers a suggestion to
fix it.

Thus, if you write
   "HashTable t = null"
you'll get the suggestion
   "Change HashTable to Hashtable"
and double clicking it will replace the reference on the above line
to Hashtable - and it will import java.util.Hashtable as well (if necessary).

As another example, if you refer to String.subString(5), it will
see that there is another method named substring, and offer that: 
   "Change subString to substring".
Again double clicking performs the substitution (after a confirmation
dialog).

Hope that helps. (Warning - the tasklist feature is not a standard
part of NetBeans and is not yet stable. This is for those of you
willing to play around with (and provide feedback on) the development
version.)

-- Tor
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.