Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Thursday, May 28, 2020 11:28 PM
hi
I have noticed that when i copy and paste code, either from a visual studio project or from the net, causes errors.
like it seems to have additional information in the copy,a bit like pasting word documents into a html editor online.
is there a way to stop this.
All replies (8)
Monday, June 1, 2020 11:46 PM ✅Answered
You might want to share this on VS Code Issues; https://github.com/microsoft/vscode/issues. It's probably something to do with encoding. You might try, as suggested above, pasting into a text editor like notepad or notepad++ to strip non ACSII characters. In the case of notepad++ view the actual hex code. Then paste from notepad to VS Code. If that works then there is probably a setting in VS code that will fix this issue.
Can you share a web site that causes this copy/paste issue and the steps to reproduce?
Tuesday, June 2, 2020 2:21 AM ✅Answered
Can you give an exact sequence of keystrokes that you use that reproduces the problem? Give an exact example of which web browser you are using, exactly which web page you are browsing, exactly how you select the text you are copying, etc, etc - all the precise details. Of course, the gold standard is an example that anyone can reproduce. It is hard to fathom what ctr+p has to do with a copy and paste operation.
The problem is that copy and paste works millions (or billions?) of times a day for developers all over the world using VSCode. If it doesn't work for you then it must be something very specific about what you are doing or your source or your destination or your configuration. I certainly wouldn't think of repair as 'extreme' in this sort of circumstance. So, you should be extremely precise in detailing exactly what it is that you do, exactly what your source is, exactly what the destination is and exactly what your configuration is. If we can't reproduce from your precise description then it would point towards some sort of corruption in your environment (project files or tools).
Friday, May 29, 2020 1:37 AM
Hi EnenDaveyBoy,
I have noticed that when i copy and paste code, either from a visual studio project or from the net, causes errors.
like it seems to have additional information in the copy,a bit like pasting word documents into a html editor online.
As far as I know, you can copy the code from the visual studio project to another, there is no additional information, but if you copy the code from the word document, some website, there may be additional information.
You can try to paste the copied information on the text, to see if there is additional information, and then paste and copy.
Best regards,
Sam
Saturday, May 30, 2020 11:42 PM
causes errors.
There are three key parts to programming
Detail, Detail and Detail
Could you expand a little on "causes errors"? Show the code, show the error, show the steps to reproduce.
Sunday, May 31, 2020 12:49 PM
an example is i have just copied "JWTHeader" from a browser.
i type
var foo = new and ctrl an p so it red
var foo = new JWTHeader then added brakets and the semi colon.
but it has a red wavey line and said cannot be found.
I made sure all the packages where in place, still the error,hovered over sid couldnot be found, ctrland . nothing.
yet if i delete it and type it in its found,spelling was the same layout was the same.
Monday, June 1, 2020 12:34 AM
How did you copy JWTHeader? From which browser? On which page? How did you select the text that you copied (double-click to select a word or click and drag to make selection? or some other method?) When you paste what you copied into Notepad, what do you see?
What program is 'vs'? Full name and version from 'Help'- 'About'
What is the definition of 'ctrl an p'? On my copy of 'Visual Studio Community 2019, ctrl-p is a shortcut to file->print.
BTW - When I tried to get the version information for my installation of Visual Studio there was no response and I could not open any menu at all with Visual Studio. Running 'Repair' fixed the problem. Have you done any basic debugging for your problem?
Monday, June 1, 2020 11:23 PM
i copied class names from both browsers and other projects opened in another instance. it happens on many pages many times. i used ctrl and c and ctrl and v,pasting into notpad just shows text
vs should be vs code= visual studio code v 1.45.1
don't know what the terminologuy is but ctrl p opens up a textbox to allow yoou to search for files
its normally just the thing i have copied and pasted that causes the issue, repair seems extreme,dotnet clean and restore and sometimes build sometimes work sometimesi have to delete the text andtype it which can be annoying.
Tuesday, June 2, 2020 10:17 PM
i will try and remember the processes next timeit happens,and then report it the issues link.
Thanks for the help.