visual-studio-code

Show current branch on terminal

大憨熊 提交于 2021-01-29 04:52:01
问题 Is there any way to show in Terminal of VS Code to show in brackets current branch ? I saw it somewhere but not sure how it can be done. By some extension or whatever.. C:/myUser/project> git status I would like to see it something like: C:/myUser/project>(master) git status 回答1: For Linux Terminal You can modify the PS1 variable. PS1 is a Bash Environment Variable that represents the primary prompt string which is displayed when the shell is ready. You can achieve your result by modifying

How can I let vscode know when SCM visible or not?

风流意气都作罢 提交于 2021-01-29 04:46:51
问题 I would like to make toggle key with VScode's keybinding. with alt + 1 to 5 to toggle explorer and search, scm, debug extension I could find "explorerViewletVisible" or "searchViewletVisible" But I couldn't find visibilities of scm (source control) and debug, extensions. I use "sideBarVisible" for these key but it is not a perfect solution. Does Anyone know right 'when expression' of these situations? { "key": "alt+1", "command": "workbench.view.explorer", }, { "key": "alt+1", "command":

VS code: JDK 13 not working in WSL ubuntu

萝らか妹 提交于 2021-01-29 03:11:38
问题 For some reason whenever I try running VS code within the WSL it says that "The JAVA_HOME environment variable (/mnt/c/Program Files/jdk-13.0.1) does not point to a JDK." When I simply run VS code normally(not in WSL) it works fine and there are no issues. If anyone could help it would be greatly appreciated, Thanks 来源: https://stackoverflow.com/questions/58739440/vs-code-jdk-13-not-working-in-wsl-ubuntu

tsconfig.json ignored by Visual Studio Code

烂漫一生 提交于 2021-01-29 03:10:49
问题 I have a tsconfig.json file at the root of my project: { "compilerOptions": { "target": "ES5", "module": "commonjs", "emitDecoratorMetadata": true, "experimentalDecorators": true, "sourceMap": true, "noEmitHelpers": true, "baseUrl": ".", "paths": { "services/*": ["./src/app/shared/services/*"] } }, "compileOnSave": false, "buildOnSave": false, "awesomeTypescriptLoaderOptions": { "forkChecker": true, "useWebpackText": true } } I am trying to define my paths so we don't need to use relative

VS code: JDK 13 not working in WSL ubuntu

邮差的信 提交于 2021-01-29 03:07:26
问题 For some reason whenever I try running VS code within the WSL it says that "The JAVA_HOME environment variable (/mnt/c/Program Files/jdk-13.0.1) does not point to a JDK." When I simply run VS code normally(not in WSL) it works fine and there are no issues. If anyone could help it would be greatly appreciated, Thanks 来源: https://stackoverflow.com/questions/58739440/vs-code-jdk-13-not-working-in-wsl-ubuntu

How can I use Windows' built-in OpenSSH ssh-agent in VS Code, instead of Git bash's?

六月ゝ 毕业季﹏ 提交于 2021-01-29 02:08:15
问题 I am running OpenSSH on Windows, using the built-in OpenSSH included since the Autumn/Fall Creators Update. I am using ssh just fine in my PowerShell, but Visual Studio Remote Development (and I guess Git for Windows?) are not using my OpenSSH. Instead, they seem to be using the Git for Windows SSH client from MinGW. This means all my ssh-add ed keys are not present in the VS or Git ssh-agent . How can I get Visual Studio (and maybe Git?) to use the builtin OpenSSH install so that I can use

Duplicate import suggestions in VS Code

安稳与你 提交于 2021-01-28 22:59:51
问题 Recently I am being shown duplicate suggestions like this Does anyone know how to fix this? 回答1: So actually I figured out the issue. If you have installed both Path Intellisense and Node Module Intellisense extensions, both will search for all the modules in the project and hence resulting in duplicates showing up. The way to solve this issue is to add the following to settings.json "node-module-intellisense.scanFileModules": false 来源: https://stackoverflow.com/questions/63095724/duplicate

Cannot find name 'jQuery' error in controller.js

好久不见. 提交于 2021-01-28 18:36:51
问题 I am developing a UI5 app in VS Code. I added a new count function to the *.controller.js file, and in order to display the count from the server, I am using jQuery like in the following code: jQuery.each(this._mFilters, function (sFilterKey, oFilter) { oModel.read("/portfolios/$count", { filters: oFilter, success: function (oData) { var sPath = "/" + sFilterKey; oViewModel.setProperty(sPath, oData); } }); }); Unfortunately, I get the following error: Does anyone know why was the error

Change text by Command with VS-Code-Extension

陌路散爱 提交于 2021-01-28 12:30:34
问题 I want to implement a second code formatting. This formatting should be executable by an additional command. I have already registered a DocumentFormattingEditProvider and that is fine. vscode.languages.registerDocumentFormattingEditProvider({ language: 'sosse' }, { provideDocumentFormattingEdits(document: vscode.TextDocument) { return formattingAction(document); }, }); But in my case I need a second formatting action for one-liners, which is executed by an command. I thought about using:

Get focused Explorer folder or file in an extension when command triggered by a shortcut, not by context menu

三世轮回 提交于 2021-01-28 12:11:57
问题 A follow-on to this question: How to get file name or path in vscode extension when user right click on file in explorer/context? My command expects to receive the uri to the item selected with a right-click; and in fact it does if I invoke the command by choosing it from the context menu.... If, however, I bind a shortcut key to this command (and correctly set the "when" context to only activate when explorer has focus) I do not receive the uri; that parameter is undefined . Obviously there