mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-06-13 07:10:26 +08:00
Applying the sample contribution guidelines
This commit is contained in:
@ -163,6 +163,19 @@ const lspSamples = [
|
||||
'https://github.com/Microsoft/vscode/wiki/Extension-Authoring:-Adopting-Multi-Root-Workspace-APIs#language-client--language-server',
|
||||
apis: [],
|
||||
contributions: []
|
||||
},
|
||||
{
|
||||
description: 'Source Control Sample',
|
||||
path: 'source-control-sample',
|
||||
guide: 'https://code.visualstudio.com/api/extension-guides/scm-provider',
|
||||
apis: [
|
||||
'workspace.workspaceFolders',
|
||||
'SourceControl',
|
||||
'SourceControlResourceGroup',
|
||||
'scm.createSourceControl',
|
||||
'TextDocumentContentProvider'
|
||||
],
|
||||
contributions: ["menus"]
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@ -4,7 +4,19 @@ This sample implements a minimal source control provider. It shows how the sourc
|
||||
|
||||

|
||||
|
||||
Activate the extension by invoking the `Open JSFiddle` command. This invokes following 4 lines, which does the following:
|
||||
## VS Code API
|
||||
|
||||
Following VS Code APIs are demonstrated by this extension:
|
||||
|
||||
- `workspace.workspaceFolders`
|
||||
- `scm.createSourceControl`
|
||||
- `SourceControl`
|
||||
- `SourceControlResourceGroup`
|
||||
- `TextDocumentContentProvider`
|
||||
|
||||
## Running the Sample
|
||||
|
||||
Activate the extension by invoking the `Open JSFiddle` command, specify the JSFiddle code, if no workspace folder is open, select a workspace folder. This invokes following 4 lines, which does the following:
|
||||
|
||||
1. creates the custom source control provider associated with the workspace folder
|
||||
1. creates the source control resource group to later show the local changes to the files in the repository
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import * as vscode from 'vscode';
|
||||
import { FiddleData, FiddleRepository, toExtension, downloadFiddle, areIdentical, uploadFiddle, Fiddle } from './fiddleRepository';
|
||||
import { FiddleRepository, toExtension, downloadFiddle, areIdentical, uploadFiddle, Fiddle } from './fiddleRepository';
|
||||
import * as path from 'path';
|
||||
import { writeFileSync, existsSync, unlinkSync } from 'fs';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user