visual-studio-code

Visual Studio Code IntelliSense not working for Node.js

爷,独闯天下 提交于 2021-01-27 05:22:41
问题 I have gone through the following threads before posting this question. Visual Studio Code: Intellisense not working Visual Studio Code Intellisense not working for Javascript I have Visual Studio version 1.26.1 on my Windows 10 laptop. I am learning Node.Js, so I wanted to learn various functionalities in 'FS' module. I created a new file called 'app1.js' in Visual Studio Code, and wrote the following line of code. fsObj = require('fs'); After this when I typed fsObj. to see what functions

How to create file in current explorer directory in vs code using only keys?

江枫思渺然 提交于 2021-01-27 05:16:10
问题 Like in vim nerd tree plugin, when you push 'm' then 'a' button in vim nerd tree you can add file in current directory where cursor on Nerd tree. Is it possible do it in vs code? Maybe some plugins? 回答1: Unfortunately there is no such plugin yet but you could define some customized keybindings which resembles NERDTree to some extent ( File > Preferences > Keyboard Shortcuts and click on the link keybindings.json ): [ { "key": "f", "command": "explorer.newFile", "when": "explorerViewletFocus &

VSCode: How to perform “Clear Search Results” in “Find in Files” without using the mouse?

China☆狼群 提交于 2021-01-27 04:55:36
问题 After I search through files in the project directory with Command-Shift-f, the files that are opened are have the search string highlighted. The only way to unhighlight them seems to be to clear the search results. But typing "Esc" doesn't do that. I have to click the top-right corner "Clear Search Results" button. Is there a keyboard shortcut for that? 回答1: Update: Now you can add keybindings for these commands. Example: { "key": "cmd+escape", "command": "search.action.clearSearchResults",

What's the difference between “editor.insertSpaces” and “editor.tabSize” in settings?

时光毁灭记忆、已成空白 提交于 2021-01-27 04:41:40
问题 How are they interpreted differently? I can only see what "editor.tabSize" does, which is the number of spaces that a tab occupies. Thank you. 回答1: From the configuration file: { // Controls the rendering size of tabs in characters. // If set to auto, the value will be guessed based on the opened file. "editor.tabSize": 4, // Controls if the editor will insert spaces for tabs. // If set to auto, the value will be guessed based on the opened file. "editor.insertSpaces": true } As you can see

visual studio code remote ssh over ssh proxy

烈酒焚心 提交于 2021-01-27 04:41:09
问题 I am trying to use vs-code's remote-ssh extension to connect to a server over a ssh tunnel. The server is part of an internal cluster that does not have a public ip address, and I connect to it via a proxy in the cluster using the method outlined in link: # ~/.ssh/config Host internal* User root ProxyCommand ssh user@firewall 'nc %h %p' When I try to connect to the internal server, I get the following error dialog: Could not establish connection to "internal-server". The process tried to

Is there a way to set up a shortcut to call Build Tasks in VS Code?

安稳与你 提交于 2021-01-27 02:55:42
问题 Currently, I have a Build Task set up in Visual Studio Code (not Visual Studio). When I press Ctrl + Shift + B , I get a list of my build tasks, I then have to select my task and then it will compile and run my program. Is there an easier way to do this, so instead of Ctrl + Shift + B -> Enter , I can just press one button and have a preset Build Task run? Either a keyboard button or a GUI button will work great. 回答1: Mark the task as your default build task via Terminal -> Configure Default

VS Code alternative to webstorm's “find usages”

眉间皱痕 提交于 2021-01-26 22:29:32
问题 In WebStorm there's a really nice feature that you can right-click a file and choose "Find usages...", what would output all the files and all the line numbers in the project where that file is referenced (e.g. where path to it is specified as a string in JS require ). I really love that feature, since it's very useful for refactoring - before I delete or edit smth I might want to find usages first to get clear understanding of what other things would be affected. Is there a way I could do

How to disable error highlighting in VS Code?

 ̄綄美尐妖づ 提交于 2021-01-26 21:55:22
问题 I need to disable error highlighting in Java files in VS Code. VS Code tries to check a Groovy file while thinking it is a Java file. As you can see in the picture all imports after the first and the types after the first field are highlighted red (due to missing semicolons). However I do not want the error check for this Groovy file. NOTE: I only have the plugins Clang, RedHat.Java, Markdown PDF, Sort Lines, and Uncrustify installed. Even if I disable all the red highlighting is visible. 回答1

How to disable error highlighting in VS Code?

喜夏-厌秋 提交于 2021-01-26 21:53:46
问题 I need to disable error highlighting in Java files in VS Code. VS Code tries to check a Groovy file while thinking it is a Java file. As you can see in the picture all imports after the first and the types after the first field are highlighted red (due to missing semicolons). However I do not want the error check for this Groovy file. NOTE: I only have the plugins Clang, RedHat.Java, Markdown PDF, Sort Lines, and Uncrustify installed. Even if I disable all the red highlighting is visible. 回答1

How to find unused flutter classes in Android Studio or Visual Studio Code

无人久伴 提交于 2021-01-26 20:35:40
问题 Because rapid change in app requirement from client, I have nearly 200 dart files, and many of them are unused. Is there any way for me to find unused classes except resorting to manually search one by one? In Android Studio, I can find java or kotlin classes which are unused by using "inspect code" feature. But I can't find any tools for the same purpose for dart / flutter. Thank you for your help in advance. 回答1: I'm not sure about unused classes per se. I know you can clean up unused