Can GitHub Copilot stop auto-suggesting, instead be triggered by a keystroke? - visual-studio-code

I find Github Copilot very helpful in some specific situations, but fairly unhelpful in its verbosity in most situations.
By default, it's always on, always suggesting (and frequently getting in my way.) I want it to be less aggressive, disabling the auto-suggestion, but still have it readily available at a keystroke.
What I've tried already:
In a helpful post, I see that Alt\ is the default key for triggering Copilot suggestions. Great, that's half of the solution.
In settings.json, setting the following seems to disable copilot entirely! It is no longer available using the keyboard shortcut.
"github.copilot.inlineSuggest.enable": false
I wonder if that's a bug, because there's already multiple ways to disable copilot entirely.

In settings.json (under File, Preferences, Settings), I found that setting the more general option:
"editor.inlineSuggest.enabled": false,
Seems to work as I'd hoped. Copilot suggestions are now only provided on-demand, when I press Alt\, and accepted when I press Tab
I worry that this might disable other types of suggestions I rely on... but language auto-completion still seems to work. I'll update this answer if I find anything I miss.
BTW, changing the keyboard shortcuts:
Under File, Preferences, Keyboard Shortcuts, if you search for inlinesuggest, you see the keystrokes for both triggering inline suggestion and for committing (aka, accepting) inline suggestions. Double-click the row to change the key (but watch out for conflicts.)

For Jetbrains IDE (e.g. Webstorm).
You can uncheck automatically show completions in the IDE's settings (Settings > Languages & Frameworks > GitHub Copilot).
and then still TRIGGER completion with a keystroke Alt+\ or any keymap you are comfortable with (Settings > Keymap > "Copilot" in the search bar):

Related

Visual Studio Code search across files (find in files) is not working

I am using Visual Studio Code 1.31.1 in MacOS 10.13.6. I open VSCode, I open a folder of text files, and I press command-option-F, or use Edit -> Find in Files. I search for a string that I know for sure exists in multiple text files in the open folder, and it says it can't find it.
Searching across files works if I have the folder open and have each and every single file open as a tab, which is rather pointless. Is there a way to search across files without actually having them all open as tabs?
I think it was because I opened a folder on Google Drive File Stream. It works fine on local files.
In my case, this was caused by me accidentally toggling the "Search only in Open Editors" option.
Had this same issue, the search functionality was only working for files that were open in the editor. My issue was that VS Code had an update downloaded and ready to update, so I just restarted VS Code, let the update finish and the issue was gone.
It could be that the search is looking into all folders (including node_modules ones), so as it is too big, the search never ends
To fix that, you can list all folders that you want to exclude of the search, to do that, open your vscode settings (ctrl + ,) type "Search: Exclude" in the search box and add your folders. (Btw some are already added by default)
Besides, remember to enable that filter in your search, this is simple, just toggle on the gear button in your search section
If you are still not sure about what to do, take a look in this briefly gif
Had the same issue on Mac, seems like it was related to Google Drive. once I moved the files on my local drive the search worked fine.
Check out your vs code settings. It excludes some folders by default e.g. node modules.
Go to settings, search "Search" , there will be list to exclude folders.
Remove item which might be accidentally got included, which might causing search item in all directory is not working.
I had this problem today. Turns out I had a deprecated setting for advanced RegEx searches "search.usePCRE2": true, Once removed, search started working as expected.
I just had this problem on VS Code 1.58.2 / Mac OS 10.15.7
None of the above solutions worked for me, it still keeps saying 'No results found in open editors' no matter what I do.
But I did get it working by changing the 'Search: Mode' in the settings (for the workspace, or any other scope if needed) from 'view' to 'reuseEditor'.
Yes, this doesn't fix it if you really want the results in the Explorer tab rather than a completely new editor window, but it works.
I had the same issue, i fixed mine by removing files in .gitignore
I had an issue with searching in a project with git submodules and found that the gitlens add-on defaults to ignore searching any submodules:
Setting this to 2 or more may address your problem.
In my case, I had somehow gotten my Explorer set on a subfolder of my project. Closing VS Code and reopening the workspace reset everything and search worked again.
In my case, it was files with no extensions I was not able to find. Once I added those files an extension, I was able to find them via the search feature.
I initially wrote this answer describing a confusing "inverted" behavior of the Search only in Open Editors option/button.
However, after playing around it turns out that what the GUI was showing was not "in sync" with what the search results were returning. Toggling the options a few times appears to have fixed things.
So if your search doesn't appear to be returning any results, I would suggest toggling the Search only in Open Editors and Use Exclude Settings and Ignored Files options.
Otherwise, for information, here is my previous answer:
VS Code has an extremely confusing "inverted" interface when it comes to the option Search only in Open Editors.
There is also another option which affects how search works in a confusing way: Use Exclude Settings and Ignored Files.
The below screenshot shows both:
Note that:
Search only in Open Editors is OFF
Use Exclude Settings and Ignored Files is ON
With these options I get search results back, with them set the other way around - confusingly - I get nothing.
Important to note:
If you turn Use Exclude Settings and Ignored Files OFF, then VS Code seems to stop searching any files, EXCEPT for those which are currently open in tabs. This is very confusing and not the behavior one would expect. The expected behavior would probably be to search the whole opened Folder/Workspace by default.
If you turn Search only in Open Editors OFF, then only open editors will be searched. This is the "inverted" behavior. My current build of VS Code has the indicator "inverted" for this GUI element. When it looks like it is in the "ON" state, it is actually "OFF". When it looks like it is in the "OFF" state, it is actually "ON'.
These two things interact in unexpected ways: (This is the behaviour I observed after toggling both buttons a few times. It is different to what I was seeing a few minutes ago.)
Open Editors (looks like) it is OFF, Use Exclude Settings (looks like) it is ON, search appears to search whole workspace.
Open Editors (looks like) it is OFF, Use Exclude Settings (looks like) it is OFF, search appears to search open tabs only.
Open Editors (looks like) it is ON, Use Exclude Settings (looks like) it is OFF, search appears to search whole workspace.
Open Editors (looks like) it is ON, Use Exclude Settings (looks like) it is ON, search appears to search whole workspace.
I suspect that when typing / editing the search terms, replace option, and files to include/exclude options, VS Code does not check the state of the option buttons before performing the search. This is likely the source of the bug I was seeing earlier.

VS Code: How to make IntelliSense activate with Ctrl+Space but still allow quick info?

I'm used to Eclipse, NetBeans, and PHPStorm, and am stumbling through VS Code and not easily finding how to config or fix annoyances, like the editor auto-popping down suggestions while I type, meaning if I hit Enter before realizing it's showing the suggestion, it changes what I typed.
I found this was IntelliSense, but I'm used to suggestions popping up only after hitting Ctrl+Space. When I discover quickSuggestions in Settings, the other non-false option I understand there is "other" (true), but setting that to false makes no suggestions show even when hitting Ctrl+Space.
When I find out what Ctrl+Space actually does, it's listed as "quick info" on IntelliSense's help page - https://code.visualstudio.com/docs/editor/intellisense - but "quick info" is not found in a search in Settings or Keymap... super frustrating.
So I'm kind of stumbling through seemingly wasting a lot of time of my workday trying to config things to be less annoying and disruptive... any guidance here or do I need to take a class?
Disable using Enter as accept trigger:
"editor.acceptSuggestionOnEnter": "off",
Ctrl+Space is used to trigger suggest and when suggest is visible to trigger "quick info":
You can find keybindings in default keybindings. Invoke Go to Symbol Ctrl+Shift+O

VSCode persist search preferences

Is there any way to configure my settings so that every time I reopen VSCode editor I do not lose search preferences (ie. Match Case, Use Regular Expression etc). For example in my last search if I activate Match Case how do I make this setting available even after reloading VSCode?
I was looking VSCode customization section but not found any clue on this.
I'm on the VSCode team. As of VSCode 1.8 this is not supported, but we have a feature request tracking this work: https://github.com/Microsoft/vscode/issues/11574

Eclipse : how can I disable this popup?

I'm sorry if this question has been ask before or can be found on the net. I have no idea how do I call this popup. I have no idea of the keyword to google. I tried "popup", "dialog", "confirmation" and a lot else but didn't success.
Back to the question, I've just migrate to my development machine and did fresh install for Eclipse. After that, I copy all the setting in workspace/.metadata folder from my previous machine to the new one. Everything looks fine (theme, key bindings and else) except that I have this popup appearing whenever I press some shortcut. For example, Ctrl+Space to bring up the code assist, the following dialog appears.
This popup never appeared before in my previous machine. It is annoying since I have to hit enter once every time I press those shortcut. Do you have any idea how can I turn this off?
Best
Note
I don't think this popup is code assist specific issue, I brought code assist up as an example. I also got this popup when I press shortcut to
Open Resource
Run
Refactor/Rename
Add getter/setter
and 10s other shortcut too. Also, I don't have conflict shortcut. Not that I know.
This question may have been answered here already: Disable content assist in Eclipse
Refer to the following link for the documentation on Content Assist: http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.cdt.doc.user/reference/cdt_u_c_editor_con_assist.htm
The point is to disable the actions that trigger the Content Assist.

How to avoid Eclipse blocking keyboard shortcuts

I installed a plugin that allowed me to create UML diagram from my code. Everything was working fine until I found that now all keyboard shortcuts (like CTRL-X, CTRL-Z, CTRL-SPACE, CTRL-SHIFT-F,..) except for CTRL-C and CTRL-V now require a click on a small square that appear on the bottom right corner. And this is required every single time.
This are few examples of the square that appears:
If I click on the message or press Enter I can access the functionality. Does anyone know how to get rid of this annoying thing or at least reset Eclipse related configurations?
Thanks in advance
EDIT:
I obviously tried uninstalling the plugin but nothing changed.
Try Window / Reset Perspective as the duplicate shortcuts may be still in the perspective.
Also try restart specifying -clean option to rebuild the workspace metadata.
The pop-ups you are seeing are the "keybinding conflict" popups. These are common when you have two different plugins defining the same keybinding and looks like these. Still in your case there's only one option to choose from and it definitely looks like a bug.
In the Eclipse bugtracker database there are two issues that are looking like the one you have: #377048 and #374942.
These issues are marked as fixed in 4.2-I20120410-0633. So if you are having Eclipse 4.2 without any service releases installed, you would probably have this. The solution is - to use a newer Eclipse version. Eclipse 4.3.1 is available to download since today, and it should contain a lot of other fixes since 4.2. So I encourage you to install it.
The other solution could be to try playing with keybinding dialog (Window->Preferences->General->Keys) and trying to unbind and re-bind the commands that you are having issues with.