diff --git a/README.md b/README.md index 53f8fd5..75b4b02 100644 --- a/README.md +++ b/README.md @@ -1,65 +1,31 @@ -# git-codelens README +# Git CodeLens -This is the README for your extension "git-codelens". After writing up a brief description, we recommend including the following sections. +Provides Git blame (and history eventually) CodeLens for many supported Visual Studio Code languages (in theory -- the language must support symbol searching). ## Features -Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file. +Provides CodeLens with the author and date of the last check-in. -For example if there is an image subfolder under your extension project workspace: +> ![CodeLens](https://raw.githubusercontent.com/eamodio/vscode-git-codelens/master/images/preview-codelens.png) -\!\[feature X\]\(images/feature-x.png\) +Clicking on a CodeLens opens a blame "explorer" with the commits and changed lines in the right pane and the commit (file) contents on the left. -> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow. +> ![Blame Explorer](https://raw.githubusercontent.com/eamodio/vscode-git-codelens/master/images/preview-blame.png) ## Requirements -If you have any requirements or dependencies, add a section describing those and how to install and configure them. +Must be using Git and it must be in your path. ## Extension Settings -Include if your extension adds any VS Code settings through the `contributes.configuration` extension point. - -For example: - -This extension contributes the following settings: - -* `myExtension.enable`: enable/disable this extension -* `myExtension.thing`: set to `blah` to do something +None yet. ## Known Issues -Calling out known issues can help limit users opening duplicate issues against your extension. +Too many to count -- this is still very much a work in progress. ## Release Notes -Users appreciate release notes as you update your extension. +### 0.0.1 -### 1.0.0 - -Initial release of ... - -### 1.0.1 - -Fixed issue #. - -### 1.1.0 - -Added features X, Y, and Z. - ------------------------------------------------------------------------------------------------------------ - -## Working with Markdown - -**Note:** You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts: - -* Split the editor (`Cmd+\` on OSX or `Ctrl+\` on Windows and Linux) -* Toggle preview (`Shift+CMD+V` on OSX or `Shift+Ctrl+V` on Windows and Linux) -* Press `Ctrl+Space` (Windows, Linux) or `Cmd+Space` (OSX) to see a list of Markdown snippets - -### For more information - -* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown) -* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/) - -**Enjoy!** \ No newline at end of file +Initial release but still heavily a work in progress. \ No newline at end of file diff --git a/images/preview-blame.png b/images/preview-blame.png new file mode 100644 index 0000000..447f8c8 Binary files /dev/null and b/images/preview-blame.png differ diff --git a/images/preview-codelens.png b/images/preview-codelens.png new file mode 100644 index 0000000..4bb2c35 Binary files /dev/null and b/images/preview-codelens.png differ diff --git a/package.json b/package.json index 6b75076..c628b04 100644 --- a/package.json +++ b/package.json @@ -1,22 +1,25 @@ { "name": "git-codelens", - "displayName": "Git CodeLens", - "description": "Provides Git blame information in CodeLens", "version": "0.0.1", "author": "Eric Amodio", "publisher": "eamodio", "engines": { "vscode": "^1.3.0" }, + "license": "SEE LICENSE IN LICENSE", + "displayName": "Git CodeLens", + "description": "Provides Git blame information in CodeLens", "categories": [ "Other" ], - "activationEvents": [ - "*" - ], "keywords": [ "git", "gitblame", "blame" ], + "galleryBanner": { + "color": "#0000FF", + "theme": "dark" + }, + "preview": true, "main": "./out/src/extension", "contributes": { "commands": [{ @@ -25,17 +28,25 @@ "category": "Git" }] }, - "scripts": { - "vscode:prepublish": "node ./node_modules/vscode/bin/compile", - "compile": "node ./node_modules/vscode/bin/compile -watch -p ./", - "postinstall": "node ./node_modules/vscode/bin/install && tsc" - }, + "activationEvents": [ + "*" + ], "dependencies": { - "tmp": "^0.0.28", - "spawn-rx": "^2.0.1" + "lodash": "^4.15.0", + "moment": "^2.14.1", + "spawn-rx": "^2.0.1", + "tmp": "^0.0.28" }, "devDependencies": { "typescript": "^1.8.10", "vscode": "^0.11.17" + }, + "extensionDependencies": [ + "donjayamanne.githistory" + ], + "scripts": { + "vscode:prepublish": "node ./node_modules/vscode/bin/compile", + "compile": "node ./node_modules/vscode/bin/compile -watch -p ./", + "postinstall": "node ./node_modules/vscode/bin/install && tsc" } } \ No newline at end of file diff --git a/src/codeLensProvider.ts b/src/codeLensProvider.ts index ae489c5..4845928 100644 --- a/src/codeLensProvider.ts +++ b/src/codeLensProvider.ts @@ -91,7 +91,7 @@ export default class GitCodeLensProvider implements CodeLensProvider { let sorted = lines.sort((a, b) => b.date.getTime() - a.date.getTime()); recentLine = sorted[0]; - console.log(lens.fileName, 'Blame lines:', sorted); + // console.log(lens.fileName, 'Blame lines:', sorted); let map: Map = new Map(); sorted.forEach(l => { diff --git a/src/extension.ts b/src/extension.ts index 7421398..c3589df 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -9,9 +9,13 @@ import {Commands, VsCodeCommands} from './constants'; export function activate(context: ExtensionContext) { // Workspace not using a folder. No access to git repo. if (!workspace.rootPath) { + console.warn('Git CodeLens inactive: no rootPath'); + return; } + console.log(`Git CodeLens active: ${workspace.rootPath}`); + gitRepoPath(workspace.rootPath).then(repoPath => { context.subscriptions.push(workspace.registerTextDocumentContentProvider(GitContentProvider.scheme, new GitContentProvider(context)));