Skip to content

Bracket Pair Colorizer 2 does not colorize #544

Closed

Description

@ymmt2005
  • 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.

Activity

  1. foresthoffman commented on Apr 19, 2019

    @foresthoffman
    Contributor

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

  2. ymmt2005 commented on Apr 19, 2019

    @ymmt2005
    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))
    
  3. TomFrost commented on Apr 26, 2019

    @TomFrost

    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.

  4. sr229 commented on Sep 12, 2019

    @sr229
    Contributor

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

  5. ymmt2005 commented on Sep 13, 2019

    @ymmt2005
    Author

    @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'.
    
  6. code-asher commented on Sep 13, 2019

    @code-asher
    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 event-stream@3.3.6 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.

  7. ymmt2005 commented on Sep 14, 2019

    @ymmt2005
    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 }
  8. ymmt2005 commented on Sep 14, 2019

    @ymmt2005
    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"
        }
    }
  9. code-asher commented on Sep 16, 2019

    @code-asher
    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.

  10. CogitoBurrito commented on Oct 13, 2020

    @CogitoBurrito

    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

  11. code-asher commented on Oct 13, 2020

    @code-asher
    Member

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

  12. andreimosman commented on Feb 9, 2021

    @andreimosman

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions