Comments (6)
Doesn't this mean that the diagram is expected to be served from the language server?
No, it just means that the default is to provide the diagram from the backend of the VS Code extension. We just released a new package sprotty-protocol
that can be used in the backend (main extension code), but it's true that an example for this is missing. I hope we can provide one soon.
If you want to create the model directly in the frontend (webview), you can rebind TYPES.ModelSource
to LocalModelSource
.
from sprotty-vscode.
is there any update regarding this topic?
from sprotty-vscode.
Please check out v0.5.0. It brings a major redesign of the API. This includes an option for the new WebviewEndpoint
class to communicate via a DiagramServer
as defined in sprotty-protocol:
You can create this DiagramServer
in the VS Code extension to generate diagrams and handle client actions.
from sprotty-vscode.
Hi, is there an example for the usage of DiagramServer
and WebviewEndpoint
available yet?
from sprotty-vscode.
I don't know of a publicly available example. But something like this could be a good start:
export class StatesWPM extends WebviewPanelManager {
protected override createEndpoint(identifier: SprottyDiagramIdentifier): WebviewEndpoint {
const webviewContainer = this.createWebview(identifier);
const participant = this.messenger.registerWebviewPanel(webviewContainer);
const diagramServices: DiagramServices = {
DiagramGenerator: new StatesDiagramGenerator()
};
return new WebviewEndpoint({
webviewContainer,
messenger: this.messenger,
messageParticipant: participant,
identifier,
diagramServerFactory: (dispatch) => new DiagramServer(dispatch, diagramServices)
});
}
}
export class StatesDiagramGenerator implements IDiagramGenerator {
generate(args: GeneratorArguments): SModelRoot | Promise<SModelRoot> {
// Generate a diagram model based on options like `args.options.sourceUri`
}
}
from sprotty-vscode.
I appreciate it. Thank you for the fast response!
from sprotty-vscode.
Related Issues (20)
- sprotty-vscode-webview for sprotty 1.1.x or 1.2.x
- [publish] find a way to publish the example HOT 3
- Add content security policy
- exposing vscode-api HOT 4
- [theia] Diagrams disappear when their view is maximized
- Webview Active Check Prevents Command Execution HOT 2
- How to restart an LSP server? HOT 1
- Context Menu HOT 1
- Singleton webviews are not cleaned up correctly HOT 1
- compiled by a more recent version of JRE HOT 1
- Update dependencies `vscode-languageserver` and `vscode-languageclient` to `7.0.0` and reflect breaking changes
- [Question] Custom Notifications HOT 1
- Issues trying to build langium example HOT 1
- Support webview views and webview editors
- How run project in local? HOT 3
- How to run lsp in langium example? HOT 1
- Dangling message handlers in vscode-messenger extension instance HOT 1
- how to launch sprotty-langium in local environment HOT 1
- sprotty (diagram &text) synchronized HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sprotty-vscode.