Henry Henry
  • JavaScript
  • TypeScript
  • Vue
  • ElementUI
  • React
  • HTML
  • CSS
  • 技术文档
  • GitHub 技巧
  • Nodejs
  • Chrome
  • VSCode
  • Other
  • Mac
  • Windows
  • Linux
  • Vim
  • VSCode
  • Chrome
  • iTerm
  • Mac
  • Obsidian
  • lazygit
  • Vim 技巧
  • 分类
  • 标签
  • 归档
  • 网站
  • 资源
  • Vue 资源
GitHub (opens new window)

Henry

小学生中的前端大佬
  • JavaScript
  • TypeScript
  • Vue
  • ElementUI
  • React
  • HTML
  • CSS
  • 技术文档
  • GitHub 技巧
  • Nodejs
  • Chrome
  • VSCode
  • Other
  • Mac
  • Windows
  • Linux
  • Vim
  • VSCode
  • Chrome
  • iTerm
  • Mac
  • Obsidian
  • lazygit
  • Vim 技巧
  • 分类
  • 标签
  • 归档
  • 网站
  • 资源
  • Vue 资源
GitHub (opens new window)
  • 技术文档

  • GitHub

  • Nodejs

  • Chrome

  • VSCode

  • VSCode 更新文档

    • version 1.25
    • version 1.26
    • version 1.25
    • version 1.26
    • version 1.25
    • version 1.24
    • version 1.23
    • version 1.22
    • version 1.21
    • version 1.20
      • January 2018 (version 1.20)
        • "Smart Case" search
        • Quick Fix all for JavaScript and TypeScript
        • Bracket property suggestions
        • Automatic member property suggestions
        • Marking of optional property in suggestions
        • Auto-imports based on filename
        • New keyboard shortcut context operator
        • CodeActionProvider improvements
    • version 1.19
    • version 1.18
    • version 1.17
    • version 1.16
    • version 1.15
    • version 1.14
    • version 1.13
    • version 1.12
    • version 1.11
    • version 1.10
    • version 1.9
    • version 1.8
    • version 1.7
    • version 1.6
    • version 1.5
  • AIGC

  • Other

  • 技术
  • VSCode 更新文档
Henry
2023-10-20
目录
January 2018 (version 1.20)
"Smart Case" search
Quick Fix all for JavaScript and TypeScript
Bracket property suggestions
Automatic member property suggestions
Marking of optional property in suggestions
Auto-imports based on filename
New keyboard shortcut context operator
CodeActionProvider improvements

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.

Quick fix all in file

Accept and all errors will disappear:

Quick fix all fixes all similar errors in the current file

# 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.

Suggestions for properties with spaces or other special characters are now shown

Accepting one of these suggestions automatically converts to bracket accessor notation.

Bracket accessor automatically inserted

# 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.

No more need to type this. to see property suggestions

Accept a member property suggestion, and VS Code automatically inserts the require this..

this. is automatically inserted when you suggest a property suggestion

# Marking of optional property in suggestions (opens new window)

Suggestions for optional TypeScript properties are now suffixed with a ?:

Optional property suggestions

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:

importing a default exported object by 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/"
1

# 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;
  }
}

1
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.

编辑 (opens new window)
#VSCode
上次更新: 10/20/2023, 8:34:39 AM
version 1.21
version 1.19

← version 1.21 version 1.19→

最近更新
01
搭配 Jenkins 实现自动化打包微前端多个项目
09-15
02
自动化打包微前端多个项目
09-15
03
el-upload 直传阿里 oss 并且显示自带进度条和视频回显封面图
06-05
更多文章>
0 comments
Anonymous
Markdown is supported

Be the first person to leave a comment!

Theme by Vdoing | Copyright © 2017-2025 HenryTSZ | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式