Spell Check All of the Same Word In Eclipse - eclipse

I am working on a program written by someone else and in their method headers a word is spelled wrong, repeatedly. When I hover over the word I get options to add the word to the dictionary, Change to '...', and more. However, I don't get an option to replace all instances of the word misspelled at once. Is there a way to achieve this in eclipse?

May be replace all ? (using ctrl + F or Ctrl + H)
but it could be dangerous and have side effects...
be sure to have some tests in place !
Or Replace/Find using Ctrl+F. it helps you to jump to the next occurence of the word, so you can check before replacing.

Related

How to go back to previous concurrency in VScode?

When I edit code in vscode, I often use ctrl + D to select the next word that matches the current one, but sometimes I would like to return N number of words.
Does anyone know if this is possible in vscode or is there a plugin?
Thanks!
PD. Vim has the plugin Multiline for it
The answer provided by the user rioV8 was just the solution to what I needed.
Use Ctrl+U to go to the previous match and Ctrl+K Ctrl+D to jump to the next match without selecting the current one.
Thanks!

how do you select only the entire string in vscode?

I tried looking up this questions but they were for the entire line.
My question is for example let url = "https://robohash.org/hello.png?set=set4";
here, is there any shortcut to select only the url or basically anything enclosed between "". Is it possible?
I just found a magical shortcut :)
For expand selection we can use shift + alt + ->
I had installed a stupid plugin before!
AFAIK this is not possible without an extension. You can download Quick and Simple Text Selection, the use ctrl+k " shortcut.
If you're familiar with Vim, you can use the vim extension, and then click v i " to enter visual mode, and choose everything between double quotes
For the sake of completeness, vscode also includes a smart select option, which has the keyboard shortcuts ctrl+shift+right_arrow and ctrl+shift+left_arrow (The shortcut has been changed to alt+shift+left/right_arrow). The problem with it is it doesn't specifically select everything between double quotes, and in the case of a URL, it doesn't simply work as intended. If it's only a simple string, it would also select the double quotes in addition to the string between them
There is actually another expansion called expand_region with the ability to
expand_region and undo_expand_region. The default keybindings are ctrl+w / shift+ctrl+w .
I find this one to be more convenient.
It stops before and after " and it will work for the url-fetch scenario.
What it doesn't do is to stop at a complete line (with and without indentation) which smart select seems to do. There are probably more differences that I don't know about.
Update: You have to press multiple times to expand further. For the example line in the original post this means 3 times.
ctrl+w, ctrl+w, ctrl+w
let url = "https://robo[cursor-here]hash.org/hello.png?set=set4";
1. https://robohash.org/hello.png?set
2. https://robohash.org/hello.png?set=set4
3. "https://robohash.org/hello.png?set=set4"

How can I confirm individual changes in a project-wide find and replace?

When I'm in project search (Shift + CMD + F) I can search the whole project for a specific word or expression. I can also enter a word I would like to replace it with.
If I click on one of the search results, it shows me the current version and the replacement version side by side. However, I can't find a way to confirm the replacement instance by instance! I only see a button to replace ALL instances, which is usually not what I want to do.
The reason is that certain words might be used in different context throughout the project, so usually not all search results shall be replaced.
How can I confirm the replacement instance by instance?
The replace one is on the each item that showing when mouse moved on each item.
As an alternative approach, you can press CMD + D repeatedly to select successive instances of a match, and CMD + SHIFT + D to skip any instance you do not want to include, and in this way case by case include each match in your find \ replace.
Also useful is CMD + U to undo the last selection action, in case you screw up during this process so you don't need to start over. Note, your shortcuts may be vary per operating system, but the procedure is the same.

VS Code: Case sensitive replacement after pressing Crtl - D

Let's suppose I have the following code:
But I change my mind and I don't want to call it plan anymore. I want to call it schedule. So, because VS Code is so amazing and I'm so lazy, I press Ctrl + D hoping for VS Code to change the name respecting the case. But suddenly:
Is it there any way to tell VS Code to respect the case?
With 1.37 (July 2019), it is possible through a find/replace (which now can replace by preserving case).
Issue 9798 has been implemented by PR 78003.
issue 78397 has been implemented by PR 79111 (1.38 only) for search/replace.
From 1.37 release notes:
You can now preserve case when doing replacement in the editor's Find widget. The feature is turned on when the Preserve Case option (AB button) is turned on in the editor's Replace input box.
Currently VS Code only supports preserve Full Upper Case, Full Lower Case, and Title Case.
Shortcuts are Alt + C for case sensitive. There is a little toolbar appears at the top-right corner of the VS Code, to let you toggle search options.
or you just Ctrl + F to toggle replace mode.
The v1.38 release in early September will extend the Preserve Case functionality to replacements while searching across files using the Search Panel. See add Preserve Case to Searches (all files).
.
There is also a new case preservation mode for hyphen-separated words.
v1.39 is adding preserve case for _underscore separated words. Like foo_bar.
See https://github.com/microsoft/vscode/pull/79660
If you want to achieve this without using the find/replace menu, there is an extension which solves your problem: https://marketplace.visualstudio.com/items?itemName=Cardinal90.multi-cursor-case-preserve
As far as I know it isn't, a workaround could be using the buttons that appear on top right after you press Ctrl + D. The second lets you select occurrences respecting the case, this way you could replace the text in 2 steps, first Plan and then plan.
So select the code bit, ctrl+h to open replace, edit find and replace, turn off match case in find, turn on preserve case within replace, Alt+L to find all occurences in selection, and Ctrl+Alt+Enter to execute.
9/10 cases you'll get it wrong, doesn't worth the effort. Just use ctr+d, then do the same for the uppercase.
Personally looking forward for a simpler/safer solution through the ctrl+d way. :)

Improved jumps to definition

When we're using ctags in vim and want to go to particular definition of variable or function we press ctrl + ], when we want to go back we press ctrl + T.
When we want to autocomplete a name of a variable we press ctrl + N and from a little violet window we can choose the right word.
Is it possible to improve go to definition so that we won't jump in the document, but only the little window with the function or variable definition will appear?
thank you
You want a way to see the function's signature without actually jumping to its definition?
I know about two plugins supposed to provide exactly this feature:
EchoFunc,
Tag Signature Balloons
The last time I tried echofunc it didn't work for JavaScript, at least for me, but it worked well for the few PHP files I've tested it with. I didn't try the other one because it's GVim-only and I use the CLI version almost as often as the GUI version.
But you can also use TagList and/or TagBar: two very useful plugins providing great code navigation based on ctags. Both will display the signature of the tag under your cursor if you hit <Space>.