Skip to content

Commit

Permalink
Update to v0.0.5 (#65)
Browse files Browse the repository at this point in the history
* clean up

* Update README.md

* Minor code improvement

* pump v0.0.5

* revert: do not ignore package-lock.json

Co-authored-by: Kekschen <[email protected]>
  • Loading branch information
hieunc229 and Kekschen authored Jul 2, 2022
1 parent 59a0146 commit cbb348b
Show file tree
Hide file tree
Showing 7 changed files with 949 additions and 108 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ yarn-error.log
/vscode.d.ts
/vscode.proposed.d.ts
vscode.d.ts
/out
87 changes: 47 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,38 @@

# Captain Stack — Code suggestion for VSCode

[![Captain Stack on Marketplace](https://vsmarketplacebadge.apphb.com/version/captainstack.captain-stack.svg)](https://marketplace.visualstudio.com/items?itemName=captainstack.captain-stack) [![Captain Stack on Marketplace](https://vsmarketplacebadge.apphb.com/installs-short/captainstack.captain-stack.svg)](https://marketplace.visualstudio.com/items?itemName=captainstack.captain-stack) [![Discord Chat](https://img.shields.io/discord/864164585070526475.svg)](https://discord.gg/5F5tDsWFmp)

This feature is somewhat similar to [Github Copilot](https://copilot.github.com/)'s code suggestion. But instead of using AI, it sends your search query to Google, then retrieves StackOverflow answers and autocompletes them for you.

Have questions? [Join our Discord server](https://discord.gg/5F5tDsWFmp) [![Discord Chat](https://img.shields.io/discord/864164585070526475.svg)](https://discord.gg/5F5tDsWFmp)
This feature is somewhat similar to Github Copilot's code suggestion. But instead of using AI, it sends your search query to Google, then retrieves StackOverflow, Github Gist answers and autocompletes them for you.

![Demo Video](./demo.gif)

## Table of contents:

1. [Installation](#1-installation)
2. [Play with Captain Stack](#2-play-with-captain-stack)
3. [Captain Stack configurations](#3-captain-stack-configurations)
4. [Notes](#4-notes)
5. [Changelog](#5-changelog)
6. [Troubleshooting](#6-troubleshooting)
7. [Contributors](#7-contributors)


_Note: ⚠️ This extension uses a proposed API (inline-completion) and can only be used for extension development in [VSCode Insider release](https://code.visualstudio.com/insiders/). It's not yet available on VSCode_

---

## 1. Installation

**Check out the installation video: https://youtu.be/MD-kzsF0Scg**
The following information

Before installation, make sure you have [VSCode Insider](https://code.visualstudio.com/insiders/). You'll be using this version. To install and starting Captain Stack:
Table of contents:

1. Download this repository to your local machine. Unzip and open it on VSCode Insider (make sure the root directory is the same as `package.json` file)
2. (optional) Run `npm install` in the terminal to install dependencies. _A `postinstall` script would download the latest version of `vscode.proposed.d.ts`_
3. Run the `Run Extension` target in the Debug View. Or from the top menu, choose `Run > Start Debugging`.
- [Captain Stack — Code suggestion for VSCode](#captain-stack--code-suggestion-for-vscode)
- [1. Install extension from the marketplace](#1-install-extension-from-the-marketplace)
- [2. How to use](#2-how-to-use)
- [3. Installation for development](#3-installation-for-development)
- [4. Captain Stack configurations](#4-captain-stack-configurations)
- [Available settings](#available-settings)
- [5. Notes](#5-notes)
- [6. Changelog](#6-changelog)
- [7. Troubleshooting](#7-troubleshooting)
- [Common reasons why you can't run Captain Stack:](#common-reasons-why-you-cant-run-captain-stack)
- [Still not running?](#still-not-running)
- [8. Contributors](#8-contributors)

This will:
- Start a task `npm: watch` to compile the code and watch for changes
- Open a new VSCode window (you should use the extension here)
---

_Note: When you make changes, you should refresh that window to apply changes. To refresh, open Command Palette (Command+Shift+P on MacOS, or Ctrl+Shift+P on Windows), then choose "Developer: Reload window"_
## 1. Install extension from the marketplace

---
You can search for "Captain Stack" on VSCode Extension Marketplace, or use [Captain Stack direct link](https://marketplace.visualstudio.com/items?itemName=captainstack.captain-stack) to install. Have questions? [Join our Discord server](https://discord.gg/5F5tDsWFmp)

## 2. Play with Captain Stack
## 2. How to use

To trigger inline completion, you'll need to type `//find {your keyword}.` (start with `//find`, end with a dot `.`)

Expand All @@ -51,14 +42,29 @@ For example
//find binary search in javascript.
```

Make sure that `showInlineCompletions` is enabled in your settings!
```
"editor.inlineSuggest.enabled": true
```
Make sure `Inline Suggest` is `enabled` from the VS Code Settings

## 3. Installation for development

**Check out the installation video: https://youtu.be/MD-kzsF0Scg**

To install and starting Captain Stack:

1. Clone this repository to your PC using `git clone https://github.com/hieunc229/copilot-clone.git .`. Please note there is a dot at the end of the command

2. Run `npm install` in the terminal to install dependencies

3. Now, you can start the extension. From the top menu, choose `Run > Start Debugging`.

This will:
- Start a task `npm: watch` to compile the code and watch for changes
- Open a new VSCode window (you should use the extension here)

_Note: When you make changes, you should refresh that window to apply changes. To refresh, open Command Palette (Command+Shift+P on MacOS, or Ctrl+Shift+P on Windows), then choose "Developer: Reload window"_

---

## 3. Captain Stack configurations
## 4. Captain Stack configurations

There are a few configurations available for Captain Stack. To open the configurationview:

Expand All @@ -74,7 +80,7 @@ There are a few configurations available for Captain Stack. To open the configur

---

## 4. Notes
## 5. Notes

- There are more code sources that should be considered besides StackOverflow
- If you see `unsupported` error message, ignore it
Expand All @@ -87,8 +93,10 @@ If those factor became problems, the extension could be using their official API

---

## 5. Changelog
## 6. Changelog

- Jul 02, 2022 — Officially published Captain Stack on extension marketplace
- 2022 — Added GithubGist source
- Aug 15, 2021 - Added `sites` and `maxResults` configurations
- Jul 31, 2021 — Create code extracting abstracting to add more code sources
- Jul 14, 2021 - Adapted to VS Code Insiders Release Version 1.59
Expand All @@ -97,11 +105,10 @@ If those factor became problems, the extension could be using their official API

---

## 6. Troubleshooting
## 7. Troubleshooting

### Common reasons why you can't run Captain Stack:

- You're not using VSCode Insider. It can be [downloaded here](https://code.visualstudio.com/insiders/)
- When `Run debugger`, it shows different target options (nodejs, edge, etc.). Your VSCode root directly might be incorrect. Make sure your root directory is the same with the `package.json` file.
- Error message `module "node-fetch" not found...`. You need to run `npm install`
- `canvas.node` was compiled against a different Node.js. [Try to remove canvas](https://github.com/hieunc229/copilot-clone/issues/9) (`npm uninstall canvas`)
Expand All @@ -115,7 +122,7 @@ If none of the above works, open a thread or join our [Discord channel and have

---

## 7. Contributors
## 8. Contributors

The plugins is available, thanks to:

Expand All @@ -128,5 +135,5 @@ The plugins is available, thanks to:
---
Love Captain Stack? Check out other things I do:

- [Inverr Nocode Site Builder](https://inverr.com/?ref=github-filepond)
- [Rebit Nocode Site Builder](https://rebit.co/?ref=github)
- [Hieu's Twitter](https://twitter.com/hieuSSR/)
Loading

0 comments on commit cbb348b

Please sign in to comment.