Re: [java-gnome-hackers] sourceview development branch
Brought to you by:
afcowie
From: Serkan K. <se...@ge...> - 2009-05-23 12:07:55
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Andrew Cowie yazmış: I don't know how common it is but users are always able to add custom language definitions. Predefining constants for languages will hinder this extensibility. > Normally I'm pretty obsessive about strong typing, and the idea of > strongly-typed Language instances seems fine. Fair bit of work to get > at, as we've seen. So part of me wonders if we couldn't compress that a > bit. > > If it wasn't for the fact that I just asserted how important strong type > safety is, I'd almost be tempted to suggest: > > buffer.setLanguage("java"); > > but... no. > > Hm. > > Dare I suggest preconfigured constants, ie Language.JAVA maybe? See > org.gnome.gtk's PaperSize.A4 and friends. So have a look at that, have a > look at the no-arg TextTag() and no-arg TextBuffer() constructors. While > you're at it, see org.gnome.gtk's Statusbar for an example of where we > just engineered around something that was silly. > > See if any of these spawn any bright ideas. > > [obviously the risk with preconfigured constants is we don't want to > force GtkSourceView to load all kinds of stuff if we aren't going to > need it, and initializing constants has a tendency to do that unless > you're careful about being lazy] - -- Sincerely, Serkan KABA -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkoX5xIACgkQRh6X64ivZaIR6wCfUCyU71JNun2ZTshCn3uKKd2c iccAn2Zu2siqLvdBTi3xrHg5Fw6sR+kX =POPh -----END PGP SIGNATURE----- |