Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit df25c55

Browse files
m-g-kmbwhite
authored andcommitted
Fix vscode issue with missing OutputConsole (#69)
* Fix vscode issue with missing OutputConsole Signed-off-by: m-g-k <[email protected]> * Fix tests in Travis Signed-off-by: m-g-k <[email protected]>
1 parent c77f01a commit df25c55

File tree

7 files changed

+44
-19
lines changed

7 files changed

+44
-19
lines changed

client/.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@
1212
out
1313
server
1414
node_modules
15-
*.vsix
15+
*.vsix
16+
.nyc_output
17+
.vscode-test
18+
coverage

client/.vscode/tasks.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,21 @@
4646
"reveal": "never"
4747
},
4848
"problemMatcher": []
49+
},
50+
{
51+
"type": "npm",
52+
"script": "lint",
53+
"problemMatcher": [
54+
"$tsc"
55+
]
56+
},
57+
{
58+
"type": "npm",
59+
"script": "lint",
60+
"path": "server/",
61+
"problemMatcher": [
62+
"$tsc"
63+
]
4964
}
5065
]
5166
}

client/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,9 @@
309309
"exact_paths": [
310310
"node_modules",
311311
"out",
312-
"server"
312+
"server",
313+
".vscode-test",
314+
"coverage"
313315
],
314316
"file_type_method": "EXCLUDE",
315317
"file_types": [

client/src/extension.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ import * as fs from 'fs';
1818
import * as os from 'os';
1919
import { spawn } from 'child_process';
2020

21-
import { workspace, commands, Disposable, ExtensionContext, window, WorkspaceConfiguration, TextDocumentChangeEvent, TextDocumentContentChangeEvent, Range, Position, Uri, TextDocumentShowOptions, ViewColumn, extensions } from 'vscode';
21+
import { workspace, commands, Disposable, ExtensionContext, OutputChannel, window, WorkspaceConfiguration, TextDocumentChangeEvent, TextDocumentContentChangeEvent, Range, Position, Uri, TextDocumentShowOptions, ViewColumn, extensions } from 'vscode';
2222
import { LanguageClient, LanguageClientOptions, SettingMonitor, ServerOptions, TransportKind, NotificationType, Code2ProtocolConverter, DidChangeTextDocumentParams } from 'vscode-languageclient';
2323

2424
let client: LanguageClient = null;
2525

2626
export function activate(context: ExtensionContext) {
27-
// console.log('CLIENT activate!!!');
27+
// console.log('CLIENT activate!!!');
2828

2929
const disposable3 = workspace.onDidChangeConfiguration((params) => {
3030
// console.log(`CLIENT onDidChangeConfiguration ${JSON.stringify(params)}`); //debug
@@ -33,7 +33,8 @@ export function activate(context: ExtensionContext) {
3333
context.subscriptions.push(disposable3);
3434

3535
// The server is implemented in node
36-
const serverModule = context.asAbsolutePath(path.join('server', 'server.js'));
36+
const serverModule = context.asAbsolutePath(path.join('server/src', 'server.js'));
37+
const outputChannel: OutputChannel = window.createOutputChannel('Hyperledger Composer');
3738

3839
// The debug options for the server
3940
const debugOptions = { execArgv: ['--nolazy', '--inspect=6009'] };
@@ -54,7 +55,8 @@ export function activate(context: ExtensionContext) {
5455
configurationSection: 'composer',
5556
// Notify the server about file changes to '.clientrc files contain in the workspace
5657
// fileEvents: workspace.createFileSystemWatcher('**/.clientrc')
57-
}
58+
},
59+
outputChannel: outputChannel
5860
};
5961

6062
// Create the language client and start the client.

client/test/extension.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@ suite('Extension Tests', () => {
3030
const uri = vscode.Uri.file(path.join(rootPath, '../test/data/valid/cto/test.cto'));
3131

3232
workspace.openTextDocument(uri).then((document) => {
33-
const text = document.getText();
34-
assert.equal(document.languageId, 'composer');
35-
assert.ok(document.lineCount === 41);
33+
const text = document.getText();
34+
assert.equal(document.languageId, 'composer');
35+
assert.ok(document.lineCount === 41);
3636

3737
});
3838
});
3939

4040
test('activate should return an acl file when open an acl file', () => {
4141

42-
const uri = vscode.Uri.file(path.join(rootPath, '../test/data/valid/acl/permissions.acl'));
42+
const uri = vscode.Uri.file(path.join(rootPath, '../test/data/valid/acl/permissions.acl'));
4343

44-
workspace.openTextDocument(uri).then((document) => {
45-
const text = document.getText();
46-
assert.equal(document.languageId, 'composer-acl');
47-
assert.ok(document.lineCount === 34);
44+
workspace.openTextDocument(uri).then((document) => {
45+
const text = document.getText();
46+
assert.equal(document.languageId, 'composer-acl');
47+
assert.ok(document.lineCount === 48);
4848
});
4949
});
5050
});

server/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@
1111
# limitations under the License.
1212

1313
out
14-
node_modules
14+
node_modules
15+
.nyc_output
16+
coverage

server/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,22 @@
1313
"url": "https://github.com/hyperledger/composer-vscode-plugin"
1414
},
1515
"dependencies": {
16-
"composer-common": "latest",
16+
"composer-common": "0.19.1",
1717
"vscode-languageserver": "3.3.0",
1818
"vscode-uri": "1.0.1"
1919
},
2020
"devDependencies": {
2121
"@types/mocha": "^2.2.33",
22-
"@types/node": "^6.0.52",
22+
"@types/node": "^6.0.106",
2323
"chai": "^4.1.2",
24-
"mocha": "^5.0.0",
24+
"mocha": "^5.1.0",
2525
"nyc": "^11.4.1",
2626
"source-map-support": "^0.5.3",
2727
"ts-node": "^4.1.0",
2828
"tslint": "^5.9.1",
2929
"tslint-loader": "^3.5.3",
30-
"typescript": "^2.6.2"
30+
"typescript": "^2.6.2",
31+
"license-check-and-add": "^2.3.1"
3132
},
3233
"scripts": {
3334
"install:server": "installServerIntoExtension ../client ./package.json ./tsconfig.json",

0 commit comments

Comments
 (0)