Improvement on monaco language service
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 641
- Avg merge
- 12h 4m
- Merged PRs (30d)
- 57
Description
The goal of this issue is to outline and track the work required to leverage the monaco editor to improve our Javascript language service.
Background
Initially there was some work done in which we ended forking the monaco editor and the result is outlined here. You can test some of the features in the older v1.4.7
This became hard to maintain and eventually didn't yield the expected results.
Main Objectives
- 1. Improve error handling
- 2. Completions from functions (enabled by using snippets)
Optional
- Syntax highlighting
Relevant PRs
https://github.com/microsoft/pxt/pull/8048
https://github.com/microsoft/pxt/pull/8049
Details
1. Error Handling
We currently simply pipe the typescript compiler errors to the user who might not have as much context - would like to add telemetry to understand the most common error types and for these provide either a link to documentation (instead of simply prompting user to debug the project) or perhaps display a more verbose description of how to resolve the error.

2. Parameter completion on functions
Despite this being the more complex objective it would also be the most helpful.
To generate the snippets we need to bridge the compiler and Monaco worker. Currently investigating how to do this and options would include either starting another worker that would handle this, or use getTypeScriptWorker (although seems like monaco doesn't expose web worker). Another option, depending on the impact on performance, could be to send the entire API info from snippets.
Optional: Syntax Highlighting
It might be useful to highlight classes based on their category (sprite in blue, controller in red, etc.)
This could be increasingly distracting though but it's an option worth discussing
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.