Applying the sample contribution guidelines

This commit is contained in:
Jan Dolejsi
2019-03-12 23:54:14 +00:00
parent bca441ddab
commit 8cc900dfef
3 changed files with 27 additions and 2 deletions

View File

@ -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"]
}
]

View File

@ -4,7 +4,19 @@ This sample implements a minimal source control provider. It shows how the sourc
![alt text](resources/images/demo.gif "Extension demo")
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

View File

@ -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';