Extension authoring · code.visualstudio.com

Update 1.66.1: The update addresses these issues.

Update 1.66.2: The update addresses these security issues.

Downloads: Windows: x64 Arm64 | Mac: Universal Intel silicon | Linux: deb rpm tarball Arm snap


Welcome to the March 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:

If you'd like to read these release notes online, go to Updates on code.visualstudio.com.

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.

Highlights short: If you just have 60 seconds, check out the March VS Code release highlights video to quickly see what's new.

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.

Accessibility

The team works hard to make VS Code one of the most accessible editors available. This release contains several improvements to help usability and accessibility:

Workbench

Local history

Local history of files is now available in the Timeline view. Depending on the configured settings, every time you save an editor, a new entry is added to the list:

Each local history entry contains the full contents of the file at the time the entry was created and in certain cases, can provide more semantic information (for example, indicate a refactoring).

From an entry you can:

  • Compare the changes to the local file or previous entry.
  • Restore the contents.
  • Delete or rename the entry.

There are new global commands to work with local history:

  • workbench.action.localHistory.create - Create a new history entry for the active file with a custom name.
  • workbench.action.localHistory.deleteAll - Delete all history entries across all files.
  • workbench.action.localHistory.restoreViaPicker - Find a history entry to restore across all files.

These commands don't have default keybindings but you can add your own keyboard shortcuts.

There are also new settings to work with local history:

  • workbench.localHistory.enabled - Enable or disable local history (default: true).
  • workbench.localHistory.maxFileSize - File size limit when creating a local history entry (default: 256 KB).
  • workbench.localHistory.maxFileEntries - Local history entries limit per file (default: 50).
  • workbench.localHistory.exclude - Glob patterns for excluding certain files from local history.
  • workbench.localHistory.mergeWindow - Interval in seconds during which further changes are added to the last entry in local file history (default 10s).

A new filter action in the Timeline view toolbar allows you to enable or disable individual providers:

Timeline filter drop down with Git History unchecked and Local History checked

Note: Local history entries are stored in different locations depending on your use of VS Code. When opening local files, the entries are persisted in the local user data folder and when opening remote files, they will be stored on the remote user data folder. When no file system is available (for example, in certain cases when using VS Code for Web), entries are stored into IndexedDB.

Settings editor

Language filter

Users can now type @lang:languageId in the Settings editor search box to view and edit all settings that can be configured for the language with ID languageId. This way, users can view language-specific settings, also known as language overrides.

Note that these overrides remain configured until explicitly reset by clicking in the gear icon and resetting the setting.

The short video below has the language filter set to @lang:css to display all possible CSS language override settings.

Theme: Light Pink

Workspace and Folder settings preservation

Workspace and folder settings in the Settings editor are now preserved until manually reset by the user. This change helps the case where the user wants to explicitly specify a workspace setting value that is equal to the default value of a setting, but is different from the user setting value. Previously, users had to open the workspace settings JSON file to set this value.

Below the editor tab size is set in Settings editor Workspace tab and it is automatically added to the workspace's settings.json file.

Theme: Light Pink

Primary notification buttons

The first button of a notification now appears with a primary color to distinguish from other buttons. This follows the same patterns as dialogs.

Notification where first button is displayed as green primary color

Theme: GitHub Dark

New context keys for editors

There are new context keys indicating whether an editor is the first or last in an editor group:

  • activeEditorIsFirstInGroup- Whether the active editor is the first one in its group.
  • activeEditorIsLastInGroup- Whether the active editor is the last one in its group.

These context keys can be used to conditionally enable keyboard shortcuts using when clauses.

Default binary editor

A new setting, workbench.editor.defaultBinaryEditor, lets you circumvent the binary file warning and automatically open the editor type of your choosing when a binary file is detected. You can select the default binary editor ID from a dropdown in the Settings editor or via IntelliSense in settings.json.

Smoother authentication experiences

You may notice smoother authentication flows of both GitHub and Microsoft.

  • For GitHub authentication, we've removed the initial Continue page so your log in experience requires one less step.
  • For Microsoft authentication, we try to minimize the number of times you are sent out of VS Code to log in, if you've already logged in with Microsoft for Settings Sync or another extension.

Install pre-release and normal extensions together from CLI

VS Code now supports installing pre-release and normal extensions together from the command line. For example, the following command line instruction will install the pre-release version of GitHub.vscode-pull-request-github extension and release version of GitHub.remotehub extension:

"ordered_list": {
  "scope": "markdown",
  "prefix": "ol",
  "body": [
    "$CURSOR_NUMBER. $0"
  ],
  "description": "Add ordered list"
}

Updated source control decorators

In order to make the source control decorators more visible for accessibility, we've added a new pattern for modified lines and increased the contrast for all decorators.

Bracket pair colorization

There is a new setting editor.bracketPairColorization.independentColorPoolPerBracketType. When set to true, each bracket type ({ ... } or ( ... )) will use its own color pool for colorization. Thus, nested brackets of different types will have the same color.

A screenshot that demonstrates independent color pools turned on

A screenshot that demonstrates independent color pools turned off

Improved language detection

Last iteration we added the setting workbench.editor.historyBasedLanguageDetection to configure whether to make use of a new language detection strategy that takes into consideration the file types you have opened. This setting is now enabled by default, and a new setting workbench.editor.preferHistoryBasedLanguageDetection was added to give more priority to the results from this strategy.

VS Code for the Web

Drag and drop folders

You can now drag and drop local files and folders into a browser window opened on vscode.dev or insiders.vscode.dev with a browser that supports the web file system access API to access the contents. This works both when dropping over the editor area as well as the File Explorer.

Remote Repositories

Extension refactoring

Previously, the Azure Repos extension depended directly on the GitHub Repositories extension. Azure Repos and GitHub Repositories now depend on a common extension, Remote Repositories, which supports common workflows across GitHub and Azure Repos. All APIs previously exposed by the GitHub Repositories extension are now exposed by Remote Repositories.

Reminder to sync repository

When you reopen a repository with uncommitted changes, by default Remote Repositories does not display the latest version of your repository. We now display a dialog to manually sync your repository so that your repository stays up to date with what's on GitHub or Azure Repos. You can control this dialog using the remoteHub.uncommittedChangesOnEntry setting.

Reminder to sync your repository

Theme: One Monokai

Azure Repos

This milestone we are enabling the capability to edit and commit changes to repositories that are hosted in Azure Repos. We have also added basic functionality to create, update, and open pull requests for Azure Repos.

Notebooks

Find decorations on scroll bar

The Find results in notebooks will now be rendered in the scroll bar:

Move focus to the interactive window

There are two new commands for placing focus in the interactive window.

  • interactive.input.focus - Move focus to the input editor in the interactive window.
  • interactive.history.focus - Move focus to history in interactive window.

These commands don't have default keybindings but you can add your own keyboard shortcuts.

Debugging

JavaScript debugging

The JavaScript debugger now supports collecting and visualizing heap profiles. Heap profiles allow you to see where and how much memory is allocated over time. These have been added as an option in the Debug: Take Performance Profile command, which is also accessible via a record ⏺ button in the CALL STACK view.

Example of the Flame Chart visualizer showing a memory profile for vscode. One cell is hovered over, showing that 33KB of memory was allocated in "ipc.ts".

Languages

CSS formatter

The built-in CSS extension now ships with a formatter. The formatter works with CSS, LESS and SCSS. It is implemented by the JS Beautify library and comes with the following settings:

  • css.format.enable - Enable/disable default CSS formatter.
  • css.format.newlineBetweenRules - Separate rulesets by a blank line.
  • css.format.newlineBetweenSelectors - Separate selectors with a new line.
  • css.format.spaceAroundSelectorSeparator - Ensure a space character around selector separators '>', '+', '~' (for example, a > b).

The same settings also exist for less and scss.

JavaScript semantic highlighting in HTML

We've aligned the semantic highlighting of JavaScript source in HTML files with what you see in normal .js files.

Not only does this make code colors more consistent, it also adds some important semantic information that was missing before, such as highlighting readonly types.

TypeScript 4.6.3

VS Code now bundles TypeScript 4.6.3. This minor update fixes a few important bugs.

Markdown shorthand reference links are now clickable

Markdown lets you can create links using a shorthand syntax in cases where the link text matches the link definition ID. For example, [my fancy link], uses the my fancy link link definition (for example, [my fancy link]: https://example.com). These shorthand links are now clickable in VS Code's editor:

In the editor, clicking these links navigates to the link definition. In the Markdown preview, the links instead navigate to the link destination.

reStructuredText grammar

There is now a built-in extension for reStructuredText (rst) file syntax highlighting.

reStructuredText example showing syntax highlighting

Contributions to extensions

Python

Changes to the interpreter display in the Status bar

The Python extension, in order to be consistent with other languages, moved the selected Python interpreter information towards the right side in the Status bar beside the Python language status item. With the intention of cleaning up the Status bar, it's now only displayed when a Python or a settings.json file is currently open.

Python interpreter information displayed towards the right of the Status bar

New Python File command

There's now two faster ways to create empty Python files: through a new command called Python: New Python File, or through the New File... item on the Get Started page.

Pylint extension

There is now a new Microsoft Pylint extension for linting using pylint. This extension utilizes the Language Server Protocol to provide linting support.

The Pylint extension provides additional configuration to adjust the severity levels of the issues reported via pylint.

{
  content: 'this is an info message';
  severity: InputBoxValidationSeverity.Info;
}

which would look like this:

Input box with 'this is an info message' severity message

Details of this proposal can be found in inputBoxSeverity.

Notebook document change events

There is a new proposal for notebook document change events: it is available as notebookDocumentEvents and contains two events:

  • vscode.workspace.onDidSaveNotebookDocument fires whenever a notebook has been saved.
  • vscode.workspace.onDidChangeNotebookDocument fires whenever a notebook has changed. For example, when cells were added or removed, cells themselves changed, or metadata changed.

Tabs API shape finalization

The tabs API is approaching finalization next milestone and is currently in a state where the shape will remain stable with little to no changes. The April 2022 iteration will be the last chance to provide feedback regarding the shape and features of this API. Feedback can be provided via GitHub issues. The tabs API allows for the reading of open tabs, their locations, and closing them.

Inline Completions

We continued working on inline completions to prepare for finalization in the next couple of releases. Inline completions can now be used to suggest snippets or text-replacements (previously, only text-insertions were supported).

Drop into editor

The proposed text editor drop API lets extensions handle drops into text editors. These drop events can come from within VS Code—such as dragging a file from VS Code's Explorer into a text editor—or can be generated by dropping a file from your operating system into VS Code.

To try the new API, you must set "workbench.experimental.editor.dragAndDropIntoEditor.enabled": true. After enabling this, you can then drop into the editor by holding down Shift while dragging and dropping.

We've included experimental support for generating links when you drop into a Markdown file. You can also see the Markdown extension's source for an example of the API in use.

There is a new proposal for setting a resolved or unresolved state on comment threads. Comment threads that specify a state will be given additional UX treatment.

Engineering

Electron 17 update

In this milestone, we are excited to ship with Electron v17 in VS Code. This is a major update from our previous adoption of Electron v13 and takes advantage of the process reuse architecture from Electron. Over the past year, we have been reimplementing and gradually rolling out changes to some of our core services with respect to their interaction and lifetime associated with the workbench in preparation for this new architecture:

Special thanks to everyone involved with this effort, also thanks to the community for self-hosting on Insiders and providing feedback so we can confidently ship this update.

What does this change mean for VS Code users?

Operations like switching workspaces and reloading workspaces should now be faster. With this update, we also bump our Chromium version to 98.0.4758.109 and Nodejs version to 16.13.0.

What's next?

We will continue Electron version adoption under their new release cadence. We are also actively working towards sandboxing the workbench and the next step is to improve the communication channel between the Node.js hosted service and a sandboxed workbench, which will allow us to further simplify the new architecture.

RPM package requirements list improvement

We now calculate the dependencies needed for the rpm packages as part of our build process inspired by the work done in Chromium. This allows us to provide an up-to-date dependency list when adopting newer runtimes or native modules. We will also introduce a similar change to our debian packages in the upcoming milestone.

Support out-of-band releases for built-in extensions

Those built-in extensions that are available in the Marketplace can now be released out-of-band and VS Code will detect the new version and update the extension. This will enable these extensions to support pre-releases as well.

Documentation

R in VS Code

There is a new R in Visual Studio Code topic describing R programming language support in VS Code with the R extension. The R extension includes rich language features such as code completions and linting as well as integrated R terminals and dedicated workspace, data, and plot viewers.

R Extension for Visual Studio Code details pane

Development containers blog post

In case you missed Burke Holland's recent blog post on using dev containers to create easy to use programming environments, check out "The problem with tutorials". The blog post describes how Laravel uses pre-configured Docker containers to provide the runtime and dependencies for their PHP framework tutorials.

Notable fixes

  • 117674 Debug console stops automatically scrolling sometimes when contents wrap
  • 138963 When debugging is started, the debug console does not work properly
  • 142754 Emacs usage in VS Code terminal is broken
  • 143513 contributes.configuration items respects "order" attribute in views only if search box empty
  • 144458 Glob patterns **/p* incorrectly match on /foo/ap
  • 144783 Settings list widget items that are not being edited don't seem to have a max width
  • 145243 Settings toc unable to be resized in smaller screens
  • 145572 Settings box can overlap setting

Thank you

Last but certainly not least, a big Thank You to the contributors of VS Code.

Web extensions

Extension authors for enabling extensions that run code as web extensions (the list below is between March 1 2022 and March 27 2022):

Issue tracking

Contributions to our issue tracking:

Pull requests

Contributions to vscode:

Contributions to vscode-css-languageservice:

Contributions to vscode-js-debug:

Contributions to vscode-languageserver-node:

Contributions to vscode-vsce:

Contributions to debug-adapter-protocol:

Contributions to language-server-protocol:

Read the original on code.visualstudio.com ↗