Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 60 additions & 60 deletions .vscode/tasks.json
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've corrected the indentation in this file.

Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"label": "watch",
"dependsOn": [
"npm: watch:tsc",
"npm: watch:esbuild"
],
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "watch:esbuild",
"group": "build",
"problemMatcher": "$esbuild-watch",
"isBackground": true,
"label": "npm: watch:esbuild",
"presentation": {
"group": "watch",
"reveal": "never"
}
},
{
"type": "npm",
"script": "watch:tsc",
"group": "build",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"label": "npm: watch:tsc",
"presentation": {
"group": "watch",
"reveal": "never"
}
},
{
"type": "npm",
"script": "watch-tests",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never",
"group": "watchers"
},
"group": "build"
},
{
"label": "tasks: watch-tests",
"dependsOn": [
"npm: watch",
"npm: watch-tests"
],
"problemMatcher": []
}
]
"version": "2.0.0",
"tasks": [
{
"label": "watch",
"dependsOn": [
"npm: watch:tsc",
"npm: watch:esbuild"
],
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "watch:esbuild",
"group": "build",
"problemMatcher": "$esbuild-watch",
"isBackground": true,
"label": "npm: watch:esbuild",
"presentation": {
"group": "watch",
"reveal": "never"
}
},
{
"type": "npm",
"script": "watch:tsc",
"group": "build",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"label": "npm: watch:tsc",
"presentation": {
"group": "watch",
"reveal": "never"
}
},
{
"type": "npm",
"script": "watch-tests",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never",
"group": "watchers"
},
"group": "build"
},
{
"label": "tasks: watch-tests",
"dependsOn": [
"npm: watch",
"npm: watch-tests"
],
"problemMatcher": []
}
]
}
17 changes: 11 additions & 6 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,18 @@ export async function activate(_context: ExtensionContext) {
clientOptions
);

outputChannel.appendLine("PonyLSP client ready");
outputChannel.appendLine("Pony language server client starting…");
// Start the client. This will also launch the server
return client.start().catch(reason => {
window.showWarningMessage(`Failed to run Pony Language Server (PLS): ${reason}`);
showPony(false);
client = undefined;
});
return client
.start()
.then(() => {
outputChannel.appendLine("Pony language server client ready");
})
.catch((reason) => {
window.showWarningMessage(`Pony language server client failed: ${reason}`);
Comment on lines -81 to +89
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the debug logging to indicate when pony-lsp starts, is ready, or fails.

showPony(false);
client = undefined;
});
}

export async function deactivate(): Promise<void> {
Expand Down
4 changes: 2 additions & 2 deletions src/test/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ describe('Extension Test Suite', () => {

// Verify it did not create the language client
const clientReadyMessage = mockOutputChannel.appendLine.getCalls().find((call: sinon.SinonSpyCall<[string], void>) =>
call.args[0] && call.args[0].includes('PonyLSP client ready')
call.args[0] && call.args[0].includes('Pony language server client starting')
);
assert.strictEqual(clientReadyMessage, undefined, 'should not log "PonyLSP client ready" when returning early');
assert.strictEqual(clientReadyMessage, undefined, 'should not log "Pony language server client starting" when returning early');
});
});
});
Expand Down