You can integrate howdoi as a code editor extension. For this, you need to edit the files within the extension/code-editor-integration folder. To improve the Visual Studio Code howdoi extension, edit the files within the extension/vscode-howdoi folder and republish the extension.
runHowdoi
function which takes in a user’s query(type = string). The parameter is encapsulated by a single line comment and is formatted as : // howdoi query
runHowdoi
function returns and Object which looks like :
{
Question: string
Answer : string[]
Link : string[]
}
Next, install all important packages by running npm install
npm run compile
npm start
npm run build
npm test
To use the plug-in to create a howdoi extension, follow these steps:
Copy the code-editor-integration
folder in your workspace and remove node-modules
folder. You can do this by adding the script in your package.json
file and running it. But, first you will need to install ncp and rimraf.:
"copy": "ncp ../code-editor-integration/ src/code-editor-integration/"
"clean": "rimraf ./src/code-editor-integration/node_modules"
Import the plugin.ts
file into your main file.
Call the runHowdoi
function.
To begin the development for Visual Studio Code extension, install all the necessary packages:
npm install
Then precompile the extension :
npm run precompile
To run and test extension, utilize the Visual Studio Code’s debugging tools.