How to copy a URL of code line in VSCode? - github

It happens often when I work in VSCode and I need to send a code line URL from a repo to a colleague.
There is no native support for this in VSCode. There is a capability that's enabled by Atlassian plugin if you are using Bitbucket. However, I've been looking for a more versatile option.

An answer I found using GitLens:
Option 1
Install GitLens plugin in VSCode
Open file from a cloned repo then Cmd+Shift+P > type GitLens: Copy
Click on Settings cog and assign key binding (Cmd+C+P is free)
Select a line from code in a cloned repo and use your shortcut to copy URL
Option 2
(ref How can I copy the repository URL for a line of code in Visual Studio Code?)
Install GitLens plugin in VSCode
Open file from a cloned repo then Cmd+Shift+P > type GitLens: Copy
Run gitlens.copyRemoteFileUrlToClipboard command.

Related

VSC check in project relevant extensions to a version control system

I created a project (in my case flutter) with Visual Studio Code. Therefore I installed some extensions. It is planned to upload the project to gitlab.
My problem relates to the extension: Is it possible to store all extensions used in the git repo as well so other developers don't have to install them all manually?
My first thought was about to reference these extension in the .vscode folder somehow, but I haven't found information on how this could work.
Put all the required extensions to the Workspace Recommendation:
Go to the extension bar: Ctrl+Shift+X
Select an extension
use context menu (right click) and select: Add to Workspace Recommendation
don't put the big extensions to the repo, you need to update these big files for each update and that will bloat the repo to an enormous size.

Copy and Paste mouse shortcuts in Git Bash terminal in Eclipse

The text cannot be COPIED by double-clicking and PASTED on right-clicking when working on Git bash in Eclipse, similar to the usage in Git Bash Windows application, which saves much time.
Is there any solution or best terminal alternative integrated in Eclipse?
That does not seem to be supported by the Terminal component, part of CDT since Eclipse 2020-03, with code source now in org.eclipse.cdt.git/tree/terminal.
No issue has been mentioned in this bugzilla list, which means you would need to create one to mention this use case.

How can we add existing file to VS code solution, I am not getting 'Add existing item' option

Can we add existing file or folder to VS code solution from explorer itself ?
One way is to add from file explorer but can this be done from VS code explorer itself like other Visual studio IDE solution explorer ?
We can't add it like Visual Studio IDE as how you will always have a link to it.
However, you can "Open" a file temporarily via Cntrl+O or can open a new Window with that other folder opened.
On Linux, the existing file can be inserted by copying to system's clipboard then paste from VSC.
To copy to system's clipboard:
xclip <filename>
Then paste to VSC as usual using Ctrl-V.

Empty Sidebar on Visual Studio Code on File -> Open

I have been using Visual Studio Code for sometime and its really amazing so far. But often I stumble upon an issue where if I import project through File->Open I end up with empty sidebar. If I do cmd+P to load files, files are available but its just not visible on sidebar.
Trying open projects with File->Open Recents or Ctrl+R also dint work out.
After reporting the issue to Visual Studio Code's github link, they have resolved the issue pretty fast.
Reason
Users who had file explorer hidden in 1.15 release might not see file explorer and also cannot retrieve it after upgrading to latest version. Workaround is to upgrade to insiders containing the fix or clear cache for that folder as follows:
Steps
Close the window opening the folder that has this issue
Open new empty Window
Run command Developer: Toggle Developer Tools
Go to Application Tab in Developer tools
Select file:// under Local Storage section in the menu on the left
Search for the key workbench.explorer.views.state using Filter inputbox
Select the folder with this key and Delete it
Now open the folder in VS Code and you should be seeing the file explorer.

How to open the workspace folder from within Eclipse

My Eclipse has a project open which is inside a workspace folder.
Can I open the folder somehow from within Eclipse like you can in Visual Studio where you simply right click a project and press the "Open Containing Folder"?
There is a plugin that offers the functionality that you're seeing (and a little bit more) called, StartExplorer Eclipse Plug-in.
It's available here:
http://basti1302.github.io/startexplorer/
StartExplorer's github repo is here: https://github.com/basti1302/startexplorer
You install it by going to Help -> Install new software -> (add the update site url and install)