-
Hi, From the changelog I understand that there a some breaking changes and I try to adapt this to my own code. But from the example code here I run into some problems. .......
function createServerModules(): ContainerModule[] {
const appModule = createAppModule({ logLevel: LogLevel.info, logDir: LOG_DIR, fileLog: true, consoleLog: false });
const elkLayoutModule = configureELKLayoutModule({ algorithms: ['layered'], layoutConfigurator: WorkflowLayoutConfigurator });
const mainModule = new WorkflowServerModule().configureDiagramModule(new WorkflowDiagramModule(() => GModelStorage), elkLayoutModule);
return [appModule, mainModule];
} This method (and also other code pieces) expect a In my case the server is implemented in Java and so I have created a const const JAVA_EXECUTABLE = path.join(
__dirname,
`../server/${artifactId}-${version}${isSnapShot ? "-SNAPSHOT" : ""}-glsp.jar`
);
export async function activate(context: vscode.ExtensionContext): Promise<void> {
// Start server process using quickstart component
let serverProcess: GlspSocketServerLauncher | undefined;
const useIntegratedServer = JSON.parse(process.env.GLSP_INTEGRATED_SERVER ?? 'false');
if (!useIntegratedServer && process.env.GLSP_SERVER_DEBUG !== 'true') {
const additionalArgs = ['--fileLog', 'true', '--logDir', LOG_DIR];
if (process.env.GLSP_WEBSOCKET_PATH) {
additionalArgs.push('--webSocket');
}
serverProcess = new GlspSocketServerLauncher({
executable: JAVA_EXECUTABLE,
socketConnectionOptions: { port: JSON.parse(process.env.GLSP_SERVER_PORT || DEFAULT_SERVER_PORT) },
additionalArgs,
logging: true
});
context.subscriptions.push(serverProcess);
await serverProcess.start();
}
.... Is this approach valid so far? I still wonder if the // Wrap server with quickstart component
const bpmnServer = useIntegratedServer
? new NodeGlspVscodeServer({
clientId: 'glsp.workflow',
clientName: 'workflow',
serverModules: createServerModules()
})
: new SocketGlspVscodeServer({
clientId: 'glsp.workflow',
clientName: 'workflow',
connectionOptions: {
port: serverProcess?.getPort() || JSON.parse(process.env.GLSP_SERVER_PORT || DEFAULT_SERVER_PORT),
path: process.env.GLSP_WEBSOCKET_PATH
}
}); Thanks for any hints regarding the integration of a java server in VSCode Integration 1.1.0-RC10. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I think I found the solution. In case that you only have a Java Server implementation, the So your code have to look like this: ....
......
const JAVA_EXECUTABLE = path.join(
__dirname,
`../server/${artifactId}-${version}${isSnapShot ? "-SNAPSHOT" : ""}-glsp.jar`
);
export async function activate(context: vscode.ExtensionContext): Promise<void> {
// Start server process using quickstart component
let serverProcess: GlspSocketServerLauncher | undefined;
const useIntegratedServer = JSON.parse(process.env.GLSP_INTEGRATED_SERVER ?? 'false');
if (!useIntegratedServer && process.env.GLSP_SERVER_DEBUG !== 'true') {
const additionalArgs = ['--fileLog', 'true', '--logDir', LOG_DIR];
if (process.env.GLSP_WEBSOCKET_PATH) {
additionalArgs.push('--webSocket');
}
serverProcess = new GlspSocketServerLauncher({
executable: JAVA_EXECUTABLE,
socketConnectionOptions: { port: JSON.parse(process.env.GLSP_SERVER_PORT || DEFAULT_SERVER_PORT) },
additionalArgs,
logging: true
});
context.subscriptions.push(serverProcess);
await serverProcess.start();
}
// Wrap server with quickstart component
const workflowServer = new SocketGlspVscodeServer({
clientId: 'glsp.workflow',
clientName: 'workflow',
connectionOptions: {
port: serverProcess?.getPort() || JSON.parse(process.env.GLSP_SERVER_PORT || DEFAULT_SERVER_PORT),
path: process.env.GLSP_WEBSOCKET_PATH
}
});
// Initialize GLSP-VSCode connector with server wrapper
const glspVscodeConnector = new GlspVscodeConnector({
server: workflowServer,
logging: true
});
const customEditorProvider = vscode.window.registerCustomEditorProvider(
'workflow.glspDiagram',
new WorkflowEditorProvider(context, glspVscodeConnector),
{
webviewOptions: { retainContextWhenHidden: true },
supportsMultipleEditorsPerDocument: false
}
);
context.subscriptions.push(workflowServer, glspVscodeConnector, customEditorProvider);
workflowServer.start();
configureDefaultCommands({ extensionContext: context, connector: glspVscodeConnector, diagramPrefix: 'workflow' });
....
..... In |
Beta Was this translation helpful? Give feedback.
I think I found the solution.
In case that you only have a Java Server implementation, the
NodeGlspVscodeServer
and the functioncreateServerModules()
can simply be removed from the example code.So your code have to look like this: