mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
Remove proposed API Sample
This commit is contained in:
@ -15,7 +15,6 @@ You can expect from each sample:
|
||||
|
||||
- [Hello Code Sample](hellocode-sample): The Hello World sample for VS Code.
|
||||
- [Hello Code Minimal Sample](hellocode-sample): A minimal version of Hello Code Sample that doesn't use TypeScript.
|
||||
- [Proposed API Sample](proposed-api-sample): A sample that illustrates [Proposed API](https://vscode-ext-docs.azurewebsites.net/api/advanced-topics/using-proposed-api).
|
||||
|
||||
## Samples
|
||||
|
||||
|
||||
4
proposed-api-sample/.gitignore
vendored
4
proposed-api-sample/.gitignore
vendored
@ -1,4 +0,0 @@
|
||||
out
|
||||
node_modules
|
||||
.vscode-test/
|
||||
*.vsix
|
||||
21
proposed-api-sample/.vscode/launch.json
vendored
21
proposed-api-sample/.vscode/launch.json
vendored
@ -1,21 +0,0 @@
|
||||
// A launch configuration that compiles the extension and then opens it inside a new window
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [{
|
||||
"name": "Run Extension",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}"
|
||||
],
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/out/**/*.js"
|
||||
],
|
||||
"preLaunchTask": "npm: watch"
|
||||
}
|
||||
]
|
||||
}
|
||||
20
proposed-api-sample/.vscode/tasks.json
vendored
20
proposed-api-sample/.vscode/tasks.json
vendored
@ -1,20 +0,0 @@
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
// for the documentation about the tasks.json format
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"type": "npm",
|
||||
"script": "watch",
|
||||
"problemMatcher": "$tsc-watch",
|
||||
"isBackground": true,
|
||||
"presentation": {
|
||||
"reveal": "never"
|
||||
},
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,21 +0,0 @@
|
||||
# Proposed API Sample
|
||||
|
||||
This is a sample illustrating how to use [Proposed API](https://vscode-ext-docs.azurewebsites.net/api/advanced-topics/using-proposed-api) in VS Code. It is adapted from the [Hello Code Sample](/hellocode-sample).
|
||||
|
||||
The proposed API being used is `vscode.env.clipboard.readText()`. See details here: https://github.com/Microsoft/vscode/issues/217#issuecomment-433963587.
|
||||
|
||||
## VS Code API
|
||||
|
||||
### Proposed API
|
||||
|
||||
- [`env.clipboard`](https://github.com/Microsoft/vscode/blob/master/src/vs/vscode.proposed.d.ts#L49)
|
||||
- [`Clipboard.readText`](https://github.com/Microsoft/vscode/blob/master/src/vs/vscode.proposed.d.ts#L44)
|
||||
|
||||
## Running the Sample
|
||||
|
||||
This sample runs on VS Code Insider with commit [4626bc0e1b679d555dd6f034ece35ffc394b3bb7](https://github.com/Microsoft/vscode/commit/4626bc0e1b679d555dd6f034ece35ffc394b3bb7). If VS Code updated the Clipboard API in the future, you must re-download [`vscode.proposed.d.ts`](https://github.com/Microsoft/vscode/blob/master/src/vs/vscode.proposed.d.ts) to `src/vscode.proposed.d.ts` and update your API usage accordingly.
|
||||
|
||||
- Run `npm install` in terminal to install dependencies
|
||||
- Run the `Run Extension` target in the Debug View. This will:
|
||||
- Start a task `npm: watch` to compile the code
|
||||
- Run the extension in a new VS Code window
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 846 KiB |
2056
proposed-api-sample/package-lock.json
generated
2056
proposed-api-sample/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,37 +0,0 @@
|
||||
{
|
||||
"name": "hellocode-sample",
|
||||
"displayName": "hellocode-sample",
|
||||
"description": "HelloWorld example for VS Code",
|
||||
"version": "0.0.1",
|
||||
"publisher": "vscode-samples",
|
||||
"enableProposedApi": true,
|
||||
"engines": {
|
||||
"vscode": "^1.27.0"
|
||||
},
|
||||
"categories": [
|
||||
"Other"
|
||||
],
|
||||
"activationEvents": [
|
||||
"onCommand:extension.helloCode"
|
||||
],
|
||||
"main": "./out/extension.js",
|
||||
"contributes": {
|
||||
"commands": [
|
||||
{
|
||||
"command": "extension.helloCode",
|
||||
"title": "Hello Code"
|
||||
}
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"vscode:prepublish": "npm run compile",
|
||||
"compile": "tsc -p ./",
|
||||
"watch": "tsc -watch -p ./",
|
||||
"postinstall": "node ./node_modules/vscode/bin/install"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^8.10.25",
|
||||
"typescript": "^2.6.1",
|
||||
"vscode": "^1.1.21"
|
||||
}
|
||||
}
|
||||
@ -1,30 +0,0 @@
|
||||
// The module 'vscode' contains the VS Code extensibility API
|
||||
// Import the module and reference it with the alias vscode in your code below
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
// this method is called when your extension is activated
|
||||
// your extension is activated the very first time the command is executed
|
||||
export function activate(context: vscode.ExtensionContext) {
|
||||
// Use the console to output diagnostic information (console.log) and errors (console.error)
|
||||
// This line of code will only be executed once when your extension is activated
|
||||
console.log('Congratulations, your extension "hellocode-sample" is now active!');
|
||||
|
||||
// The command has been defined in the package.json file
|
||||
// Now provide the implementation of the command with registerCommand
|
||||
// The commandId parameter must match the command field in package.json
|
||||
let disposable = vscode.commands.registerCommand('extension.helloCode', () => {
|
||||
// The code you place here will be executed every time your command is executed
|
||||
|
||||
// Display a message box to the user
|
||||
// You are using Proposed API here!
|
||||
vscode.env.clipboard.readText().then(clipboardText => {
|
||||
vscode.window.showInformationMessage(`I'm using Proposed API here! Clipboard text is: ${clipboardText}`);
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
context.subscriptions.push(disposable);
|
||||
}
|
||||
|
||||
// this method is called when your extension is deactivated
|
||||
export function deactivate() {}
|
||||
1266
proposed-api-sample/src/vscode.proposed.d.ts
vendored
1266
proposed-api-sample/src/vscode.proposed.d.ts
vendored
File diff suppressed because it is too large
Load Diff
@ -1,11 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"outDir": "out",
|
||||
"lib": ["es6"],
|
||||
"sourceMap": true,
|
||||
"rootDir": "src"
|
||||
},
|
||||
"exclude": ["node_modules", ".vscode-test"]
|
||||
}
|
||||
Reference in New Issue
Block a user