Eclipse (Squish) add custom annotation types - eclipse

Hay, has anybody experiences with adding custom annotation types or appearance color options to the eclipse squish IDE? I'm trying to find a way to highlight previously verbalized words in the editor (i.e. **markme_**something(parameter). Sadly I can't find any plugins and as far as I noticed squish is doing a good job to hamper any kinds of external not former installed or in the manual mentioned plugins.
Another of my thoughts are to write an addition to the syntax checker but that would be probably kinda over the top and not that easy to realize. The source code is written in python.
Greetings and thanks!
Eduard

To mark a search string in the editor you can use Search > Search... (Ctrl+H). Then just enter the search string and press Enter. (While this will open and populate the "Search" view, the search string occurrences are being marked in the editor anyway.)
Perhaps you are trying to let the script editor color (a customizable set of) substrings in a customizable way? I have not found an Eclipse plug-in that would achieve that. The closest I could find (and available in source code form) is Highlight On Selection.
PS: Note that custom plug-ins are not supported in the Squish IDE, but that you can use the Eclipse IDE Integration, and then install the desired plug-ins into this Eclipse installation.

Related

In an eclipse plugin: How can I programmatically highlight lines of codes in the java editor?

I am trying to develop an eclipse plugin that does some documentation check on java code and highlights some lines of code in the editor.
To achieve my goal, I DON'T want to create a new editor in eclipse, I simply want to extend the default java editor to draw a line under (or highlight) the methods that do not satisfy some set of predetermined requirements.
Do I need to create a PresentationReconciler? If yes, how do I make the JDT or workbench use my reconciler.
I have never done plugin development and this is my first attempt.
Several starting points for you:
Annotations are an UI feature of JFace's text editor that allows you to visually mark some places in an open editor.
Markers are a Workbench feature, more high-level. They are generic "objects that may be associated with Workbench resources", and they can display in several places: in text editors (as annotations) or in the Problems view, for example.
Depending on what you want to do, you would plug in your plug-in into extension points related to either of those.
The Eclipse Java editor is located in the org.eclipse.jdt.internal.ui.javaeditor.JavaEditor package.
The "internal" in the package name means that the Eclipse development team can change how the Java editor works with new revisions.
Try this help page: Juno Help on syntax highlighting
At the end of the page, it describes how to dynamically add a PresentationReconciler, which is used for syntax highlighting. See if that fits the problem that you want to solve.
I assume you already have a plugin project.
In your plugin.xml, open the tab Extensions, click Add..., search for org.eclipse.ui.editors, then you should see a template named Editor, which will produce a simple xml editor to experiment and play with. Also, you will be able to see the needed structure to define a custom editor.
Hope this helps...
I don't know if you still have a need for this, but you are going to want to use Annotations to keep track of what parts of the editor you need to highlight.
For actually doing the graphical effect of highlighting, you could do syntax highlighting via a PresentationReconciler, but I have no experience with that.
We used a technique we borrowed from http://editbox.sourceforge.net/, replacing the background image of the editor Shell. Its open source, so check it out. (Our code might also help -- its at https://github.com/IDE4edu/EclipseEditorOverlay )

Eclipse highlighting the same occurrence of the word

In Notepad++, it has a very nice feature that if I select a word, it will highlight all the same words throughout the text. I can also set the hot-keys to highlight up to five different words with different styles (See the effect below) .
Is there any ways to get this similar effect in eclipse? I know when editing Java, it will highlight all the same variables, but it will not work when I highlight the comments and editing other files type (e.g. xml, html, js, css and etc).
I've been working with Eclipse for quite a while and I'm pretty certain that there is no canonical way of doing this.
In Eclipse these things are managed on a per-editor basis and the Java editor does not support what your looking for for all I know. At least for the Java editor you can do some minor configuration in what is highlighted and how (Preferences > Java > Editor > Mark Occurrences), but I guess you already know that.
As for plugins, I'm not aware of any plugin that achieves what you're looking for. As a matter of fact I'd be surprised if there really was a plugin which achieves what you're looking for.
If something comes up I'd much appreciate you sharing it here, I've been trying to get decent highlighting into Eclipse for years unsuccessfully... :)
Here is a plugin for eclipse: http://ystrot.github.io/glance/
It highlights all occurrences as with notepad++ upon hitting Ctrl + Alt + F.
Below is what I found works for me but you can also assign a key shortcut to 'Find Text in File':
Select the word or section of text
Press CTR+3 to activate 'Quick Access' search
Type 'Find Text in File'
Execute
As mentioned by #Kislingk you can modify how the words are highlighted/marked in 'Preferences > General >Editors>Text Editors > Annotations'.
Here is the closest solution I have found:
Create a shortcut in Preferences/General/Keys
type in the search field: "Find Text in File"
By default it has nothing assigned so just assign your key binding to it.
Annotations can help with displaying it in the sidebar
If you enable "Mark Occurrences" (Alt + Shift + O), then all words that are the same as the one you have marked will be highlighted.
Well if you're searching in the currently open file only (via CTRL-F) then no, you can't have everything highlighted.
However if you use the advanced search (CTRL-H, then go to "File search" tab) there you can input the search pattern, as well as the file-name pattern for the file(s) where it should search, and when the search is done, the search terms are highlighted in each file where they were found:
Use file search to search selected resource can highlight same word in single file.
Another useful eclipse plugin is eclipse instasearch. It has extensive feature set. This is also available in eclipse marketplace.
There are other options needed to enable.(Preferences > General >Editors>Text Editors > Annotations). Find Occurrences and WriteOccurrences and enable Text as 'Hightlight'
Have tried all of the above answer, but all not working. At the end, i found that it's due to i have accidentally remove some of the JRE System Library, after add back, it's work correctly
Window > Preferences > Java > Editor > Mark Occurrences

Variable use highlighting in Intellij IDEA

One of the features I really like about Netbeans is that when you click on a variable, method, field etc. Netbeans shows you all the usages of this entity in the right hand bar as little bars of colour. Is there a way to get this behaviour in IntelliJ IDEA and if so, how do I turn it on? I haven't found anything in the settings or Google but I might be missing something!
file>settings or ctrl+alt+s (for windows) select editor from the list on the left and check Highlight usages of element at caret in the Highlight on Caret Movement section
Apart from enabling the "automatic highlight usages" setting described above, you can also invoke "highlight usages" manually, using the shortcut Ctrl+Shift+F7.
The benefits of using the "manual" highlight usages are:
You can highlight usages of multiple variables/methods/etc at the same time
You can remove highlighting for an individual element selectively, by invoking Ctrl+Shift+F7 again on that element
some users find it less distracting than "automatic highlight usage" - this is subjective or course
Above answers are correct but still to get the exact behavior like in Netbeans try to use Identyfier Highlighter plugin for Intellij Idea (available in default plugin list under window settings).
This is really strange as Idea features mentioned in previous answers would do the job if merged into the one configurable feature.

How to replace Eclipse search dialog?

Is it possible to replace Eclipse search dialog to something more convenient, like the search dialog in Firefox or Chrome? The default one doesn't support F3 to search for the next match, it doesn't move itself away if the match is underneath the box and doesn't allow to highlight all the matches - and these are the features I really miss...
I don't think you can replace the Find dialog easily. You would probable need to (re-)write parts of Eclipse. Definitely doable, but not a small task...
That said, most of your problems can probably be addressed by the current dialog:
The default one doesn't support F3 to search for the next match
"search next match" is Ctrl-K by default. You can configure the keybindings under "Preferences / General / Keys": change the keybinding for "Find Next".
it doesn't move itself away if the match is underneath the box
Yes, that would be nifty. The dialog does however remember where you last put it, so just put it somewhere out of the way (e.g. over the package browser, or to the right), and it will stay there.
and doesn't allow to highlight all the matches
This is not yet available (though it has been discussed: https://bugs.eclipse.org/bugs/show_bug.cgi?id=29692 ). There are however two ways of getting a similar result:
Use the search function from the toolbar ("File Search" from the "torch" button). If you search there, it will highlight all matches in the editor (and provide marks in the editor ruler, and a list in the search view).
For Java elements, activate "Mark Occurences" ("highlight pen" button). This will highlight all occurences of a Java element if you mark in in the editor.
Maybe one of these will help you.
Finally, you can just open any file in an external editor (like (g)vim or Notepad++) right from inside Eclipse (right-click -> Open with). Then you can use any editor you want...
While it may not be exactely what you want, have you ever used the incremental search (Ctrl + J)? In my opinion it is much more convenient than the standard search.
A newer alternative is InstaSearch.
Information:
InstaSearch is an Eclipse plug-in for doing fast text search in the workspace. The search is performed instantly as-you-type and resulting files are displayed in an Eclipse view. It is a lightweight plug-in based on Apache Lucene search engine.
Each file then can be previewed using few most matching and relevant lines. A double-click on the match leads to the matching line in the file.
The "search the next match" is Ctrl-K. Previous is also available, see the "Edit" menu...
Only the highlight feature does not seem to be present. You might need a plugin for that (everythinhg is possible with plugins).
There was a Summer of Code project to implement a Firefox like search in Eclipse in 2007.
This is the official page, and this Blog shows a promising screenshot.
I never tried to install it, and I didn't find a final release or something though :(
SearchTab is an Eclipse plugin that shows a Firefox-like search tab
You do this by changing the key bindings under Preferences -> General -> Keys

String search: has Eclipse IDE got a modern "find" UI (a la Firefox)

One thing really really annoys me about the Eclipse ide: its find UI is so old style.
I would much prefer something like Firefox or Safari, that doesn't clutter my screen real estate with a useless window.
(source: eclipse-blog.org)
Press ctrl+j. Is that what you want?
Hold down shift to go backwards.
you can also select the word you want to search and use ctrl+K, use shift to go backwards.
And, if Eclipse's incremental search is not enough, you could always use a plugin like Glance.From their site:
Glance is an Eclipse plug-in providing extensible useful incremental text search in Eclipse. This plug-in supports the following features:
highlight all found matches
background search which never blocks text box
search in tables and trees
update matches when target content changed
new text containers can be supported through extension points
a lot of search settings
You mean, like... Ctrl+F, and then Ctrl+K?
You don't have to use the Search menu.
On the other hand, if you just don't like the popup dialog, I think you're SOL for now.
The Eclipse "find" dialog does more than "find" on browsers you mentioned (e.g. search-and-replace, etc.) Having more options means more real estate to control them.