Saved searches
Use saved searches to filter your results more quickly
Cancel Create saved search
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
microsoft / vscode Public
How to Contribute
Justin Chen edited this page Aug 23, 2023 · 252 revisions
Project Management
- Roadmap
- Iteration Plans
- Development Process
- Issue Tracking
- Issues Triaging
- Community Issue Tracking
- Automated Issue Triaging
- Issue Grooming
- Writing Test Plan Items
- Sanity Check
Contributing
- How to Contribute
- Submitting Bugs and Suggestions
- Performance Issues
- Keybinding Issues
- Native Crash Issues
- Search Issues
- Terminal Issues
- File Watcher Issues
- Writing Tests
- Smoke Test
Documentation
- Extensions
- API
- Visual Studio Code
- Document Repository
- Multi Root Workspace API
Clone this wiki locally
Contributing to Visual Studio Code
There are many ways to contribute to the Visual Studio Code project: logging bugs, submitting pull requests, reporting issues, and creating suggestions.
After cloning and building the repo, check out the issues list. Issues labeled help wanted are good issues to submit a PR for. Issues labeled good first issue are great candidates to pick up if you are in the code for the first time. If you are contributing significant changes, or if the issue is already assigned to a specific month milestone, please discuss with the assignee of the issue first before starting to work on the issue.
In order to download necessary tools, clone the repository, and install dependencies via yarn , you need network access.
You’ll need the following tools:
- Git
- Node.JS, x64, version >=18.15.x and
- Yarn 1, version >=1.10.1 and
- Python (required for node-gyp; check the node-gyp readme for the currently supported Python versions)
- Note: Python will be automatically installed for Windows users through installing windows-build-tools npm module (see below)
- Windows 10/11
- Install the Windows Build Tools:
- if you install Node on your system using the Node installer from the Node.JS page then ensure that you have installed the ‘Tools for Native Modules’. Everything should work out of the box then.
- if you use a node version manager like nvm or nvs then follow these steps:
- Install the current version of Python using the Microsoft Store Package.
- Install the Visual C++ Build Environment by either installing the Visual Studio Build Tools or the Visual Studio Community Edition. The minimum workload to install is ‘Desktop Development with C++’.
- open a command prompt and run npm config set msvs_version . (If you are using Visual Studio 2019 then you need to run npm config set msvs_version 2019 )
- Xcode and the Command Line Tools, which will install gcc and the related toolchain containing make
- Run xcode-select —install to install the Command Line Tools
- On Debian-based Linux: sudo apt-get install build-essential g++ libx11-dev libxkbfile-dev libsecret-1-dev libkrb5-dev python-is-python3
- On Red Hat-based Linux: sudo yum groupinstall «Development Tools» && sudo yum install libX11-devel.x86_64 libxkbfile-devel.x86_64 libsecret-devel krb5-devel # or .i686 .
- Others:
- make
- pkg-config
- GCC or another compile toolchain
In case of issues, try deleting the contents of ~/.node-gyp (alternatively ~/.cache/node-gyp for Linux, ~/Library/Caches/node-gyp/ for macOS, or %USERPROFILE%\AppData\Local\node-gyp for Windows) first and then run yarn cache clean and then try again.
If you are on Windows or Linux 64 bit systems and would like to compile to 32 bit, you’ll need to set the npm_config_arch environment variable to ia32 before running yarn . This will compile all native node modules for a 32 bit architecture. Similarly, when cross-compiling for ARM, set npm_config_arch to arm .
Note: For more information on how to install NPM modules globally on UNIX systems without resorting to sudo , refer to this guide.
If you have Visual Studio 2019 installed, you may face issues when using the default version of node-gyp. If you have Visual Studio 2019 installed, you may need to follow the solutions here.
Alternatively, you can avoid local dependency installation as this repository includes a Visual Studio Code Remote — Containers / Codespaces development container.
- For Remote — Containers, use the Remote-Containers: Open Repository in Container. command which creates a Docker volume for better disk I/O on macOS and Windows.
- For Codespaces, install the GitHub Codespaces extension in VS Code, and use the Codespaces: Create New Codespace command.
Docker / the Codespace should have at least 4 Cores and 6 GB of RAM (8 GB recommended) to run the full build. See the development container README for more information.
If you’d like to contribute to the list of available development containers in the Remote — Containers extension, you can check out the Contributing documentation in the vscode-dev-containers repo.
Enable Commit Signing
If you’re a community member, feel free to jump over this step.
Otherwise, if you’re a member of the VS Code team, follow the Commit Signing guide.
If you want to understand how VS Code works or want to debug an issue, you’ll want to get the source, build it, and run the tool locally.
NOTE: If you need to debug the 32bit version of VS Code on 64bit Windows, follow the guide on how to do that.
Getting the sources
First, fork the VS Code repository so that you can make a pull request. Then, clone your fork locally:
git clone https://github.com/>>/vscode.gitOccasionally you will want to merge changes in the upstream repository (the official code repo) with your fork.
cd vscode git checkout main git pull https://github.com/microsoft/vscode.git mainManage any merge conflicts, commit them, and then push them to your fork.
Note: The microsoft/vscode repository contains a collection of GitHub Actions that help us with triaging issues. As you probably don’t want these running on your fork, you can disable Actions for your fork via https://github.com/>/vscode/settings/actions .
Install and build all of the dependencies using Yarn :
cd vscode yarnThen you have two options:
- If you want to build from inside VS Code, you can open the vscode folder and start the build task with Ctrl + Shift + B ( CMD + Shift + B on macOS). The build task will stay running in the background even if you close VS Code. If you happen to close VS Code and open it again, just resume the build by pressing Ctrl + Shift + B ( CMD + Shift + B ) again. You can kill it by running the Kill Build VS Code task or pressing Ctrl + D in the task terminal.
- If you want to build from a terminal, run yarn watch . This will run both the core watch task and watch-extension tasks in a single terminal.
The incremental builder will do an initial full build and will display a message that includes the phrase «Finished compilation» once the initial build is complete. The builder will watch for file changes and compile those changes incrementally, giving you a fast, iterative coding experience.
Troubleshooting:
- Windows: If you have installed Visual Studio 2017 as your build tool, you need to open x64 Native Tools Command Prompt for VS 2017. Do not confuse it with VS2015 x64 Native Tools Command Prompt, if installed.
- Linux: You may hit a ENOSPC error when running the build. To get around this follow instructions in the Common Questions.
If the build step fails, or if the built version fails to run (see next section), run git clean -xfd in your vscode folder, then re-run yarn .
Errors and Warnings
Errors and warnings will show in the console while developing VS Code. If you use VS Code to develop VS Code, errors and warnings are shown in the status bar at the bottom left of the editor. You can view the error list using View | Errors and Warnings or pressing Ctrl + P and then ! ( CMD + P and ! on macOS).
Tip! You don’t need to stop and restart the development version of VS Code after each change. You can just execute Reload Window from the command palette. We like to assign the keyboard shortcut Ctrl + R ( CMD + R on macOS) to this command.
To test the changes, you launch a development version of VS Code on the workspace vscode , which you are currently editing.
To test changes with a remote, use the «TestResolver» in your Code — OSS window which creates a fake remote window. Search Command Palette for TestResolver . More information is at https://github.com/microsoft/vscode/issues/162874#issuecomment-1271774905.
Running on Electron with extensions run in NodeJS:
macOS and Linux
./scripts/code.sh ./scripts/code-cli.sh # for running CLI commands (eg --version).\scripts\code.bat .\scripts\code-cli.bat
Tip! If you receive an error stating that the app is not a valid Electron app, it probably means you didn’t run yarn watch first.
VS Code for the Web
Extensions and UI run in the browser.
Besides yarn watch also run yarn watch-web to build the web bits for the built-in extensions.
macOS and Linux
./scripts/code-web.sh
.\scripts\code-web.bat
Code Server Web
UI in the browser, extensions run in code server (NodeJS):
macOS and Linux
./scripts/code-server.sh --launch
.\scripts\code-server.bat --launch
You can identify the development version of VS Code («Code — OSS») by the following icon in the Dock or Taskbar:
VS Code has a multi-process architecture and your code is executed in different processes.
The render process runs the UI code inside the Shell window. To debug code running in the render you can either use VS Code or the Chrome Developer Tools.
- Open the vscode repository folder
- Choose the VS Code launch configuration from the launch dropdown in the Debug viewlet and press F5 .
Using the Chrome Developer Tools
- Run the Developer: Toggle Developer Tools command from the Command Palette in your development instance of VS Code to launch the Chrome tools.
- It’s also possible to debug the released versions of VS Code, since the sources link to sourcemaps hosted online.

The extension host process runs code implemented by a plugin. To debug extensions (including those packaged with VS Code) which run in the extension host process, you can use VS Code itself. Switch to the Debug viewlet, choose the Attach to Extension Host configuration, and press F5 .
The search process can be debugged, but must first be started. Before attempting to attach, start a search by pressing Ctrl + P ( CMD + P on macOS), otherwise, attaching will fail and time out.
Run the unit tests directly from a terminal by running ./scripts/test.sh from the vscode folder ( scripts\test on Windows). The test README has complete details on how to run and debug tests, as well as how to produce coverage reports.
We also have automated UI tests. The smoke test README has all the details.
Run the tests directly from a terminal by running ./scripts/test.sh from the vscode folder ( scripts\test on Windows). The test README has complete details on how to run and debug tests, as well as how to produce coverage reports.
We use eslint for linting our sources. You can run eslint across the sources by calling yarn eslint from a terminal or command prompt. You can also run yarn eslint as a VS Code task by pressing Ctrl + P ( CMD + P on macOS) and entering task eslint .
To lint the source as you make changes you can install the eslint extension.
The Visual Studio Marketplace is not available from the vscode open source builds. If you need to use or debug an extension you can check to see if the extension author publishes builds in their repository (check the Builds page) or if it is open source you can clone and build the extension locally. Once you have the .VSIX, you can «side load» the extension either through the command line or using Install from VSIX command in the Extensions View command drop-down (see more on command line extension management).
Even if you have push rights on the Microsoft/vscode repository, you should create a personal fork and create feature branches there when you need them. This keeps the main repository clean and your personal workflow cruft out of sight.
Before we can accept a pull request from you, you’ll need to sign a Contributor License Agreement (CLA). It is an automated process and you only need to do it once.
To enable us to quickly review and accept your pull requests, always create one pull request per issue and link the issue in the pull request. Never merge multiple requests in one unless they have the same root cause. Be sure to follow our Coding Guidelines and keep code changes as small as possible. Avoid pure formatting changes to code that has not been modified otherwise. Pull requests should contain tests whenever possible.
Introducing usage of new Electron API with a PR
A pull request that depends on Electron API that VS Code is currently not using comes with a certain risk and may be rejected. Whenever we update Electron, there is a chance that less popular Electron APIs break and it is very hard to find out upfront. Once a PR lands in VS Code, the role of maintaining the feature moves to the team and as such we have to follow up with upstream components to ensure the feature is still supported. As such, as a rule of thumb:
- avoid Electron APIs and use web standards instead (this also ensures that your feature is supported in our web client)
- if you must use Electron APIs, we require a unit test at https://github.com/electron/electron so that we protect against future breakage.
Where to Contribute
Check out the full issues list for a list of all potential areas for contributions. Note that just because an issue exists in the repository does not mean we will accept a contribution to the core editor for it. There are several reasons we may not accept a pull request like:
- Performance — One of Visual Studio Code’s core values is to deliver a lightweight code editor, that means it should perform well in both real and perceived performance.
- User experience — Since we want to deliver a lightweight code editor, the UX should feel lightweight as well and not be cluttered. Most changes to the UI should go through the issue owner and/or the UX team.
- Architectural — The team and/or feature owner needs to agree with any architectural impact a change may make. Things like new extension APIs must be discussed with and agreed upon by the feature owner.
To improve the chances to get a pull request merged you should select an issue that is labelled with the help-wanted or bug labels. If the issue you want to work on is not labelled with help-wanted or bug , you can start a conversation with the issue owner asking whether an external contribution will be considered.
To avoid multiple pull requests resolving the same issue, let others know you are working on it by saying so in a comment.
Spell check errors
Pull requests that fix spell check errors in translatable strings (strings in nls.localize(. ) calls) are welcomed but please make sure it doesn’t touch multiple feature areas, otherwise it will be difficult to review. Pull requests only fixing spell check errors in source code are not recommended.
VS Code can be packaged for the following platforms: win32-ia32 | win32-x64 | darwin-x64 | darwin-arm64 | linux-ia32 | linux-x64 | linux-arm
These gulp tasks are available:
- vscode-[platform] : Builds a packaged version for [platform] .
- vscode-[platform]-min : Builds a packaged and minified version for [platform] .
Tip! Run gulp via yarn to avoid potential out of memory issues, for example yarn gulp vscode-linux-x64
We’re also interested in your feedback for the future of VS Code. You can submit a suggestion or feature request through the issue tracker. To make this process more effective, we’re asking that these include more information to help define them more clearly.
We accept feedback on translations in language packs via GitHub issues in our localization repo that contains our currently supported language packs.
In order to keep the conversation clear and transparent, please limit discussion to English and keep things on topic with the issue. Be considerate to others and try to be courteous and professional at all times.
Want to contribute to this Wiki?
Компилятор для VS Code и кракозябры в консоли
Vim, конечно, штука хорошая, но боковой панели с древом каталогов и файлов не предоставляет, поэтому недавно мне пришлось установить Visual Studio Code.
Первая проблема — это как компилировать C++? Для решения можно воспользоваться mingw, установку которого можно выполнить по этой ( Wayback Machine ) статье. В ней довольно подробно изложено, что нужно сделать, а также приведён пример task.json, который понадобится для решения второй проблемы.
Вторая проблема — непонятные символы(кракозябры) в командной строке. Довольно распространённая ситуация. Решение будет в четыре этапа.
Первый этап — конфигурация task.json
Нам необходимо добавить в ключ «args» файла task.json следующие значения:
"-finput-charset=", "-fexec-charset="Исходная и конечная кодировка будет кириллицей, поэтому используем CP1251.
"-finput-charset=CP1251", "-fexec-charset=CP1251"В итоге получится примерно так:
< "version":"2.0.0", "tasks": [ < . "args": [ "-g", "$", "-finput-charset=CP1251", "-fexec-charset=CP1251", "-o", "$\\$.exe" ] . > ] >Список поддерживаемых кодировок можно прочитать тут ( Wayback Machine ).
Второй этап — смена шрифта в командной строке
Обычный шрифт в командной строке не поддерживает кириллицу, поэтому для отображения кириллицы его нужно сменить на Consolas(или Lucida Consolas). Для этого необходимо:
- Нажать правой кнопкой мыши по строке заголовка;
- Нажать на «Properties»(«Свойства»);
- Перейти в «Font»(«Шрифт»);
- Выбрать Consolas(или Lucida Consolas);
- Нажать на «OK».

Если вам необходимо, чтобы пользователь оставался со стандартным шрифтов, тогда поменяйте значение «-fexec-charset=cp1251» на «-fexec-charset=cp866» в task.json и пропустите четвёртый этап.
Третий этап — смена кодировки файла
Перед созданием файла можно задать кодировку по умолчанию через settings.json. Он находится в %appdata%/Code/User. Также его можно изменить и не переключаясь между VSCode и файловым менеджером. Для этого переходим в «Настройки»(«Settings»), слева внизу иконка шестерни, далее «Текстовый редактор»(«Text Editor») и прокручиваем до момента «Изменить в settings.json»(«Edit in settings.json»).

В ключе «files.encoding» устанавливаем необходимое значение, в нашем случае «windows1251».
Если файл был создан ранее, то его можно переоткрыть в нужной кодировке через строку состояния и выбрать Cyrillic (Windows 1251).

Четвёртый этап — устанавливаем кодировку командной строки
Для того чтобы вручную установить кодировку в командной строке можно воспользоваться командой «chcp », например «chcp 1251».
Для того чтобы это сделала программа на C++ необходимо подключить библиотеку windows.h и прописать две функции «SetConsoleCP()» и «SetConsoleOutputCP()».
Итог
Для сравнения воспользуемся таким кодом:
#include #include using namespace std; int main()< // Используется в 3-м варианте // SetConsoleCP(1251); SetConsoleOutputCP(1251); // =========================== // cout
Итоговый файл представлен в нескольких вариантах:
- Без изменения task.json и шрифта;
- С изменением task.json(cp866), но без изменения шрифта;
- С изменением task.json(cp1251) и шрифта.



Как можно заметить, в последнем варианте кодировка изменилась из-за указанных функций: «SetConsoleCP» и «SetConsoleCP».
The post image by Daniel Agrelo from Pixabay
2 комментария
Спасибо за статью. На онлайн-парах своей шараги пригодится 100% пригодится и для выполнения лабораторки тоже.
Дмитрий :
Начал пилить библиотеки небольшие себе под разработку на Пайтоне, столкнулся с этой же проблемой. После статьи всё стало отлично
Добавить комментарий Отменить ответ
Для отправки комментария вам необходимо авторизоваться.
Как скомпилировать с в visual studio code

Компиляция SASS/SCSS в CSS в VS CODE с помощью плагина Live Sass Compiler
14 апреля 2023
Оценки статьи
Еще никто не оценил статьюSASS (Syntactically Awesome Style Sheets) и SCSS (Sassy CSS) - это мощные препроцессоры CSS, которые предоставляют разработчикам множество дополнительных функций, таких как переменные, вложенность, миксины и многое другое, что делает стилизацию веб-сайтов более эффективной и организованной. Однако, браузеры не могут понимать эти языки препроцессоров напрямую, поэтому необходимо компилировать их в обычный CSS перед использованием на веб-страницах.
VS Code - одна из популярных интегрированных сред разработки (IDE) с множеством расширений для облегчения работы разработчиков. Одним из таких расширений является Live Sass Compiler, которое позволяет автоматически компилировать SASS/SCSS файлы в CSS и создавать уменьшенные версии CSS. Давайте рассмотрим, как установить и настроить это расширение.
Установка Live Sass Compiler
Для начала, откройте VS Code и перейдите в расширения VSCODE (Visual Studio Marketplace), либо используйте поиск расширений по идентификатору @glenn2223.live-sass . Установите расширение Live Sass Compiler и перезагрузите VS Code, если это требуется.

Настройка компиляции SASS/SCSS в CSS
Теперь, когда расширение установлено, откройте ваш файл SASS/SCSS в VS Code. Внизу на панели инструментов вы увидите надпись "Watch Sass" с иконкой глаза. Щелкните по ней, чтобы включить автоматическую компиляцию SASS/SCSS файлов в CSS.

При изменении файла SASS/SCSS, расширение будет автоматически компилировать его в CSS, и результат будет сохраняться в отдельном CSS файле.

Оптимизация CSS файла с помощью Live Sass Compiler
Вы также можете настроить различные параметры компиляции, используя настройки расширения.
Например, вы можете настроить расположение экспортируемого CSS файла, стиль компиляции CSS (расширенный или сжатый), имя расширения для экспортируемого файла и другие параметры.
Для этого нажмите Ctrl+Shift+P, введите "Открыть пользовательские настройки (JSON)" и откройте файл с настройками. Затем добавьте необходимые параметры в файл настройки.
Например, добавим следующий фрагмент:
settings.json
"liveSassCompile.settings.formats":[ "format": "compressed" >, ]
При компиляции SASS/SCSS файлов, ваш CSS файл будет максимально сжат.
Другие полезные настройки:
Подробнее о них на github.
settings.json
"liveSassCompile.settings.formats":[ "format": "expanded", "extensionName": ".css", "savePath": "/css" >, "extensionName": ".min.css", "format": "compressed", "savePath": "/dist/css" > ], "liveSassCompile.settings.excludeList": [ "**/node_modules/**", ".vscode/**" ], "liveSassCompile.settings.generateMap": true, "liveSassCompile.settings.autoprefix": [ "defaults" ] >Меню категорий
-
Загрузка категорий.
Добро пожаловать в Блог Разработчика Владислава Александровича.
Ведется медленная, но уверенная разработка функционала сайта.
Django Core: 0.3.4 / Next.js 1.0 / UPD: 05.06.2023
Отладка кода Go с помощью Visual Studio Code
В этом руководстве мы поговорим о том, как отладить код Go с помощью Visual Studio Code, а также установить необходимые расширения, инструменты анализа и отладчики.
Сначала мы создадим простое тестовое приложение, а затем рассмотрим использование обычных и условных точек останова.
Благодаря этому набору навыков вы сможете точнее оценить состояние вашего приложения в определенные моменты выполнения его кода.
Требования
- Базовые знания по Go.
- Копия Go на вашем компьютере. Чтобы установить Go, следуйте руководству Установка Go и настройка локальной среды разработки в macOS, Ubuntu или Windows.
- Установка Visual Studio Code на вашем компьютере.
- Плагин VSCide-Go. После установки плагина откройте любой файл .go в VS Code. В правом нижнем углу строки состояния вы увидите Install Analysis Tools. Нажмите на эту ссылку, чтобы установить пакеты Go, необходимые для эффективной работы плагина.
- Установка Delve, отладчика для Go с открытым исходным кодом. Подробные инструкции по установке для конкретных платформ вы найдете здесь.
1: Создание тестового приложения
В этом мануале мы будем использовать два примера для отладки кода Go:
- Программа Go, создающая файл JSON.
- Функция и тест.
Ниже вы найдете исходный код для первого примера – программы. Создайте файл main.go:
Добавьте в файл следующий код:
package main import ( "encoding/json" "fmt" "log" ) // Avenger represents a single hero type Avenger struct < RealName string `json:"real_name"` HeroName string `json:"hero_name"` Planet string `json:"planet"` Alive bool `json:"alive"` >func (a *Avenger) isAlive() < a.Alive = true >func main() < avengers := []Avenger< < RealName: "Dr. Bruce Banner", HeroName: "Hulk", Planet: "Midgard", >, < RealName: "Tony Stark", HeroName: "Iron Man", Planet: "Midgard", >, < RealName: "Thor Odinson", HeroName: "Thor", Planet: "Midgard", >, > avengers[1].isAlive() jsonBytes, err := json.Marshal(avengers) if err != nil < log.Fatalln(err) >fmt.Println(string(jsonBytes)) >
В этом коде мы определили структуру Avenger, а затем создали массив Avengers, изменили статус одного из них на “alive”, конвертировали результаты в JSON и, наконец, вывели их в STDOUT.
Вы можете запустить приложение с помощью команды:
Результат будет выглядеть так:
2: Отладка по точкам останова
Чтобы начать отладку, нам нужно создать конфигурацию. Нажмите на значок отладки в левой панели Visual Studio. Затем нажмите на шестеренку, чтобы создать конфигурацию.

Вы создадите файл конфигурации в .vscode/launch.json с показанным выше содержимым. Перенаправьте программу конфигурации на файл main.go; поскольку на данный момент у нас есть только файл main.go, мы можем перейти в root рабочей области:
Далее нам нужно добавить точку останова, потому что на таких точках и держится отладка.
Давайте добавим точку останова в строку 21 (func main()). Для этого кликните слева от номера строки, и вы увидите красную точку.

Затем нажмите либо F5, либо кнопку Launch в разделе Debug в левом верхнем углу, чтобы открыть представление Debug View.
Нажмите несколько раз кнопку Step Over на панели Debug Toolbar.

Отладчик в конечном итоге переместится на строку 40.

Раздел Debug покажет нам состояние текущей позиции точки останова.
Мы можем увидеть состояние или значение переменных в это конкретное время в разделе Variables.
Также можно просмотреть стек вызовов. Здесь показано, что на данный момент запущена функция main и строка 40.
Если вы продолжите нажимать Stepping Over, вы увидите, как изменится значение avengers: “Tony Stark” будет иметь значение Alive.
3: Добавление условных точек останова
VS Code предоставляет вам возможность редактировать точки останова, задавая им выражение (в большинстве случаев это логическое выражение).
Например, в строке 40:
avengers[1].isAlive()
мы могли бы поместить условие, что точка останова поднимается только тогда, когда выражение оценивается как истинное, как в avengers[1].Planet == “Earth”.
Для этого щелкните правой кнопкой мыши на точку останова и выберите Edit Breakpoint.
Даже если у вас нет точки останова, вы все равно можете щелкнуть правой кнопкой мыши, и вам будет предложено добавить условную точку останова – Add Conditional Breakpoint.
Давайте добавим условие здесь:
avengers[1].Planet == "Earth"

Теперь, если вы запустите отладчик с помощью F5, он не остановится на точке останова. Приложение будет работать нормально, и вы увидите результаты в консоли отладки.

Затем отредактируйте код, чтобы он соответствовал ожидаемому условию. Внесите такое изменение в main.go:
Когда мы снова запустим отладчик с помощью F5, откроется окно отладки, и вы увидите, что редактор останавливается в точке останова и что JSON не отображается в консоли Debug.

4: Выполнение отладочных тестов
Давайте добавим в файл main.go новую функцию, которая включит операцию сложения:
func add(a, b int) int
Создайте в том же каталоге тестовый файл main_test.go со следующим содержимым:
package main import "testing" func Test_add(t *testing.T) < a, b, c := 1, 2, 3 res := add(a, b) if res != c < t.Fail() >>
Данный код просто складывает два числа, а тест вызывает функцию.
Однако, если у вас установлен плагин VSCode-Go, вы увидите дополнительные параметры в верхней части функции — run test и debug test:

Вы можете нажать на run test, чтобы запустить тест и увидеть результаты в окне Output.
Для отладки теста (например, если мы не можем что-то понять) нужно добавить точку останова, как мы делали раньше, и нажать debug test.
Добавьте точку останова в строке 10, а затем нажмите на debug test.

Откроется представление, где мы можем использовать инструмент отладки, чтобы перейти и проверить состояние в разделе переменных.
Заключение
Отладка является важной частью разработки программного обеспечения, и такие инструменты, как Visual Studio Code, могут значительно облегчить нашу жизнь.
В этом мануале мы попробовали настроить базовую отладку кода. Теперь вы можете добавить отладчик в любой из ваших проектов и поэкспериментировать с ним.
- Install the Windows Build Tools:
