Skip to content
This repository was archived by the owner on Jul 31, 2022. It is now read-only.

Commit 01f7845

Browse files
author
Divyendu Singh
committed
formatting: unification and declaration
1 parent cc7f713 commit 01f7845

File tree

10 files changed

+417
-421
lines changed

10 files changed

+417
-421
lines changed

.vscode/settings.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
// Place your settings in this file to overwrite default and user settings.
22
{
3-
"files.exclude": {
4-
"out": false // set this to true to hide the "out" folder with the compiled JS files
5-
},
6-
"search.exclude": {
7-
"out": true // set this to false to include "out" folder in search results
8-
}
9-
}
3+
"editor.formatOnSave": true,
4+
"prettier.tabWidth": 2,
5+
"prettier.eslintIntegration": true,
6+
"prettier.singleQuote": false,
7+
"files.exclude": {
8+
"out": false // set this to true to hide the "out" folder with the compiled JS files
9+
},
10+
"search.exclude": {
11+
"out": true // set this to false to include "out" folder in search results
12+
}
13+
}

package.json

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,75 @@
11
{
2-
"name": "vscode-graphql",
3-
"displayName": "vscode-graphql",
4-
"description": "GraphQL Awesomeness for VSCode",
5-
"version": "0.0.1",
6-
"publisher": "prisma",
7-
"engines": {
8-
"vscode": "^1.23.0"
9-
},
10-
"categories": ["Programming Languages", "Snippets"],
11-
"activationEvents": [
12-
"onCommand:extension.isDebugging",
13-
"onLanguage:graphql",
14-
"workspaceContains:**/.graphqlconfig",
15-
"workspaceContains:**/.graphqlconfig.yml",
16-
"workspaceContains:**/.graphqlconfig.yaml"
17-
],
18-
"main": "./out/extension",
19-
"contributes": {
20-
"languages": [
21-
{
22-
"id": "graphql",
23-
"extensions": [".gql", ".graphql"],
24-
"aliases": ["GraphQL", "graphql"],
25-
"configuration": "./src/language/language-configuration.json"
26-
}
27-
],
28-
"grammars": [
29-
{
30-
"language": "graphql",
31-
"path": "./src/grammars/graphql.json",
32-
"scopeName": "source.graphql"
33-
}
34-
],
35-
"snippets": [
36-
{
37-
"language": "graphql",
38-
"path": "./src/snippets/graphql.json"
39-
}
2+
"name": "vscode-graphql",
3+
"displayName": "vscode-graphql",
4+
"description": "GraphQL Awesomeness for VSCode",
5+
"version": "0.0.1",
6+
"publisher": "prisma",
7+
"engines": {
8+
"vscode": "^1.23.0"
9+
},
10+
"categories": ["Programming Languages", "Snippets"],
11+
"activationEvents": [
12+
"onCommand:extension.isDebugging",
13+
"onLanguage:graphql",
14+
"workspaceContains:**/.graphqlconfig",
15+
"workspaceContains:**/.graphqlconfig.yml",
16+
"workspaceContains:**/.graphqlconfig.yaml"
4017
],
41-
"configuration": {
42-
"vscode-graphql.debug": {
43-
"type": ["boolean", "null"],
44-
"title": "VSCode GraphQL - Debug Mode",
45-
"default": false,
46-
"description": "Enable debug logs"
47-
}
18+
"main": "./out/extension",
19+
"contributes": {
20+
"languages": [
21+
{
22+
"id": "graphql",
23+
"extensions": [".gql", ".graphql"],
24+
"aliases": ["GraphQL", "graphql"],
25+
"configuration": "./src/language/language-configuration.json"
26+
}
27+
],
28+
"grammars": [
29+
{
30+
"language": "graphql",
31+
"path": "./src/grammars/graphql.json",
32+
"scopeName": "source.graphql"
33+
}
34+
],
35+
"snippets": [
36+
{
37+
"language": "graphql",
38+
"path": "./src/snippets/graphql.json"
39+
}
40+
],
41+
"configuration": {
42+
"vscode-graphql.debug": {
43+
"type": ["boolean", "null"],
44+
"title": "VSCode GraphQL - Debug Mode",
45+
"default": false,
46+
"description": "Enable debug logs"
47+
}
48+
},
49+
"commands": [
50+
{
51+
"command": "extension.isDebugging",
52+
"title": "VSCode GraphQL - Is Debugging?"
53+
}
54+
]
55+
},
56+
"scripts": {
57+
"vscode:prepublish": "npm run compile",
58+
"compile": "tsc -p ./",
59+
"watch": "tsc -watch -p ./",
60+
"postinstall": "node ./node_modules/vscode/bin/install",
61+
"test": "npm run compile && node ./node_modules/vscode/bin/test"
62+
},
63+
"devDependencies": {
64+
"typescript": "^2.6.1",
65+
"vscode": "^1.1.6",
66+
"tslint": "^5.8.0",
67+
"@types/node": "^7.0.43",
68+
"@types/mocha": "^2.2.42"
4869
},
49-
"commands": [
50-
{
51-
"command": "extension.isDebugging",
52-
"title": "VSCode GraphQL - Is Debugging?"
53-
}
54-
]
55-
},
56-
"scripts": {
57-
"vscode:prepublish": "npm run compile",
58-
"compile": "tsc -p ./",
59-
"watch": "tsc -watch -p ./",
60-
"postinstall": "node ./node_modules/vscode/bin/install",
61-
"test": "npm run compile && node ./node_modules/vscode/bin/test"
62-
},
63-
"devDependencies": {
64-
"typescript": "^2.6.1",
65-
"vscode": "^1.1.6",
66-
"tslint": "^5.8.0",
67-
"@types/node": "^7.0.43",
68-
"@types/mocha": "^2.2.42"
69-
},
70-
"dependencies": {
71-
"babel-polyfill": "^6.26.0",
72-
"graphql-language-service-server": "^1.1.2",
73-
"vscode-languageclient": "^4.1.3"
74-
}
70+
"dependencies": {
71+
"babel-polyfill": "^6.26.0",
72+
"graphql-language-service-server": "^1.1.2",
73+
"vscode-languageclient": "^4.1.3"
74+
}
7575
}

src/extension.ts

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,71 +2,71 @@
22
import * as path from "path";
33
import { workspace, ExtensionContext, window, commands } from "vscode";
44
import {
5-
LanguageClient,
6-
LanguageClientOptions,
7-
ServerOptions,
8-
TransportKind
5+
LanguageClient,
6+
LanguageClientOptions,
7+
ServerOptions,
8+
TransportKind
99
} from "vscode-languageclient";
1010

1111
function getConfig() {
12-
return workspace.getConfiguration(
13-
"vscode-graphql",
14-
window.activeTextEditor ? window.activeTextEditor.document.uri : null
15-
);
12+
return workspace.getConfiguration(
13+
"vscode-graphql",
14+
window.activeTextEditor ? window.activeTextEditor.document.uri : null
15+
);
1616
}
1717

1818
export function activate(context: ExtensionContext) {
19-
const config = getConfig();
20-
const { debug } = config;
21-
if (debug) {
22-
console.log('Extension "vscode-graphql" is now active!');
23-
}
19+
const config = getConfig();
20+
const { debug } = config;
21+
if (debug) {
22+
console.log('Extension "vscode-graphql" is now active!');
23+
}
2424

25-
const serverModule = context.asAbsolutePath(
26-
path.join("out/server", "server.js")
27-
);
25+
const serverModule = context.asAbsolutePath(
26+
path.join("out/server", "server.js")
27+
);
2828

29-
const debugOptions = {
30-
execArgv: ["--nolazy", "--debug=6009", "--inspect=localhost:6009"]
31-
};
29+
const debugOptions = {
30+
execArgv: ["--nolazy", "--debug=6009", "--inspect=localhost:6009"]
31+
};
3232

33-
let serverOptions: ServerOptions = {
34-
run: { module: serverModule, transport: TransportKind.ipc },
35-
debug: {
36-
module: serverModule,
37-
transport: TransportKind.ipc,
38-
options: debugOptions
39-
}
40-
};
33+
let serverOptions: ServerOptions = {
34+
run: { module: serverModule, transport: TransportKind.ipc },
35+
debug: {
36+
module: serverModule,
37+
transport: TransportKind.ipc,
38+
options: debugOptions
39+
}
40+
};
4141

42-
let clientOptions: LanguageClientOptions = {
43-
documentSelector: [{ scheme: "file", language: "graphql" }],
44-
synchronize: {
45-
fileEvents: workspace.createFileSystemWatcher("**/*.{graphql,gql}")
46-
},
47-
outputChannelName: "graphql language server"
48-
};
42+
let clientOptions: LanguageClientOptions = {
43+
documentSelector: [{ scheme: "file", language: "graphql" }],
44+
synchronize: {
45+
fileEvents: workspace.createFileSystemWatcher("**/*.{graphql,gql}")
46+
},
47+
outputChannelName: "graphql language server"
48+
};
4949

50-
const client = new LanguageClient(
51-
"vscode-graphql",
52-
"GraphQL Language Server",
53-
serverOptions,
54-
clientOptions,
55-
debug
56-
);
50+
const client = new LanguageClient(
51+
"vscode-graphql",
52+
"GraphQL Language Server",
53+
serverOptions,
54+
clientOptions,
55+
debug
56+
);
5757

58-
const disposableClient = client.start();
59-
context.subscriptions.push(disposableClient);
58+
const disposableClient = client.start();
59+
context.subscriptions.push(disposableClient);
6060

61-
const disposableCommand = commands.registerCommand(
62-
"extension.isDebugging",
63-
() => {
64-
window.showInformationMessage(`is in debug mode: ${debug}`);
65-
}
66-
);
67-
context.subscriptions.push(disposableCommand);
61+
const disposableCommand = commands.registerCommand(
62+
"extension.isDebugging",
63+
() => {
64+
window.showInformationMessage(`is in debug mode: ${debug}`);
65+
}
66+
);
67+
context.subscriptions.push(disposableCommand);
6868
}
6969

7070
export function deactivate() {
71-
console.log('Extension "vscode-graphql" is now de-active!');
71+
console.log('Extension "vscode-graphql" is now de-active!');
7272
}

0 commit comments

Comments
 (0)