├── .env
├── .gitignore
├── images
├── icon.png
└── changelog
│ ├── 0.0.1.gif
│ ├── 0.0.5
│ ├── stack.png
│ ├── googleSearch.PNG
│ └── stackoverflowApi.gif
│ └── 0.0.4
│ └── searchgoogle.gif
├── helperUtils
├── logger.js
├── VsCodeUtils.js
├── LinkUtil.js
└── StackOverflowApi.js
├── .vscodeignore
├── .vscode
├── extensions.json
└── launch.json
├── jsconfig.json
├── searches
├── googleErrorSearch
│ └── index.js
├── githubErrorSearch
│ └── index.js
├── youtubeErrorSearch
│ └── index.js
├── stackoverflowErrorSearch
│ └── index.js
└── index.js
├── constants
└── index.js
├── test
├── suite
│ ├── extension.test.js
│ └── index.js
└── runTest.js
├── .eslintrc.json
├── CHANGELOG.md
├── extension.js
├── vsc-extension-quickstart.md
├── README.md
└── package.json
/.env:
--------------------------------------------------------------------------------
1 | STACKOVERFLOW_KEY=n5E2Yl989XPdQpjT6qCedQ((
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .vscode-test/
3 | *.vsix
4 | token
5 |
--------------------------------------------------------------------------------
/images/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gihanrcg/error-help/HEAD/images/icon.png
--------------------------------------------------------------------------------
/images/changelog/0.0.1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gihanrcg/error-help/HEAD/images/changelog/0.0.1.gif
--------------------------------------------------------------------------------
/images/changelog/0.0.5/stack.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gihanrcg/error-help/HEAD/images/changelog/0.0.5/stack.png
--------------------------------------------------------------------------------
/images/changelog/0.0.4/searchgoogle.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gihanrcg/error-help/HEAD/images/changelog/0.0.4/searchgoogle.gif
--------------------------------------------------------------------------------
/images/changelog/0.0.5/googleSearch.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gihanrcg/error-help/HEAD/images/changelog/0.0.5/googleSearch.PNG
--------------------------------------------------------------------------------
/images/changelog/0.0.5/stackoverflowApi.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gihanrcg/error-help/HEAD/images/changelog/0.0.5/stackoverflowApi.gif
--------------------------------------------------------------------------------
/helperUtils/logger.js:
--------------------------------------------------------------------------------
1 | const logError = (message) => {
2 | console.log(`ERROR : ${message}`)
3 | }
4 |
5 | module.exports = {
6 | logError
7 | }
--------------------------------------------------------------------------------
/.vscodeignore:
--------------------------------------------------------------------------------
1 | .vscode/**
2 | .vscode-test/**
3 | test/**
4 | .gitignore
5 | .yarnrc
6 | vsc-extension-quickstart.md
7 | **/jsconfig.json
8 | **/*.map
9 | **/.eslintrc.json
10 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | // See https://go.microsoft.com/fwlink/?LinkId=733558
3 | // for the documentation about the extensions.json format
4 | "recommendations": [
5 | "dbaeumer.vscode-eslint"
6 | ]
7 | }
--------------------------------------------------------------------------------
/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "commonjs",
4 | "target": "es6",
5 | "checkJs": true, /* Typecheck .js files. */
6 | "lib": [
7 | "es6"
8 | ]
9 | },
10 | "exclude": [
11 | "node_modules"
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/searches/googleErrorSearch/index.js:
--------------------------------------------------------------------------------
1 | const { SITE_NONE } = require('../../constants');
2 | const { allErrorsInQuickPick } = require('..')
3 |
4 | const searchInGoogle = (currentlyOpenTabfile) => {
5 | allErrorsInQuickPick(currentlyOpenTabfile, SITE_NONE);
6 | }
7 |
8 | module.exports = {
9 | searchInGoogle
10 | }
--------------------------------------------------------------------------------
/searches/githubErrorSearch/index.js:
--------------------------------------------------------------------------------
1 | const { SITE_GITHUB } = require('../../constants');
2 | const { allErrorsInQuickPick } = require('..')
3 |
4 | const searchInGithub = (currentlyOpenTabfile) => {
5 | allErrorsInQuickPick(currentlyOpenTabfile, SITE_GITHUB);
6 | }
7 |
8 | module.exports = {
9 | searchInGithub
10 | }
--------------------------------------------------------------------------------
/searches/youtubeErrorSearch/index.js:
--------------------------------------------------------------------------------
1 | const { SITE_YOUTUBE } = require('../../constants');
2 | const { allErrorsInQuickPick } = require('..')
3 |
4 | const searchInYoutube = (currentlyOpenTabfile) => {
5 | allErrorsInQuickPick(currentlyOpenTabfile, SITE_YOUTUBE);
6 | }
7 |
8 | module.exports = {
9 | searchInYoutube
10 | }
--------------------------------------------------------------------------------
/searches/stackoverflowErrorSearch/index.js:
--------------------------------------------------------------------------------
1 | const { SITE_STACKOVERFLOW } = require('../../constants');
2 | const { allErrorsInQuickPick } = require('..')
3 |
4 | const searchInStackOverflow = (currentlyOpenTabfile) => {
5 | allErrorsInQuickPick(currentlyOpenTabfile, SITE_STACKOVERFLOW);
6 | }
7 |
8 | module.exports = {
9 | searchInStackOverflow
10 | }
--------------------------------------------------------------------------------
/constants/index.js:
--------------------------------------------------------------------------------
1 | const GOOGLE_SEARCH_LINK = 'http://google.com/search?q=';
2 |
3 | const SITE_STACKOVERFLOW = 'site:stackoverflow.com';
4 | const SITE_YOUTUBE = 'site:youtube.com';
5 | const SITE_GITHUB = 'site:github.com';
6 | const SITE_NONE = '';
7 |
8 | module.exports = {
9 | GOOGLE_SEARCH_LINK,
10 | SITE_STACKOVERFLOW,
11 | SITE_YOUTUBE,
12 | SITE_GITHUB,
13 | SITE_NONE
14 | }
--------------------------------------------------------------------------------
/test/suite/extension.test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | // You can import and use all API from the 'vscode' module
4 | // as well as import your extension to test it
5 | const vscode = require('vscode');
6 | // const myExtension = require('../extension');
7 |
8 | suite('Extension Test Suite', () => {
9 | vscode.window.showInformationMessage('Start all tests.');
10 |
11 | test('Sample test', () => {
12 | assert.strictEqual(-1, [1, 2, 3].indexOf(5));
13 | assert.strictEqual(-1, [1, 2, 3].indexOf(0));
14 | });
15 | });
16 |
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "browser": false,
4 | "commonjs": true,
5 | "es6": true,
6 | "node": true,
7 | "mocha": true
8 | },
9 | "parserOptions": {
10 | "ecmaVersion": 2018,
11 | "ecmaFeatures": {
12 | "jsx": true
13 | },
14 | "sourceType": "module"
15 | },
16 | "rules": {
17 | "no-const-assign": "warn",
18 | "no-this-before-super": "warn",
19 | "no-undef": "warn",
20 | "no-unreachable": "warn",
21 | "no-unused-vars": "warn",
22 | "constructor-super": "warn",
23 | "valid-typeof": "warn"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | // A launch configuration that launches the extension inside a new window
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | {
6 | "version": "0.2.0",
7 | "configurations": [
8 | {
9 | "name": "Run Extension",
10 | "type": "extensionHost",
11 | "request": "launch",
12 | "args": [
13 | "--extensionDevelopmentPath=${workspaceFolder}"
14 | ]
15 | },
16 | {
17 | "name": "Extension Tests",
18 | "type": "extensionHost",
19 | "request": "launch",
20 | "args": [
21 | "--extensionDevelopmentPath=${workspaceFolder}",
22 | "--extensionTestsPath=${workspaceFolder}/test/suite/index"
23 | ]
24 | }
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/test/runTest.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 |
3 | const { runTests } = require('vscode-test');
4 |
5 | async function main() {
6 | try {
7 | // The folder containing the Extension Manifest package.json
8 | // Passed to `--extensionDevelopmentPath`
9 | const extensionDevelopmentPath = path.resolve(__dirname, '../');
10 |
11 | // The path to the extension test script
12 | // Passed to --extensionTestsPath
13 | const extensionTestsPath = path.resolve(__dirname, './suite/index');
14 |
15 | // Download VS Code, unzip it and run the integration test
16 | await runTests({ extensionDevelopmentPath, extensionTestsPath });
17 | } catch (err) {
18 | console.error('Failed to run tests');
19 | process.exit(1);
20 | }
21 | }
22 |
23 | main();
--------------------------------------------------------------------------------
/helperUtils/VsCodeUtils.js:
--------------------------------------------------------------------------------
1 | const vscode = require('vscode');
2 | const { logError } = require('./logger');
3 |
4 | const getSelectedText = () => {
5 | const editorWindow = vscode.window.activeTextEditor;
6 | if (!editorWindow) {
7 | logError('Invalid Editor Window');
8 | }
9 | const { document, selections } = editorWindow;
10 |
11 | const eol = document.eol === 1 ? '\n' : '\r\n';
12 | const selectedLines = selections.map(select => {
13 | if (select.start.line === select.end.line && select.start.character === select.end.character) {
14 | const text = document.getText(document.lineAt(select.start).range);
15 | return `${text}${eol}`;
16 | }
17 | return document.getText(select);
18 | });
19 |
20 | return selectedLines[0].trim();
21 | }
22 |
23 | module.exports = {
24 | getSelectedText
25 | }
--------------------------------------------------------------------------------
/test/suite/index.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const Mocha = require('mocha');
3 | const glob = require('glob');
4 |
5 | function run() {
6 | // Create the mocha test
7 | const mocha = new Mocha({
8 | ui: 'tdd',
9 | color: true
10 | });
11 |
12 | const testsRoot = path.resolve(__dirname, '..');
13 |
14 | return new Promise((c, e) => {
15 | glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
16 | if (err) {
17 | return e(err);
18 | }
19 |
20 | // Add files to the test suite
21 | files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
22 |
23 | try {
24 | // Run the mocha test
25 | mocha.run(failures => {
26 | if (failures > 0) {
27 | e(new Error(`${failures} tests failed.`));
28 | } else {
29 | c();
30 | }
31 | });
32 | } catch (err) {
33 | console.error(err);
34 | e(err);
35 | }
36 | });
37 | });
38 | }
39 |
40 | module.exports = {
41 | run
42 | };
43 |
--------------------------------------------------------------------------------
/helperUtils/LinkUtil.js:
--------------------------------------------------------------------------------
1 | const { GOOGLE_SEARCH_LINK } = require("../constants");
2 |
3 | const formatGoogleLink = (errorCode, errorMessage, siteConst) => {
4 | return GOOGLE_SEARCH_LINK + '' + errorCode + ' ' + errorMessage + ' ' + siteConst
5 | }
6 |
7 | const formatStackOverflowApiKey = (encodedAPISearchTerm, encodedTagsString, stackoverflowApiKey) => {
8 | return `https://api.stackexchange.com/2.2/search?order=desc&sort=relevance&intitle=${encodedAPISearchTerm}&tagged=${encodedTagsString}&site=stackoverflow&key=${stackoverflowApiKey}`
9 | }
10 | const formatStackOverflowSearch = (searchTerm) => {
11 | return `https://stackoverflow.com/search?q=${encodeURIComponent(searchTerm)}`;
12 | }
13 | const formatGoogleSearch = (searchTerm) => {
14 | return `https://www.google.com/search?q=${encodeURIComponent(searchTerm)}`;
15 | }
16 |
17 | module.exports = {
18 | formatGoogleLink,
19 | formatStackOverflowApiKey,
20 | formatStackOverflowSearch,
21 | formatGoogleSearch
22 | }
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 |
3 | ----------
4 |
5 | ## [0.0.5] - 2021-06-06
6 | ### Added
7 |
8 | - Integrated with Stackoverflow API
9 | - Search for Selection in Google Ctrl + Alt + S
10 | - Search for Selection in StackOverflow Ctrl + Alt + S
11 |
12 | ----------
13 | ## [0.0.4] - 2021-06-05
14 | ### Added
15 | - Search Any Text in Google Directly Ctrl + Alt + G
16 |
17 |
18 |
19 | ### Changed
20 | - Changed the category of the extension to Error Help
21 | - now you can search for all available commands by searching 'Error Help'
22 |
23 | ----------
24 | ## [0.0.3] - 2021-06-05
25 | ### Added
26 | - Search on Google functionality
27 | - Search on Github functionality
28 | - Search on Youtube functionality
29 |
30 | ### Changed
31 | - Formatted the Changelog
32 | - Updated the ReadMe.md
33 |
34 | ----------
35 | ## [0.0.2] - 2021-06-04
36 | ### Added
37 | - Initial release
38 | - Search on StackOverflow functionality
39 |
40 |
--------------------------------------------------------------------------------
/searches/index.js:
--------------------------------------------------------------------------------
1 | const vscode = require('vscode');
2 | const { SITE_NONE } = require('../constants');
3 | const { formatGoogleLink } = require('../helperUtils/LinkUtil')
4 | const opn = require('opn');
5 |
6 | const allErrorsInQuickPick = async(currentlyOpenTabfile, type) => {
7 | const diagnostics = vscode.languages.getDiagnostics(currentlyOpenTabfile.uri)
8 | .filter(err => {
9 | return err.severity === 0;
10 | }).map(err => {
11 | let place = 'Ln ' + err.range.start.line + ' Ch ' + err.range.start.character + ' | ' + currentlyOpenTabfile.fileName;
12 | return {
13 | label: err.message,
14 | detail: place,
15 | err: err
16 | }
17 | });
18 | if (diagnostics && diagnostics.length > 0) {
19 | const selected = await vscode.window.showQuickPick(diagnostics, {
20 | matchOnDetail: true,
21 | });
22 | if (selected) {
23 |
24 | const { code, message } = selected.err;
25 | // vscode.env.openExternal(vscode.Uri.parse(formatGoogleLink(code, message, type)));
26 | opn(formatGoogleLink(code, message, type));
27 | }
28 | } else {
29 | vscode.window.showInformationMessage('No Errors found !');
30 | }
31 | }
32 |
33 | const webSearchText = async() => {
34 | const text = await vscode.window.showInputBox();
35 | if (text) {
36 | // vscode.env.openExternal(vscode.Uri.parse(formatGoogleLink("", text, SITE_NONE)));
37 | opn(formatGoogleLink(formatGoogleLink("", text, SITE_NONE)));
38 | }
39 | }
40 |
41 | module.exports = {
42 | allErrorsInQuickPick,
43 | webSearchText
44 | }
--------------------------------------------------------------------------------
/extension.js:
--------------------------------------------------------------------------------
1 | const vscode = require('vscode');
2 | const { searchInGoogle } = require('./searches/googleErrorSearch');
3 | const { searchInYoutube } = require('./searches/youtubeErrorSearch');
4 | const { searchInStackOverflow } = require('./searches/stackoverflowErrorSearch');
5 | const { searchInGithub } = require('./searches/githubErrorSearch');
6 | const { webSearchText } = require('./searches');
7 | const { getSelectedText } = require('./helperUtils/VsCodeUtils');
8 | const { stackOverflowApiSearch } = require('./helperUtils/StackOverflowApi')
9 |
10 | /**
11 | * @param {vscode.ExtensionContext} context
12 | */
13 | const activate = (context) => {
14 | context.subscriptions.push(
15 | vscode.commands.registerCommand('error-help.searchGoogle', () => {
16 | let currentlyOpenTabfile = vscode.window.activeTextEditor.document;
17 | searchInGoogle(currentlyOpenTabfile);
18 | })
19 | );
20 | context.subscriptions.push(
21 | vscode.commands.registerCommand('error-help.searchYoutube', () => {
22 | let currentlyOpenTabfile = vscode.window.activeTextEditor.document;
23 | searchInYoutube(currentlyOpenTabfile);
24 | })
25 | );
26 | context.subscriptions.push(
27 | vscode.commands.registerCommand('error-help.searchStackOverflow', () => {
28 | let currentlyOpenTabfile = vscode.window.activeTextEditor.document;
29 | searchInStackOverflow(currentlyOpenTabfile);
30 | })
31 | );
32 | context.subscriptions.push(
33 | vscode.commands.registerCommand('error-help.searchGithub', () => {
34 | let currentlyOpenTabfile = vscode.window.activeTextEditor.document;
35 | searchInGithub(currentlyOpenTabfile);
36 | })
37 | );
38 | context.subscriptions.push(
39 | vscode.commands.registerCommand('error-help.webSearch', () => {
40 | webSearchText();
41 | })
42 | );
43 | context.subscriptions.push(
44 | vscode.commands.registerCommand('error-help.stackOverflowAPI', () => {
45 | stackOverflowApiSearch(getSelectedText())
46 | })
47 | );
48 | }
49 |
50 | // this method is called when your extension is deactivated
51 | function deactivate() {}
52 |
53 | module.exports = {
54 | activate,
55 | deactivate
56 | }
--------------------------------------------------------------------------------
/vsc-extension-quickstart.md:
--------------------------------------------------------------------------------
1 | # Welcome to your VS Code Extension
2 |
3 | ## What's in the folder
4 |
5 | * This folder contains all of the files necessary for your extension.
6 | * `package.json` - this is the manifest file in which you declare your extension and command.
7 | * The sample plugin registers a command and defines its title and command name. With this information VS Code can show the command in the command palette. It doesn’t yet need to load the plugin.
8 | * `extension.js` - this is the main file where you will provide the implementation of your command.
9 | * The file exports one function, `activate`, which is called the very first time your extension is activated (in this case by executing the command). Inside the `activate` function we call `registerCommand`.
10 | * We pass the function containing the implementation of the command as the second parameter to `registerCommand`.
11 |
12 | ## Get up and running straight away
13 |
14 | * Press `F5` to open a new window with your extension loaded.
15 | * Run your command from the command palette by pressing (`Ctrl+Shift+P` or `Cmd+Shift+P` on Mac) and typing `Hello World`.
16 | * Set breakpoints in your code inside `extension.js` to debug your extension.
17 | * Find output from your extension in the debug console.
18 |
19 | ## Make changes
20 |
21 | * You can relaunch the extension from the debug toolbar after changing code in `extension.js`.
22 | * You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes.
23 |
24 | ## Explore the API
25 |
26 | * You can open the full set of our API when you open the file `node_modules/@types/vscode/index.d.ts`.
27 |
28 | ## Run tests
29 |
30 | * Open the debug viewlet (`Ctrl+Shift+D` or `Cmd+Shift+D` on Mac) and from the launch configuration dropdown pick `Extension Tests`.
31 | * Press `F5` to run the tests in a new window with your extension loaded.
32 | * See the output of the test result in the debug console.
33 | * Make changes to `src/test/suite/extension.test.js` or create new test files inside the `test/suite` folder.
34 | * The provided test runner will only consider files matching the name pattern `**.test.ts`.
35 | * You can create folders inside the `test` folder to structure your tests any way you want.
36 | ## Go further
37 |
38 | * [Publish your extension](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) on the VSCode extension marketplace.
39 | * Automate builds by setting up [Continuous Integration](https://code.visualstudio.com/api/working-with-extensions/continuous-integration).
40 |
--------------------------------------------------------------------------------
/helperUtils/StackOverflowApi.js:
--------------------------------------------------------------------------------
1 | const { formatStackOverflowApiKey, formatStackOverflowSearch, formatGoogleSearch } = require("./LinkUtil");
2 | const axios = require('axios');
3 | const vscode = require('vscode');
4 | const opn = require('opn');
5 |
6 | const stackOverflowApiSearch = async(searchText) => {
7 |
8 | if (!searchText || searchText.trim() === '') {
9 | return null;
10 | }
11 |
12 | const regex = /\[(.+?)\]/gm;
13 | let processedSearchText = searchText;
14 | let match;
15 | let searchTags = [];
16 |
17 | while ((match = regex.exec(processedSearchText)) !== null) {
18 | if (match.index === regex.lastIndex) {
19 | regex.lastIndex++;
20 | }
21 | match.forEach((m, index) => {
22 | if (index === 0) {
23 | processedSearchText = processedSearchText.replace(m, "").trim();
24 | } else if (index === 1) {
25 | searchTags.push(m);
26 | }
27 | });
28 | }
29 | const stackoverflowApiKey = 'n5E2Yl989XPdQpjT6qCedQ((';
30 | const encodedTagsString = encodeURIComponent(searchTags.join(';'));
31 | const encodedAPISearchTerm = encodeURIComponent(processedSearchText);
32 |
33 | const apiSearchUrl = formatStackOverflowApiKey(encodedAPISearchTerm, encodedTagsString, stackoverflowApiKey);
34 |
35 | const questionsMeta = [
36 | { title: `🔎 Search Stackoverflow: ${searchText}`, url: formatStackOverflowSearch(searchText) },
37 | { title: `🔎 Search Google: ${searchText}`, url: formatGoogleSearch(searchText) },
38 |
39 | ];
40 |
41 | const result = await axios.default.get(apiSearchUrl);
42 | if (result) {
43 | const { items } = result.data;
44 | if (items && items.length > 0) {
45 | items.forEach((question, index) => {
46 | questionsMeta.push({
47 | title: `${index+1} ⛳${question.score} ${question.is_answered ? '✔' : '😕'}-${question.title} 🏷️ [${question.tags.join('|')}`,
48 | url: question.link
49 | })
50 | })
51 | } else return null;
52 | } else return null;
53 |
54 | const questionTitles = questionsMeta.map(question => question.title)
55 | const selectedTitle = await vscode.window.showQuickPick(questionTitles, { canPickMany: false });
56 | if (selectedTitle) {
57 | const selectedQuestionMeta = questionsMeta.find(q => q.title === selectedTitle);
58 | const selectedQuestionUrl = selectedQuestionMeta ? selectedQuestionMeta.url : '';
59 | if (selectedQuestionUrl) {
60 | opn(selectedQuestionUrl);
61 | }
62 | }
63 |
64 | }
65 | module.exports = {
66 | stackOverflowApiSearch
67 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Error Help
2 |
3 | This is a very simple extension developed to help developers in searching help for errors🎆.
4 |
5 | ## What can this extension do ?
6 |
7 | > Search errors in the code in Google
8 |
9 | > Search errors in the code in Stackoverflow
10 |
11 | > Search errors in the code in Github
12 |
13 | > Search errors in the code in Youtube
14 |
15 | > Search a selected text in Google
16 |
17 | > Search a selected text in StackOverflow
18 |
19 | > Directly navigate to stackoverflow questions based on the search
20 |
21 |
22 | -
23 |
24 |
25 |
26 | ## How to use this extension ?
27 |
28 | ### Search Directly on Google
29 | - Press Ctrl + Alt + G, insert the text and press Enter.
30 | - Press Ctrl + Shift + P, type `>Search Text Google` ,insert the text and press Enter.
31 | -
32 |
33 |
34 |
35 | ### Search selected text using StackOverflow API
36 | 1. Select a portion of text in the editor.
37 | 2. Press Ctrl + Alt + S, wait for the result to display.
38 | 3. Select any option you like.
39 | -
40 |
41 |
42 | ### Search errors in the code in Google
43 | - Press Ctrl + Shift + P, type `>Search Google` ,select the error and press Enter.
44 |
45 | ### Search errors in the code in Github
46 | - Press Ctrl + Shift + P, type `>Search Github` ,select the error and press Enter.
47 |
48 | ### Search errors in the code in Youtube
49 | - Press Ctrl + Shift + P, type `>Search Youtube` ,select the error and press Enter.
50 |
51 | ### Search errors in the code in Stackoverflow
52 | - Press Ctrl + Shift + P, type `>Search StackOverflow` ,select the error and press Enter.
53 |
54 |
55 | 
56 |
57 |
58 | ## Future Work
59 | - Capture Exception Stacktrace.
60 |
61 | ## Contribute to this Extensions and Add your ideas.
62 |
63 | - [Github Repository](https://github.com/gihanrcg/error-help)
64 |
65 | Add your ideas as issues and code as PRs in the repository and make sure to star the repository 😊
66 |
67 | 1. Fork the repository
68 | 2. Create your feature branch `git checkout -b feature/`
69 | 3. Commit and Push your Changes
70 | 4. Add a Pull Request. Make sure to add the badge **FEATURE**
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "error-help",
3 | "displayName": "Error Help",
4 | "publisher": "GihanSiriwardhana",
5 | "description": "Search help for your errors and warnings",
6 | "icon": "images/icon.png",
7 | "repository": {
8 | "type": "git",
9 | "url": "https://github.com/gihanrcg/error-help.git"
10 | },
11 | "version": "0.0.5",
12 | "engines": {
13 | "vscode": "^1.56.0"
14 | },
15 | "categories": [
16 | "Other"
17 | ],
18 | "activationEvents": [
19 | "onCommand:error-help.searchGoogle",
20 | "onCommand:error-help.searchYoutube",
21 | "onCommand:error-help.searchStackOverflow",
22 | "onCommand:error-help.searchGithub",
23 | "onCommand:error-help.webSearch",
24 | "onCommand:error-help.stackOverflowAPI"
25 | ],
26 | "main": "./extension.js",
27 | "contributes": {
28 | "commands": [{
29 | "command": "error-help.searchGoogle",
30 | "title": "Search Google",
31 | "category": "Error Help"
32 | },
33 | {
34 | "command": "error-help.searchYoutube",
35 | "title": "Search Youtube",
36 | "category": "Error Help"
37 | },
38 | {
39 | "command": "error-help.searchStackOverflow",
40 | "title": "Search Stack Overflow",
41 | "category": "Error Help"
42 | },
43 | {
44 | "command": "error-help.searchGithub",
45 | "title": "Search Github",
46 | "category": "Error Help"
47 | },
48 | {
49 | "command": "error-help.webSearch",
50 | "title": "Search Text Google",
51 | "category": "Error Help"
52 | },
53 | {
54 | "command": "error-help.stackOverflowAPI",
55 | "title": "Search Stackoverflow API",
56 | "category": "Error Help"
57 | }
58 | ],
59 | "keybindings": [{
60 | "command": "error-help.webSearch",
61 | "key": "ctrl+alt+g",
62 | "mac": "cmd+alt+g"
63 | },
64 | {
65 | "command": "error-help.stackOverflowAPI",
66 | "key": "ctrl+alt+s",
67 | "mac": "cmd+alt+s"
68 | }
69 | ],
70 | "menus": {
71 | "editor/context": [{
72 | "command": "error-help.stackOverflowAPI",
73 | "group": "Error Help",
74 | "when": "editorHasSelection"
75 | }]
76 | }
77 | },
78 | "scripts": {
79 | "lint": "eslint .",
80 | "pretest": "npm run lint",
81 | "test": "node ./test/runTest.js"
82 | },
83 | "devDependencies": {
84 | "@types/vscode": "^1.56.0",
85 | "@types/glob": "^7.1.3",
86 | "@types/mocha": "^8.0.4",
87 | "@types/node": "14.x",
88 | "eslint": "^7.19.0",
89 | "glob": "^7.1.6",
90 | "mocha": "^8.2.1",
91 | "typescript": "^4.1.3",
92 | "vscode-test": "^1.5.0"
93 | },
94 | "dependencies": {
95 | "axios": "^0.21.1",
96 | "dotenv": "^10.0.0",
97 | "opn": "^6.0.0"
98 | }
99 | }
--------------------------------------------------------------------------------