mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
19
welcome-view-content-sample/.eslintrc.json
Normal file
19
welcome-view-content-sample/.eslintrc.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"root": true,
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 6,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": [
|
||||
"@typescript-eslint"
|
||||
],
|
||||
"rules": {
|
||||
"@typescript-eslint/naming-convention": "warn",
|
||||
"@typescript-eslint/semi": "warn",
|
||||
"curly": "warn",
|
||||
"eqeqeq": "warn",
|
||||
"no-throw-literal": "warn",
|
||||
"semi": "off"
|
||||
}
|
||||
}
|
||||
7
welcome-view-content-sample/.vscode/extensions.json
vendored
Normal file
7
welcome-view-content-sample/.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||
// for the documentation about the extensions.json format
|
||||
"recommendations": [
|
||||
"dbaeumer.vscode-eslint"
|
||||
]
|
||||
}
|
||||
28
welcome-view-content-sample/.vscode/launch.json
vendored
Normal file
28
welcome-view-content-sample/.vscode/launch.json
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
// 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",
|
||||
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
|
||||
"outFiles": ["${workspaceFolder}/out/**/*.js"],
|
||||
"preLaunchTask": "${defaultBuildTask}"
|
||||
},
|
||||
{
|
||||
"name": "Extension Tests",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}",
|
||||
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
|
||||
],
|
||||
"outFiles": ["${workspaceFolder}/out/test/**/*.js"],
|
||||
"preLaunchTask": "${defaultBuildTask}"
|
||||
}
|
||||
]
|
||||
}
|
||||
11
welcome-view-content-sample/.vscode/settings.json
vendored
Normal file
11
welcome-view-content-sample/.vscode/settings.json
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
// Place your settings in this file to overwrite default and user settings.
|
||||
{
|
||||
"files.exclude": {
|
||||
"out": false // set this to true to hide the "out" folder with the compiled JS files
|
||||
},
|
||||
"search.exclude": {
|
||||
"out": true // set this to false to include "out" folder in search results
|
||||
},
|
||||
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
|
||||
"typescript.tsc.autoDetect": "off"
|
||||
}
|
||||
20
welcome-view-content-sample/.vscode/tasks.json
vendored
Normal file
20
welcome-view-content-sample/.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
// 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
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
14
welcome-view-content-sample/README.md
Normal file
14
welcome-view-content-sample/README.md
Normal file
@ -0,0 +1,14 @@
|
||||
# Welcome view content
|
||||
|
||||
This sample demonstrates how to implement welcome view content, which gets displayed in certain views whenever they are empty.
|
||||
|
||||
Run the sample and run `Close Workspace`. In the _no workspace_ window, go to the Explorer. You'll see the content contributed via the `package.json` declaration.
|
||||
|
||||
## Running the Sample
|
||||
|
||||
- Open this example in VS Code Insiders
|
||||
- `npm install`
|
||||
- `npm run watch`
|
||||
- `F5` to start debugging
|
||||
- Run the `Workspaces: Close Workspace` command
|
||||
- Open the Explorer view
|
||||
1915
welcome-view-content-sample/package-lock.json
generated
Normal file
1915
welcome-view-content-sample/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
51
welcome-view-content-sample/package.json
Normal file
51
welcome-view-content-sample/package.json
Normal file
@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "welcome-view-content-sample",
|
||||
"publisher": "vscode-samples",
|
||||
"description": "Uri Handler Sample",
|
||||
"version": "0.0.1",
|
||||
"engines": {
|
||||
"vscode": "^1.46.0"
|
||||
},
|
||||
"categories": [
|
||||
"Other"
|
||||
],
|
||||
"activationEvents": [
|
||||
"onCommand:welcome-view-content-sample.hello"
|
||||
],
|
||||
"main": "./out/extension.js",
|
||||
"contributes": {
|
||||
"commands": [
|
||||
{
|
||||
"command": "welcome-view-content-sample.hello",
|
||||
"title": "Hello World!"
|
||||
}
|
||||
],
|
||||
"viewsWelcome": [
|
||||
{
|
||||
"view": "workbench.explorer.emptyView",
|
||||
"contents": "You can have paragraphs of text here. You can have [links](https://code.visualstudio.com) to external sources or [internal commands](command:welcome-view-content-sample.hello).\nUse new lines to have new paragraphs.\nPlace a link alone in a paragraph to make it a button\n[Hello](command:welcome-view-content-sample.hello)"
|
||||
}
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"vscode:prepublish": "npm run compile",
|
||||
"compile": "tsc -p ./",
|
||||
"watch": "tsc -watch -p ./",
|
||||
"pretest": "npm run compile && npm run lint",
|
||||
"lint": "eslint src --ext ts",
|
||||
"test": "node ./out/test/runTest.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/glob": "^7.1.3",
|
||||
"@types/mocha": "^8.0.4",
|
||||
"@types/node": "^12.11.7",
|
||||
"@types/vscode": "^1.46.0",
|
||||
"@typescript-eslint/eslint-plugin": "^4.9.0",
|
||||
"@typescript-eslint/parser": "^4.9.0",
|
||||
"@vscode/test-electron": "^1.6.1",
|
||||
"eslint": "^7.15.0",
|
||||
"glob": "^7.1.6",
|
||||
"mocha": "^8.1.3",
|
||||
"typescript": "^4.1.2"
|
||||
}
|
||||
}
|
||||
14
welcome-view-content-sample/src/extension.ts
Normal file
14
welcome-view-content-sample/src/extension.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
export function activate(context: vscode.ExtensionContext) {
|
||||
let disposable = vscode.commands.registerCommand(
|
||||
'welcome-view-content-sample.hello',
|
||||
async () => {
|
||||
vscode.window.showInformationMessage('Hello world!');
|
||||
}
|
||||
);
|
||||
|
||||
context.subscriptions.push(disposable);
|
||||
}
|
||||
|
||||
export function deactivate() {}
|
||||
21
welcome-view-content-sample/tsconfig.json
Normal file
21
welcome-view-content-sample/tsconfig.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"outDir": "out",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"sourceMap": true,
|
||||
"rootDir": "src",
|
||||
"strict": true /* enable all strict type-checking options */
|
||||
/* Additional Checks */
|
||||
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
||||
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
||||
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
".vscode-test"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user