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

Improve JSX/TSX support in code editor #32833

Merged
merged 4 commits into from
Dec 14, 2024
Merged

Conversation

silverwind
Copy link
Member

@silverwind silverwind commented Dec 13, 2024

Two tweaks to Monaco to improve JSX/TSX support.

  1. Certain language features like JSX/TSX only work when passing uri (containing the filename), do this.
  2. Set the jsx compiler option to avoid error annotations

Before:
Screenshot 2024-12-13 at 15 11 33

After:
Screenshot 2024-12-13 at 15 10 46

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 13, 2024
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 13, 2024
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Dec 14, 2024
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Dec 14, 2024

Haven't tested, does the "change filename" still work?

For example: "New File" -> input "a.c" as filename (highlight as C) -> change file name to "a.md" (highlight as MD and provide preview)


Tested, works

@wxiaoguang wxiaoguang added this to the 1.23.0 milestone Dec 14, 2024
@silverwind
Copy link
Member Author

silverwind commented Dec 14, 2024

Yes, language change on filename change still works. Ideally we would also update model uri on filename change, but I left that out for now because it likely requires to create new models which may have unintended side effects.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Dec 14, 2024
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Dec 14, 2024
@lunny lunny enabled auto-merge (squash) December 14, 2024 03:08
@lunny lunny merged commit bed563e into go-gitea:main Dec 14, 2024
26 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Dec 14, 2024
@silverwind silverwind deleted the monaco-tsx branch December 14, 2024 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/frontend size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants