Skip to content

Commit 53846f9

Browse files
committed
Initial implementation with codelens
0 parents  commit 53846f9

22 files changed

+697
-0
lines changed

Diff for: .gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
out
2+
node_modules
3+
npm-debug.log
4+
.vscode-test

Diff for: .vscode/launch.json

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// A launch configuration that compiles the extension and then opens it inside a new window
2+
{
3+
"version": "0.1.0",
4+
"configurations": [
5+
{
6+
"name": "Launch Extension",
7+
"type": "extensionHost",
8+
"request": "launch",
9+
"runtimeExecutable": "${execPath}",
10+
"args": [
11+
"--extensionDevelopmentPath=${workspaceRoot}"
12+
],
13+
"stopOnEntry": false,
14+
"sourceMaps": true,
15+
"outDir": "${workspaceRoot}/out",
16+
"preLaunchTask": "compile"
17+
},
18+
{
19+
"name": "Launch Tests",
20+
"type": "extensionHost",
21+
"request": "launch",
22+
"runtimeExecutable": "${execPath}",
23+
"args": [
24+
"--extensionDevelopmentPath=${workspaceRoot}",
25+
"--extensionTestsPath=${workspaceRoot}/out/test"
26+
],
27+
"stopOnEntry": false,
28+
"sourceMaps": true,
29+
"outDir": "${workspaceRoot}/out/test",
30+
"preLaunchTask": "compile"
31+
}
32+
]
33+
}

Diff for: .vscode/settings.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Place your settings in this file to overwrite default and user settings.
2+
{
3+
"editor.tabSize": 2,
4+
"editor.insertSpaces": true,
5+
/*"files.exclude": {
6+
"node_modules": true,
7+
"out": false // set this to true to hide the "out" folder with the compiled JS files
8+
},
9+
"search.exclude": {
10+
"out": true // set this to false to include "out" folder in search results
11+
},*/
12+
"typescript.tsdk": "./node_modules/typescript/lib" // we want to use the TS server from our node_modules folder to control its version
13+
}

Diff for: .vscode/tasks.json

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Available variables which can be used inside of strings.
2+
// ${workspaceRoot}: the root folder of the team
3+
// ${file}: the current opened file
4+
// ${fileBasename}: the current opened file's basename
5+
// ${fileDirname}: the current opened file's dirname
6+
// ${fileExtname}: the current opened file's extension
7+
// ${cwd}: the current working directory of the spawned process
8+
// A task runner that calls a custom npm script that compiles the extension.
9+
{
10+
"version": "0.1.0",
11+
// we want to run npm
12+
"command": "npm",
13+
// the command is a shell script
14+
"isShellCommand": true,
15+
"echoCommand": true,
16+
"suppressTaskName": true,
17+
"args": [
18+
"run",
19+
"-s"
20+
],
21+
"tasks": [
22+
{
23+
"taskName": "compile",
24+
"isBuildCommand": true,
25+
"args": [
26+
"compile"
27+
]
28+
},
29+
{
30+
"taskName": "test",
31+
"isTestCommand": true,
32+
"args": [
33+
"test"
34+
]
35+
}
36+
]
37+
}

Diff for: .vscodeignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.vscode/**
2+
typings/**
3+
out/test/**
4+
test/**
5+
src/**
6+
grunt/**
7+
gruntfile.js
8+
.travis*
9+
**/*.map
10+
.gitignore
11+
tsconfig.json
12+
vsc-extension-quickstart.md

Diff for: LICENSE

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Copyright (c) Tamás Kiss
2+
3+
All rights reserved.
4+
5+
MIT License
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8+
9+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10+
11+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Diff for: README.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Code Metrics - VsCode Extension
2+
3+
Computes the complexity of typescript class members.
4+
5+
## Install
6+
7+
[How to install vscode extentions](https://code.visualstudio.com/docs/editor/extension-gallery)
8+
9+
### Change Log
10+
11+
- 0.0.1
12+
- Initial project setup
13+
14+
### License
15+
16+
Licensed under MIT

Diff for: grunt/aliases.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
default:
2+
compile
3+
4+
compile:
5+
- clean:sourceArtifacts
6+
- shell:compileSource
7+
8+
test:
9+
- compile
10+
- shell:tests
11+
12+
smoke:
13+
- compile
14+
- shell:smoke

Diff for: grunt/clean.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
options:
2+
force: true
3+
npm:
4+
src: node_modules
5+
sourceArtifacts:
6+
src: <%= config.paths.srcOut %>

Diff for: grunt/config.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
paths:
2+
src: ./src
3+
srcOut: ./out
4+
test: ./test
5+
testOut: ./out/test

Diff for: grunt/shell.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
options:
2+
stdout: true
3+
stderr: true
4+
failOnError: true
5+
stdinRawMode: false
6+
7+
compileSource: tsc --outDir <%= config.paths.srcOut %> --sourceMap
8+
9+
tests: node ./node_modules/vscode/bin/test

Diff for: gruntfile.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = grunt => {
2+
const pathUtil = require('path');
3+
const configPath = pathUtil.join(process.cwd(), 'grunt');
4+
const config = grunt.file.readYAML(pathUtil.join(configPath, 'config.yaml'));
5+
config.env = process.env;
6+
7+
require('load-grunt-config')(grunt, {
8+
jitGrunt: true,
9+
configPath: configPath,
10+
config: config
11+
});
12+
13+
};

Diff for: images/logo.png

478 Bytes
Loading

Diff for: package.json

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"name": "vscode-codemetrics",
3+
"private": true,
4+
"description": "Shows the complexity information for TypeScript class members.",
5+
"author": "Tamas Kiss",
6+
"publisher": "Tamas Kiss",
7+
"license": "MIT",
8+
"version": "0.0.1",
9+
"displayName": "CodeMetrics",
10+
"icon": "images/logo.png",
11+
"engines": {
12+
"vscode": "0.10.x"
13+
},
14+
"keywords": [
15+
"vscode",
16+
"code",
17+
"packagesmetrics",
18+
"typescript"
19+
],
20+
"categories": [
21+
"Other"
22+
],
23+
"activationEvents": [
24+
"onLanguage:typescript"
25+
],
26+
"main": "./out/extension",
27+
"scripts": {
28+
"vscode:prepublish": "node ./node_modules/vscode/bin/compile",
29+
"watch": "node ./node_modules/vscode/bin/compile -watch -p ./",
30+
"postinstall": "node ./node_modules/vscode/bin/install",
31+
"clean": "grunt clean:sourceArtifacts",
32+
"compile": "grunt compile",
33+
"test": "grunt test"
34+
},
35+
"devDependencies": {
36+
"typescript": "^1.8.7",
37+
"vscode": " ^0.11.7",
38+
"grunt": "^1.0.1",
39+
"grunt-cli": "^1.2.0",
40+
"load-grunt-config": "^0.19.1",
41+
"grunt-contrib-clean": "^1.0.0",
42+
"grunt-shell": "^1.2.1"
43+
},
44+
"dependencies": {
45+
"vscode-languageclient": "^2.1.0"
46+
}
47+
}

0 commit comments

Comments
 (0)