diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000000..6fc6efb10b --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,38 @@ +name: PHP Composer +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "main" ] + +permissions: write + contents: + +jobs: + build: latest + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v3 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" + # Docs: https://getcomposer.org/doc/articles/scripts.md + + # - name: Run test suite + # run: composer run-script test diff --git a/Build-Champion.md b/Build-Champion.md index efb28e3d9c..37c574ff96 100644 --- a/Build-Champion.md +++ b/Build-Champion.md @@ -19,8 +19,8 @@ Follow this as a rough guide for how to review a build: 1. Open the "Build" link which will go to GH Actions or ADO 2. Click into the failed step and review the failure -3. If an issue is already created for this failure, mark the thread with a ✅ to indicate it's actioned -4. If not action the failure and then mark the thread with ✅, here are some common failure types and how to handle them: +3. If an issue is already created for this failure, mark the thread with a ✅ to indicate that action has been taken on it +4. Otherwise take the action and then mark the thread with ✅, here are some common failure types and how to handle them: **Test failure:** If it looks like the test failed because of the linked change, ping the [area owner](#area-owners). diff --git a/Code-Editor-Roadmap.md b/Code-Editor-Roadmap.md index 9765685195..476d8de7fc 100644 --- a/Code-Editor-Roadmap.md +++ b/Code-Editor-Roadmap.md @@ -9,7 +9,7 @@ * [issue #9409](https://github.com/Microsoft/vscode/issues/9409): Outdent issue with Typescript * [issue #15598](https://github.com/Microsoft/vscode/issues/15598): Multi-line indents do not preserve partial indents -* [issue ##2272](https://github.com/Microsoft/vscode/issues/2272): Automatically indent "end" for ruby code +* [issue #2272](https://github.com/Microsoft/vscode/issues/2272): Automatically indent "end" for ruby code ## Find widget * [issue #15579](https://github.com/Microsoft/vscode/issues/15579): Regex search issue diff --git a/Coding-Guidelines.md b/Coding-Guidelines.md index 162b18cfa1..07ca9bd33c 100644 --- a/Coding-Guidelines.md +++ b/Coding-Guidelines.md @@ -25,8 +25,9 @@ We use tabs, not spaces. * All strings visible to the user need to be externalized ## UI labels -* Use title-style capitalization for command labels, buttons, and menu items (each word is capitalized). +* Use title case (each major word is capitalized) for command labels, buttons, and menu items * Don't capitalize prepositions of four or fewer letters unless it's the first or last word (e.g. "in", "with", "for"). +* Use sentence case (only first word is capitalized) for titles/headings in views and don't end with a period (e.g. "Build with agent mode") ## Style * Use arrow functions `=>` over anonymous function expressions diff --git a/Commit-Signing.md b/Commit-Signing.md index aac3164729..be542d3262 100644 --- a/Commit-Signing.md +++ b/Commit-Signing.md @@ -20,6 +20,8 @@ git config --global gpg.program "C:\Program Files (x86)\GnuPG\bin\gpg.exe" Install the necessary tools and configure GPG: +First, install Homebrew (https://brew.sh/). Then run the following commands: + ```bash brew install gpg2 gnupg pinentry-mac mkdir -p ~/.gnupg @@ -56,6 +58,7 @@ With the following options: - Expiration: `0` (does not expire) - Real Name: use your real name - Email address: use your Microsoft email address + - Note: If you use the setting "Keep my email addresses private" (in the [GitHub Email Settings](https://github.com/settings/emails)), you might need to set the private email address listed there as the email address on this step. - Comment: `Key for signing commits for Microsoft` - **Passphrase**: Pick a long, secure passphrase, which you'll easily remember. diff --git a/Copilot-Issues.md b/Copilot-Issues.md index 9808474002..d9e9779804 100644 --- a/Copilot-Issues.md +++ b/Copilot-Issues.md @@ -44,6 +44,12 @@ To look at the information that was send to and received from the Language Model LLM Request Log +### Chat Replay/Log Viewer + +The `.chatreplay.json` file can be viewed here: https://digitarald.github.io/vscode-chat-logs/ , either local-only va drag & drop or linked from an uploaded gist. The viewer also supports markdown logs (right-click `Copy All` in a conversation) and Chat Exports (command: `Chat: Export Chat…`. + +Chat Replay Viewer + ## Custom Instructions Logs To debug why your [custom instructions](https://code.visualstudio.com/docs/copilot/copilot-customization#_custom-instructions) are not used by the language model test the following. diff --git a/Custom-eslint-rules.md b/Custom-eslint-rules.md new file mode 100644 index 0000000000..7bfad6f747 --- /dev/null +++ b/Custom-eslint-rules.md @@ -0,0 +1,125 @@ +# Custom ESLint rules + +We use a set of custom [ESLint](http://eslint.org) to enforce repo specific coding rules and styles. These custom rules are run in addition to many standard ESLint rules we enable in the project. Some example custom rules includes: + +- Enforcing proper code layering +- Preventing checking in of `test.only(...)` +- Enforcing conventions in `vscode.d.ts` + +Custom rules are mostly used for enforcing or banning certain coding patterns. We tend to leave stylistic choices up to area owners unless there's a good reason to enforce something project wide. + +This doc provides a brief overview of how these rules are setup and how you can add a new one. + +# Resources +- [ESLint rules](https://eslint.org/docs/latest/extend/custom-rules) — General documentation about writing eslint rules +- [TypeScript ASTs and eslint](https://typescript-eslint.io/blog/asts-and-typescript-eslint/) — Look at how ESLint works with TS programs +- [ESTree selectors](https://eslint.org/docs/latest/extend/selectors) — Info about the selector syntax rules use to target specific nodes in an AST. Works similarly to css selectors. +- [TypeScript ESLint playground](https://typescript-eslint.io/play/#showAST=es) — Useful tool for figuring out the structure of TS programs and debugging custom rule selectors + + +# Custom Rule Configuration + +Custom rules are defined in the `.eslint-plugin-local` folder. Each rule is defined in its own TypeScript file. These follow the naming convention: + +- `code-RULE-NAME.ts` — General rules that apply to the entire repo. +- `vscode-dts-RULE-NAME.ts` — Rules that apply just to `vscode.d.ts`. + +These rules are then enabled in the `eslint.config.js` file. This is the main eslint configuration for our repo. It defines a set of file scopes which rules should apply to files in those scopes. + +For example, here's a configuration that enables the no `test.only` rule in all `*.test.ts` files in the VS Code repo: + +```ts +{ + // Define which files these rules apply to + files: [ + '**/*.test.ts' + ], + languageOptions: { parser: tseslint.parser, }, + plugins: { + 'local': pluginLocal, + }, + rules: { + // Enable the rule from .eslint-plugin-local/code-no-test-only.ts + 'local/code-no-test-only': 'error', + } +} +``` + +# Creating a new custom rule +This walks through the steps to create a new eslint rule: + +1. Create a new rule file under `.eslint-plugin-local`. Generally you should call it `code-YOUR-RULE-NAME.ts`, for example, `.eslint-plugin-local/code-no-not-null-assertions-on-undefined-values.ts` + +2. In this file, add the rule. Here's a template: + + ```ts + /*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + import * as eslint from 'eslint'; + + export = new class YourRuleName implements eslint.Rule.RuleModule { + + readonly meta: eslint.Rule.RuleMetaData = { + messages: { + customMessageName: 'message text shown in errors/warnings', + }, + schema: false, + }; + + create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener { + return { + [SELECTOR]: (node: any) => { + // Report errors if needed + return context.report({ + node, + messageId: 'customMessageName' + }); + } + }; + } + }; + ``` + + - Update the name of the class to match the name of your rule + - Add message entries for any errors you want to report + - Update `SELECTOR` with the [ESTree selector](https://eslint.org/docs/latest/extend/selectors) needed to target the nodes you are interested in. Use the [TypeScript ESLint playground](https://typescript-eslint.io/play/#showAST=es) to figure out which nodes you need and debug selectors + +3. Register the rule in `eslint.config.js` + + Generally this is just turning on the rule in the rule list like so: + + ```js + rules: { + // Name should match file name + 'local/code-no-not-null-assertions-on-undefined-values': 'warn', + ... + } + ``` + +Rules can also take custom arguments. For example, here's how we can pass arguments to a custom rule in the `eslint.config.js`: + +``` +rules: { + 'local/code-no-not-null-assertions-on-undefined-values': ['warn', { testsOk: true }], + ... +} +``` + +In these cases make sure to update the `meta.schema` property on your rule with the JSON schema for the arguments. You can access these arguments using `context.options` in the rule `create` function + + +## Adding fixes to custom rules +Fixes are a useful way to mechanically fix basic linting issues, such as auto inserting semicolons. These fixes typically work at the AST level, so they are a more reliable way to perform bulk fixes compared to find/replaces. + +To add a fix for a custom rule: + +1. On the `meta` for your rule, add `fixable: 'code'` + +2. When reporting an error in the rule, also include a `fix`. This is a function that takes a `fixer` argument and returns one or more fixes. + +See the [Double quoted to single quoted string covert fix](https://github.com/microsoft/vscode/blob/b074375e1884ae01033967bf0bbceeaa4795354a/.eslint-plugin-local/code-no-unexternalized-strings.ts#L128) for an example. The ESLint docs also have [details on adding fixes and the fixer api](https://eslint.org/docs/latest/extend/custom-rules#applying-fixes) + +The fixes can be run using `npx eslint --fix` in the VS Code repo \ No newline at end of file diff --git a/December-Test-Plan.md b/December-Test-Plan.md index de76cf0a89..9cf1311de3 100644 --- a/December-Test-Plan.md +++ b/December-Test-Plan.md @@ -11,7 +11,7 @@ Verify that long text now nicely wraps across multiple lines in the debug repl b - [x] linux @aeschli We have changed breakpoints states and now show it differently in the UI. Verify: -* new UI properly and intuitivly reflects if breakpoints are enabled, disabled, verified, or deactivated. +* new UI properly and intuitively reflects if breakpoints are enabled, disabled, verified, or deactivated. * breakpoints get hit / not hit depending on their enablement state ### Debug - extension debugging diff --git a/Endgame-testing-and-verification.md b/Endgame-testing-and-verification.md new file mode 100644 index 0000000000..213599eca4 --- /dev/null +++ b/Endgame-testing-and-verification.md @@ -0,0 +1,59 @@ +This page covers testing during the [endgame](https://github.com/microsoft/vscode/wiki/Running-the-Endgame) process. It's mainly for VS Code team members but others may find our general approach to testing and some of the specific tips of interest + +# General Philosophy +The VS Code team strives for a culture where all team members feel responsible for the quality of VS Code and are empowered to uphold and improve this quality. Testing and how we approach testing is a key part of this. + +It's not always the most fun to run through tests and verify issues, but this is a key part of upholding the quality of VS Code. When a bug is fixed, we want to confirm it really has been fixed. When a feature is committed to a milestone, we want to make sure it works as described. But it's more than that too. + +When going through a test-plan item or verifying an issue, it's not enough to mechanically through the exact flow listed so you can check it off and move on to the next item. Instead try to treat testing as more exploratory, open ended process. + +For bugs, try other cases beyond the original issue. Could the fix be improved? Are there similar bugs in other areas of the product? + +For features, ask yourself: does the feature makes sense as designed? Does it align with the rest of VS Code? Could be improved or extended? Could it cause problems for certain workflows or in the future? + +Approaching testing this way not only helps us ship a better product, it also makes testing more fun. Exploring new features and trying to break them becomes an interesting challenge. How can I break this? How else could it have been implemented? It can also be a great opportunity to learn about and explore a new area of the product. + +Don't be afraid about opening bugs or providing feedback. Getting fresh eyes on a feature is extremely valuable, and often interns will end up spot problems or offer perspective that a team of very senior engineers hadn't considered. If you see something that feels off during testing, open an issue. It doesn't have to be something major. You don't even have to be sure it is a bug. Just having the issue opened provides valuable feedback. Do this even for any part of VS Code, not just the feature you are testing/verification + +Critically, take this same testing mindset beyond endgame into your daily work too. We all use VS Code every day, so always report issues and confusion you run into in your day-to-day work too. We are all responsible for the quality of VS Code + + +# Starting questions to ask during testing + +- Does this feature work as described? Try other flows and variations too beyond exactly what the test-plan item describes +- Does this behavior make sense? Could it be simplified or improved? +- Does this behavior feel aligned with the rest of VS Code? +- Could a new user understand it? Can they learn about it? +- Can I break it? What happens if I try entering invalid values or going off of the recommended flow +-Does it work nicely for all sorts of VS Code setups and configurations and usage patterns (see notes on UI testing below) + +# Basics for testing UI features +- Is the feature accessible? + At the very least try using the keyboard to navigate, but you can also use a screen reader for more complete testing + +- Does it work at different zoom levels? + +- Does it work with different color themes, especially the high contrast themes? + +- Does it work with different window / UI component sizes and different workbench layouts? + +- When relevant, does it work with different icon themes or when disabling various UI features + +- If relevant, do the keybindings make sense? + +Are the command names good and if there are default keybindings do they conflict with existing VS Code / OS keybindings + +# Basics for testing APIs +- Try approaching it as a beginner who is unfamiliar with the space. Is there enough info to understand the API? + +- Do the JSDocs make sense? Make sure to check that links are rendered properly in IntelliSnese + +- For new package.json contributions, make sure the hover documentation in the package.json makes sense. Make sure they have reasonable IntelliSense suggestions. Make sure the snippet suggestions fill in correctly. Make sure you get an error for invalid configurations + +- Look at the names in the API. Are they consistent with other names in the product? + +- Does the API encourage correct usage? Are there any easy to miss complexities or footguns? + +- Does the API require a large amount of boilerplate? Is this something we should try to improve? + +- If there's an extension sample or written documentation, is it up to date? Does it build correctly? Do the docs in it make sense? \ No newline at end of file diff --git a/Extension-API-guidelines.md b/Extension-API-guidelines.md index 4461eca214..9752372e87 100644 --- a/Extension-API-guidelines.md +++ b/Extension-API-guidelines.md @@ -23,7 +23,7 @@ Events aren’t defined on the types they occur on but in the best matching name Private Events - -Private or instance events aren't accessible via globals but exist on objects, e.g., `FileSystemWatcher#onDidCreate`. *Don't* use private events unless the sender of the event is private. The rule of thumb is: 'Objects that can be accessed globally (editors, tasks, terminals, documents, etc)' should not have private events, objects that are private (only known by its creators, like tree views, web views) can send private events' +Private or instance events aren't accessible via globals but exist on objects, e.g., `FileSystemWatcher#onDidCreate`. *Don't* use private events unless the sender of the event is private. The rule of thumb is: 'Objects that can be accessed globally (editors, tasks, terminals, documents, etc) should not have private events, objects that are private (only known by its creators, like tree views, web views) can send private events'. Event naming - @@ -100,7 +100,7 @@ We define the API with strictNull-checks in mind. That means we use the optional Undefined is False - -The default value of an optional, boolean property is `false`. This is for consistency with JS where undefined never evaluates to `true` +The default value of an optional, boolean property is `false`. This is for consistency with JS where undefined never evaluates to `true`. JSDOC - @@ -108,19 +108,19 @@ We add JSDoc for all parts of the API. The doc is supported by markdown syntax. # Optional parameters (`?` vs `| undefined`) - For implementation, treat omitting a parameter with `?` the same as explicitly passing in `undefined` -- Use `| undefined` when you want to callers to always have to consider the parameter. -- Use `?` when you want to allow callers to omit the parameter. -- Never use `?` and `| undefined` on a parameter. Instead follow the two rules above to decide which version to use . -- If adding a new parameter to an existing function, use `?` as this allows the new signature to be backwards compatible with the old version. -- Do not add an overload to add an optional parameter to the end of the function. Instead use `?`. +- Use `| undefined` when you want callers to always have to consider the parameter +- Use `?` when you want to allow callers to omit the parameter +- Never use `?` and `| undefined` on a parameter. Instead follow the two rules above to decide which version to use +- If adding a new parameter to an existing function, use `?` as this allows the new signature to be backwards compatible with the old version +- Do not add an overload to add an optional parameter to the end of the function. Instead use `?` # Optional properties (`?` vs `| undefined`) - Do not write code that treats the absence of a property differently than a property being present but set to `undefined` - This can sometimes hit you on spreads or iterating through objects, so just something to be aware of -- For readonly properties on interfaces that VS Code exposes to extensions (this include managed objects, as well as the objects passed to events): - - Use `| undefined` as this makes it clear the property exists but has the value `undefined`. +- For readonly properties on interfaces that VS Code exposes to extensions (this includes managed objects, as well as the objects passed to events): + - Use `| undefined` as this makes it clear the property exists but has the value `undefined` - For readonly properties on options bag type objects passed from extensions to VS Code: - Use `?` when it is ok to omit the property diff --git a/Feature-Areas.md b/Feature-Areas.md index 3413465f5a..b2cdf81e5a 100644 --- a/Feature-Areas.md +++ b/Feature-Areas.md @@ -32,6 +32,6 @@ In addition there can be feature sub areas which are colored light blue. ||| |api|vscode extension API|| |install-update|install and update of vscode|| -|accessiblity|accessibility support|| +|accessibility|accessibility support|| |i18n|internationalization - Code, translation error|| |L10N|New UI language request in loc platform for language pack extension|| \ No newline at end of file diff --git a/How-to-Contribute.md b/How-to-Contribute.md index 3c6d0ad0dd..5c9fef1e2d 100644 --- a/How-to-Contribute.md +++ b/How-to-Contribute.md @@ -13,15 +13,36 @@ In order to download necessary tools, clone the repository, and install dependen You'll need the following tools: - [Git](https://git-scm.com) -- [Node.JS](https://nodejs.org/en/download/prebuilt-binaries), **x64** or **ARM64**, version `>=20.x` (also see [`.nvmrc`](https://github.com/microsoft/vscode/blob/main/.nvmrc), which may provide a more precise version to install) +- [Node.js](https://nodejs.org/en/download/prebuilt-binaries), **x64** or **ARM64**, version `>=20.x` (also see [`.nvmrc`](https://github.com/microsoft/vscode/blob/main/.nvmrc), which may provide a more precise version to install) + - Consider using `fnm` instead of `nvm`. See the section [Use the correct version of Node](https://github.com/microsoft/vscode/wiki/How-to-Contribute#use-the-correct-version-of-node) below for more details on how to set that up. - If using `nvm`, consider updating your default node installation with `nvm alias default ` - - Windows: do not pick the option to install Windows Build Tools, see the step below for instructions - - Windows: If using [`nvm-windows`](https://github.com/coreybutler/nvm-windows) on **ARM64**, you must postfix each command with `arm64`. Eg: `nvm install 22 arm64` + - Windows: + - Do not pick the option to install Windows Build Tools, see the step below for instructions + - If using [`nvm-windows`](https://github.com/coreybutler/nvm-windows) on **ARM64**, you must postfix each command with `arm64`. Eg: `nvm install 22 arm64` + - macOS/Linux: + - When using `nvm` with the zsh shell, ensure that the nvm initialization script is added to `.zprofile` rather than `.zshrc`. The `.zshrc` file is only sourced for interactive shells (such as those in the VS Code terminal panel), while VS Code build tasks use a non-interactive shell that sources `.zprofile` but not `.zshrc`. Placing the script in `.zprofile` helps maintain a consistent Node.js version across both environments. + - [Python](https://www.python.org/downloads/) (required for node-gyp; check the [node-gyp readme](https://github.com/nodejs/node-gyp#installation) for the currently supported Python versions) - Make sure `python` can run from a command line prompt without error - Your Python version may not come with all the proper utilities, it is recommended to install the `setuptools` package (`pip install setuptools`) otherwise you may get difficult to debug errors. - A C/C++ compiler tool chain for your platform: - **Windows 10/11 (x64 or ARM64)** + -
Quick install via winget (Windows Package Manager) + Select your operating system, and run the given command in a terminal. +
Windows x64/x86 + winget install --id Microsoft.VisualStudio.2022.BuildTools -e --source winget --override "--add Microsoft.VisualStudio.Component.Windows11SDK.22621 --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre --add Microsoft.VisualStudio.Component.VC.ATL.Spectre --add Microsoft.VisualStudio.Component.VC.ATLMFC.Spectre" +
+
Windows ARM + winget install --id Microsoft.VisualStudio.2022.BuildTools -e --source winget --override "--add Microsoft.VisualStudio.Component.Windows10SDK.20348 --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.Runtimes.ARM.Spectre --add Microsoft.VisualStudio.Component.VC.ATL.ARM.Spectre --add Microsoft.VisualStudio.Component.VC.MFC.ARM.Spectre" +
+
Windows ARM64 + winget install --id Microsoft.VisualStudio.2022.BuildTools -e --source winget --override "--add Microsoft.VisualStudio.Component.Windows10SDK.20348 --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.Runtimes.ARM64.Spectre --add Microsoft.VisualStudio.Component.VC.ATL.ARM64.Spectre --add Microsoft.VisualStudio.Component.VC.MFC.ARM64.Spectre" +
+ + For details on the packages listed, see [Visual Studio Build Tools component directory](https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022#desktop-development-with-c) + +
+ - Install the Visual C++ Build Environment by either installing the [Visual Studio Build Tools](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools) or the [Visual Studio Community Edition](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community). The minimum workload to install is `Desktop Development with C++`. But there are additional components from "Individual components": - `MSVC v143 - VS 2022 C++ x64/x86 Spectre-mitigated libs (Latest)` (use `ARM64`, not `ARM` for Windows on ARM, but the x64/x86 may still be needed) - `C++ ATL for latest build tools with Spectre Mitigations` @@ -34,6 +55,9 @@ You'll need the following tools: - **macOS** - [Xcode](https://developer.apple.com/xcode/resources/) 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 + - **Note**: if you have multiple installations of clang/clang++, make sure you include the following lines in your `~/.bash_profile` file to point CMake to the correct binaries: + - `export CXX="$(xcode-select -p)/usr/bin/clang++"` + - `export CC="$(xcode-select -p)/usr/bin/clang"` - **Linux** * 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`. @@ -48,7 +72,7 @@ Make sure you cloned `vscode` into a folder without any spaces in the path hiera 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 `git clean -xfd` 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 `npm`. This will compile all native node modules for a 32 bit architecture. Similarly, when cross-compiling for ARM, set `npm_config_arch` to `arm`. +> 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 `npm`. 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](http://www.johnpapa.net/how-to-use-npm-global-without-sudo-on-osx/). @@ -121,6 +145,21 @@ Manage 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`. +### Use the correct version of Node + +Before installing and building, ensure you are using the correct version of Node. + +It's recommended you install [`fnm`](https://github.com/Schniz/fnm) and run the following command in your `vscode` folder: + +``` +fnm use +``` + +> [!TIP] +> When [configuring fnm](https://github.com/Schniz/fnm#shell-setup) you can add the `--use-on-cd` flag and then `fnm use` will be automatically run whenever you navigate to a new directory. + +Otherwise, check the `.nvmrc` file in the `vscode` folder to see the current version of Node being used and then update Node however you see fit. + ### Build Install and build all of the dependencies using `npm`: diff --git a/Iteration-Plans.md b/Iteration-Plans.md index f9479ee411..7961a7f819 100644 --- a/Iteration-Plans.md +++ b/Iteration-Plans.md @@ -1,3 +1,24 @@ +### November 2025 + +* [Iteration Plan](https://github.com/microsoft/vscode/issues/277757) +* [Endgame](https://github.com/microsoft/vscode/issues?q=is%3Aissue+label%3Aendgame-plan+milestone%3A%22November+2025%22) + + +### October 2025 + +* [Iteration Plan](https://github.com/microsoft/vscode/issues/271045) +* [Endgame](https://github.com/microsoft/vscode/issues?q=is%3Aissue+label%3Aendgame-plan+milestone%3A%22October+2025%22) + +### September 2025 + +* [Iteration Plan](https://github.com/microsoft/vscode/issues/266653) +* [Endgame](https://github.com/microsoft/vscode/issues?q=is%3Aissue+label%3Aendgame-plan+milestone%3A%22September+2025%22) + +### August 2025 + +* [Iteration Plan](https://github.com/microsoft/vscode/issues/260895) +* [Endgame](https://github.com/microsoft/vscode/issues?q=is%3Aissue+label%3Aendgame-plan+milestone%3A%22August+2025%22) + ### July 2025 * [Iteration Plan](https://github.com/microsoft/vscode/issues/255701) diff --git a/Keybinding-Issues.md b/Keybinding-Issues.md index d2edb91a20..c65540363f 100644 --- a/Keybinding-Issues.md +++ b/Keybinding-Issues.md @@ -43,7 +43,7 @@ The first keydown event is for the `MetaLeft` key (`cmd`) and cannot be dispatch * Are you connecting to the Linux machine via some form of virtualization or remote desktop software? * **symptoms**: e.g. pressing AltGr acts as `Backspace`, pressing C acts as `ArrowLeft`, etc. * **solution**: use `"keyboard.dispatch": "keyCode"` in your settings and restart VS Code. - * **explanation**: VS Code on Linux dispatches keybindings using scan codes to accomodate various keyboard layouts. This works well when sitting physically at the machine and the OS is the one creating keyboard events, but some virtualization / remote desktop software creates keyboard events with incorrect scan codes. + * **explanation**: VS Code on Linux dispatches keybindings using scan codes to accommodate various keyboard layouts. This works well when sitting physically at the machine and the OS is the one creating keyboard events, but some virtualization / remote desktop software creates keyboard events with incorrect scan codes. * Are you switching keyboard layouts while VS Code is running? * **symptoms**: VS Code keybindings reflect the keyboard layout that was active when VS Code was launched. diff --git a/Known-issues.md b/Known-issues.md index e630e1cf9b..4d0253e190 100644 --- a/Known-issues.md +++ b/Known-issues.md @@ -19,5 +19,5 @@ reported by [**alexey-kozlenkov**](https://github.com/Microsoft/vscode/issues/12 reported by [**rcdmk**](https://github.com/Microsoft/vscode/issues/12637#issuecomment-277464550) > I have another trick that does work as long as I keep focus on the VS code window: - > 1. Tap with tree fingers, so Search/Cortana pannel shows up to the left of screen. + > 1. Tap with three fingers, so Search/Cortana panel shows up to the left of screen. > 2. Swipe with two fingers over the VS code window and notice that the document does scroll \ No newline at end of file diff --git a/Lists-And-Trees.md b/Lists-And-Trees.md index 4f8c34d691..ea2fc90d59 100644 --- a/Lists-And-Trees.md +++ b/Lists-And-Trees.md @@ -26,7 +26,7 @@ Apart from being a virtual rendering engine, the `List` provides quite a lot of ### Index Tree -A tree UI widget should be able to represent tree-like data, eg. a file explorer. A rendered tree can always be rendered as a list; it is each row's indentation level and twistie indicators which give the user the perception of tree structure. By leveraging the virtual rendering functionalites of the list we can use composition to create a tree widget. +A tree UI widget should be able to represent tree-like data, eg. a file explorer. A rendered tree can always be rendered as a list; it is each row's indentation level and twistie indicators which give the user the perception of tree structure. By leveraging the virtual rendering functionalities of the list we can use composition to create a tree widget. There is the question of API: how can we keep a tree-like structure API relatively simple, yet allow for complex operations, such as removing and inserting whole subtrees? If we take the same `splice` analogy as the list's (pick a location, remove some elements and add other elements), it's possible to come up with a tree `splice` call, in which the location is multi-dimensional (the first element of the `start` array represents the index in the root's children array; the `n`-th element of the `start` array represents the index in the `n - 1`-th children array) and the elements to insert are entire subtrees. @@ -95,4 +95,4 @@ Here are the results from profiling all these cases on the same machine along wi | **Filter to One** | 970 ms | 78 ms | 12.4x | | **Collapse All** | 30.000 ms 😱 | 625 ms | **48x** 😎 | -While the speedup results are impressive, some of the absolute values are still unnaceptable: 625ms for collapsing all tree nodes will eat up a large chunk of JavaScript time, drastically reducing our frame rate, even if collapsing all nodes is a punctual operation. The good news is that there is still lots of room for improvement, given that we now have a solid algorithm and data structure foundation on which can iterate much easier. Stay tuned! \ No newline at end of file +While the speedup results are impressive, some of the absolute values are still unacceptable: 625ms for collapsing all tree nodes will eat up a large chunk of JavaScript time, drastically reducing our frame rate, even if collapsing all nodes is a punctual operation. The good news is that there is still lots of room for improvement, given that we now have a solid algorithm and data structure foundation on which can iterate much easier. Stay tuned! \ No newline at end of file diff --git a/Notebook-documentation.md b/Notebook-documentation.md index 2559f8ece5..a48d8d94a1 100644 --- a/Notebook-documentation.md +++ b/Notebook-documentation.md @@ -29,7 +29,7 @@ Since we are using the `TextModelResolverService` for cell's text model resoluti ## Viewport rendering -The viewport rendering of notebook list view is a "guess and validate" process. It will calcuate how many cells/rows it can render within the viewport first, have them all rendered, and then ask for their real dimensions, and based on the cell/row dimensions it will decide if it needs to render more cells (if there is still some room in the viewport) or remove a few. +The viewport rendering of notebook list view is a "guess and validate" process. It will calculate how many cells/rows it can render within the viewport first, have them all rendered, and then ask for their real dimensions, and based on the cell/row dimensions it will decide if it needs to render more cells (if there is still some room in the viewport) or remove a few. For short, the process is more or less @@ -103,7 +103,7 @@ Since most elements' positions are absolute and there is latency between the two * Fewer layout messages between the main and iframe * Less flickering and forced reflow on scrolling -While we continue optimizing the layout code, we need to make sure that the new optimization won't lead to regression in above three aspects. Here is a list of existing optimziations we already have and we want to make sure they still perform well when updating layout code. +While we continue optimizing the layout code, we need to make sure that the new optimization won't lead to regression in above three aspects. Here is a list of existing optimizations we already have and we want to make sure they still perform well when updating layout code. ## Avoid flickering on resize of cells above current viewport @@ -164,7 +164,7 @@ will genrate text output `2`. The re-rendering of the output is fast and we want 2. In 200ms, we will reset the output height to `0`, unless there is a new output rendered 2. Received new output 1. Re-render the new output - 2. Calcuate the height of the new output, update layout + 2. Calculate the height of the new output, update layout If the new output is rendered within 200ms, users won't see the UI movement. @@ -192,7 +192,7 @@ We also warm up all rendered markdown in the document, from top to bottom, when * require our own serialization/deserialization * Performance * `window.find` can be slow - * We currently travese the DOM tree to figure out which cell/output contain the find match belongs to, it's really costly. One idea is checking the absolute position of the find match and compare it with output container positions. + * We currently traverse the DOM tree to figure out which cell/output contain the find match belongs to, it's really costly. One idea is checking the absolute position of the find match and compare it with output container positions. * Search only rendered outputs * MutationObserver for output change * Change active selection to the beginning of the new output and then request `window.find` diff --git a/Publish-vscode-types.md b/Publish-vscode-types.md index 4f96a9aba1..d9c1f346eb 100644 --- a/Publish-vscode-types.md +++ b/Publish-vscode-types.md @@ -18,7 +18,7 @@ Example of PR when releasing 1.84 - https://github.com/DefinitelyTyped/Definitel 4. Update the minor version in `"version"` property in `types/vscode/package.json`, e.g., `1.83.9999` to `1.84.9999` (`9999` is not just an example) 5. Submit the PR - If there are any lint failures in the CI job for the PR, you can disable tests in either the `tslint.json` or `.eslintrc.json` files. But first check to make sure that the lint failure isn't pointing out a real issue in our `vscode.d.ts` or with the copy/paste job. -6. Ask either @jrieken or @kieferrm to merge the PR. +6. Ask either @mjbvz, @jrieken, or @kieferrm to merge the PR. 7. `@types/vscode` will be published in ~10 minutes. 8. Make sure a correct version of `@types/vscode` was published, e.g., if you're releasing VS Code 1.84, you should see `@types/vscode` version 1.84.0 [here](https://www.npmjs.com/package/@types/vscode) diff --git a/Roadmap-2020.md b/Roadmap-2020.md index 35214302b6..2c75a449a2 100644 --- a/Roadmap-2020.md +++ b/Roadmap-2020.md @@ -217,7 +217,7 @@ VS Code is made possible through a wide range of technologies. Below are example ## Explorations -- [ ] Explore support to synchronize more state when opening the same folder in different VS Code installs such as untitled files, open files, focussed editor. +- [ ] Explore support to synchronize more state when opening the same folder in different VS Code installs such as untitled files, open files, focused editor. - [ ] Explore how to better provide support for low-end devices. - [ ] :runner: Explore how to support new user in learning VS Code (interactive exploration mode, videos) - [ ] Explore how to make it easier to show, tell, and share your VS Code customizations. diff --git a/Runtime-debugging.md b/Runtime-debugging.md index 37cb5d1a20..47019dce81 100644 --- a/Runtime-debugging.md +++ b/Runtime-debugging.md @@ -1,6 +1,8 @@ ## Table of Contents - [CPU profiling unresponsive window via tracing](#tracing-cpu-profiler) - [Using samply on macOS](#samply-sampling-profiler) +- [Using samply on windows](#samply-sampling-profiler) +- [Using samply on linux](#samply-sampling-profiler) - [Using etw on windows](#etw-windows-profiler) @@ -32,6 +34,26 @@ If you have an unsigned build of VSCode, then samply can be used to capture both You can inspect the profile with `samply.exe load --breakpad-symbol-dir profile.json.gz` +## Using samply on windows + +If you want to capture only application related cpu profile with both JIT and native traces + +* Download the latest release of https://github.com/mstange/samply/releases +* Start from the command line with following `samply.exe record -s -o profile.json.gz --browsers -- /Microsoft\ VS\ Code/Code.exe --js-flags="--enable-etw-stack-walking --interpreted-frames-native-stack"` +* Perform the steps for unresponsiveness or slow startups etc +* Exit the application and the profile will be saved to `profile.json.gz` + +You can inspect the profile with `samply.exe load --breakpad-symbol-dir profile.json.gz` + +## Using samply on linux + +* Download the latest release of https://github.com/mstange/samply/releases +* Start from the command line with following `samply.exe record -s -o profile.json.gz --browsers -- /code --js-flags="--perf-basic-prof --perf-prof-unwinding-info --interpreted-frames-native-stack"` +* Perform the steps for unresponsiveness or slow startups etc +* Exit the application and the profile will be saved to `profile.json.gz` + +You can inspect the profile with `samply.exe load --breakpad-symbol-dir profile.json.gz` + ## Using etw on windows @@ -40,8 +62,10 @@ You can inspect the profile with `samply.exe load --breakpad-symbol-dir p * Select the following options under `Resource Analysis` 1) CPU Usage 2) File I/O activity - 3) Pool usage - 4) VirtualAlloc usage + 3) Registry I/O activity + 4) Pool usage + 5) VirtualAlloc usage + 6) GPU activity * Set `Performance Scenario` to `General`, `Detail level` to `verbose` and `Logging mode` to `file` * Start the recorder * Start the VSCode application from the terminal with the following additional flags `--js-flags="--enable-etw-stack-walking --interpreted-frames-native-stack"` diff --git a/Search-Issues.md b/Search-Issues.md index 55b952e890..1fc35d01f6 100644 --- a/Search-Issues.md +++ b/Search-Issues.md @@ -8,7 +8,7 @@ Besides `.gitignore`, we also look at the `.ignore`, `.rgignore`, and `.git/info > **Tip**: You can set `"search.useIgnoreFiles": false` to disable using the `.gitignore` file for search -An easy way to validate whether exclude setttings or ignore files are affecting your search is to turn off the "Use Exclude Settings and Ignore Files" button in the search viewlet. This is the gear button in the lower right corner: +An easy way to validate whether exclude settings or ignore files are affecting your search is to turn off the "Use Exclude Settings and Ignore Files" button in the search viewlet. This is the gear button in the lower right corner: ![Use Exclude Settings and Ignore Files button](https://user-images.githubusercontent.com/8586769/132767680-dd9048dc-beef-4849-a5cd-2cfadcd01e19.png) diff --git a/Source-Code-Organization.md b/Source-Code-Organization.md index 464e3f1931..ed7c294928 100644 --- a/Source-Code-Organization.md +++ b/Source-Code-Organization.md @@ -1,13 +1,15 @@ -Visual Studio Code consists of a layered and modular `core` (found as `src/vs`) that can be extended using extensions. Extensions are run in a separate process referred to as the -`extension host.` Extensions are implemented by utilising the [extension API](https://code.visualstudio.com/docs/extensions/overview). Built-in extensions can be found in the `extensions` folder. +Visual Studio Code consists of a layered and modular `core` that can be extended using extensions. Extensions are run in a separate process referred to as the +`extension host`. Extensions are implemented by utilising the [extension API](https://code.visualstudio.com/docs/extensions/overview). + +The `core` can be found under the `src/vs/` folder. Built-in extensions can be found under the `extensions/` folder. # Layers The `core` is partitioned into the following layers: - `base`: Provides general utilities and user interface building blocks that can be used in any other layer. - `platform`: Defines service injection support and the base services for VS Code that are shared across layers such as `workbench` and `code`. Should not include `editor` or `workbench` specific services or code. -- `editor`: The "Monaco" editor is available as a [separate downloadable](https://microsoft.github.io/monaco-editor/) component. -- `workbench`: Hosts the "Monaco" editor, notebooks, and custom editors and provides the framework for panels like the Explorer, Status Bar, or Menu Bar, leveraging [Electron](https://www.electronjs.org/) to implement the VS Code desktop application and browser APIs to provide VS Code for the Web. +- `editor`: Monaco Editor Core. Note: The full [Monaco Editor](https://microsoft.github.io/monaco-editor/) is defined in a separate repo https://github.com/microsoft/monaco-editor, which adds some programming language features on top of the Monaco Editor Core and publishes the combination as an npm package. See that repo's [CONTRIBUTING.md](https://github.com/microsoft/monaco-editor/blob/main/CONTRIBUTING.md) for a diagram that explains how these are related. +- `workbench`: Hosts the Monaco Editor Core, notebooks, and custom editors and provides the framework for panels like the Explorer, Status Bar, or Menu Bar, leveraging [Electron](https://www.electronjs.org/) to implement the VS Code desktop application and browser APIs to provide VS Code for the Web. - `code`: The entry point to the desktop app that stitches everything together, this includes the Electron main file, shared process, and the CLI for example. - `server`: The entry point to our server app for remote development. @@ -30,7 +32,8 @@ The `core` of VS Code is fully implemented in [TypeScript](https://github.com/mi - may use code from: `common`, `node`, `electron-utility`
- +environments +
# Dependency Injection diff --git a/Terminal-Issues.md b/Terminal-Issues.md index f9b1aa064d..4ed4f13392 100644 --- a/Terminal-Issues.md +++ b/Terminal-Issues.md @@ -48,6 +48,36 @@ For some terminal issues it's useful to get trace logs, this can reveal at what If for some reason you're unable to restart VS Code like you're running in a remote, you can change the log level via the command palette (F1 `Developer: Set Log Level...`). +### Why was a terminal command auto approved in chat? + +The terminal tool in chat has a [powerful auto approve feature](https://code.visualstudio.com/docs/copilot/chat/chat-tools#_automatically-approve-terminal-commands) that you can enable in the allow dropdown. Once enabled, this will enable a set of default auto approval rules (unless `"chat.tools.terminal.ignoreDefaultAutoApproveRules": true` is set), you can see this set inside VS Code by auto completing the `chat.tools.terminal.autoApprove` setting in your settings.json file. For example this includes the following rules: + +```json +{ + "find": true, + "/^find\\b.*-(delete|exec|execdir|fprint|fprintf|fls|ok|okdir)\\b/": false, +} +``` + +This allows the `find` command in general, but not a set of arguments that can either write to arbitrary files or execute arbitrary commands. + +In addition to the default rules, enabling auto approve will also enable auto approval rules in your [settings](https://code.visualstudio.com/docs/configure/settings) (user, profile, remote and workspace scopes). + +In order to be approved a _command line_ must: + +1. Achieve one of the following: + - All sub-commands are auto approved by a rule. For example, `foo && bar` would need a `foo` and a `bar` rule. + - The command line was auto approve by a rule. For example, `foo && bar` would match `"/^foo/": { "approve": true, "matchCommandLine": true }`. +2. No sub-commands or command lines are _denied_ by a false auto auto approve rule. For example, `"foo": false` will always block the `foo` command regardless of arguments. +3. For any detected file writes (only redirection at the time of writing), the command passes the rules defined by the `chat.tools.terminal.blockDetectedFileWrites` setting. By default this allows writing to workspace files as typically you will have an SCM protecting the content, and the [timeline view](https://code.visualstudio.com/docs/getstarted/userinterface#_timeline-view) may also allow accessing file history. So `cat README.md > README2.md` will intentionally allow writing to README2.md, or something like `cat /dev/null > README.md` can delete the content of a file. + +If you see a command unexpectedly auto approved, you can follow these steps to diagnose why it was auto approve: + +1. Hovering the tool call's check icon should tell you which rule(s) were used to approve it which can be clicked to go directly to them in your settings file. +2. Opening the Output panel and selecting the Terminal channel will show detailed logging on the reasoning of how the command was approved. + +Note also that we use tree-sitter to parse the commands and extract sub-commands, we use [this PowerShell grammar](https://github.com/airbus-cert/tree-sitter-powershell) for pwsh and [the official bash grammar](https://github.com/tree-sitter/tree-sitter-bash) for everything else. This does mean that using auto approve on zsh may approve something unexpected when there is a conflict with bashes syntax, this is one of the "best effort" things that's talked about in the modal opt-in warning. You can read more about this and other related concerns in the caution section in [the docs](https://code.visualstudio.com/docs/copilot/chat/chat-tools#_automatically-approve-terminal-commands). + ### Using showkey to investigate keybinding issues There is a utility called `showkey` which will print the character codes as received by the application, this is similar to escape sequence logging above but's evaluated on the process side. Install `showkey` by installing the `kbd` package on Linux or `showkey` on homebrew, for example: @@ -83,6 +113,14 @@ Known rendering problems: Sometimes terminal wrapping doesn't work as expected, for example a line that is expected to wrap will start overwriting the first part of the wrapped line. This type of problem is typically related to the backend and frontend's column count differing. You can get the frontend's column count by counting the number of cells in a line, for the backend `stty -a | grep columns` should tell you. +### Prompt input detection + +To power features like [terminal IntelliSense](https://code.visualstudio.com/docs/terminal/shell-integration#_intellisense-preview) and general understanding of the command that was run in the terminal, we detect what is happening in the prompt by leveraging [shell integration](https://code.visualstudio.com/docs/terminal/shell-integration). When these feature aren't working as expected you can check VS Code's understanding of the prompt input by hovering the terminal tab and clicking Show Details on the bottom. Taking a screenshot of this is helpful to diagnose problems in this area. + +### Investigating buffer synchronization issues with Windows/ConPTY + +The helper [ConsoleMonitor.exe](https://github.com/microsoft/vscode/wiki/bin/ConsoleMonitor.exe) is available that is built from [the Windows Terminal repo](https://github.com/microsoft/terminal/blob/b56f61eca1b931ac03aaa8ad148bd95112e42ba1/src/tools/ConsoleMonitor/main.cpp) allows showing the actual buffer maintained by ConPTY in a console window. To do this, just download the binary and run it within the terminal you want to track. + ## Why did you close my issue? We get _a lot_ of issues and have to split our time between responding to and issues and actually improving the product. Because of this, we have a pretty high bar on issue quality and reproducibility, if we can't reproduce the issue we may have to close it off since we cannot action it. diff --git a/VS-Code-Speech.md b/VS-Code-Speech.md index c268d842e7..7076d59340 100644 --- a/VS-Code-Speech.md +++ b/VS-Code-Speech.md @@ -14,7 +14,7 @@ Install the [GitHub Copilot Chat](https://marketplace.visualstudio.com/items?ite ## Keybindings -For a quick experience of starting to listen from the microphone and submitting when done you can assign the following keybinding squence: +For a quick experience of starting to listen from the microphone and submitting when done you can assign the following keybinding sequence: ```json { diff --git a/_Sidebar.md b/_Sidebar.md index 36df6b2b02..edfd6832d0 100644 --- a/_Sidebar.md +++ b/_Sidebar.md @@ -11,6 +11,7 @@ * [[Release Process]] * [[Running the Endgame]] * [[Writing Test Plan Items]] + * [[Endgame testing and verification]] * [[Sanity Check]] * [[Related Projects]] @@ -35,6 +36,7 @@ * [[Contributor License Agreement]] * [[Extension API Guidelines]] * [[Accessibility Guidelines]] +* [[Custom ESLint rules]] **Documentation** * [Extensions](https://code.visualstudio.com/docs/extensions/overview) diff --git a/bin/ConsoleMonitor.exe b/bin/ConsoleMonitor.exe new file mode 100644 index 0000000000..3727b6c178 Binary files /dev/null and b/bin/ConsoleMonitor.exe differ