[Builder] Possible search and replace improvements for Builder



Hi everyone,

My name is Fangwen Yu, a university student from China. I am
interested in implementing search and replace as well as a spell check
plugin for Builder as my GSoC project this year. I have been doing
some general bug fixing for Builder and added a context menu for the
search entry where you can toggle various search options.

The idea of search and replace is self explanatory, however there are
some details to consider regarding implementation and user
experience. I've tried a lot of editors and IDEs lately, also read
previous discussion [1] in this list and Allan Day's design ideas [2]
for gedit's search and replace UX. Below is a list of possible
improvements I summarized and some questions. Please let me know your
opinion, any comment is appreciated.

1) Add multi-line search. Currently Builder can't handle multi-line
search text properly and merely prints a warning message.

2) Search in project. It can be very useful for finding definitions
and references of functions and variables, at least before we have more
intelligent tools. As Mr Hergert has pointed out, if we are going to
reuse the code of GtkSourceView, we have to create a GtkSourceBuffer
for every file we want to search, this can be very inefficient. Since
we don't need styling and other fancy stuff when search in project, I
think we can use `grep` as the backend for unopened files, parse its
output and list information in the panel below the text editor, the
user can then click on each result to open the file and jump to the
match. But should we use an external tool in Builder?

3) Replace in project. Without the help of code analysis tools,
replace in project is dangerous and would rarely be used by conscious
users. However, if we are going to implement this, again, is using
external tools such as `sed` a good idea?

4) Add "Preserve case" option to the search and replace dialog. If you
search for "foo" and replace with "bar", "foo" => "bar", "Foo" =>
"Bar", "FOO" => "BAR". This can be very helpful for developers.

5) Add "quick replace". When the user do a search and hit Ctrl-H
within the search entry, the search and replace dialog pops up, the
"Find" entry is filled with the search text, so the user only has to
take care of the "Replace with" field, thus called "quick replace".

As for the spell check plugin part, I am not sure whether splitting
function_name into individual words and spell check on them is a good
idea, since function and variable names usually contain incorrect
English, we may mess up the display with many misspelled words.

[1] https://mail.gnome.org/archives/builder-list/2015-January/msg00005.html
[2] https://wiki.gnome.org/Design/Whiteboards/GeditFindReplace


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]