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

[JS, TS] Add Monarch support for private identifiers #3919

Merged
merged 1 commit into from May 2, 2023

Conversation

spahnke
Copy link
Contributor

@spahnke spahnke commented Apr 18, 2023

Fixes #3254

This is a very simple solution that just allows the # character as the start character of identifiers for all identifiers. I don't know Monarch enough to know if there is a way to constrain this to identifiers in classes, but I doubt there is. In any case if you use the # character at the start of e.g. a variable name the language service raises an error diagnostic, so that this might not be a problem? Maybe this simple solution is enough for this issue. Let me know what you think, or feel free to discard this.

grafik

Local Playground Link: https://microsoft.github.io/monaco-editor/playground.html?sourceLanguages=http%3A%2F%2Flocalhost%3A5002%2Fout%2Flanguages%2Famd-tsc#XQAAAAJoAQAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscwzblk-_1uhs0-3YGTBOsVJ4S4FwfCDQb5-2uUHXTVAefbVSd9IzaZ_vv9VR9KugsKikU_wkLK9jT_o8SJxwvSkZPE3r8N8C4O8JIRyP6PwIhuEzac9gRZJKV5O9_hRAHvieANI4sR5MKuH1inQaY1HbVLv0DvpOrvrDW6_vt1nHUY5cvnsy0iVQoS8hn2gWkAT4c2hWqFP24-1CdV2IAbzISiaOAa-IE1cC042gJ9VmprZ1KuCo6ic8uz7shuG3cxVt_qoOHa5r6Qz6qCXoH-gAs_coxt1vAO8lWJWMLtOTMA3__77F3Y

@hediet hediet added this to the May 2023 milestone May 2, 2023
@hediet hediet enabled auto-merge May 2, 2023 12:42
@hediet
Copy link
Member

hediet commented May 2, 2023

Thanks!

Also: I see you used the playground to debug/develop your PR. Did you run into any issues?

@hediet hediet merged commit 496274a into microsoft:main May 2, 2023
3 checks passed
@spahnke spahnke deleted the private-identifiers branch May 2, 2023 13:37
@spahnke
Copy link
Contributor Author

spahnke commented May 2, 2023

Also: I see you used the playground to debug/develop your PR. Did you run into any issues?

No issues! I really like this experience and it helped me immensely with the other PR for link and editor openers I contributed to the VS Code repo, because you could see and debug the changes immediately. The only thing I had to do for my machine was to change ports, but that was easy enough.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] class private #fields are tokenised as invalid in monaco
3 participants