Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The Visual Studio Code 0.10.8 release features a palpable plethora of improvements, including...
When you write an extension for VS Code, you are developing it against a set of APIs that we define through a file called vscode.d.ts
. You can see this file in our repository here. This file is picked up from our TypeScript and JavaScript language service to provide you with rich validation and IntelliSense while you develop your extension.
As we make changes to the VS Code API between versions, vscode.d.ts
changes and is updated and tagged from release to release. Previously, we stored the vscode.d.ts
file within the vscode
npm module that all extensions automatically depend on. So to update to our latest API, you would just install a newer version of the vscode
npm module in your extension by typing npm update vscode
.
We found that this approach has many issues:
vscode
npm module needs to be updated and versioned independent from VS Code versions because it contains API unrelated code (e.g. for test running)engine
field of the package.json
in your extension should be the only place that drives the decision which API to develop against.To solve these issues, we made the following changes:
vscode.d.ts
is no longer shipping within the vscode
npm module.engine
field in your extension is used to determine which version of vscode.d.ts
to use.npm
commands.Since this is a breaking change for existing extensions, we increased the vscode
npm module version to 0.11.0
. We encourage all extension writers to update their devDependency to vscode
in their package.json
to this new version (^0.11.x
) to benefit from future updates to tooling for extensions.
The process of installing a specific version of the API into your extension is still very simple:
engine
field of the package.json
. For example, when you want to upgrade to the 0.10.8
version of the VS Code API then define "engines": { "vscode": "^0.10.7" }
vscode
module is at least 0.11.0
.postinstall
script to your package.json
like this: "scripts": { "postinstall": "node ./node_modules/vscode/bin/install" }
npm install
from the root of your extension.vscode
module will download the appropriate version of vscode.d.ts
based on the version in engines
field you declared in the package.json
.We added a few new APIs to enable writing even more awesome extensions.
You can now validate user input, get called when an item is focused in Quick Pick, and Quick Pick now has room for additional details. Also Quick Pick now supports GitHub Octicons like the Status Bar.
We have introduced the concept of virtual documents. These are textual documents that don't have a representation on disk, but are generated at runtime. For example, HTML generated from Markdown or source code from debug symbols.
Combine virtual documents with the new vscode.previewHtml
command and you can come up with some creative experiences.
ViewColumn
.MarkedString
to display Markdown content in various UI elements.We have changed the debug protocol in the following (backward compatible) ways:
InitializeRequest
now returns information about the capabilities of the debug adapter. The VS Code debugger uses this information to enable or configure features which only exist for certain debug adapters.ConfigurationDoneRequest
: VS Code sends this request to indicate that the configuration (e.g. registering stored breakpoints and exception options) of the debug session has finished and that debugging is about to start. For backward compatibility, VS Code will send this request only if the debug adapter returns a value of true
for the supportsConfigurationDoneRequest
capability.Source
type:
origin
attribute to provide additional information about the source in the debug UI.adapterData
attribute that the VS Code debug UI will transparently persist for breakpoints.SourceBreakpoint
: an array of SourceBreakpoint
is an alternate means to specify the individual breakpoints for the SetBreakpointsRequest
. The SourceBreakpoint
allows for specifying column and condition information for a breakpoint (in addition to the line).With the January release, we've started to simplify the process of writing automated tests for a debug adapter. The basic idea is to provide a toolkit with Promise-based building blocks for individual protocol requests (e.g. stepInRequest
) and for common request sequences (e.g. hitBreakpoint
). These building blocks can be easily configured for a specific adapter and combined to form complex scenarios.
Here are three example Mocha tests:
var dc: DebugClient = ...; test('should run program to the end', () => { return Promise.all([ dc.configurationSequence(), dc.launch({ program: "main.js" }), dc.waitForEvent('terminated') ]); }); test('should stop on entry', () => { return Promise.all([ dc.configurationSequence(), dc.launch({ program: "main.js", stopOnEntry: true }), dc.assertStoppedLocation('entry', 1) ]); }); test('should set a breakpoint and stop on it', () => { return dc.hitBreakpoint({ program: "main.js" }, "test.js", 15); });
More examples can be found in these debug adapter projects on GitHub:
You can see the Promise-based API in DebugClient.ts and an initial set of tests in adapter.test.ts. We plan to make this API available as an npm module in February.
From a user's perspective, nothing has really changed when editing JSON, but under the hood, the JSON language support has been refactored. JSON language support drives the smartness when editing JSON files, from validation based on schemes to code completion and formatting. JSON is now a regular extension, using the same VS Code extension APIs as everyone else. The implementation is based on the language server infrastructure, which makes it easy to run in a separate process. Read here for more on the language server.
Check out all the new features and update to Visual Studio Code v0.10.9:
https://code.visualstudio.com/updates
Thanks for stopping. Bye!
- Ninja Ed
Please sign in to use this experience.
Sign in