Как обновить visual studio code
Работая с Visual Studio Code, я заметил, что если файл, с которым вы работаете, изменяется, всякий раз, когда этот файл фокусируется на панели кода, он будет перезагружен с диска (если у вас нет изменений в файле через VSCode) .
Однако, если вы работаете с этим файлом, предупреждения об изменениях файла не выводятся.
Я просматривал настройки и не нашел ничего похожего на вариант визуальной студии:
Обнаруживать, когда файл изменяется вне среды
Итак, мой вопрос: есть ли какие-то скрытые настройки или какие-то взломы, чтобы это предупреждение произошло.
Обновить
Решено в версии 0.3.0 Visual Studio Code.
- Файл будет обновлен с диска, если в редакторе нет изменений. (очень полезно для чтения файлов журнала во время выполнения процесса)
- Если есть изменения с обеих сторон (с диска и через редактор), когда вы пытаетесь сохранить файл с помощью VSCode, редактор предупредит вас об этой ситуации (т.е. «грязные записи»), и сравнение файлов позволит вам решить что делать.
@JohnPapa Я пытаюсь добиться того же поведения, что и в визуальной студии или возвышенном тексте. Если у меня нет изменений через IDE, файл в IDE должен быть обновлен до последней версии с жесткого диска. Если у меня есть изменения через IDE, а также за пределами IDE, должно появиться предупреждение об этой ситуации. Что-то вроде «Файл xxx изменился на диске. Вы хотите его перезагрузить?»
@johnPapa просто. Допустим, вы редактировали файл, думая, что это другой файл. Вы внезапно понимаете это и хотите потерять свои изменения. Или, что более важно, вы проверяете другую ветку git. Практически любой другой редактор, такой как notepad ++, сразу скажет: «Файл на диске был изменен. Вы хотите перезагрузить?». Vscode не обнаружит его, и вы можете внести изменения и сохранить и в конечном итоге перезаписать неправильную ветку, что ужасно. Не верю, что у меня все еще будет эта проблема в 2020 году
VSCode никогда не обновит файл, если в нем есть изменения, не сохраненные на диск. Однако, если файл открыт и в нем нет изменений, он заменит изменения на диске, что верно.
В настоящее время нет возможности отключить это поведение.
У всех других редакторов это есть. Некоторые файлы могут быть случайно изменены пользователем, но на самом деле пользователь хочет, чтобы ему сказали, что этот файл был изменен на диске, и спросили, хотят ли они его перезагрузить, по крайней мере, через панель уведомлений в редакторе.
Другие редакторы могут иметь это, но такое поведение сохраняется даже при закрытии и повторном открытии VSCode, что очень опасно, если вы не ожидаете, что это произойдет. У вас может быть открыто 10 файлов, вы вернетесь к VS2017, а затем вернетесь к VSCode через 2 дня и выполните «сохранить все» .
@Ingemar Я действительно хотел дать VSCode шанс (не в последнюю очередь для Angular intellisense) и, возможно, переключиться между VS2017 и VSCode. Я часто вносил изменения в VSCode, но не сохранял их, а затем менял тот же файл в VS2017. Я бы переключился обратно на VSCode и случайно повторно сохранил файл после моего изменения (даже после закрытия / повторного открытия). Всего за пару дней мои изменения исчезли как минимум дважды, и однажды я наконец понял, почему для меня это был конец VSCode. По крайней мере, VSCode должен предупреждать, когда вы сохраняете файл, который был изменен извне с момента его открытия в VSCode.
Этому ответу сейчас 3 года, кто-нибудь открывал вопрос по этому поводу? Не могли бы вы разместить ссылку здесь?
I have VS Code version 1.37.1 and I want to update to the current available version 1.43. My OS is Windows 10.
How can I update the current version to the latest?. Like in Eclipse, check for updates is not updating the installation, rather it gives me a zip.
hi there dear @upog - great question: a run vscode in Anaconda-;: how to update this - can i do. Should i do this via Conda!?
5 Answers 5
VS Code will automatically update itself on windows 10. If you'd like to force an update check there's an option available for that under 'Help > Check for Updates'.
If the update still doesn't complete, you can run the installer from here as described in the official Visual Studio Code Documentation under Docs » Supporting » Howtoupdate, found here.
hi there dear @Fehr - great to read your answer and the explanation: i run vscode in Anaconda-;: how to update this - can i do. Should i do this via Conda!?
Hey @zero, do you mean that you run anaconda in vscode and perhaps installed it using the Anaconda Navigator? If so are you asking how to update the version of Anaconda that you're using, or visual studio? If the former, please see the Anaconda documentation here, if the latter, the instructions above should still apply.
hello dear Fehr - man many thanks for the reply - great to hear from you. I have installed VSCode 2 years ago - and afterwards i had installed Anaconda. So - lets say i have mixed some things up. - and now i try to apply the ideas of this thread. Many many thanks - i will do so as reported and come back and report all my findings.
If Update:Mode in VS Code's setting is on 'none' , 'Check for Updates . ' option will disappear from Help. Just be sure it's not on 'none' then you can check for updates.
2021-12-15, if you don't see Check for Updates. then Settings
Make sure it's not none
Then Help, Check for updates. , it won't auto-install. Once it downloads the update, either Help, Install update, or
Normally you don't need to do anything. The default configuration auto-updates and tells you it needs a restart.
If you experience different behaviour then either someone has interfered with settings in VS Code or the platform (Win/Lin/Osx) is misconfigured.
Type Ctrl+, or your platform equivalent and then filter for "update", then inspect your settings to see what may be mucked up. You can also force an update in the Help menu, and if this results in the download of a zip file it's not VS Code that's messed up, it's your platform.
Welcome to the April 2022 release of Visual Studio Code. There are many updates in this version that we hope you'll like, some of the key highlights include:
-
- Nest generated files under source files in the Explorer. - Filter button brings up searches such as @Modified settings - Colored bracket pairs are now enabled by default. - Ctrl+Alt to quickly hide or show inlay hints in the editor. - Drop files into the editor to create Markdown links. - Quickly find all references to headers, files, URLs. - Now supporting inlay hints and lazy variable resolution. - Guidance for VS Code extension UI best practices. - Learn how to use the Rust programming language in VS Code.
Watch the release party: Listen in as the VS Code team discusses some of the new features. You can find the recording of the event on our YouTube channel.
Insiders: Want to try new features as soon as possible? You can download the nightly Insiders build and try the latest updates as soon as they are available.
Assets
The update addresses these issues, including a fix for a security vulnerability.
Assets
The update addresses these issues.
Assets
Welcome to the March 2022 release of Visual Studio Code. There are many updates in this version that we hope you will like, some of the key highlights include:
-
- Keep track of local file changes independent of source control. - Displays available language-specific settings. - Matches are highlighted in the terminal panel and scroll bar. - Code formatting for CSS, LESS, and SCSS. - Collect and view JS memory allocations while debugging. - Drag and drop files and folders into vscode.dev. - Connect via SSH to Apple Silicon/M1/ARM64 machines. - Learn how to use R for data science in VS Code.
Insiders: Want to try new features as soon as possible? You can download the nightly Insiders build and try the latest updates as soon as they are available.
Assets
The update addresses these issues.
Assets
The update addresses these issues, including a fix for a security vulnerability.
Assets
Welcome to the February 2022 release of Visual Studio Code.
- New editor history navigation - Scope Go Back/Go Forward history to editor group or single editor.
- Light High Contrast theme - Light theme for enhanced VS Code editor visibility.
- New audio cues - Audio cues for warnings, inline suggestions, and breakpoint hits.
- Drag and drop Problems and Search results - Drag results to new or existing editor groups.
- Source Control diff editor management - Automatically close diff editors after Git operations.
- Debugger lazy variable evaluation - Lazy evaluation of JavaScript/TypeScript property getters.
- Preview: Terminal shell integration - Rerun terminal commands, command status decorations.
- VS Code for the Web - Reopen recent local files and folders, improved Git integration.
Insiders: Want to try new features as soon as possible? You can download the nightly Insiders build and try the latest updates as soon as they are available.
Assets
The update addresses these issues.
Assets
The update addresses these issues.
Assets
Welcome to the January 2022 release of Visual Studio Code. There are many updates in this version that we hope you will like, some of the key highlights include:
- New Side Panel - Display more views at once with the new Side Panel.
- Settings editor search - Search now prioritizes whole word matches.
- Audio cues - Hear when the cursor moves to folded regions, errors, and breakpoints.
- Unicode highlighting - Avoid highlighting characters in supported languages.
- Automatic terminal replies - Create automatic responses to common terminal prompts.
- Notebook UI improvements - Search text in Markdown and output cells.
- Debug binary data view - View and edit binary data while debugging.
- Markdown path suggestions - Quickly insert relative file paths and header links.
- JS/TS surround with snippets - Insert selected code inside snippets.
- VS Code for the Web - Support for signed GitHub commits in vscode.dev and github.dev.
Watch a highlight of the new features in this version at the VS Code team's release party. You can find the recording of the event on our YouTube channel.
Insiders: Want to try new features as soon as possible? You can download the nightly Insiders build and try the latest updates as soon as they are available.
I downloaded the .tar.gz version of VS Code for Ubuntu (64-bit) and have been able to run it smoothly for some time. Some extensions have been installed too.
How can I efficiently update this VS Code installation? One thing I can think of is to just download the new .tar.gz archive and extract to the same location, just keeping the old "extensions" folder.
If I use the .deb version, would the same process be needed? Would I download the new .deb every time there is an update?
That's what I've been doing. About once a month I go to the website and download the new version and just install it over the old. Later VS Code has a software update checker built in now in the HELP menu. Cheers, Al
Yes, the installed VS Code has that feature, but whenever there is an update -> it asks with a dialog -> send me to the download site . It's still somewhat inconvenient.
Well yes. but we are talking about Microsoft, yes? I'm not aware of any PPA or repository for VS Code. Cheers, Al
As of v1.10.1 Official signed repositories for Linux have been added. "This enables automatic updates using the platform's update mechanism."
11 Answers 11
The following commands work for me:
Place those two commands into an executable Bash script called auto-update-vscode , and you can simply run that from your shell any time Visual Studio Code says it's out of date.
For me, the old .deb was correctly replaced. @CassianoMontanari did you chose some other form of installation the first time?
@user18099 Yes, I installed VSCode via Software Center from Ubuntu. I formatted my PC since then, now on Ubuntu 18.04, installed VSCode only from Software Center.
This is not Auto Update. It re-downloads and re-installs every time even if there is no update. And if you have an installed version from apt or snap, you will have a duplicate!
what's confusing here is that if you just double-click on the file in Ubuntu (20.04) it opens with the software installer app which only offers you the "remove" option
Updated answer October 2021:
If you installed the software using the .deb file you don't have to download the package manually. You can just do:
That's what the question is about, yes, and the repo is added automatically only if you used the deb file to install it in the first place. Not if you used the zip. That's not mentioned in your answer either
That doe snot seem to work for me. I get code is already the newest version (1.34.0-1557957934) , however, the current version is 1.44. Any ideas?
Per VSCode doc as of today October 2021, it can be installed or re-installed via following: sudo apt update and then sudo apt install code Note: apt instead of apt-get
Vladimir S. posted the correct solution, although he originally didn't link directly to the section that had the answer. The direct link is here.
For those who'd rather not click, here's the official solution per Microsoft:
Debian and Ubuntu based distributions
The easiest way to install for Debian/Ubuntu based distributions is to download and install the .deb package (64-bit) either through the graphical software center if it's available or through the command line with:
Installing the .deb package will automatically install the apt repository and signing key to enable auto-updating using the regular system update mechanism (apt update). Note that 32-bit and .tar.gz binaries are also available on the download page.
The repository and key can also be installed manually with the following script:
Then update the package cache and install the package using:
Once it's installed per above, it usually will update whenever you run apt update. That's covered above also.
I made the mistake of downloading the .deb file then just double-clicking it in ubuntu file manager. This launched the sofware update application which showed the new version I had downloaded but didn't give me any option to upgrade; only to remove!
In true Microsoft style, they decided to call the package just code . So download the latest .deb and:
Configuration files, installed extensions and even currently used folder are preserved.
Since version 1.10.2, Visual Studio Code has got the official signed repositories for Linux. Please look here.
This got me thinking, why the hack I have old version - and the version I was running was a duplicate from apt install code . just remove it and use the snap one x)
If you get an error message
The simplest solution is to download the latest binary from the Official Source and then install it by executing the following:
This will reinstall code over the older version. Your settings and installed extensions will remain unchanged as expected.
It is annoying to do this every month. The wget solution didn't work for me. I think that is the link
Follow the steps given below:
Download the latest version of Visual Studio Code as a .deb package.
Install GDebi Package Installer (if not installed).
Then remove Visual Studio Code (older version) by opening its .deb package (which you downloaded earlier) using GDebi Package Installer and then click on "Remove Package" option.
Then open the .deb package of the latest version of Visual Studio Code using GDebi Package Installer and click "Install Package" and install latest version of Visual Studio Code.
All your configurations (packages installed and other customisations) in Visual Studio Code which you did earlier will be restored automatically even after following the above procedure. So you need not worry about installing the packages again. You will find those customisations and packages automatically in the latest version you have installed.
Updating through this procedure doesn't remove/purge configuration files of Visual Studio Code and that's why, all your configurations in Visual Studio Code are restored.
This procedure works also for other code editors, like Sublime Text 3 and Atom. I have myself tested and verified it.
Я скачал zip-версию VS Code для Ubuntu (64-битную версию) и смог запустить ее в течение некоторого времени. Некоторые расширения были также установлены.
Как я могу эффективно обновить эту установку VS Code? Одна вещь, о которой я могу думать, это просто скачать новый zip и распаковать его в то же место, просто сохранив старую папку «extensions».
Если я использую .deb версию, будет ли необходим тот же процесс (загружать новый .deb каждый раз, когда происходит обновление?)
Это то, что я делал. Примерно раз в месяц я захожу на сайт и скачиваю новую версию и просто устанавливаю ее поверх старой. Позднее VS Code имеет встроенную проверку обновлений программного обеспечения в меню HELP. Cheers, Al
Да, установленный VS Code имеет эту функцию, но всякий раз, когда происходит обновление -> он запрашивает с помощью диалога -> отправляет меня на сайт загрузки . Это все еще несколько неудобно.
Ну да . но мы говорим о Microsoft, да? Я не знаю ни одного PPA или репозитория для VS Code. Cheers, Al
Начиная с v1.10.1 были добавлены официальные подписанные репозитории для Linux. «Это включает автоматическое обновление с использованием механизма обновления платформы».
Это работает для меня:
Добавьте эти два шага в вызываемый исполняемый скрипт bash, auto-update-vscode и вы можете просто запустить его из своей оболочки в любое время, когда VS Code скажет, что он устарел.
Для меня старый .deb был правильно заменен. @CassianoMontanari Вы выбрали другой способ установки в первый раз?
@ user18099 Да, я установил VSCode через Центр программного обеспечения из Ubuntu. Я отформатировал свой компьютер с тех пор, теперь на Ubuntu 18.04 установлен VSCode только из Центра программного обеспечения.
Для тех, кто предпочитает не нажимать, вот официальное решение от Microsoft:
Дистрибутивы на основе Debian и Ubuntu
Самый простой способ установки для дистрибутивов на основе Debian / Ubuntu - это загрузить и установить пакет .deb (64-битный) либо через графический центр программного обеспечения, если он доступен, либо через командную строку с помощью:
Установка пакета .deb автоматически установит репозиторий apt и ключ подписи, чтобы включить автоматическое обновление с использованием обычного механизма обновления системы (apt update). Обратите внимание, что 32-битные и .tar.gz двоичные файлы также доступны на странице загрузки.
Хранилище и ключ также можно установить вручную с помощью следующего скрипта:
Затем обновите кеш пакета и установите пакет, используя:
Вам не нужно загружать пакет вручную. Вы можете просто сделать:
Вот о чем вопрос, да, и репозиторий добавляется автоматически, только если вы сначала использовали файл deb для его установки. Нет, если вы использовали почтовый индекс. Это также не упоминается в вашем ответе
В истинном стиле MS они решили назвать пакет просто code . Так что скачайте последний .deb и:
Конфигурация, установленные расширения и даже используемая в данный момент папка сохраняются.
Следуйте инструкциям ниже:
Загрузите последнюю версию кода Visual Studio в виде пакета .deb.
Установите GDebi Package Installer (если не установлен).
Затем удалите код Visual Studio (более старая версия), открыв его пакет .deb (который вы загрузили ранее) с помощью программы установки пакетов GDebi, а затем нажмите «Удалить пакет».
Затем откройте пакет .deb последней версии кода Visual Studio с помощью программы установки пакетов GDebi, нажмите «Установить пакет» и установите последнюю версию кода Visual Studio.
Все ваши конфигурации (установленные пакеты и другие настройки) в коде Visual Studio, которые вы делали ранее, будут автоматически восстановлены даже после выполнения описанной выше процедуры. Так что вам не нужно беспокоиться об установке пакетов снова. Вы найдете эти настройки и пакеты автоматически в последней установленной вами версии.
Обновление с помощью этой процедуры не приводит к удалению / очистке файлов конфигурации кода Visual Studio, и поэтому все ваши конфигурации в коде Visual Studio восстанавливаются.
Эта процедура работает и для других редакторов кода, таких как Sublime Text 3 и Atom. Я сам проверил и проверил это.
Читайте также: