
Security News
Scaling Socket from Zero to 10,000+ Organizations
Socket CEO Feross Aboukhadijeh shares lessons from scaling a developer security startup to 10,000+ organizations in this founder interview.
@eclipse-emfcloud/modelserver-markers-theia
Advanced tools
The model server client API provides validation methods which manipulate JSON objects which can be cast as Diagnostic objects (@eclipse-emfcloud/modelserver-theia/lib/browser/diagnostic).
export interface ModelServerClient extends JsonRpcServer<ModelServerFrontendClient> {
validation(modeluri: URI): Promise<Response<string>>;
// WebSocket connection
subscribeWithValidation(modeluri: URI): void;
}
Users may want to log these validation diagnostics in Theia's Problems view (provided by @theia/markers).
This module provides the necessary tools to achieve this purpose with minimalist code.
After calling the validation, you can create markers as simply as :
@inject(MessageService) protected readonly messageService: MessageService;
@inject(DiagnosticManager) protected readonly diagnosticManager: DiagnosticManager;
const modelURI : URI;
// perform validation
this.modelServerClient.validation(modelURI.toString())
.then((response: Response<any>) => {
// get resulting diagnostic
const diagnostic = response.body as Diagnostic;
// print markers in Problems view
diagnosticManager.setDiagnostic(modelURI, diagnostic);
// display the validation status
this.messageService.info(`Validation finished with level ${Diagnostic.getSeverityLabel(diagnostic)}.`)
});
The marker in the problems view can be used to navigate to the precise element in error.
As this navigation depends on your model editor implementation, you must implement the OpenHandler interface if you want this functionality (see @theia/core/lib/browser/opener-service.ts).
In the opener options, you will find a selection entry, which value can be cast as a ModelElementRange, containing fake start and end values, but the correct model element's URI fragment (identifier) at the uriFragment key.
It is up to your widget implementation to select the correct element corresponding to this URI fragment.
FAQs
## Use case
The npm package @eclipse-emfcloud/modelserver-markers-theia receives a total of 98 weekly downloads. As such, @eclipse-emfcloud/modelserver-markers-theia popularity was classified as not popular.
We found that @eclipse-emfcloud/modelserver-markers-theia demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh shares lessons from scaling a developer security startup to 10,000+ organizations in this founder interview.

Research
Socket Threat Research maps a rare inside look at OtterCookie’s npm-Vercel-GitHub chain, adding 197 malicious packages and evidence of North Korean operators.

Research
Socket researchers identified a malicious Chrome extension that manipulates Raydium swaps to inject an undisclosed SOL transfer, quietly routing fees to an attacker wallet.