microsoft / microsoft/monaco-editor

[Feature Request] Implement Cedar policy language by default

Open
#4,717 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

Context
  • This issue is not a bug report. (please use a different template for reporting a bug)
  • This issue is not a duplicate of an existing issue. (please use the search to find existing issues)
Description

I want to write Cedar Policy Language in Monaco-editor implemented in my web app. I've managed to define 'cedar' as a custom language for me by providing tokens and suggestions. But when it comes to error handling by setting markers in the editor, it is tough to handle user-written code in editor by checking every nested bracket. There is a vs-code extension for Cedar language. Can we use that extension directly in the Monaco editor?

Please let me know how I manage to handle error handling like vs-code in my custom-defined language for each and every small rule of the nested bracket without defining it from scratch.

Monaco Editor Playground Link

No response

Monaco Editor Playground Code

permit (
principal == PhotoApp::User::"alice",
action == PhotoApp::Action::"viewPhoto",
resource == PhotoApp::Photo::"vacationPhoto.jpg"
);

permit (
principal == PhotoApp::User::"stacey",
action == PhotoApp::Action::"viewPhoto",
resource
)
when { resource in PhotoApp::Account::"stacey" };

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing Monaco Editor's custom-language integration and the existing VS Code Cedar extension mentioned in the issue. Determine whether the extension can provide Cedar parsing and error markers in Monaco, and define completion as Cedar being available by default with rule-level validation and diagnostics.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript, vscode
Domain
tooling, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.