Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting custom markers individually for each file #247

Open
Dako390 opened this issue Jan 12, 2022 · 0 comments
Open

Setting custom markers individually for each file #247

Dako390 opened this issue Jan 12, 2022 · 0 comments

Comments

@Dako390
Copy link

Dako390 commented Jan 12, 2022

Hello everybody.

I am currently looking for an option to display markers (errors) received by a custom validator only in the right file.
An error looks something like this:

{ file: 'path/to/a/file', message: 'Field scope is deprecated', severity: 1, ruleName: 'deprecated-events', ruleDescription: 'Checks for deprecated events.', row: 310, column: 9 }

So it already kind of has the marker structure.
My application uses tabs like vs code and the user can switch between those or close them.

My question now is: How do I display this error using ngx-monaco-editor when the corresponding file is currently opened in the tab?

I have the path stored in the tab so I can check it like if (openedTab.path === error.file). My problem is that I somehow can not use monaco.editor.setModelMarkers(). I guess the reason is because I am using ngx-monaco-editor? What would monaco.editor be in my case?

My html looks like this:
<ngx-monaco-editor automaticLayout="true" style="height: 100%" [options]="editorOptions" [(ngModel)]="code" (ngModelChange)="save();" (onInit)="onInit($event); editorInit($event)"></ngx-monaco-editor>

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant