How does Nautilus change highlighting for class definitions
Hi, in short: in which method is Nautilus adapting source-code highlighting based on the selection (class or method)? slightly longer: With Marco Naddeo we wanted to add ini-modules to Nautilus. Because an ini-module definition is a Smalltalk expression (just like a class definition), we want Nautilus to do source-code highlighting of an ini-module the same way it does for class definitions. How is Nautilus changing the source-code highlighting process depending on the selection (class or method)? Thank you -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill
Browse class references to the âNautilusClassSelectedâ Announcement, I see a mention of a method called #showScriptCode: when it subscribes to that announcement, perhaps thatâs the one you need? This is in contrast with #showSourceCode:, which is used in the subscription of the NautilusProtocolSelected and NautilusMethodSelected announcements. I think the difference lies between those methods.
On Dec 9, 2015, at 2:16 PM, Damien Cassou <damien.cassou@inria.fr> wrote:
Hi,
in short: in which method is Nautilus adapting source-code highlighting based on the selection (class or method)?
slightly longer: With Marco Naddeo we wanted to add ini-modules to Nautilus. Because an ini-module definition is a Smalltalk expression (just like a class definition), we want Nautilus to do source-code highlighting of an ini-module the same way it does for class definitions. How is Nautilus changing the source-code highlighting process depending on the selection (class or method)?
Thank you
-- Damien Cassou http://damiencassou.seasidehosting.st
"Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill
2015-12-09 14:45 GMT+01:00 Skip Lentz <skip.lentz@inria.fr>:
Browse class references to the âNautilusClassSelectedâ Announcement, I see a mention of a method called #showScriptCode: when it subscribes to that announcement, perhaps thatâs the one you need? This is in contrast with #showSourceCode:, which is used in the subscription of the NautilusProtocolSelected and NautilusMethodSelected announcements. I think the difference lies between those methods.
the distinction between method and class definition highlighting is done by AbstractNautilusUI>>setStylerClass: if it is nil, it treats all code as "smalltalk expressions" if it is not-nil it treats all code as "method definitions". But beware, there are multiple parts involved if you use nautilus code pane. - parser for syntax highlighting - the styler itself - completion ( you may or may not want to have NEC to popup the completion menu) - class / method selection dependent menu entries (Suggestions for example) - the acceptor (on accept, a class definition is execute, a method definition is compiled) what are ini-modules?
On Dec 9, 2015, at 2:16 PM, Damien Cassou <damien.cassou@inria.fr> wrote:
Hi,
in short: in which method is Nautilus adapting source-code highlighting based on the selection (class or method)?
slightly longer: With Marco Naddeo we wanted to add ini-modules to Nautilus. Because an ini-module definition is a Smalltalk expression (just like a class definition), we want Nautilus to do source-code highlighting of an ini-module the same way it does for class definitions. How is Nautilus changing the source-code highlighting process depending on the selection (class or method)?
Thank you
-- Damien Cassou http://damiencassou.seasidehosting.st
"Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill
On Dec 9, 2015, at 2:55 PM, Nicolai Hess <nicolaihess@gmail.com> wrote:
2015-12-09 14:45 GMT+01:00 Skip Lentz <skip.lentz@inria.fr <mailto:skip.lentz@inria.fr>>: Browse class references to the âNautilusClassSelectedâ Announcement, I see a mention of a method called #showScriptCode: when it subscribes to that announcement, perhaps thatâs the one you need? This is in contrast with #showSourceCode:, which is used in the subscription of the NautilusProtocolSelected and NautilusMethodSelected announcements. I think the difference lies between those methods.
the distinction between method and class definition highlighting is done by AbstractNautilusUI>>setStylerClass: if it is nil, it treats all code as "smalltalk expressions" if it is not-nil it treats all code as "method definitionsâ.
Ah ok.
But beware, there are multiple parts involved if you use nautilus code pane. - parser for syntax highlighting - the styler itself - completion ( you may or may not want to have NEC to popup the completion menu) - class / method selection dependent menu entries (Suggestions for example) - the acceptor (on accept, a class definition is execute, a method definition is compiled)
Yes but if he just adds his own announcement such as âNautilusIniModuleSelectedâ and subscribes to it in addition to "NautilusClassSelected" it should be fine no?
what are ini-modules?
Link: http://smalltalkhub.com/#!/~MarcoNaddeo/IniModules <http://smalltalkhub.com/#!/~MarcoNaddeo/IniModules>. But probably Marco and/or Damien can answer that better.
On Dec 9, 2015, at 2:16 PM, Damien Cassou <damien.cassou@inria.fr <mailto:damien.cassou@inria.fr>> wrote:
Hi,
in short: in which method is Nautilus adapting source-code highlighting based on the selection (class or method)?
slightly longer: With Marco Naddeo we wanted to add ini-modules to Nautilus. Because an ini-module definition is a Smalltalk expression (just like a class definition), we want Nautilus to do source-code highlighting of an ini-module the same way it does for class definitions. How is Nautilus changing the source-code highlighting process depending on the selection (class or method)?
Thank you
-- Damien Cassou http://damiencassou.seasidehosting.st <http://damiencassou.seasidehosting.st/>
"Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill
Nicolai Hess <nicolaihess@gmail.com> writes:
2015-12-09 14:45 GMT+01:00 Skip Lentz <skip.lentz@inria.fr>:
But beware, there are multiple parts involved if you use nautilus code pane. - parser for syntax highlighting - the styler itself - completion ( you may or may not want to have NEC to popup the completion menu) - class / method selection dependent menu entries (Suggestions for example) - the acceptor (on accept, a class definition is execute, a method definition is compiled)
thanks to both.
what are ini-modules?
it's a tentative replacement for class-side instance creation methods that suffer from a lot of problems. It's a new concept, just like traits and slots, except that it solves the instance creation problems listed at the end of http://smalltalkhub.com/#!/~MarcoNaddeo/IniModules Thanks again -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill
On Dec 9, 2015, at 3:02 PM, Damien Cassou <damien.cassou@inria.fr> wrote:
Nicolai Hess <nicolaihess@gmail.com> writes:
2015-12-09 14:45 GMT+01:00 Skip Lentz <skip.lentz@inria.fr>:
But beware, there are multiple parts involved if you use nautilus code pane. - parser for syntax highlighting - the styler itself - completion ( you may or may not want to have NEC to popup the completion menu) - class / method selection dependent menu entries (Suggestions for example) - the acceptor (on accept, a class definition is execute, a method definition is compiled)
thanks to both.
what are ini-modules?
it's a tentative replacement for class-side instance creation methods that suffer from a lot of problems. It's a new concept, just like traits and slots, except that it solves the instance creation problems listed at the end of
http://smalltalkhub.com/#!/~MarcoNaddeo/IniModules <http://smalltalkhub.com/#!/~MarcoNaddeo/IniModules>
Looks nice, will the UI you are creating show some special way of displaying/editing them? Or is it just to be able to see a list of ini-modules in the browser and edit them in ordinary syntax?
Thanks again
-- Damien Cassou http://damiencassou.seasidehosting.st
"Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill
Thanks to both for your help! :) Il 09/12/2015 16:56, Skip Lentz ha scritto:
On Dec 9, 2015, at 3:02 PM, Damien Cassou <damien.cassou@inria.fr <mailto:damien.cassou@inria.fr>> wrote:
Nicolai Hess <nicolaihess@gmail.com <mailto:nicolaihess@gmail.com>> writes:
2015-12-09 14:45 GMT+01:00 Skip Lentz <skip.lentz@inria.fr <mailto:skip.lentz@inria.fr>>:
But beware, there are multiple parts involved if you use nautilus code pane. - parser for syntax highlighting - the styler itself - completion ( you may or may not want to have NEC to popup the completion menu) - class / method selection dependent menu entries (Suggestions for example) - the acceptor (on accept, a class definition is execute, a method definition is compiled)
thanks to both.
what are ini-modules?
it's a tentative replacement for class-side instance creation methods that suffer from a lot of problems. It's a new concept, just like traits and slots, except that it solves the instance creation problems listed at the end of
Looks nice, will the UI you are creating show some special way of displaying/editing them? Or is it just to be able to see a list of ini-modules in the browser and edit them in ordinary syntax?
The second one, for this prototype. But I surely agree with you that, in the future, a more sophisticated GUI could help a lot the class developer in defining ini-modules. Marco
Thanks again
-- Damien Cassou http://damiencassou.seasidehosting.st
"Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill
-- Marco Naddeo PhD Student Dipartimento di Informatica Università degli Studi di Torino Corso Svizzera 185, 10149 Torino, Italy
participants (4)
-
Damien Cassou -
Marco Naddeo -
Nicolai Hess -
Skip Lentz