Open Zxilly opened 2 months ago
gopls in the browser would indeed be really nice to have!
There are a few things that make this difficult:
go list
internally. So that's something that needs to be worked around.Right now playground uses codemirror, I think it would be simpler to switch to monaco implementation.
Actually, no. I specifically choose CodeMirror 6 over Monaco. CodeMirror 6 is very flexible, small, and because it uses native browser APIs it works everywhere. And it supports autocomplete. Monaco doesn't support mobile browsers, is big and from what I've read difficult to configure/modify. Switching to Monaco would mean dropping mobile support, which I'm not willing to do.
"Monaco doesn't support mobile browsers"
I think it works on mobile, but due to the WebWorkers, the bundler may need additional setup.
I tried it. Inserting text and backspace work, but selecting text does not. Also, when you focus the editor in Chrome it zooms in much further than useful/practical. These things all work correctly in CodeMirror 6.
This is where I tried it: https://microsoft.github.io/monaco-editor/
Also, that page literally says:
The Monaco editor is not supported in mobile browsers or mobile web frameworks.
In any case, this is besides the point. The feature request is about gopls autocompletion, not about the editor. If there are any features in the editor missing feel free to file a bug report, but autocomplete is supported in CodeMirror 6 (just not wired up yet in the playground).
I think I need to start with some exec proposals for wasm port of Golang, there are these APIs we need in wasi 0.3
Right now playground uses codemirror, I think it would be simpler to switch to monaco implementation.