Skip to content

VSCode Extension

Samuel Ainsworth edited this page Nov 10, 2021 · 1 revision

cuddlefish-comments README

  • VSCode extensions do not really support native/gyp dependencies. See https://github.com/microsoft/vscode/issues/658. There are pure-JS git implementations but they will certainly be much slower with git blames and may be buggy. Using nodegit would be ideal since it supports some caching between git blame calls but using nodegit is blocked on https://github.com/nodegit/nodegit/issues/1840. Currently we just invoke the git command directly and parse results in JS. This is easy and portable.

Notes:

TODO:

  • startThread enablement is currently !commentIsEmpty && !activeEditorIsDirty. It's not clear if activeEditorIsDirty will be correct when the user has two editors open: one has the comment and the other is dirty. See https://code.visualstudio.com/api/references/when-clause-contexts for more info. Can't find a better context.
  • Upgrade nodegit dependency once 0.28.0 is released. See https://github.com/nodegit/nodegit/issues/1840 and https://github.com/nodegit/nodegit/issues/1864.
  • add a feedback option!
  • make it work as a "Web Extension"
    • wasm can be used in web extensions according to this quote: "The browser runtime environment only supports the execution of JavaScript and WebAssembly. Libraries written in other programming languages need to be cross-compiled, for instance there is tooling to compile C/C++ and Rust to WebAssembly. The vscode-anycode extension, for example, uses tree-sitter, which is C/C++ code compiled to WebAssembly." could we cross-compile libgit2 to wasm?

Run npm run gql:codegen -- --watch to download the schema and generate TS types in development.

Clone this wiki locally