<
From version < 24.1 >
edited by Soeren Domroes
on 2019/05/16 10:56
To version < 21.1 >
edited by Soeren Domroes
on 2019/05/16 10:36
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -169,7 +169,7 @@
169 169  
170 170  === Known issues: ===
171 171  
172 -\\
172 +Refreshing the browser is not enough for the diagram to work. If the diagram is needed the language server has to be restarted before the browser is refreshed. This is a known issue in theia-sprotty.
173 173  
174 174  = Developing for KEITH =
175 175  
... ... @@ -308,57 +308,8 @@
308 308  
309 309  == Server Client communication interface ==
310 310  
311 -Not only messages from client to server but rather messages from server client might be needed.
311 +Not only messages from client to server but rather mesages from server client might be needed
312 312  
313 -Messages that can be send from server to client are defined in the KeithLanguageClient:
314 -
315 -{{code title="Example KeithLanguageLCient"}}
316 -/**
317 - * LanguageClient that implements additional methods necessary for server client communication in KEITH.
318 - *
319 - * @author really fancy name
320 - *
321 - */
322 - @JsonSegment("keith")
323 -interface KeithLanguageClient extends LanguageClient {
324 -
325 - @JsonNotification("kicool/compile")
326 - def void compile(Object results, String uri, boolean finished);
327 -
328 - @JsonNotification("kicool/cancel-compilation")
329 - def void cancelCompilation(boolean success);
330 -
331 - // Not only notifications, but also server client requests should be possible, but currently there is no use case for that.
332 -}
333 -{{/code}}
334 -
335 -These messages can be caught on the client side by defining the message that is caught like this:
336 -
337 -{{code title="Client side message definition"}}
338 -export const snapshotDescriptionMessageType = new NotificationType<CodeContainer, void>('keith/kicool/compile');
339 -{{/code}}
340 -
341 -This message type is bound to a method that should be called whenever the client receives such a message.
342 -
343 -{{code title="Client side message registration"}}
344 -const lClient: ILanguageClient = await this.client.languageClient
345 -lClient.onNotification(snapshotDescriptionMessageType, this.handleNewSnapshotDescriptions.bind(this))
346 -{{/code}}
347 -
348 -The method should receive all parameters specific in the KeithLanguageClient interface on the serevr side.
349 -
350 -Such a notification from server to client is send like this:
351 -
352 -{{code title="Server side message sending"}}
353 -future.thenAccept([
354 - // client is the KeithLanguageClient registered in a LanguageServerExtension that implements a ILanguageClientProvider
355 - // compile is the command defined in the KeithLanguageClientInterface
356 - client.compile(new CompilationResults(this.snapshotMap.get(uri)), uri, finished)
357 -])
358 -{{/code}}
359 -
360 -\\
361 -
362 362  == Register and calling an extension (on client side) ==
363 363  
364 364  Language server extension do not have to be registered on the client side. It is just called.
... ... @@ -365,7 +365,7 @@
365 365  
366 366  You can send a request or a notification to the language server like this:
367 367  
368 -{{code title="Client side message sending"}}
319 +{{code}}
369 369  const lclient = await this.client.languageClient
370 370  const snapshotsDescriptions: CodeContainer = await lclient.sendRequest("keith/kicool/compile", [uri, KeithDiagramManager.DIAGRAM_TYPE + '_sprotty', command,
371 371   this.compilerWidget.compileInplace]) as CodeContainer
... ... @@ -379,10 +379,10 @@
379 379  
380 380  In this example client is an instance of a language client. It is usually injected like this:
381 381  
382 -{{code title="Client side LanguageClientContribution injection"}}
383 -@inject(KeithLanguageClientContribution) public readonly client: KeithLanguageClientContribution
333 +{{code}}
384 384  constructor(
385 - // other injected classes that are relevant for the constructor
335 + @inject(KeithLanguageClientContribution) public readonly client: KeithLanguageClientContribution
336 + // other injected classes
386 386   ) {
387 387   // constructor stuff
388 388  }
Confluence.Code.ConfluencePageClass[0]
Id
... ... @@ -1,1 +1,1 @@
1 -57803004
1 +57802996
URL
... ... @@ -1,1 +1,1 @@
1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/57803004/Running KEITH
1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/57802996/Running KEITH