Giter Site home page Giter Site logo

typefox / theia-xtext-sprotty-example Goto Github PK

View Code? Open in Web Editor NEW
70.0 11.0 28.0 1.36 MB

An example Xtext DSL in Theia with Sprotty visualisation

License: Eclipse Public License 2.0

Xtend 45.65% TypeScript 49.35% JavaScript 1.99% CSS 2.04% Dockerfile 0.97%

theia-xtext-sprotty-example's Introduction

A Domain-Specific Language IDE in the Cloud Using Open-Source Only

This is a tutorial on how to build a web-based IDE with support for an example domain-specific language (DSL) using open-source technologies only. In particular we employ the following technologies from the Eclipse project:

  • Xtext to implement a language server for a domain-specific language,
  • Theia to build an IDE that runs in the cloud or as desktop client,
  • Sprotty to visualize the DSL models in diagrams,
  • Eclipse Layout Kernel to layout these diagrams automatically.

This example has been presented at EclipseCon Europe 2018 in Ludwigsburg (recording, slides).

screenshot

Structure

Each branch in this repository represents a major stage, each commit a subtask to be implemented to reach the stage.

The four stages are as follows:

Stage 1: Implement a Language Server For a Statemachine DSL with Xtext

We create a new Xtext project, add a grammar for a statemachine DSL, and run the Xtext code generator to generate the language server (LS) for the DSL. We also add a bit of sugar in form of

  • a parser test,
  • a bit of scoping (customizing linking),
  • a simple code generator that generates a Java class from a statemachine model,
  • and some constraint checks.

Stage 2: Create a Theia Application and Integrate the DSL Language Server

Open in Gitpod

We use a yeoman generator to create the skeleton for a theia-app with a custom extension. We turn the latter into a language extension for our DSL by copying the LS from the last stage, adding a grammar for highlighting and a bit of glue code. At the end of this stage, our IDE supports the textual statemachine language. Thanks to Xtext's, it already offers validation, content assist, hovers, navigation of references, etc.

Stage 3: Add Live-Diagrams for the DSL with Sprotty

Open in Gitpod

Text is nice, but we want a visual representation of the statemachines as well. Using the Sprotty framework, we add diagram support to the LS, generate a diagram model from the DSL models, and extend the client with a diagram widget. The diagram updates automatically when the source model changes. We use the ELK to layout these diagrams and fine-tune the visual representation. To tie the graphics even stronger to the text, we add tracing and validation markers. Now, selection in the text editor and the diagram are synchronized.

Stage 4: Turn the Diagram View into a Graphical Editor (beta)

Open in Gitpod

In this stage, we turn the graphical view into an editor. We add various interaction patterns to the diagrams to allow the creation of elements, the manipulation of edges, and the editing of labels. all these interactions are mapped to text modifications of the DSL model, such that the diagram is always generated from the text and never the other way around. It is far easier to keep the two representations consistent than with any bi-directional synchronization.

Note that the editing features of Sprotty are still in beta.

Build/Run Instructions

Gitpod

Gitpod is a cloud IDE that is based on Theia as well. Gitpod allows to experiment with the contents of this repository without installing anything on your local machine.

The buttons above open the respective stage in Gitpod. To run it, wait for the build to finish and then click on the Open Browser button. An example workspace is opened in a new browser tab.

Local

The prerequisites are defined here.

To build, run

cd language-server
./gradlew build
cd ../theia
yarn

From there, to run the browser app

cd browser-app
yarn start

and point your browser to localhost:3000.

Alternatively, run the electron app by running

yarn rebuild:electron
cd electron-app
yarn start

Troubleshooting

Note, this example application is single-sourced. Whenever you want to switch between the electron and the browser-based applications, you have to rebuild it manually. When switching to the electron, change the directory to theia and run the following:

yarn rebuild:electron

If you want to use the browser-based application, rebuild it for the browser from the theia folder:

yarn rebuild:browser

theia-xtext-sprotty-example's People

Contributors

jankoehnlein avatar kittaakos avatar monaka avatar spoenemann avatar svenefftinge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

theia-xtext-sprotty-example's Issues

No diagram service for type 'states-diagram'

Hi, when I open this project on browser localhost:3000, it can successfully connect the dsl, but when I click "open in diragram", no diagram appear, and in the output view shows :
[Error - 下午7:21:49] No diagram service for type 'states-diagram'

image

how to solve it ? Thank you.

Uninstallable dependencies on Windows

I started to follow the readme and when I ran yarn I got:

λ yarn
yarn install v1.19.1
[1/4] Resolving packages...
[2/4] Fetching packages...
warning Pattern ["@theia/filesystem@next"] is trying to unpack in the same destination "C:\\Users\\oscar.granada\\AppData\\Local\\Yarn\\Cache\\v6\\npm-@theia-filesystem-0.10.0-next.c1d367f3-2edb8e39511395237b195e88b085dd7e4a22b001-integrity\\node_modules\\@theia\\filesystem" as pattern ["@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]"]. This could result in non-deterministic behavior, skipping.
warning Pattern ["@theia/workspace@next"] is trying to unpack in the same destination "C:\\Users\\oscar.granada\\AppData\\Local\\Yarn\\Cache\\v6\\npm-@theia-workspace-0.10.0-next.c1d367f3-63f8e9b258814513f0dcc028512f9d7cb01e4825-integrity\\node_modules\\@theia\\workspace" as pattern ["@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]"]. This could result in non-deterministic behavior, skipping.
warning Pattern ["@theia/navigator@next"] is trying to unpack in the same destination "C:\\Users\\oscar.granada\\AppData\\Local\\Yarn\\Cache\\v6\\npm-@theia-navigator-0.10.0-next.c1d367f3-2fee07df00a5741fc17d7d1737f11aea2dbbcfd1-integrity\\node_modules\\@theia\\navigator" as pattern ["@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]"]. This could result in non-deterministic behavior, skipping.
warning Pattern ["@theia/process@next"] is trying to unpack in the same destination "C:\\Users\\oscar.granada\\AppData\\Local\\Yarn\\Cache\\v6\\npm-@theia-process-0.10.0-next.c1d367f3-fa97935b91a9770723c57301786fe876592f6e93-integrity\\node_modules\\@theia\\process" as pattern ["@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]"]. This could result in non-deterministic behavior, skipping.
warning Pattern ["@theia/editor@next"] is trying to unpack in the same destination "C:\\Users\\oscar.granada\\AppData\\Local\\Yarn\\Cache\\v6\\npm-@theia-editor-0.10.0-next.c1d367f3-a109451b2884b4b4747ed3b04e2745045a2d12c3-integrity\\node_modules\\@theia\\editor" as pattern ["@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]"]. This could result in non-deterministic behavior, skipping.
warning Pattern ["@theia/languages@next"] is trying to unpack in the same destination "C:\\Users\\oscar.granada\\AppData\\Local\\Yarn\\Cache\\v6\\npm-@theia-languages-0.10.0-next.c1d367f3-557bc4b079cd4805bc1811d5d02f1c77d28498f4-integrity\\node_modules\\@theia\\languages" as pattern ["@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]"]. This could result in non-deterministic behavior, skipping.
warning Pattern ["@theia/markers@next"] is trying to unpack in the same destination "C:\\Users\\oscar.granada\\AppData\\Local\\Yarn\\Cache\\v6\\npm-@theia-markers-0.10.0-next.c1d367f3-1f1cf5b304b11d0ccca6d097ac2f276d3353b5fb-integrity\\node_modules\\@theia\\markers" as pattern ["@theia/[email protected]","@theia/[email protected]","@theia/[email protected]","@theia/[email protected]"]. This could result in non-deterministic behavior, skipping.
warning monaco-languageclient@0.9.0: The engine "vscode" appears to be invalid.
warning vscode-base-languageclient@4.4.0: The engine "vscode" appears to be invalid.
info fsevents@1.2.4: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "workspace-aggregator-774aa545-f0d7-4df4-95e4-5a8aefb98363 > states-sprotty > sprotty > [email protected]" has incorrect peer dependency "snabbdom@~0.6.6".
warning "workspace-aggregator-774aa545-f0d7-4df4-95e4-5a8aefb98363 > browser-app > @theia/messages > [email protected]" has unmet peer dependency "react@>=16.3.3".
warning "workspace-aggregator-774aa545-f0d7-4df4-95e4-5a8aefb98363 > browser-app > @theia/messages > [email protected]" has unmet peer dependency "react-dom@>=16.3.3".
warning "workspace-aggregator-774aa545-f0d7-4df4-95e4-5a8aefb98363 > browser-app > @theia/git > @theia/scm > [email protected]" has unmet peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0".
warning "workspace-aggregator-774aa545-f0d7-4df4-95e4-5a8aefb98363 > browser-app > @theia/git > @theia/scm > [email protected]" has unmet peer dependency "react-dom@^0.14.0 || ^15.0.0 || ^16.0.0".
warning "workspace-aggregator-774aa545-f0d7-4df4-95e4-5a8aefb98363 > browser-app > @theia/cli > @theia/application-manager > [email protected]" has unmet peer dependency "font-awesome@>=4.3.0".
warning "workspace-aggregator-774aa545-f0d7-4df4-95e4-5a8aefb98363 > browser-app > @theia/cli > @theia/application-manager > font-awesome-webpack > [email protected]" has incorrect peer dependency "less@^2.3.1".
[4/4] Building fresh packages...
[1/10] ⠂ nsfw
[2/10] ⠂ @theia/node-pty
[3/10] ⠂ drivelist
[4/10] ⠂ oniguruma
error C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@12.6.0 | win32 | x64
gyp info spawn C:\Python27\python.EXE
gyp info spawn args [
gyp info spawn args   'C:\\Users\\oscar.granada\\development\\eclipse-workspace\\theia-xtext-sprotty-example\\theia\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=2015',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\oscar.granada\\development\\eclipse-workspace\\theia-xtext-sprotty-example\\theia\\node_modules\\nsfw\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\oscar.granada\\development\\eclipse-workspace\\theia-xtext-sprotty-example\\theia\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\oscar.granada\\.node-gyp\\12.6.0\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\oscar.granada\\.node-gyp\\12.6.0',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\oscar.granada\\development\\eclipse-workspace\\theia-xtext-sprotty-example\\theia\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\oscar.granada\\.node-gyp\\12.6.0\\<(target_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\oscar.granada\\development\\eclipse-workspace\\theia-xtext-sprotty-example\\theia\\node_modules\\nsfw',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\Users\\oscar.granada\\development\\eclipse-workspace\\theia-xtext-sprotty-example\\theia\\node_modules\\nsfw\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe
gyp info spawn args [
gyp info spawn args   'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64'
gyp info spawn args ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  NSFW.cpp
  Queue.cpp
  NativeInterface.cpp
  Controller.cpp
  Watcher.cpp
  win_delay_load_hook.cc
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan_converters_43_inl.h(22): warning C4996: 'v8::Value::ToBoolean': was declared deprecated (compiling source file ..\src\NSFW.cpp) [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\.node-gyp\12.6.0\include\node\v8.h(2523): note: see declaration of 'v8::Value::ToBoolean' (compiling source file ..\src\NSFW.cpp)
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan_converters_43_inl.h(40): warning C4996: 'v8::Value::BooleanValue': was declared deprecated (compiling source file ..\src\NSFW.cpp) [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\.node-gyp\12.6.0\include\node\v8.h(2561): note: see declaration of 'v8::Value::BooleanValue' (compiling source file ..\src\NSFW.cpp)
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan_implementation_12_inl.h(103): error C2664: 'v8::MaybeLocal<v8::Function> v8::Function::New(v8::Local<v8::Context>,v8::FunctionCallback,v8::Local<v8::Value>,int,v8::ConstructorBehavior,v8::SideEffectType)': cannot convert argument 1 from 'v8::Isolate *' to 'v8::Local<v8::Context>' (compiling source file ..\src\NSFW.cpp) [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan_implementation_12_inl.h(105): note: No constructor could take the source type, or constructor overload resolution was ambiguous (compiling source file ..\src\NSFW.cpp)
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan_implementation_12_inl.h(337): error C2660: 'v8::StringObject::New': function does not take 1 arguments (compiling source file ..\src\NSFW.cpp) [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\.node-gyp\12.6.0\include\node\v8.h(5381): note: see declaration of 'v8::StringObject::New' (compiling source file ..\src\NSFW.cpp)
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan_implementation_12_inl.h(337): error C2059: syntax error: ')' (compiling source file ..\src\NSFW.cpp) [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan.h(1034): error C2661: 'v8::Value::ToString': no overloaded function takes 0 arguments (compiling source file ..\src\NSFW.cpp) [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan.h(1044): error C2664: 'int v8::String::WriteUtf8(v8::Isolate *,char *,int,int *,int) const': cannot convert argument 1 from 'char *' to 'v8::Isolate *' (compiling source file ..\src\NSFW.cpp) [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan.h(1044): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast (compiling source file ..\src\NSFW.cpp)
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan.h(1818): warning C4996: 'v8::Object::Set': was declared deprecated (compiling source file ..\src\NSFW.cpp) [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\.node-gyp\12.6.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set' (compiling source file ..\src\NSFW.cpp)
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan.h(1824): warning C4996: 'v8::Object::Set': was declared deprecated (compiling source file ..\src\NSFW.cpp) [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\.node-gyp\12.6.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set' (compiling source file ..\src\NSFW.cpp)
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan.h(1830): warning C4996: 'v8::Object::Set': was declared deprecated (compiling source file ..\src\NSFW.cpp) [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\.node-gyp\12.6.0\include\node\v8.h(3367): note: see declaration of 'v8::Object::Set' (compiling source file ..\src\NSFW.cpp)
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan.h(1836): warning C4996: 'v8::Object::Get': was declared deprecated (compiling source file ..\src\NSFW.cpp) [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\.node-gyp\12.6.0\include\node\v8.h(3412): note: see declaration of 'v8::Object::Get' (compiling source file ..\src\NSFW.cpp)
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan.h(1842): warning C4996: 'v8::Object::Get': was declared deprecated (compiling source file ..\src\NSFW.cpp) [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\.node-gyp\12.6.0\include\node\v8.h(3412): note: see declaration of 'v8::Object::Get' (compiling source file ..\src\NSFW.cpp)
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan.h(1847): warning C4996: 'v8::Object::Get': was declared deprecated (compiling source file ..\src\NSFW.cpp) [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\.node-gyp\12.6.0\include\node\v8.h(3416): note: see declaration of 'v8::Object::Get' (compiling source file ..\src\NSFW.cpp)
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan_object_wrap.h(24): error C2039: 'IsNearDeath': is not a member of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\NSFW.cpp)
  c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan.h(1859): note: see declaration of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\NSFW.cpp)
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan_object_wrap.h(67): warning C4996: 'v8::PersistentBase<v8::Object>::MarkIndependent': was declared deprecated (compiling source file ..\src\NSFW.cpp) [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\.node-gyp\12.6.0\include\node\v8.h(563): note: see declaration of 'v8::PersistentBase<v8::Object>::MarkIndependent' (compiling source file ..\src\NSFW.cpp)
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan_object_wrap.h(124): error C2039: 'IsNearDeath': is not a member of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\NSFW.cpp)
  c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan.h(1859): note: see declaration of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\NSFW.cpp)
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\src\nsfw.cpp(51): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\src\nsfw.cpp(75): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\.node-gyp\12.6.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\src\nsfw.cpp(76): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\.node-gyp\12.6.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\src\nsfw.cpp(79): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\.node-gyp\12.6.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\src\nsfw.cpp(80): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\.node-gyp\12.6.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\src\nsfw.cpp(81): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\.node-gyp\12.6.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\src\nsfw.cpp(83): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\.node-gyp\12.6.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\src\nsfw.cpp(86): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\.node-gyp\12.6.0\include\node\v8.h(3367): note: see declaration of 'v8::Object::Set'
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\src\nsfw.cpp(93): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\src\nsfw.cpp(149): error C2660: 'v8::FunctionTemplate::GetFunction': function does not take 0 arguments [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\.node-gyp\12.6.0\include\node\v8.h(5948): note: see declaration of 'v8::FunctionTemplate::GetFunction' (compiling source file ..\src\NSFW.cpp)
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\src\nsfw.cpp(149): error C2660: 'Nan::Persistent<v8::Function,v8::NonCopyablePersistentTraits<T>>::Reset': function does not take 1 arguments [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
          with
          [
              T=v8::Function
          ]
  c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan_persistent_12_inl.h(25): note: see declaration of 'Nan::Persistent<v8::Function,v8::NonCopyablePersistentTraits<T>>::Reset'
          with
          [
              T=v8::Function
          ] (compiling source file ..\src\NSFW.cpp)
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\src\nsfw.cpp(150): error C2660: 'v8::FunctionTemplate::GetFunction': function does not take 0 arguments [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\.node-gyp\12.6.0\include\node\v8.h(5948): note: see declaration of 'v8::FunctionTemplate::GetFunction' (compiling source file ..\src\NSFW.cpp)
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\src\nsfw.cpp(150): error C2661: 'Nan::Set': no overloaded function takes 2 arguments [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\src\nsfw.cpp(177): error C2660: 'v8::Value::Uint32Value': function does not take 0 arguments [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\.node-gyp\12.6.0\include\node\v8.h(2567): note: see declaration of 'v8::Value::Uint32Value' (compiling source file ..\src\NSFW.cpp)
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\src\nsfw.cpp(178): error C2661: 'v8::Value::ToString': no overloaded function takes 0 arguments [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\src\nsfw.cpp(178): error C2512: 'v8::String::Utf8Value::Utf8Value': no appropriate default constructor available [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\src\nsfw.cpp(209): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\src\nsfw.cpp(214): warning C4996: 'v8::Object::Set': was declared deprecated [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\.node-gyp\12.6.0\include\node\v8.h(3358): note: see declaration of 'v8::Object::Set'
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\src\nsfw.cpp(255): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\src\nsfw.cpp(257): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\src\nsfw.cpp(282): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\src\nsfw.cpp(324): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw\build\nsfw.vcxproj]
  c:\users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:203:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\oscar.granada\\development\\eclipse-workspace\\theia-xtext-sprotty-example\\theia\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\oscar.granada\development\eclipse-workspace\theia-xtext-sprotty-example\theia\node_modules\nsfw

Updating the Xtext Community Website

Hello Sprotty team,

The Xtext team would like to update the Xtext community website listing all the cool projects people are building around Xtext/Xtend.

See also the corresponding GitHub issue and Bugzilla ticket.

If you are interested that the Theia-Xtext-Sprotty example project is listed there, please provide the following information as a comment to this issue:

<tr>
	<td><a href="project_link">project_name</a></td>
	<td>project_description_max_2_sentences</td>
	<td>license</td>
	<td>category</td>
	<td>author(s)</td>
</tr>

We will then update the Xtext community website and get it online as soon as possible.

Thanks!
Tamás

Allow diagram widget to be displayed as a preview widget

Hi,

I'm trying to display a Diagram in a preview pane as defined in the preview package.

My idea was to generate the Diagram widget using the createWidget method of the DiagramManager class then using the getSvgElement method of the DiagramWidget class in the renderContent method of the PreviewHandler interface.

However, it seems that the widget must be added to the shell and activated to actually generate the SVG content of the diagram, for instance using the doOpen method of the DiagramManager class. And we should avoid that when displaying the diagram in a preview pane.

Is it possible ? Or does it require some change in sprotty-theia library ?

Thanks for your help !

yarn error!

D:\Eclipse\eclipse_theia\src_run\theia-xtext-sprotty-example-master\theia>yarn
yarn install v1.7.0
[1/4] Resolving packages...
success Already up-to-date.
$ lerna run prepare
lerna info version 2.4.0
states-sprotty: > [email protected] prepare D:\Eclipse\eclipse_theia\src_run\theia-xtext-sprotty-example-master\theia\states-sprotty
states-sprotty: > yarn run clean && yarn run build
states-sprotty: yarn run v1.7.0
states-sprotty: warning package.json: No license field
states-sprotty: $ rimraf lib
states-sprotty: Done in 0.26s.
states-sprotty: yarn run v1.7.0
states-sprotty: warning package.json: No license field
states-sprotty: $ tsc
states-sprotty: Done in 2.33s.
states-dsl: > [email protected] prepare D:\Eclipse\eclipse_theia\src_run\theia-xtext-sprotty-example-master\theia\states-dsl
states-dsl: > yarn run clean && yarn install:languageserver && yarn run build
states-dsl: yarn run v1.7.0
states-dsl: warning package.json: No license field
states-dsl: $ rimraf lib
states-dsl: Done in 0.24s.
states-dsl: yarn run v1.7.0
states-dsl: warning package.json: No license field
states-dsl: $ rimraf -rf ./build && mkdir build && yarn copy:languageserver && yarn unzip:languageserver
states-dsl: warning package.json: No license field
states-dsl: $ cp ../../language-server/io.typefox.examples.theia.states.ide/build/distributions/states-language-server.zip .
states-dsl: 'cp' �����ڲ����ⲿ���Ҳ���ǿ����еij���
states-dsl: ���������ļ���
states-dsl: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
states-dsl: error Command failed with exit code 1.
states-dsl: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
states-dsl: error Command failed with exit code 1.
states-dsl: npm ERR! code ELIFECYCLE
states-dsl: npm ERR! errno 1
states-dsl: npm ERR! [email protected] prepare: yarn run clean && yarn install:languageserver && yarn run build
states-dsl: npm ERR! Exit status 1
states-dsl: npm ERR!
states-dsl: npm ERR! Failed at the [email protected] prepare script.
states-dsl: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
states-dsl: npm ERR! A complete log of this run can be found in:
states-dsl: npm ERR! C:\Users\lllstandout\AppData\Roaming\npm-cache_logs\2019-07-01T03_35_40_158Z-debug.log
lerna ERR! execute callback with error
lerna ERR! Error: Command failed: npm run prepare
lerna ERR! warning package.json: No license field
lerna ERR! warning package.json: No license field
lerna ERR! warning package.json: No license field
lerna ERR! 'cp' �����ڲ����ⲿ���Ҳ���ǿ����еij���
lerna ERR! ���������ļ���
lerna ERR! error Command failed with exit code 1.
lerna ERR! error Command failed with exit code 1.
lerna ERR! npm ERR! code ELIFECYCLE
lerna ERR! npm ERR! errno 1
lerna ERR! npm ERR! [email protected] prepare: yarn run clean && yarn install:languageserver && yarn run build
lerna ERR! npm ERR! Exit status 1
lerna ERR! npm ERR!
lerna ERR! npm ERR! Failed at the [email protected] prepare script.
lerna ERR! npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
lerna ERR!
lerna ERR! npm ERR! A complete log of this run can be found in:
lerna ERR! npm ERR! C:\Users\lllstandout\AppData\Roaming\npm-cache_logs\2019-07-01T03_35_40_158Z-debug.log
lerna ERR!
lerna ERR!
lerna ERR! > [email protected] prepare D:\Eclipse\eclipse_theia\src_run\theia-xtext-sprotty-example-master\theia\states-dsl
lerna ERR! > yarn run clean && yarn install:languageserver && yarn run build
lerna ERR!
lerna ERR! yarn run v1.7.0
lerna ERR! $ rimraf lib
lerna ERR! Done in 0.24s.
lerna ERR! yarn run v1.7.0
lerna ERR! $ rimraf -rf ./build && mkdir build && yarn copy:languageserver && yarn unzip:languageserver
lerna ERR! $ cp ../../language-server/io.typefox.examples.theia.states.ide/build/distributions/states-language-server.zip .
lerna ERR! info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR! info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR!
lerna ERR! at Promise.all.then.arr (D:\Eclipse\eclipse_theia\src_run\theia-xtext-sprotty-example-master\theia\node_modules\lerna\node_modules\execa\index.js:236:11)
(node:952) UnhandledPromiseRejectionWarning: Error: Command failed: npm run prepare
warning package.json: No license field
warning package.json: No license field
warning package.json: No license field
'cp' �����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���
error Command failed with exit code 1.
error Command failed with exit code 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] prepare: yarn run clean && yarn install:languageserver && yarn run build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] prepare script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\lllstandout\AppData\Roaming\npm-cache_logs\2019-07-01T03_35_40_158Z-debug.log

[email protected] prepare D:\Eclipse\eclipse_theia\src_run\theia-xtext-sprotty-example-master\theia\states-dsl
yarn run clean && yarn install:languageserver && yarn run build

yarn run v1.7.0
$ rimraf lib
Done in 0.24s.
yarn run v1.7.0
$ rimraf -rf ./build && mkdir build && yarn copy:languageserver && yarn unzip:languageserver
$ cp ../../language-server/io.typefox.examples.theia.states.ide/build/distributions/states-language-server.zip .
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

at Promise.all.then.arr (D:\Eclipse\eclipse_theia\src_run\theia-xtext-sprotty-example-master\theia\node_modules\lerna\node_modules\execa\index.js:236:11)
at process._tickCallback (internal/process/next_tick.js:68:7)

(node:952) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
(node:952) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Update documentation with Theia prerequisites

I'm trying to follow the build instructions from here:
https://github.com/TypeFox/theia-xtext-sprotty-example#local

I have:

$ node --version
v10.16.2

and

$ yarn --version
1.17.3

When I get to the step to run yarn to build the theia extension...

$ yarn
yarn install v1.17.3
....
error /home/kdvolder/git/theia-xtext-sprotty-example/theia/node_modules/native-keymap: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /home/kdvolder/git/theia-xtext-sprotty-example/theia/node_modules/native-keymap
Output:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/home/kdvolder/git/theia-xtext-sprotty-example/theia/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/kdvolder/git/theia-xtext-sprotty-example/theia/node_modules/native-keymap/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/kdvolder/git/theia-xtext-sprotty-example/theia/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/kdvolder/.node-gyp/10.16.2/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/kdvolder/.node-gyp/10.16.2',
gyp info spawn args   '-Dnode_gyp_dir=/home/kdvolder/git/theia-xtext-sprotty-example/theia/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/kdvolder/.node-gyp/10.16.2/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/kdvolder/git/theia-xtext-sprotty-example/theia/node_modules/native-keymap',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
Package x11 was not found in the pkg-config search path.
Perhaps you should add the directory containing `x11.pc'
to the PKG_CONFIG_PATH environment variable
No package 'x11' found
Package xkbfile was not found in the pkg-config search path.
Perhaps you should add the directory containing `xkbfile.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xkbfile' found
gyp: Call to 'pkg-config x11 xkbfile --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/home/kdvolder/git/theia-xtext-sprotty-example/theia/node_modules/node-gyp/lib/configure.js:345:16)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.15.0-55-generic
gyp ERR! command "/usr/bin/node" "/home/kdvolder/git/theia-xtext-sprotty-example/theia/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /home/kdvolder/git/theia-xtext-sprotty-example/theia/node_modules/native-keymap

yarn still error!

warning "workspace-aggregator-790b66c9-a186-4975-9f3e-3da1abac5ac0 > browser-app

@theia/cli > @theia/application-manager > font-awesome-webpack > less-loader@
2.2.3" has incorrect peer dependency "less@^2.3.1".
[4/4] Building fresh packages...
[-/11] ⠈ waiting...
[11/11] ⠈ @theia/java
[-/11] ⠁ waiting...
[-/11] ⠁ waiting...
error D:\Eclipse\eclipse_theia\src_run\theia-xtext-sprotty-example-master\theia
node_modules@theia\java: Command failed.
Exit code: 1
Command: node ./scripts/download-jdt-ls.js
Arguments:
Directory: D:\Eclipse\eclipse_theia\src_run\theia-xtext-sprotty-example-master\t
heia\node_modules@theia\java

Renaming is not working correctly

The rename feature is not working as intended and renames a different state than selected.
This can be reproduced as follows:

(0. Apply the fix from pull request #2 so this example can actually be built)

  1. Create a new file such as Test.sm.
  2. write this basic code in the file:
    statemachine test
  3. Open the diagram view
  4. Hover in the diagram and create a new state with the popup box by clicking on "new State"
  5. Same as step 4
  6. Double click on the state1 in the diagram and rename the element in the new popup box to e.g. "foo"

This causes the state0 to be renamed to foo and not the state1 as was intended.

Yarn command for theia produces error

d:\Projects\theia-xtext-sprotty-example\theia>yarn
yarn install v1.16.0
[1/4] Resolving packages...
success Already up-to-date.
$ lerna run prepare
lerna info version 2.4.0
states-sprotty: > [email protected] prepare d:\Projects\theia-xtext-sprotty-example\theia\states-sprotty
states-sprotty: > yarn run clean && yarn run build
states-sprotty: yarn run v1.16.0
states-sprotty: warning package.json: No license field
states-sprotty: $ rimraf lib
states-sprotty: Done in 0.25s.
states-sprotty: yarn run v1.16.0
states-sprotty: warning package.json: No license field
states-sprotty: $ tsc
states-sprotty: Done in 2.06s.
states-dsl: > [email protected] prepare d:\Projects\theia-xtext-sprotty-example\theia\states-dsl
states-dsl: > yarn run clean && yarn install:languageserver && yarn run build
states-dsl: yarn run v1.16.0
states-dsl: warning package.json: No license field
states-dsl: $ rimraf lib
states-dsl: Done in 0.30s.
states-dsl: yarn run v1.16.0
states-dsl: warning package.json: No license field
states-dsl: $ rimraf -rf ./build && mkdir build && yarn copy:languageserver && yarn unzip:languageserver
states-dsl: warning package.json: No license field
states-dsl: $ cp ../../language-server/io.typefox.examples.theia.states.ide/build/distributions/states-language-server.zip .
states-dsl: "cp" �� ���� ����७��� ��� ���譥�
states-dsl: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
states-dsl: ��������, �ᯮ��塞�� �ணࠬ��� ��� ������ 䠩���.
states-dsl: error Command failed with exit code 1.
states-dsl: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
states-dsl: error Command failed with exit code 1.
states-dsl: npm ERR! code ELIFECYCLE
states-dsl: npm ERR! errno 1
states-dsl: npm ERR! [email protected] prepare: `yarn run clean && yarn install:languageserver && yarn run build`
states-dsl: npm ERR! Exit status 1
states-dsl: npm ERR!
states-dsl: npm ERR! Failed at the [email protected] prepare script.
states-dsl: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
states-dsl: npm ERR! A complete log of this run can be found in:
states-dsl: npm ERR!     C:\Users\iga_m\AppData\Roaming\npm-cache\_logs\2019-06-11T16_51_42_353Z-debug.log
lerna ERR! execute callback with error
lerna ERR! Error: Command failed: npm run prepare
lerna ERR! warning package.json: No license field
lerna ERR! warning package.json: No license field
lerna ERR! warning package.json: No license field
lerna ERR! "cp" �� ���� ����७��� ��� ���譥�
lerna ERR! ��������, �ᯮ��塞�� �ணࠬ��� ��� ������ 䠩���.
lerna ERR! error Command failed with exit code 1.
lerna ERR! error Command failed with exit code 1.
lerna ERR! npm ERR! code ELIFECYCLE
lerna ERR! npm ERR! errno 1
lerna ERR! npm ERR! [email protected] prepare: `yarn run clean && yarn install:languageserver && yarn run build`
lerna ERR! npm ERR! Exit status 1
lerna ERR! npm ERR!
lerna ERR! npm ERR! Failed at the [email protected] prepare script.
lerna ERR! npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
lerna ERR!
lerna ERR! npm ERR! A complete log of this run can be found in:
lerna ERR! npm ERR!     C:\Users\iga_m\AppData\Roaming\npm-cache\_logs\2019-06-11T16_51_42_353Z-debug.log
lerna ERR!
lerna ERR!
lerna ERR! > [email protected] prepare d:\Projects\theia-xtext-sprotty-example\theia\states-dsl
lerna ERR! > yarn run clean && yarn install:languageserver && yarn run build
lerna ERR!
lerna ERR! yarn run v1.16.0
lerna ERR! $ rimraf lib
lerna ERR! Done in 0.30s.
lerna ERR! yarn run v1.16.0
lerna ERR! $ rimraf -rf ./build && mkdir build && yarn copy:languageserver && yarn unzip:languageserver
lerna ERR! $ cp ../../language-server/io.typefox.examples.theia.states.ide/build/distributions/states-language-server.zip .
lerna ERR! info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR! info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR!
lerna ERR!     at Promise.all.then.arr (d:\Projects\theia-xtext-sprotty-example\theia\node_modules\lerna\node_modules\execa\index.js:236:11)
lerna ERR!     at <anonymous>
(node:18320) UnhandledPromiseRejectionWarning: Error: Command failed: npm run prepare
warning package.json: No license field
warning package.json: No license field
warning package.json: No license field
"cp" �� ���� ����७��� ��� ���譥�
��������, �ᯮ��塞�� �ணࠬ��� ��� ������ 䠩���.
error Command failed with exit code 1.
error Command failed with exit code 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] prepare: `yarn run clean && yarn install:languageserver && yarn run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] prepare script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Yarn version 1.16.0
Node version 8.16.0
Java version 1.8.0

Cannot start electron app

Hi, I managed to build the example locally and I'm able to run theia in the browser (via localhost).
Building the electron app succeeds as well, however, starting it fails with the following error:

image

In my bash, I see:
$ yarn start
yarn run v1.15.2
$ theia start

Starting the master backend process with 5000 (ms) timeout.
Starting server worker...
Server worker has been started. [ID: 1 | PID: 12044]
D:\ws-theia\theia-xtext-sprotty-example\theia\node_modules\electron-store\index.js:8
const defaultCwd = (electron.app || electron.remote.app).getPath('userData');
^

TypeError: Cannot read property 'app' of undefined
at new ElectronStore (D:\ws-theia\theia-xtext-sprotty-example\theia\node_modules\electron-store\index.js:8:55)
at Object. (D:\ws-theia\theia-xtext-sprotty-example\theia\electron-app\src-gen\frontend\electron-main.js:23:23)
at Object. (D:\ws-theia\theia-xtext-sprotty-example\theia\electron-app\src-gen\frontend\electron-main.js:161:3)
at Module._compile (module.js:642:30)
at Object.Module._extensions..js (module.js:653:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:504:12)
at Function.Module._load (module.js:496:3)
at Function.Module.runMain (module.js:683:10)
at startup (bootstrap_node.js:196:16)
Server worker has been disconnected. [ID: 1 | PID: 12044]
Server worker failed to start within 5000 milliseconds.
Pass a greater value as '--startup-timeout' option to increase the timeout or a negative to disable.
Failed to start the backend application.
Error: A dynamic link library (DLL) initialization routine failed.
\?\D:\ws-theia\theia-xtext-sprotty-example\theia\node_modules@theia\node-pty\build\Release\pty.node
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:166:20)
at Object.Module._extensions..node (module.js:671:18)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:166:20)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:504:12)
at Function.Module._load (module.js:496:3)
at Module.require (module.js:586:17)
at require (internal/module.js:11:18)
at Object. (D:\ws-theia\theia-xtext-sprotty-example\theia\node_modules@theia\node-pty\lib\windowsPtyAgent.js:9:11)
at Object. (D:\ws-theia\theia-xtext-sprotty-example\theia\node_modules@theia\node-pty\lib\windowsPtyAgent.js:175:3)
Error: A dynamic link library (DLL) initialization routine failed.
\?\D:\ws-theia\theia-xtext-sprotty-example\theia\node_modules@theia\node-pty\build\Release\pty.node
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:166:20)
at Object.Module._extensions..node (module.js:671:18)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:166:20)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:504:12)
at Function.Module._load (module.js:496:3)
at Module.require (module.js:586:17)
at require (internal/module.js:11:18)
at Object. (D:\ws-theia\theia-xtext-sprotty-example\theia\node_modules@theia\node-pty\lib\windowsPtyAgent.js:9:11)
at Object. (D:\ws-theia\theia-xtext-sprotty-example\theia\node_modules@theia\node-pty\lib\windowsPtyAgent.js:175:3)

How can I get the correct Xtext DSL?

We have five Ecore files for our model, but when we use eclipse tools to automatically convert the Ecore file to Xtext, there are two problems as follows, we would like to consult you.
10

15

11

there is a file named ‘GenerateMyDsl.mwe2’ be created, but when we click ‘running as mwe2 Workflow’ it has some errors.
14

How to solve this problem?

TypeError: uri.withoutFragment is not a function

Happens with #18.

I do not know yet whether this is a generic Theia issue or related to my changes. I will take care of it.

Steps to reproduce:

  • Open the example workspace.

For some reason, I get a codeUri, instead of a Theia one.

Screen Shot 2019-08-21 at 22 33 16

Error:

monaco-outline-contribution.ts:15 Uncaught (in promise) TypeError: uri.withoutFragment is not a function
    at EditorManager.../node_modules/@theia/core/lib/browser/navigatable.js.NavigatableWidgetOpenHandler.serializeUri (navigatable.ts:93)
    at EditorManager.../node_modules/@theia/core/lib/browser/navigatable.js.NavigatableWidgetOpenHandler.createWidgetOptions (navigatable.ts:85)
    at EditorManager.../node_modules/@theia/core/lib/browser/widget-open-handler.js.WidgetOpenHandler.getOrCreateWidget (widget-open-handler.ts:163)
    at EditorManager.<anonymous> (widget-open-handler.ts:81)
    at step (widget-open-handler.ts:15)
    at Object.next (widget-open-handler.ts:15)
    at widget-open-handler.ts:15
    at new Promise (<anonymous>)
    at ../node_modules/@theia/core/lib/browser/widget-open-handler.js.__awaiter (widget-open-handler.ts:15)
    at EditorManager.../node_modules/@theia/core/lib/browser/widget-open-handler.js.WidgetOpenHandler.open (widget-open-handler.ts:80)

How to setup more than one diagram types for same model

Hi,
I created a DSL with graphical rendering based on your example. I got a requirement to have different views (diagram types) for the same textual model, such that the user can right-click on the text file and select which view she wants to show. Currently, my approach is to use a single diagram server on the server side and send different models to client depending on the diagram type. Correspondingly, on the client side, I had to create for each diagram type the following:

  • a diagram server subclassed from LSTheiaDiagramServer
  • a diagram manager (declares label for menu, and iconClass)
  • a subclass of DiagramConfiguration for binding
  • create a container in di.config.ts

I see a lot of duplicated code in TypeScript. If I would need to have an additional diagram type, I would create these classes again and again. In addition, I cannot create different layout approaches for these diagram types, since there is only one diagram server on the server side, different configurations regarding needsClientLayout and needsServerLayout in di.config.ts will create problems.

What would be the best way to do it? An small example would be very appreciated.
Thanks in advance for your support.

How to debug xtext language server

This is rather a question than an issue: Is there a way to debug the language server? Using "yarn start" in browser-app folder, the java process cannot be debugged. Thanks.

Can't build the xtext plugin.

The log is like follow. I'll send PR for fixing this soon.

OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
> Task :io.typefox.examples.theia.states:generateXtextLanguage UP-TO-DATE
> Task :io.typefox.examples.theia.states:generateXtext UP-TO-DATE
> Task :io.typefox.examples.theia.states:compileJava UP-TO-DATE
> Task :io.typefox.examples.theia.states:processResources UP-TO-DATE
> Task :io.typefox.examples.theia.states:classes UP-TO-DATE
> Task :io.typefox.examples.theia.states:jar UP-TO-DATE
> Task :io.typefox.examples.theia.states:assemble UP-TO-DATE
> Task :io.typefox.examples.theia.states:generateTestXtext UP-TO-DATE
> Task :io.typefox.examples.theia.states:compileTestJava UP-TO-DATE
> Task :io.typefox.examples.theia.states:processTestResources NO-SOURCE
> Task :io.typefox.examples.theia.states:testClasses UP-TO-DATE
> Task :io.typefox.examples.theia.states:test UP-TO-DATE
> Task :io.typefox.examples.theia.states:check UP-TO-DATE
> Task :io.typefox.examples.theia.states:build UP-TO-DATE

> Task :io.typefox.examples.theia.states.ide:generateXtext FAILED
ERROR:The method needsServerLayout(boolean) is undefined for the type LanguageAwareDiagramServer (file:/projects/theia-xtext-sprotty-example/language-server/io.typefox.examples.theia.states.ide/src/main/java/io/typefox/examples/theia/states/ide/diagram/StatesDiagramServerFactory.xtend line : 15 column : 11)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':io.typefox.examples.theia.states.ide:generateXtext'.
> Xtext validation failed, see build log for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s
9 actionable tasks: 1 executed, 8 up-to-date

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.