vscode-extensions

How to listen to events in vscode's TreeDataProvider?

流过昼夜 提交于 2021-02-20 19:02:45
问题 I'm playing with building a vscode extension, using the TreeDataProvider API. I have a list of things showing, each TreeItem a composed label string, all works fine. What I am missing is a way of reacting to click events on any of the items. VSCode selects the item when you click on it, but I'd like to listen to that event, get the item in question etc... It's not obvious to me from the docs. In general, customizing the TreeItem is severely lacking, e.g. being able to colorize the label or

Extension for VScode to find unused public function in the nodejs application

梦想与她 提交于 2021-02-19 05:49:25
问题 I need the VScode extension to find the un-used public function in my Nodejs application. 回答1: I think you mean the quality tool checker for JS: JSLint https://marketplace.visualstudio.com/items?itemName=ajhyndman.jslint 来源: https://stackoverflow.com/questions/48685199/extension-for-vscode-to-find-unused-public-function-in-the-nodejs-application

VScode API why can't I get the current line?

独自空忆成欢 提交于 2021-02-19 03:01:09
问题 I am using typescript to write a vs code extension and for some reason I am unable to get the current line. The function I am trying to make is: function makeFrame() { vscode.window.activeTextEditor.selection.active.line; } Which fails with error: Object is possibly undefined The import statement is: import {window, commands, Disposable, ExtensionContext, StatusBarAlignment, StatusBarItem, TextDocument} from 'vscode'; What am I doing wrong? (I am both new to TypeScript and writing extensions

Visual Studio Code: Creating an Extension

泄露秘密 提交于 2021-02-11 15:22:55
问题 I am writing an extension for vs code and want to know if it's possible to add a tab to this bottom pane: 回答1: I doesn't look like the API supports adding a new tab to that panel, but you can create and write to a custom Output Channel, by using this: https://code.visualstudio.com/docs/extensionAPI/vscode-api#OutputChannel 来源: https://stackoverflow.com/questions/53564607/visual-studio-code-creating-an-extension

I am trying to make some interesting changes to the editing area of vscode. I want to know whether the API supports the following two features?

限于喜欢 提交于 2021-02-11 14:50:54
问题 First, does the vscode editor area support the insertion of some lines, only for display purposes, and does not affect the properties of the editing area itself, such as the line number unchanged. I know that Gitlens can display the relevant information of the author after a certain line, now I want to insert these non-editable information into separate lines. Second, in the editor area where the breakpoint is marked during debugging (that is, to the left of the line number), can a new column

How to store data for each “user” - VSCode Extention

▼魔方 西西 提交于 2021-02-11 04:31:39
问题 I'm making a extension for VSCode. What method is generally to store data? For example, settings for each user, not for each workspace. I knew the way to store data in user's workspace. But it is troublesome to set values for each workspace again and again. 回答1: I've found a answer by myself. ExtensionContext.globalState https://code.visualstudio.com/api/extension-capabilities/common-capabilities Code Sample(read and write) function method_registerCommand(context){ var store = context

Get vscode registerCompletionItemProvider to work in a json file with a `word.` trigger

我只是一个虾纸丫 提交于 2021-02-10 15:46:12
问题 I am using this code to try to register a CompletionProvider in my extension. It is essentially the code from the sample completionProvider sample https://github.com/microsoft/vscode-extension-samples/blob/master/completions-sample/src/extension.ts. I want it triggered by a . as in "launches." in my extension command in keybindings.json ultimately but it is doing nothing in any json file. Nothing happens, no error. function activate(context) { loadLaunchSettings(context); activeContext =

How can I make a POST request in a VSCode extension

好久不见. 提交于 2021-02-10 05:26:15
问题 I want to make a VSC extension that involves posting to my API, however when I write my fetch syntax out to POST to my server, it doesn't work. So I thought maybe I need to add node-fetch, so I did npm i --save node-fetch and it says This expression is not callable. and once again, it still can't make the POST request. 回答1: I have used axios to post to a URL: import * as FormData from 'form-data'; import axios from 'axios'; const form = new FormData(); form.append('srcmbr', save_folderContent

How to get VS Code debug data like breakpoints, steps, line code

拟墨画扇 提交于 2021-02-09 11:13:01
问题 I'm working on an academic software visualization project that aims to capture debug sessions and display graphically. For this, I am trying to create a Visual Studio Code Extension where I can get the data exchanged with the current language debugger, such as added breakpoints, stepsinto, stepsover, debug session start, debug file, context variables, line code debugged . That is, the same data that is displayed in the VS Code windows: VARIABLES, WATCH, CALL STACK, LOADED SCRIPTS and

How to get VS Code debug data like breakpoints, steps, line code

别等时光非礼了梦想. 提交于 2021-02-09 11:11:58
问题 I'm working on an academic software visualization project that aims to capture debug sessions and display graphically. For this, I am trying to create a Visual Studio Code Extension where I can get the data exchanged with the current language debugger, such as added breakpoints, stepsinto, stepsover, debug session start, debug file, context variables, line code debugged . That is, the same data that is displayed in the VS Code windows: VARIABLES, WATCH, CALL STACK, LOADED SCRIPTS and