Skip to content

Bracket Pair Colorizer 2 does not colorize #544

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

Closed
ymmt2005 opened this issue Apr 19, 2019 · 12 comments
Closed

Bracket Pair Colorizer 2 does not colorize #544

ymmt2005 opened this issue Apr 19, 2019 · 12 comments
Labels
bug Something isn't working

Comments

@ymmt2005
Copy link

  • code-server version: 1.868-vsc1.33.1
  • OS Version: Ubuntu 18.04

Description

Bracket Pair Colorizer 2 version 0.0.28 can be installed but not colorize brackets.

Steps to Reproduce

  1. Install the extension.
  2. Open some file containing matching brackets.
@ymmt2005 ymmt2005 added the bug Something isn't working label Apr 19, 2019
@foresthoffman
Copy link
Contributor

@ymmt2005 What errors are you receiving in your browser's developer console, and/or in the VSCode Output tab?

@ymmt2005
Copy link
Author

In developer console, I can see following errors:

ide.main.6ff7fe.js?__WB_REVISION__=13c817c691ebda81c1f4:67 Activating extension 'CoenraadS.bracket-pair-colorizer-2' failed: Cannot find module '/./node_modules.asar/vscode-textmate'.
(anonymous) @ ide.main.6ff7fe.js?__WB_REVISION__=13c817c691ebda81c1f4:67
ide.main.6ff7fe.js?__WB_REVISION__=13c817c691ebda81c1f4:60 [Extension Host] Activating extension `CoenraadS.bracket-pair-colorizer-2` failed:  Cannot find module '/./node_modules.asar/vscode-textmate' (at newlyActivatingExtension._host.actualActivateExtension.then (/home/travis/build/codercom/code-server/packages/server/build/bootstrap-fork.js.gz:187834:21))

@TomFrost
Copy link

TomFrost commented Apr 26, 2019

Note that even if you do manually install vscode-textmate to /node_modules.asar/ in the root of your filesystem, you get this in the console:

[Extension Host] TypeError: Cannot read property 'encoding' of null
	at t (nbin.js:1:8431)
	at n.(anonymous function).t (nbin.js:1:6652)
	at n (nbin.js:1:6481)
	at n.(anonymous function).t (nbin.js:1:6667)
	at go$readFile (/home/travis/build/codercom/code-server/packages/server/build/bootstrap-fork.js.gz:7452:14)	at Object.readFile (/home/travis/build/codercom/code-server/packages/server/build/bootstrap-fork.js.gz:7449:12)
	at Promise (/home/tom/code-server/extensions/coenraads.bracket-pair-colorizer-2-0.0.28/out/src/textMateLoader.js:34:16)

Interestingly: /home/tom is my home folder. I see many errors stemming from /home/travis though, and @ymmt2005 has /home/travis in his log output as well. I checked my filesystem to see if it was just this extension or not, and it appears /home/travis is all through CachedExtensions/builtin as well as globalStorage/state.json.

@sr229
Copy link
Contributor

sr229 commented Sep 12, 2019

@ymmt2005 hey OP, give v2 a try, I think we fixed it on the latest tree.

@ymmt2005
Copy link
Author

ymmt2005 commented Sep 13, 2019

@sr229 Thank you, but unfortunately, the latest v2 seems not working well:

  • It can list the extension.
  • It cannot install the extension.
  • Installation from vsix file worked, but the extension failed to start with this error:
Cannot find module '/src/build/code-server2.1472-vsc1.38.1-linux-x86_64-built/node_modules.asar/vscode-textmate'.

code-asher added a commit that referenced this issue Sep 13, 2019
Should allow manual installation of bracket pair colorizer 2: #544.
@code-asher
Copy link
Member

I added a fix for extensions trying to load from node_modules.asar. As soon as CI completes I'll put up another pre-release.

It couldn't install the extension because it didn't exist so we'll need to add a 404 check in code-server to make that more clear because it was trying to parse the 404 page as a vsix. It seems the marketplace failed to build the extension because it has a dependency on [email protected] which doesn't exist (I think it was pulled due to some security vulnerability).

Maybe the move is to run npm audit fix if a package fails to build and try again. In the meantime I fixed it manually.

@ymmt2005
Copy link
Author

Thanks. I tried the new version. It successfully installs and starts the extension.
However, it does not colorize brackets.

No errors in "Log (Remote Extension Host)".

It spits a log in console, though:

$ ./code-server
info  Server listening on http://localhost:8080
info    - No authentication
info    - Not serving HTTPS
Cannot write message in a disposed ProtocolWriter
d {
  type: 1,
  id: 489,
  ack: 500,
  data:
   a {
     buffer:
      <Buffer 04 00 00 00 02 05 00 00 00 03 32 30 31 05 00 00 00 03 34 39 38 00>,
     byteLength: 22 },
  writtenTime: 0 }

@ymmt2005
Copy link
Author

Also, I tried these in settings.json but both did not work.
In fact, it seems that code-server does not support remote.extensionKind.

{
    "remote.extensionKind": {
        "coenraads.bracket-pair-colorizer-2": "ui"
    }
}
{
    "remote.extensionKind": {
        "coenraads.bracket-pair-colorizer-2": "workspace"
    }
}

@code-asher
Copy link
Member

I neglected to test inside the binary. 😲 Looks like our binary packager had an issue in some cases reading files (the error @TomFrost posted above). Should have a new pre-release up soon.

You're right about remote.extensionKind. All extensions run on the server regardless of their kind. Eventually we'll be able to run certain extensions in the browser though.

BTW @TomFrost if you're still curious the build path inside Travis CI used to be /home/travis and that gets embedded into the binary which is why you see that path. It's been changed since then to /src/build.

@Talent30
Copy link

Bracket Pair Colorizer 2 does not work on 3.6.0.

  • Web Browser: Edge 86
  • Local OS: Windows
  • Remote OS: Linux
  • Remote Architecture: Arrch64
  • code-server --version: 3.6.0

Error message in developer console:

Activating extension 'CoenraadS.bracket-pair-colorizer-2' failed: ENOENT: no such file or directory, open '/usr/lib/code-server/lib/vscode/node_modules.asar/vscode-oniguruma/release/onig.wasm'. _logMessageInConsole @ abstractExtensionService.ts:416

@code-asher
Copy link
Member

@Talent30 Thanks for the report, I opened #2197 to fix the problem.

@andreimosman
Copy link

I got this message:

Activating extension 'CoenraadS.bracket-pair-colorizer-2' failed: Cannot find module '/usr/lib/code-server/lib/vscode/node_modules.asar/vscode-textmate'.

I realized that there was no /usr/lib/code-server/lib/vscode/node_modules.asar folder. Instead there was /usr/lib/code-server/lib/vscode/node_modules and on this folder I found 'vscode-textmate'.

I created a symbolic link:

$ sudo ln -s /usr/lib/code-server/lib/vscode/node_modules /usr/lib/code-server/lib/vscode/node_modules.asar

It's working now! =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants