version 1.20
# January 2018 (version 1.20) (opens new window)
Welcome to the January 2018 release of Visual Studio Code. This release includes the VS Code team's work during the January milestone as well as the community PRs (opens new window) contributed in December and January which means there are a lot of great updates. Here are some of the release highlights:
- Explorer multi-selection (opens new window) - Perform actions on multiple files at once.
- Improved Settings search (opens new window) - Easily find the right setting with natural language search.
- Errors & warnings in Explorer (opens new window) - Quickly navigate to errors in your code base.
- Save large and protected files (opens new window) - Save Admin protected and >256M files within VS Code.
- Git submodule support (opens new window) - Perform Git operations on nested Git repositories.
- Global snippets (opens new window) - Create snippets you can use across all file types.
- Image preview zoom (opens new window) - Zoom in and out of images with your mouse, scroll wheel or track pad.
- Terminal screen reader support (opens new window) - Integrated Terminal now has "Screen Reader Optimized" mode.
- Debugging support for multi-root workspaces (opens new window) - Manage configurations across multiple projects.
- Quick Fix all for JavaScript/TypeScript (opens new window) - Apply the same Quick Fix to all occurrences in a file.
- New Node.js deployment tutorials (opens new window) - Deploy your Node.js app with Docker or Azure App Service.
If you'd like to read these release notes online, go to Updates (opens new window) on code.visualstudio.com (opens new window).
You can also check out this 1.20 release highlights video (opens new window) from Cloud Developer Advocate Brian Clark (opens new window).
The release notes are arranged in the following sections related to VS Code focus areas. Here are some further updates:
- Workbench (opens new window) - "Smart case" search, theme specific color customization.
- Editor (opens new window) - New snippet variables, Emmet improvements, minimap on the right or left.
- Languages (opens new window) - TypeScript automatic bracket and member property suggestions.
- Debugging (opens new window) - Automatically detect Node.js subprocesses, nvm support.
- Extensions (opens new window) - Extension recommendations for new file types.
- Extension Authoring (opens new window) - Custom view support, new menu groupings.
# "Smart Case" search (opens new window)
You can now set "search.smartCase": true
to enable "smart case" mode for global search. When enabled, VS Code will automatically do a case-sensitive search when you search for a query that contains an uppercase character. If your search query is all lowercase, then the search will be case-insensitive.
For example, searching "code" will match "code" or "Code". Searching "Code" will only match "Code".
# Quick Fix all for JavaScript and TypeScript (opens new window)
Fix errors in a flash with new Quick Fix all for JavaScript and TypeScript. Move your cursor to a fixable error such as an unused variable, and trigger Quick Fixes using the lightbulb or by pressing Ctrl+.. If one of the available Quick Fixes can be applied to multiple errors in the current file, you'll see a new Fix all in file Code Action.
Accept and all errors will disappear:
# Bracket property suggestions (opens new window)
Spaces got you down? When you type .
, VS Code now shows all known properties for JavaScript and TypeScript, even if a property name contain whitespaces or other non-identifier characters.
Accepting one of these suggestions automatically converts to bracket accessor notation.
# Automatic member property suggestions (opens new window)
Tired of typing this.
to access class properties in JavaScript and TypeScript? Now you can just start typing to see available members.
Accept a member property suggestion, and VS Code automatically inserts the require this.
.
# Marking of optional property in suggestions (opens new window)
Suggestions for optional TypeScript properties are now suffixed with a ?
:
JavaScript users will also see ?
for completions that come from *.d.ts
Type Declaration (typings) packages.
# Auto-imports based on filename (opens new window)
Auto-imports for JavaScript and TypeScript now support importing default exported objects based on filename:
# New keyboard shortcut context operator (opens new window)
Keyboard shortcut contexts allow users to control when keybindings are active. They are also referred to as when clauses (opens new window) because they define when a keybinding is active or enabled. In this release, there is a new key-value pair operator for when
clauses. The expression key =~ value
treats the right hand side as a regular expression to match against the left hand side. For example, to contribute context menu items for all Docker files, one could use:
"when": "resourceFilename =~ /docker/"
# CodeActionProvider improvements (opens new window)
A CodeActionProvider
can now return objects of the new CodeAction
class. CodeAction
adds additional metadata and functionality over Command
, and better captures what Code Actions are and how they are used in VS Code's UI.
A CodeAction
primarily consists of a title
, kind
, and at least a Command
or (new in VS Code 1.20) a WorkspaceEdit
.
import * as vscode from 'vscode';
/**
* Quick fix provider that converts :) to 😀
*/
export class Emojizer implements vscode.CodeActionProvider {
provideCodeActions(document: vscode.TextDocument, range: vscode.Range) {
const pos = range.start;
const line = document.lineAt(pos.line);
// Check if we are at a :)
if (line.text[pos.character] === ':' && line.text[pos.character + 1] === ')') {
const fix = new vscode.CodeAction('Convert to 😀', vscode.CodeActionKind.QuickFix);
fix.edit = new vscode.WorkspaceEdit();
fix.edit.replace(document.uri, new vscode.Range(pos, pos.translate(0, 2)), '😀');
return [fix];
}
return undefined;
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
CodeAction
also adds metadata about Code Actions, including the Code Action's kind (vscode.CodeActionKind.QuickFix
in the example above) and the set of diagnostics that the Code Action addresses. We use this metadata to implement features such as the Refactor
command and vscode.action.codeAction
keybindings, and plan to build additional features using it in the future.
- 01
- 搭配 Jenkins 实现自动化打包微前端多个项目09-15
- 02
- 自动化打包微前端多个项目09-15
- 03
- el-upload 直传阿里 oss 并且显示自带进度条和视频回显封面图06-05