leodevbro / vscode-blockman

VSCode extension to highlight nested code blocks
https://github.com/leodevbro/vscode-blockman
MIT License
345 stars 16 forks source link

Feature Request: Support vscode.dev #128

Open zpbonjour opened 7 months ago

zpbonjour commented 7 months ago

Your extension is one of my favorites and it is greatly missed when I need to use https://vscode.dev. Is it possible to make the extension compatible with the browser version of VS Code?

leodevbro commented 7 months ago

Hello, thanks for the lovely feedback. The thing is that VS Code has many limitations, one of the limitations is that it does not give extensions access to the native AST tokens.

https://github.com/microsoft/vscode/issues/177452

So, I implemented third party library (actually it is the source code of Bracket Pair Colorizer 2) for parsing/tokenizing brackets (curly/square/round). And, BPC 2 uses some NodeJS features which does not work in web browser. The biggest problem seems importing onig.wasm from vscode-oniguruma package. I could not convert this flow into web browser environment. I could not get it working. I think I will try some more things, for example maybe downloading the wasm file from online, instead of importing from local space.