January 2021 (version 1.53)
Содержание:
- Debugging
- Installation appears to be corrupt [Unsupported]
- 1.7.2 Recovery Build
- Documentation
- Extension authoring
- Extension authoring
- Welcome View Content API
- Theme support for semantic tokens
- TypeScript semantic token improvements
- File system error code
- Arguments for StatusBarItem.command
- Custom text editors
- View-level progress indication
- Extensions view context menu when-clause context
- New Codicons
- Documentation for writing embedded language server
- Preview features
- Extension authoring
- Debugging
- Editor
- Node Debugging
- Contributions to extensions
- Browser support
- Editor
- Integrated Terminal
- Debug Adapter Protocol
Debugging
In the February release, we introduced a dropdown button to group the Run and Debug commands in a central (and compact) location in the editor’s title area (refer to the ). Based on user feedback, we’ve tried to improve the dropdown button by remembering the last executed action. The dropdown button now has two click zones, one for the default action (left) and another for the dropdown (right) which, when selected, runs the action and remembers it as the new default.
The dropdown behavior:
- If there is only a single Run or Debug action, the dropdown menu is omitted.
- If there is more than one Run or Debug action, all actions appear in the dropdown menu and the default action is set to the first action from the dropdown menu (as long as there is no remembered action).
- The default action is preserved for a specific workspace across VS Code restarts; it is not preserved per editor.
Installation appears to be corrupt [Unsupported]
VS Code does a background check to detect if the installation has been changed on disk and if so, you will see the text in the title bar. This is done since some extensions directly modify (patch) the VS Code product in such a way that is semi-permanent (until the next update) and this can cause hard to reproduce issues. We are not trying to block VS Code patching, but we want to raise awareness that patching VS Code means you are running an unsupported version. Reinstalling VS Code will replace the modified files and silence the warning.
You may also see the message if VS Code files have been mistakenly quarantined or removed by anti-virus software (see issue #94858 for an example). Check your anti-virus software settings and reinstall VS Code to repair the missing files.
1.7.2 Recovery Build
We are releasing 1.7.2 today which includes a new version of the TypeScript Server (to 2.0.10). The update to the server will re-enable the Automatic Type Acquisition (ATA) feature by default for JavaScript users. This feature greatly improves the IntelliSense in JavaScript projects and removes the need to manually install TypeScript declaration files (.d.ts files). This feature is powered by a query to the npmjs service to retrieve relevant declaration files for used modules. More details in relation to this feature, including details on how to disable it are .
The 1.7.2 release also adds the final 1.7 translations and fixes several important issues.
Downloads: Windows | Mac | Linux 64-bit: .tar.gz .deb .rpm | Linux 32-bit: .tar.gz .deb .rpm
Documentation
VS Code and Python in the classroom
Read the case study of a Computer Science professor at Harvey Mudd College, who uses VS Code in his introductory CS classes with Python. Learn about the settings he recommends for his students, as well as helpful extensions and free self-paced Python and Data Science lessons.
Troubleshooting extensions blog post
Everybody loves installing and using VS Code extensions. However, when you have lots of extensions installed, sometimes the editor can start to act «funny» and it would be great to know if the behavior is caused by a specific extension. If you missed the earlier announcement of the utility, you can read this «Resolving extension issues with bisect» blog post, which describes how you can quickly troubleshoot «bad» extensions and even help the extension author(s) with feedback.
The space in the editor toolbar () is limited. Therefore, we have
- implemented an overflow behavior. When the primary group, that is, the group of actions that get rendered with icons, exceeds nine commands then all additional commands overflow into the menu.
- added the submenu. We ask extension authors to contribute run- and debug-commands into this menu, not into the -menu anymore as we had recommended in a . In addition, it is no longer necessary to use the magic group values and in order to make the commands show up in the correct position.
Also know that the run submenu is dynamic, will replace itself with its first child when that’s the only child.
Authentication Provider API
You can now register an authentication provider, which can be used by other extensions to perform authentication against a service.
New feedback channel for the Extension Marketplace
There’s a new public repository for issues related to the Extension Marketplace. If you have technical issues, want to give feedback, or have feature requests, please open an issue.
Welcome View Content API
Certain views now support Welcome content contributed from extensions. Refer to the original issue for more information. For details about how to use this API with extension provided views, you can read the .
This API was added as proposed in the last milestone and we have now finalized it.
Theme support for semantic tokens
Color themes can now write rules to color semantic tokens reported by language extensions like TypeScript.
The rule above defines that all declarations of readonly variables in Java should be colored green and bold.
The Semantic Highlighting Wiki Page has more information.
TypeScript semantic token improvements
More semantic token types are returned by the Typescript Language Server. Color themes can take advantage of these new token types for .
- All symbols from the JavaScript default library get a modifier.
- Function parameters that are callbacks are classified as .
Read the TypeScript Semantic Highlighting plugin README for an overview of all semantic token types and modifiers returned by the TypeScript language server.
File system error code
We have added , which is a string identifying the error. When a file system error is created through any of its factory functions, then is the name of that function, for example .
Arguments for StatusBarItem.command
now accepts a full object instead of just a command ID. This lets extensions pass arguments to the command when the Status bar item is activated.
Custom text editors
With custom text editors, extensions can now replace VS Code’s standard editor with a custom webview-based view for specific text-based resources. Potential use cases include:
- Previewing assets, such as shaders or files.
- Creating WYSIWYG editors for markup languages such as XAML.
- Providing alternative, interactive views of data files such as JSON or CSV.
The custom editors documentation covers how to use the new custom text editor API and how to make sure your new editor works well with VS Code. Also be sure to check out the custom editors extension sample.
Next iteration, we’re hoping to finalize the full custom editor proposal that extends custom editors to also support binary files.
View-level progress indication
We’ve added a to the of the API to allow progress to be shown on a specific view. To use, set where specifies the ID of the view you’d like to show progress for. There is short video of this in action in the above.
We’ve added a new when-clause context to the Extension view’s context menu, which contains the extension’s identifier.
Example:
New Codicons
We’ve added the following icons to the Codicon library:
- account
- bell-dot
- debug-console
- library
- output
- run-all
- sync-ignored
Documentation for writing embedded language server
Writing language server for embedded programming languages is more involved than writing a plain language server. Given the popularity of embedded languages today, we added an Embedded Languages topic to our Language Extensions section. The documentation contains two samples to illustrate the two approaches to building embedded language servers: Language services and Request forwarding. Start by reviewing the Embedded Languages documentation or go directly to the two samples:
- Language Server for Embedded Language with Language Services
- Language Server for Embedded Language with Request Forwarding
Preview features
Continued improvements to extensible Markdown renderers in Notebooks
We continued improving our support extending the Markdown renderer in Notebooks. Our focus this iteration was improving performance of the new renderers. We also fixed many regressions that the new renders introduced.
The new renderers are still disabled by default but we are now more confident that we will be able to enable them soon. You can try out the new extensible Markdown renderers today with the undocumented setting. After enabling this setting and restarting VS Code, you should be able to use and KaTeX formulas in Markdown cells.
Getting Started
We are continuing an overhaul of our default startup editor in order to provide relevant extension-contributed tips and walkthroughs, intended to make both core VS Code features and extension contributions more approachable to new users. Many Insiders users may have already seen it, and it will be slowly rolled out to more Stable users over the course of this iteration. You can always opt in or out of the new behavior by modifying the setting to or away from .
Theme: GitHub Light
Splitting vscode package into @types/vscode and vscode-test
During the event-stream incident last year, we found that the package was affected as its 223 transitive dependencies included . These dependencies also cause GitHub security alerts from time to time for many VS Code extensions. To address dependency complexity, we started slimming down the package.
The package had served two purposes:
- Pull down for extension development.
- Run integration tests by downloading and launching a local copy of VS Code.
Now we are splitting into and , two packages with more focused functionality.
- contains for each release. For example, installs the VS Code 1.34 Extension API. Unlike , which pulls down through a script, this package can be fully cached by package managers.
- provides a set of APIs to run integration tests with VS Code. The old package will continue to work, but new features will only go to . We suggest that you switch over to , which features a slimmer dependency graph and a more flexible, explicitly documented API. You can learn more about using in the Testing Extensions article.
Additionally:
- allows you to quickly download any version of the VS Code API via CLI.
- now checks version against to prevent you from using a new API incompatible with older versions of VS Code.
- The , Testing Extensions page, and Continuous Integration page are updated to use .
- The Testing Extensions page contains a to help you transition from to and .
- All VS Code sample extensions now use .
- The VS Code extension generator scaffolds extensions using the and packages.
Node.js update
The Electron version that VS Code runs on has been updated and brings with it an update to Node.js from to . All extensions will now run on this newer version of Node.js.
APIs for remote
There is a new property that is defined whenever a remote extension host runs. Its value is defined by the extension bootstrapping the remote extension host and the value is available on the local and remote extension hosts.
Extensions that need to know whether they run on the remote or local extension host can use , which is either or . The value represents what’s defined in the extension’s file or overridden by the user. When no remote extension host exists, the value is always .
DocumentLink.tooltip
The new property allows a to customize the text displayed when a user hovers over a document link:
VS Code includes instructions on how to activate the link ( in the example above) along with the text.
Port forwarding and port mapping now support ‘127.0.0.1’ in addition to ‘localhost’
The API opens an URI using the default external application. When is called by a remote extension on a local URI, such as , VS Code automatically opens a tunnel that connects a port on the local machine to the opened port on the remote machine. This automatic tunneling previously was only enabled for ‘localhost’ URIs but it is now enabled for ‘127.0.0.1’ as well.
Additionally, the webview port mapping API now handles ‘127.0.0.1’ in addition to ‘localhost’ URIs.
More properties marked as readonly or ReadonlyArray
More properties in the VS Code API are now marked as readonly in to better express their intent to extensions.
Notable changes include:
- All fields on event interfaces are now readonly. Event objects should never be mutated as the same object can be dispatched to multiple listeners.
- The methods on now take readonly arrays. This change was made because you can only update a through its methods, not by mutating an array previously passed to it.
- is now a readonly array since it cannot be mutated.
- now takes readonly arrays since it does not mutate its parameters.
These new modifiers may cause compile errors for extension code that explicitly typed out the non-readonly types that the VS Code API was previously using:
To fix this, propagate the modifier through your extension’s source code as well:
TerminalOptions.hideFromUser
The terminal option is now in the stable API. Use this option to completely hide a terminal from the user until is called:
Combined with the and APIs, it’s possible for an extension to interact with an interactive terminal, for example, to set up a connection, and only call if something goes wrong.
The Comments API now supports displaying and managing user reactions on comments. When is present, reactions will be rendered under the comment body.
If an extension registers a reaction handler with , users will be able to respond to the existing reactions or use the reactions picker to create a new reaction.
Debugging
Breakpoints can be shown in overview ruler
To make life easier when working with breakpoints in large files, you can now show breakpoints in the editor’s overview ruler by enabling the new setting .
PreLaunch tasks for compound debug configurations
Today every debug configuration can specify a task to be run before the debug session is started via the attribute. This works well when debugging a single program, but it gets unwieldy when using compound configurations where multiple programs are involved.
In this milestone, we’ve added support for a per compound debug configuration. With this addition, a single task can build all debug targets before the individual debug sessions are started. In case of a build error, no session is started.
Editor
Keyboard Shortcuts Reference
Help > Keyboard Shortcuts Reference brings up a printable PDF reference sheet of VS Code command keyboard shortcuts. Keep this reference handy and you’ll be a VS Code power user in no time.
Here’s it is for macOS:
Below are links to the three platform-specific versions:
- Windows
- macOS
- Linux
Format Document / Format Selection
The editor now has two explicit format actions: Format Document (⇧⌥F (Windows Shift+Alt+F, Linux Ctrl+Shift+I)) and Format Selection (⌘K ⌘F (Windows, Linux Ctrl+K Ctrl+F)).
We also added new configuration options to enable/disable the default formatters for JavaScript, TypeScript, JSON, and HTML. Use these options when you have another extension installed that provides formatting for the same language.
We’ve added a new to the Marketplace so you can easily search and find source code formatting extensions.
Node Debugging
Just My Code improvements
Skipping files when stepping has been available for the protocol of the Node.js debugger for three releases. With this release, it is now available for the protocol as well. To control a file for skipping, use the context menu command Toggle skipping this file on a stack frame in the CALL STACK view.
Column breakpoints improvements
Setting breakpoints on a particular column is now supported by the Debugger for Chrome extension, and by the protocol of the Node.js debugger, when debugging (yet to be released) Node 8. A column breakpoint can be set using ⇧F9 (Windows, Linux Shift+F9) or via the context menu during a debug session.
Contributions to extensions
GitHub Pull Requests and Issues
Work continues on the GitHub Pull Requests and Issues extension, which allows you to work on, create, and manage pull requests and issues.
To learn about all the new features and updates, you can see the full release of the extension.
Remote Development
Work continues on the Remote Development extensions, which allow you to use a container, remote machine, or the Windows Subsystem for Linux (WSL) as a full-featured development environment.
Feature highlights in 1.50 include:
- Improved log access and rendering for containers.
- Better recovery support for cloning repositories in container volumes.
- Ability to install an extension in a remote context (container, SSH, WSL) without having to reload VS Code.
You can learn about new extension features and bug fixes in the Remote Development release notes.
ESLint
The approval flow to allow the execution of a ESLint library got reworked. The initial experience is now as follows:
- No modal dialog is shown when the ESLint extension tries to load a ESLint library for the first time and an approval is necessary. Instead, the ESLint status bar item changes to indicating that the execution is currently blocked.
- If the active text editor content can be validated using ESLint, a problem at the top of the file is shown in addition.
The execution of the ESLint library can be denied or approved using the following gestures:
- Clicking on the Status Bar icon.
- Using the quick fix for the corresponding ESLint problem.
- Executing the command ESLint: Manage Library Execution from the command palette.
All gestures will open the following dialog:
The chosen action is then reflected in the ESLint Status Bar item in the following way:
- will prefix the status bar item with a check mark.
- will prefix the status bar item with a double check mark.
- and will prefix the status bar item with a blocked sign.
You can manage our decisions using the following commands:
- ESLint: Manage Library Execution will reopen above dialog.
- ESLint: Reset Library Decisions lets you reset previous decisions you have made.
Template string converter
The Template String Converter extension converts quotes to backticks when a and are entered within a string in JavaScript and TypeScript files.
Docs View
The Docs View extension uses the new to show documentation for the symbol at the current cursor position in the sidebar or panel:
Browser support
Download folders (Edge, Chrome)
Leveraging the new File System Access API, VS Code running in a browser can now offer a download action for folders from the File Explorer to download all files and folders to disk.
Note: This requires a recent version of Microsoft Edge or Google Chrome.
Open Workspace notification
If you open a folder that contains files at the top level, you’ll now see a notification asking you to open it. This was always the case in VS Code for desktop, and will now work in the browser too.
Prevent accidental close
A new setting was added to show a confirmation dialog before closing or leaving the workbench.
Possible values are:
- The confirmation will only be shown when you use a keybinding to close (for example, ⌘W (Windows, Linux Alt+F4)). (default)
- : The confirmation dialog will always be shown, even if you close from a mouse gesture.
- : The confirmation will never be shown.
Note: This setting may not cover all cases. Browsers may still decide to close a tab or window without confirmation.
Editor
Large file support
Large files are always a great way to stress-test an editor. We currently use a line based representation of the text buffer, which has some serious advantages, but also disadvantages, especially in terms of memory consumption (for example, a file with very many short lines).
Any file that is over 30MB or over 300K lines will now be considered a large file and will be handled specially in some circumstances. By disabling certain features for large files, for example tokenization, line guides, and wrapping or folding, we were able to optimize memory usage, in some cases, by as much as 50%. Additionally, large files will never travel to our web worker, which computes diff information, link detection, or word based completions. This helps in reducing the memory pressure on the operating system.
Some of the optimizations will impact all files, although the effects should not be noticeable for small files. We decided to remove the hard-coded file size limit of 50MB on 64-bit installations and enforce a 300MB file size limit on 32-bit installations. Refer to #30180 for more information about the different optimizations.
Color Picker
We’ve introduced a color picker for color customizations in this release. It supports configuration of hue, saturation and opacity for the color that is picked up from the editor. It also provides the ability to trigger between different color modes by clicking on the color string at the top of the picker. The picker appears on a hover when you are over the color definition in a document.
For the preview, we enabled it for CSS, Sass and LESS files, supporting RGBA, HSLA and Hex color modes. We plan to extend the picker with more functionality as well as to enable extension authors to contribute their own color modes together with color definitions for their languages in future releases.
Auto indentation
In this milestone, we’ve turned on auto-indenting by default (). If the language you are working with has proper indentation rules (for example, TypeScript, JSON, CSS), the indentation will be adjusted when you type, move lines and paste blocks of code.
Emmet 2.0
Two releases ago, we introduced a new Emmet implementation («Emmet 2.0»). During its preview, users could opt-in and try new features such as showing Emmet abbreviations in the suggestion/auto-completion list and multi-cursor support for most of the Emmet actions. In this release, Emmet 2.0 and these features are enabled by default.
Now that Emmet abbreviations are displayed in the suggestion/auto-completion list, VS Code no longer triggers Emmet abbreviations with the Tab key by default. This solves 2 major issues:
- Unexpected Emmet expansions occurring when the user wanted to just add an indent using the Tab key.
- Items from the suggestion list getting inserted when the user actually wanted to expand an Emmet abbreviation.
You can still bind any keyboard shortcut (other than Tab key) to the command or use Emmet: Expand Abbreviation from the Command Palette.
Custom Emmet Snippets
If you use custom Emmet snippets, you will have to modify them slightly to make them work in the new Emmet.
- HTML: Custom Emmet snippets in HTML should be a valid abbreviation. For example: use instead of .
- CSS: Name the custom Emmet snippets in CSS such that they only contain letters from the snippet value in the order that they appear in the latter, so that the fuzzy matching algorithm of the suggestion list can make the right match. For example, don’t use or as the name for . Use or instead.
Read more about the new Emmet in Emmet 2.0 blog post.
Support for snippet choices
With snippet choices, a placeholder can be prefilled with a set of values. The syntax is .
Below is a working sample specifying a fixed set of color choices:
Last but not least, when inserting snippets via IntelliSense a preview is now shown.
Improved diff editor results
In this release, we made some changes to our diff algorithm to adjust the differences (which are found with the help of a Longest-Common-Substring algorithm) in such a way that they are more pleasing to the human eye.
In some cases, this means we will be more aligned with the output of (which also incorporates some of these heuristics), but in other cases (like when only trim whitespace has changed), our result will no longer contain the LCS, so it will be different than , but in our opinion it will also be more pleasing.
Integrated Terminal
Open new terminals with custom working directories
There is a new command that allows the creation of terminals with a custom current working directory (cwd):
You can create your own keyboard shortcuts to open new terminals in any number of handy working directories. The value can either be a normal path or a variable.
Better locale detection
The setting has been replaced with the new setting. The default value is , which will set the variable in your terminal session to the detected language UTF-8 value but only when it has not been explicitly configured by the user. This better default should lead to fewer issues related to language and encoding in the terminal.
Debug Adapter Protocol
More help text properties for ExceptionBreakpointsFilter
Two optional UI attributes and have been added to the .
With these attributes, clients can display additional information about exception breakpoints. The property could be displayed in a hover
and the could be used as a placeholder text for a text box where the condition can be edited.
Improved description for setExceptionBreakpoints request
We have improved the description of the request by adding guidance for what an adapter should do if the user inputs an invalid exception breakpoint condition.
New canRestart property for stack frames
A new optional boolean property has been added to the stack frame. It indicated whether the stack frame can be restarted with the request.
Based on this information a client can enable or disable a Restart Frame context menu action.