pnp / sp-dev-fx-property-controls

Reusable SPFx property pane controls - Open source initiative
https://pnp.github.io/sp-dev-fx-property-controls/
MIT License
237 stars 152 forks source link

Any interest in a Monaco-based code editor? #385

Open hugoabernier opened 3 years ago

hugoabernier commented 3 years ago

Category

Expected / Desired Behavior / Question

I created a property pane control that uses the Monaco editor for code editing. I have added the ability to support custom languages, custom syntax highlighting, and custom theming and validation. Of course, it also supports all languages supported by Monaco.

Is this something that would be useful for the community?

Observed Behavior

The current version of the code editor is awesome, but in scenarios where you need more than the supported languages (json, javascript, sass, typescript, HTML, handlebars, XML) or you need full custom syntax, it is difficult to use.

Steps to Reproduce

Use the code editor control, and try to use a non-supported language.

My suggestion is to retrofit the existing code control so that it remains backwayrd compatible, while replacing the guts of the control to use Monaco and add support for more languages, themes, and validators.

ghost commented 3 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

joelfmrodrigues commented 3 years ago

Hey @hugoabernier

Sounds great 🙂 Would that be a breaking change to the existing control or a new control? From your message it seems like a new control, but just to be sure. And would it be possible to easily transition from one to the other if users wanted to upgrade to your control as it would offer more features? If so, I guess we could consider going with only one at some point in the future...just trying to see all options 🙂

hugoabernier commented 3 years ago

@joelfmrodrigues My thought was to do it a compatible of the existing control, so that existing solutions continue to work (but with a minor look and feel difference in the editor window).

joelfmrodrigues commented 3 years ago

@hugoabernier sounds great 🙂 @AJIXuMuK any comments?

AJIXuMuK commented 2 years ago

@hugoabernier @joelfmrodrigues - sorry for the delay. As I know, devs change the properties of the current code editor directly (AceEditor). I don't think we can switch one with another without breaking some of the implementations. So I'd do MonacoCodeEditor control with the same set of properties (maybe reuse interface or extend it).