-
Notifications
You must be signed in to change notification settings - Fork 0
VSCode Extension
Samuel Ainsworth edited this page Nov 10, 2021
·
1 revision
- 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 blame
s and may be buggy. Using nodegit would be ideal since it supports some caching betweengit blame
calls but using nodegit is blocked on https://github.com/nodegit/nodegit/issues/1840. Currently we just invoke thegit
command directly and parse results in JS. This is easy and portable.
Notes:
- ApolloClient subscription from node.js: https://github.com/hasura/nodejs-graphql-subscriptions-boilerplate. Unsubscribing: https://stackoverflow.com/questions/51477002/unsubscribe-subscription-in-apollo-client
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.