vscode-extensions

Is it possible to Auth to an OAuth 2.0 API from inside a vscode extension

核能气质少年 提交于 2021-02-07 15:31:33
问题 My team writes a monitoring system which we have recently migrated the definitions of our monitoring into a git repo. These definitions are comprised of some json and powershell files. VSCode is an ideal scenario for editing and dealing with git. The problem is while developing the monitoring it is nice to be able to execute it against a test environment. Previously all editing was done through a web interface and we allowed ad hoc execution of the powershell against test machines through an

A method to expose the VSCode active 'when Clause Contexts'

依然范特西╮ 提交于 2021-02-07 10:24:56
问题 I'm searching for a method to expose VSCode active 'when Clause Contexts' e.g 'explorerResourceIsFolder'. To give you a better understanding of my use case, here's some background on the project to which a VSCode extension is being developed. My extension will facilitate programming in and controlling VSCode by voice. Caster is a Dragonfly-Based Voice Programming Toolkit. Dragonfly is a speech recognition framework. It is a Python package which offers a high-level object model and allows its

vscode api for file explorer

自作多情 提交于 2021-02-05 05:57:05
问题 I am onto writing a VSCode extension and need to create files / remove files based in a folder / subfolder selected by the user. Is there a way to find selected folder from the explorer tree through visual studio code api? One can track the opened file through active text editor or onDidOpenTextDocument() . I am interested in finding if user has selected a folder and if so the path to selected folder. For example: workspace.rootPath provides a root of the opened project. Similarly, how do I

How to do Coverage exports for vscode extensions

大兔子大兔子 提交于 2021-02-04 15:26:37
问题 I have seen a lot of tutorials how to make vscode extensions. Like: https://code.visualstudio.com/docs/extensions/testing-extensions And there is many tutorials how to do coverage exports, there many ways how to do it, but I didn't seen good examples which would follow the examples from their docs and work with vscode extensions (they need the extensionHost instead of nodejs). I have all the tests written in the mocha which is bundled in the vscode as proposed by their documents. I tried to

How to do Coverage exports for vscode extensions

廉价感情. 提交于 2021-02-04 15:26:06
问题 I have seen a lot of tutorials how to make vscode extensions. Like: https://code.visualstudio.com/docs/extensions/testing-extensions And there is many tutorials how to do coverage exports, there many ways how to do it, but I didn't seen good examples which would follow the examples from their docs and work with vscode extensions (they need the extensionHost instead of nodejs). I have all the tests written in the mocha which is bundled in the vscode as proposed by their documents. I tried to

Is there a way to make install button work in VSCode extension Webview?

霸气de小男生 提交于 2021-01-29 22:09:01
问题 We are making a VSCode extension on gatsby.js, and we have a tree view that shows a webview when clicked. In the webview, we have an 'install button' that we want to have it run 'npm install pluginName' by sending the command to the terminal. We have a method in a class called 'installPlugin', which parses through npm API to get the plugin data such as the npm install plugin command. For the webview content, we are using panel.webview.html to add the html string. On the button tag, we have an

Is there a way to make install button work in VSCode extension Webview?

不问归期 提交于 2021-01-29 21:28:03
问题 We are making a VSCode extension on gatsby.js, and we have a tree view that shows a webview when clicked. In the webview, we have an 'install button' that we want to have it run 'npm install pluginName' by sending the command to the terminal. We have a method in a class called 'installPlugin', which parses through npm API to get the plugin data such as the npm install plugin command. For the webview content, we are using panel.webview.html to add the html string. On the button tag, we have an

Same import, different errors

孤者浪人 提交于 2021-01-29 15:33:12
问题 I am making tests for my code, but I'm facing a strange import error. Notes: I am using VSCode version: 1.46.1 PYTHONPATH is set to project's root Folder structure is this: -app.py -models ---language.py ---category.py -my_tests ---unit ------models ---------category_test.py ---------language_test.py In category_test, I do import "Category" class by using: from models.category import Category In language_test, I do import "Language" class by using: from models.language import Language In

Vscode extension, setting window.activeTextEditor

旧街凉风 提交于 2021-01-29 11:26:51
问题 How can I use the vscode extension api to set the activeTextEditor ? The reason I need this is because my extension depends on an external call to extension B, and extension B does not take an argument for editor. It just looks at vscode.window.activeTextEditor . My extension is a webview which calls Extension B when something is clicked on the webview. At that moment in time, the 'active tab' is the webview, which is not activeTextEditor that I want. I want to do something like vscode.window

Why I have error overlapping range is not allowed?

二次信任 提交于 2021-01-29 09:25:29
问题 I am building formatter extension. Unfortunately I cannot find a lot of examples how to tackle simple tasks. This is my files Formatter provider and I try to capitalize some keywords. This works first time after extension refresh but not second time. What did I do wrong? 'use strict'; import * as vscode from 'vscode'; export class STFormatterProvider implements vscode.DocumentFormattingEditProvider { public out: Array<vscode.TextEdit> = []; provideDocumentFormattingEdits(document: vscode