dependabot[bot] 558fadd85e Bump minimatch and mocha in /extension/code-editor-integration | 2 年 前 | |
---|---|---|
.. | ||
src | 4 年 前 | |
.eslintignore | 4 年 前 | |
.eslintrc.json | 4 年 前 | |
.gitignore | 4 年 前 | |
README.md | 2 年 前 | |
package-lock.json | 2 年 前 | |
package.json | 2 年 前 | |
tsconfig.json | 4 年 前 |
Simplifies the process of integrating howdoi as a code editor extension.
The Code Editor Integration plug-in is ran by calling the runHowdoi
function which takes in a user's query of type string. The parameter is encapsulated by a single line comment and is formatted as follows:
// howdoi query
runHowdoi
returns an Object with the structure:
{
question: string
answer: string[]
link: string[]
}
The Object values:
First, install howdoi on your machine.
Then, install all necessary packages:
npm install
To compile the script:
npm run compile
To run the script:
npm start
To compile and run the script:
npm run build
To run the testing script:
npm test
To utilize this plug-in to create a howdoi extension for a code editor:
Copy the code-editor-integration
folder into your workspace and remove the node_modules
folder by adding the script
"copy": "ncp ../code-editor-integration/ src/code-editor-integration/"
"clean": "rimraf ./src/code-editor-integration/node_modules"
into your package.json
file and running it.
First, you will need to install ncp and rimraf.
Import the plugin.ts
file into your main file.
Call the runHowdoi
function.
Refer to vscode-howdoi
for an example.
usage:
// howdoi query [-n NUM_ANSWERS]
positional arguments:
QUERY the question to answer
optional arguments:
-n NUM_ANSWERS NUM_ANSWERS
number of answers to return
(default: 3)