Skip to content

Commit

Permalink
feat(extensions): Add emmet extension (#2244)
Browse files Browse the repository at this point in the history
This adds the built in VSCode emmet extension (Emmet 2.0), and hooks it up.

There are a few additional features we need, though, to get it usable:
- [x] Handle the `isIncomplete` value from a completion provider - emmet sends this to tell the editor to continue to request completions. We don't handle it, currently. 
- [x] Proper snippet expansion - we have an extremely minimal snippet implementation, which means the expansion aren't too helpful

__Next steps:__
-  Completion documentation - there is no preview for the expansion, currently. (tracking in #2329 )

Fixes #1948
  • Loading branch information
bryphe authored Feb 13, 2021
1 parent 80c7dad commit ad85033
Show file tree
Hide file tree
Showing 64 changed files with 9,890 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES_CURRENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- #3090 - Snippets: Add insert snippet command
- #3105 - Snippets: Implement configuration setting
- #3132 - Snippets: User snippet editing
- #2244 - Extension: Emmet support (fixes #1948)

### Bug Fixes

Expand Down
31 changes: 31 additions & 0 deletions extensions/emmet/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "extensionHost",
"request": "launch",
"name": "Launch Extension",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"sourceMaps": true,
"outFiles": ["${workspaceFolder}/out/**/*.js"]
},
{
"type": "extensionHost",
"request": "launch",
"name": "Launch Tests",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test",
"--disable-extensions",
"--skip-getting-started",
],
"sourceMaps": true,
"outFiles": ["${workspaceFolder}/out/**/*.js"]
}
]
}
3 changes: 3 additions & 0 deletions extensions/emmet/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"emmet.excludeLanguages": []
}
9 changes: 9 additions & 0 deletions extensions/emmet/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
test/**
src/**
out/**
tsconfig.json
extension.webpack.config.js
CONTRIBUTING.md
cgmanifest.json
yarn.lock
.vscode
14 changes: 14 additions & 0 deletions extensions/emmet/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## How to build and run from source?

Read the basics about extension authoring from [Extending Visual Studio Code](https://code.visualstudio.com/docs/extensions/overview)

- Read [Build and Run VS Code from Source](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#build-and-run-from-source) to get a local dev set up running for VS Code
- Open the `extensions/emmet` folder in the vscode repo in VS Code
- Press F5 to start debugging

## Running tests

Tests for Emmet extension are run as integration tests as part of VS Code.

- Read [Build and Run VS Code from Source](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#build-and-run-from-source) to get a local dev set up running for VS Code
- Run `./scripts/test-integration.sh` to run all the integrations tests that include the Emmet tests.
9 changes: 9 additions & 0 deletions extensions/emmet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Emmet integration in Visual Studio Code

**Notice:** This extension is bundled with Visual Studio Code. It can be disabled but not uninstalled.

## Features

See [Emmet in Visual Studio Code](https://code.visualstudio.com/docs/editor/emmet) to learn about the features of this extension.

Please read the [CONTRIBUTING.md](https://github.com/Microsoft/vscode/blob/master/extensions/emmet/CONTRIBUTING.md) file to learn how to contribute to this extension.
17 changes: 17 additions & 0 deletions extensions/emmet/cgmanifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"registrations": [
{
"component": {
"type": "git",
"git": {
"name": "expand-abbreviation",
"repositoryUrl": "https://github.com/emmetio/expand-abbreviation",
"commitHash": "ef943f2056572fe43ce9eebf72929d3c825f3995"
}
},
"license": "MIT",
"version": "0.5.8"
}
],
"version": 1
}
20 changes: 20 additions & 0 deletions extensions/emmet/extension.webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

//@ts-check

'use strict';

const withDefaults = require('../shared.webpack.config');

module.exports = withDefaults({
context: __dirname,
entry: {
extension: './src/extension.ts',
},
externals: {
'vscode-emmet-helper': 'commonjs vscode-emmet-helper',
},
});
Binary file added extensions/emmet/images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ad85033

Please sign in to comment.