From 7bc708c0e13ebe7fc5298bf0ff2042a109dc384d Mon Sep 17 00:00:00 2001 From: sungshik <16154899+sungshik@users.noreply.github.com> Date: Fri, 27 Dec 2024 12:02:12 +0100 Subject: [PATCH 1/3] Fix `rascal-vscode-dsl-lsp-server` import --- examples/pico-dsl-extension/src/extension.ts | 2 +- examples/pico-dsl-extension/webpack.config.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/pico-dsl-extension/src/extension.ts b/examples/pico-dsl-extension/src/extension.ts index fa3292dfb..0184a6884 100644 --- a/examples/pico-dsl-extension/src/extension.ts +++ b/examples/pico-dsl-extension/src/extension.ts @@ -1,5 +1,5 @@ import * as vscode from 'vscode'; -import { ParameterizedLanguageServer, VSCodeUriResolverServer, LanguageParameter } from '@usethesource/rascal-vscode-dsl-runtime'; +import { ParameterizedLanguageServer, VSCodeUriResolverServer, LanguageParameter } from '@usethesource/rascal-vscode-dsl-lsp-server'; import { join } from 'path'; export function activate(context: vscode.ExtensionContext) { diff --git a/examples/pico-dsl-extension/webpack.config.js b/examples/pico-dsl-extension/webpack.config.js index 3e05e539f..0620d1944 100644 --- a/examples/pico-dsl-extension/webpack.config.js +++ b/examples/pico-dsl-extension/webpack.config.js @@ -48,7 +48,7 @@ const extensionConfig = { // we copy the jars to an an easy to predict location from: path.resolve( __dirname, - "node_modules/@usethesource/rascal-vscode-dsl-runtime/assets/jars/" + "node_modules/@usethesource/rascal-vscode-dsl-lsp-server/assets/jars/" ), to: path.resolve(__dirname, "dist/rascal-lsp/"), }, @@ -56,4 +56,4 @@ const extensionConfig = { }), ], }; -module.exports = [ extensionConfig ]; \ No newline at end of file +module.exports = [ extensionConfig ]; From 214642aa006a5874747071e89f76bd82ce3e8f17 Mon Sep 17 00:00:00 2001 From: sungshik <16154899+sungshik@users.noreply.github.com> Date: Fri, 27 Dec 2024 12:28:02 +0100 Subject: [PATCH 2/3] Update to `rascal` 0.40.17 and `rascal-lsp` 2.21.0 (0.12.0) --- examples/pico-dsl-extension/package.json | 2 +- examples/pico-dsl-extension/src/extension.ts | 16 ++++++++-------- examples/pico-dsl-lsp/pom.xml | 5 ++--- .../src/main/rascal/lang/pico/LanguageServer.rsc | 8 ++++---- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/examples/pico-dsl-extension/package.json b/examples/pico-dsl-extension/package.json index 64be61f43..99173ed0d 100644 --- a/examples/pico-dsl-extension/package.json +++ b/examples/pico-dsl-extension/package.json @@ -56,6 +56,6 @@ "webpack-cli": "^4.10.0" }, "dependencies": { - "@usethesource/rascal-vscode-dsl-lsp-server": "0.5.8" + "@usethesource/rascal-vscode-dsl-lsp-server": "0.12.0" } } diff --git a/examples/pico-dsl-extension/src/extension.ts b/examples/pico-dsl-extension/src/extension.ts index 0184a6884..87e2a1060 100644 --- a/examples/pico-dsl-extension/src/extension.ts +++ b/examples/pico-dsl-extension/src/extension.ts @@ -7,19 +7,19 @@ export function activate(context: vscode.ExtensionContext) { const picoLSPJar = `|jar+file://${context.extensionUri.path}/assets/jars/pico-lsp.jar!|`; const language = { pathConfig: `pathConfig(srcs=[${picoLSPJar}])`, - name: "Pico", - extension: "pico", - mainModule: "lang::pico::LanguageServer", + name: "Pico", + extensions: ["pico"], + mainModule: "lang::pico::LanguageServer", mainFunction: "picoContributions" }; console.log(language); // rascal vscode needs an instance of this class, if you register multiple languages, they can share this vfs instance - const vfs = new VSCodeUriResolverServer(false); + const vfs = new VSCodeUriResolverServer(false); // this starts the LSP server and connects it to rascal - const lsp = new ParameterizedLanguageServer(context, - vfs, - calcJarPath(context), - true, + const lsp = new ParameterizedLanguageServer(context, + vfs, + calcJarPath(context), + true, "pico", // vscode language ID "Pico", // vscode language Title (visible in the right bottom corner) language); diff --git a/examples/pico-dsl-lsp/pom.xml b/examples/pico-dsl-lsp/pom.xml index ac9d69939..747043aeb 100644 --- a/examples/pico-dsl-lsp/pom.xml +++ b/examples/pico-dsl-lsp/pom.xml @@ -29,12 +29,12 @@ org.rascalmpl rascal - 0.28.3 + 0.40.17 org.rascalmpl rascal-lsp - 2.12.1 + 2.21.0 org.rascalmpl @@ -96,4 +96,3 @@ - diff --git a/examples/pico-dsl-lsp/src/main/rascal/lang/pico/LanguageServer.rsc b/examples/pico-dsl-lsp/src/main/rascal/lang/pico/LanguageServer.rsc index 5dc520758..c0bd6eeec 100644 --- a/examples/pico-dsl-lsp/src/main/rascal/lang/pico/LanguageServer.rsc +++ b/examples/pico-dsl-lsp/src/main/rascal/lang/pico/LanguageServer.rsc @@ -10,9 +10,9 @@ import IO; // a minimal implementation of a DSL in rascal // users can add support for more advanced features set[LanguageService] picoContributions() = { - parser(parser(#start[Program])), // register the parser function for the Pico language - outliner(picoOutliner), - summarizer(picoSummarizer, providesImplementations = false) + parsing(parser(#start[Program])), // register the parser function for the Pico language + documentSymbol(picoOutliner), + analysis(picoSummarizer, providesImplementations = false) }; @@ -46,7 +46,7 @@ int main() { language( pathConfig(srcs=[|project://pico-dsl-lsp/src/main/rascal|]), "Pico", // name of the language - "pico", // extension + {"pico"}, // extension "lang::pico::LanguageServer", // module to import "picoContributions" ) From a09da1b47b1d814c2f98a5fd7e4ffaa6fc7b7a46 Mon Sep 17 00:00:00 2001 From: sungshik <16154899+sungshik@users.noreply.github.com> Date: Fri, 27 Dec 2024 12:28:20 +0100 Subject: [PATCH 3/3] Add `*.vsix` to gitignore --- examples/pico-dsl-extension/.gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/pico-dsl-extension/.gitignore b/examples/pico-dsl-extension/.gitignore index b8428c324..39f888541 100644 --- a/examples/pico-dsl-extension/.gitignore +++ b/examples/pico-dsl-extension/.gitignore @@ -2,4 +2,5 @@ node_modules package-lock.json dist/ bin/ -lib/ \ No newline at end of file +lib/ +*.vsix