Skip to content

Commit

Permalink
Extension updates + fixing Windows problem
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-ka committed Aug 23, 2024
1 parent f649d24 commit 34d0a5b
Show file tree
Hide file tree
Showing 7 changed files with 1,494 additions and 122 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cmlVersion=6.11.1-SNAPSHOT
gradleNodePluginVersion=3.5.0
gradleNodePluginVersion=7.0.2
nodeVersion=18.17.0
1,570 changes: 1,470 additions & 100 deletions package-lock.json

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"url": "https://github.com/ContextMapper/vscode-extension/issues"
},
"engines": {
"vscode": "^1.33.0"
"vscode": "^1.92.0"
},
"categories": [
"Programming Languages"
Expand Down Expand Up @@ -181,21 +181,22 @@
},
"devDependencies": {
"@types/glob": "^7.1.1",
"@types/mocha": "^10.0.6",
"@types/node": "^11.13.2",
"@types/vscode": "^1.33.0",
"@types/mocha": "^10.0.7",
"@types/node": "20.x",
"@types/vscode": "^1.92.0",
"glob": "^7.1.4",
"lodash": ">=4.17.21",
"mocha": "^10.2.0",
"source-map-support": "^0.5.12",
"tslint": "^5.19.0",
"typescript": "^3.8.3",
"typescript": "^5.4.5",
"vscode-test": "^1.3.0"
},
"dependencies": {
"@vscode/vsce": "^2.32.0",
"lodash": ">=4.17.21",
"vsce": "^2.15.0",
"vscode-languageclient": "^5.2.1"
"vscode-languageclient": "^9.0.1"
},
"scripts": {
"vscode:prepublish": "npm run compile",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/generators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* CML generator commands
*/

import { commands, window, workspace, Uri, OpenDialogOptions, InputBoxOptions, TextDocumentShowOptions, ViewColumn } from "vscode";
import { commands, window, workspace, Uri, OpenDialogOptions, InputBoxOptions, ViewColumn } from "vscode";
import * as editor from "../editors/cml-editor";
import { CommandType } from "./command"
import * as fs from 'fs';
Expand Down
2 changes: 1 addition & 1 deletion src/commands/quickfixcommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import * as vscode from "vscode";
import { commands, window, Uri, ViewColumn } from "vscode";
import { commands, window } from "vscode";
import * as editor from "../editors/cml-editor";
import { CommandType } from "./command"
import * as input from "./userinput";
Expand Down
2 changes: 1 addition & 1 deletion src/commands/userinput.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* user input helpers */

import { window, InputBoxOptions, QuickPickOptions } from "vscode";
import { window, InputBoxOptions } from "vscode";

export async function askForName(prompt: string, initialValue: string): Promise<string> {
const inputBoxOptions: InputBoxOptions = {
Expand Down
25 changes: 13 additions & 12 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@
import * as path from 'path';
import * as os from 'os';

import { Trace } from 'vscode-jsonrpc';
import { commands, workspace, ExtensionContext, Uri, InputBoxOptions } from 'vscode';
import { LanguageClient, LanguageClientOptions, ServerOptions, VersionedTextDocumentIdentifier } from 'vscode-languageclient';
import {Trace} from 'vscode-jsonrpc';
import { commands, workspace, ExtensionContext } from 'vscode';
import { LanguageClient, LanguageClientOptions, ServerOptions } from 'vscode-languageclient/node';
import * as generators from "./commands/generators";
import * as transformations from "./commands/transformations";
import * as quickfixCommands from "./commands/quickfixcommands";

let lc: LanguageClient;

export function activate(context: ExtensionContext) {
let launcher = os.platform() === 'win32' ? 'context-mapper-lsp.bat' : 'context-mapper-lsp';
let script = context.asAbsolutePath(path.join('lsp', 'bin', launcher));

let serverOptions: ServerOptions = {
run: { command: script },
debug: { command: script, args: ['-log'], options: { env: createDebugEnv() } }
run: { command: script, options: { shell: true } },
debug: { command: script, args: ['-log'], options: { env: createDebugEnv(), shell: true } }
};

let clientOptions: LanguageClientOptions = {
Expand Down Expand Up @@ -65,17 +67,16 @@ export function activate(context: ExtensionContext) {
commands.registerCommand("cml.coordination.open.sketch.miner", quickfixCommands.openCoordinationInSketchMiner())
);

// enable tracing (.Off, .Messages, Verbose)
lc.trace = Trace.Verbose;
let disposable = lc.start();
lc.setTrace(Trace.Verbose);
lc.start();
}

// Push the disposable to the context's subscriptions so that the
// client can be deactivated on extension deactivation
context.subscriptions.push(disposable);
export function deactivate() {
return lc.stop();
}

function createDebugEnv() {
return Object.assign({
JAVA_OPTS: "-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n,quiet=y"
JAVA_OPTS:"-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n,quiet=y"
}, process.env)
}

0 comments on commit 34d0a5b

Please sign in to comment.