From a3642f16b4350c199025274bf4b7d63d36bec3ce Mon Sep 17 00:00:00 2001 From: Remy Suen Date: Wed, 30 Aug 2017 18:54:39 +0900 Subject: [PATCH] Fix #26 Upgrade to Monaco 0.10.0 Removed CodeAction as it no longer exists in 0.10.0. Also added additional compilation steps to the Travis build to ensure that the TypeScript files in both the project and the example can actually be compiled and built into an example application. Signed-off-by: Remy Suen --- .travis.yml | 4 +++- package.json | 4 ++-- src/converter.ts | 5 ----- src/languages.ts | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0ba2f523a..3747c4742 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,5 +10,7 @@ cache: - example/node_modules install: - npm install + - npm run compile - cd example - - npm install \ No newline at end of file + - npm install + - npm run build \ No newline at end of file diff --git a/package.json b/package.json index 3564916d1..8f1e30975 100644 --- a/package.json +++ b/package.json @@ -20,8 +20,8 @@ }, "dependencies": { "glob-to-regexp": "^0.3.0", - "monaco-editor": "^0.9.0", - "monaco-editor-core": "^0.9.0", + "monaco-editor": "^0.10.0", + "monaco-editor-core": "^0.10.0", "vscode-base-languageclient": "^0.0.1-alpha.2" }, "scripts": { diff --git a/src/converter.ts b/src/converter.ts index 8c5d6547e..4284af9a0 100644 --- a/src/converter.ts +++ b/src/converter.ts @@ -335,11 +335,6 @@ export class ProtocolToMonacoConverter { return items.map((codeLens) => this.asCodeLens(codeLens)); } - - asCodeActions(commands: Command[]): monaco.languages.CodeAction[] { - return this.asCommands(commands).map((command, score) => ({ command, score })); - } - asCommand(command: Command): monaco.languages.Command { return { id: command.command, diff --git a/src/languages.ts b/src/languages.ts index 28d246a79..722af2871 100644 --- a/src/languages.ts +++ b/src/languages.ts @@ -242,7 +242,7 @@ export class MonacoLanguages implements Languages { return []; } const params = this.m2p.asCodeActionParams(model, range, context); - return provider.provideCodeActions(params, token).then(result => this.p2m.asCodeActions(result)) + return provider.provideCodeActions(params, token).then(result => this.p2m.asCommands(result)); } } }