Has VS Code an autocomplete function for file paths?
For e.g. if I want to write the full path to js: "assets/libs/jquery.min.js"
Editors like Brackets.ie does this by default.
Visual code by itself has no Path intellisense, but you can use this plugin.
press f1 and copy this in it: ext install path-intellisense
Its a plug-in made by Christian Kohler, all props to him.
Plus, as Searene mentions in the comments, you may also want to set "path-intellisense.absolutePathToWorkspace": false in User Settings to make the auto-completion of absolute paths work.
Path Intellisense does not work for me, but Path Autocomplete works for me.
Installation:
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
ext install ionutvmi.path-autocomplete
You can also install it in the extensions tab(Ctrl+Shift+X).
Related
I have small problem with VSCode folder, that opened by default.
Problem description: I start new instance of VSCode (trough File->New Window), and then if I choose File->Open Folder it opens dialog with my Windows user folder as starting point (C:\Users\MyUser)
Question: How can I change that folder in settings (if it possible)? So by default it will show as start point for example D:\development\ ?
At the time I write this answer, this is not possible. There are two problems on Windows, and one problem on Mac and Linux:
VS Code does not provide a default path to the file dialog 1. It does remember the last folder that you opened a file in, but that path cannot be used as a default because it is overwritten constantly.
On Windows only, Electron ignores the default path when creating a file dialog if the default path is a directory 2.
An extension also cannot solve this, because extensions are not allowed to modify the File menu 3.
I think the best option at this point is to pin a folder to the Quick Access area in Windows Explorer, as suggested in a comment, or to put an actual shortcut in the user profile folder.
Workspaces and File > Open Recent may also be helpful if you often open the same folders.
Your main problem is that you are unable to open your specific folder in VScode.
To solve that you can simply open the terminal/cmd in that specific window by just typing cmd in your search bar or just by pressing shift+right-click in that folder.
Now your cmd is open and you just have to type "code ." in the cmd and press enter to open the current folder in your VSCode.
In case that code . doesn't work for you then you have to add the Vscode in the environment variables of your windows.
Visual Studio doesn't provide a specific feature to open a specific path. But there is a solution to your problem. You are saying that you want D:\develpment as a default when you open VS Code. You can go to that specific directory or create shortcut to desktop then click right click on that folder and then click on open with code. If you didnot see open with code then reinstall your VS code and check on open with code when you are reinstalling VS Code.
make a shortcut on the desktop for vscode and then modify it and add the folder after the .exe command. This will default open that folder when you double click on it.
Visual Studio Code can be installed in two ways - User setup and System setup. I strongly believe you have User setup installed in your PC. Try re-installing it System-wide. That should probably fix your problem.
For more information: https://code.visualstudio.com/docs/setup/windows#_user-setup-versus-system-setup
PS: A lot more information is needed, you can share a screenshot of the window and elaborate more on it.
I just installed the Visual Studio Code (v1.52.1) extension "Spelling Checker."
Now how do I use the thing?
I searched all the menus for a command to run this extension, or any extension. I asked Google "how to run a VSC extension" and only got matches that tell me how to install an extension. Apparently extensions are just supposed to run themselves.
There's a whole class of extensions for which that makes sense, such as extensions that add enhancements to editor windows. But there's another whole class of extensions, like this one, for which it makes no sense at all.
How do you run an extension?
This is confusing as the answer is spelled out in five-minute videos or is skirted around.
On your keyboard: Cmd+Shift+P (macOS) Ctrl+Shift+P (Windows, Linux, etc.) or under "View" and "Command Palette" opens the Command Palette so you can execute an extension's command such as "Browse Lite" for say https://github.com/antfu/vscode-browse-lite - hopefully, the developers say what the command is.
Note: Cmd+P (macOS) or Ctrl+P will search files by name. The shift is what's needed to launch the extension magic.
Open Visual studio code.
Go to extension option.
Then click on any extension.
After that disconnect your internet.
Then it will prompt for install extension manually.
Then it will ask to locate that .vsc file.
Select that and file and install it.
Recently I run into problem with ESlint extension in VS code. When I launch VS code and open up a js file, it popup message "Couldn't start client ESlint". It used to work fine. I tried to re-install eslint, VS code but it didn't help. Here are the versions I used.
VS code: 1.44.0 (user setup)
eslint: v6.8.0
ESLint Extension for VS code: 2.1.2
You need to dig a little bit more to get more details.
A good place to start would be to run the eslint show output command in VSCode. That should be a good starting point.
screenshot of ESLint: Show Output Command
The bottom line is that you need to follow the conventional installation path:
add eslint extension in vscode.
install eslint locally or globally via npm,
run eslint init in your project path and select proper configurations.
restart vscode just to make sure the settings are active.
again, the eslint output console should be a good starting point.
For me, it turns out I had the eslint.runtime and eslint.nodePath settings set to the specified node path on my system, but they were prefixed like this:
~/.nvm/versions/node/v14.17.0/bin/node
Using $HOME instead of ~ didn't solve it either.
I ended up having to specify an absolute path:
/home/<myusername>/.nvm/versions/node/v14.17.0/bin/node
This command won't work for me. I had installed the Visual Studio Keymap, but when I uninstalled that it made no difference. If I open Keyboard Shortcuts and try customizing it to some other keybinding, still nothing. I open the simplest javascript folder/file (folder with a single .js file) to test, simply putting the cursor on either side of the parens in console.log('hi');
Version is 1.28.2 (latest). The only other extensions I have installed are Debugger for Chrome & ESLint.
editor.action.jumpToBracket is what you want for .js files, Ctrl-Shift-\.
The "Go to matching pair" command: editor.emmet.action.matchTag is for html files.
I know I can use command "code" to open VS code or file, but I don't know what should I do to make it possible after I install VS code in Ubuntu.Thanks.
Launching from the Command Line
You can launch VS Code from the command line to quickly open a file, folder, or project. Typically, you open VS Code within the context of a folder. We find the best way to do this is to simply type:
code .
Tip: We have instructions for Mac users in our Setup topic that enable you to start VS Code from within a terminal. We add the VS Code executable to the PATH environment variable on Windows and Linux automatically during installation.
Sometimes you will want to open or create a file. If the specified files does not exist, VS Code will create them for you:
code index.html style.css readme.md
Tip: You can have as many file names as you want separated by spaces.
Source: https://code.visualstudio.com/Docs/editor/codebasics
So, there are a couple of solutions for this.
I've linked a video that shows you how to add vscode to $PATH
(which didn't work for me because I couldn't find the "shell:install path" command)
I uninstalled the vscode from my ubuntu and re-installed using sudo snap install --classic code
(This method worked for me)
Tell me which one works for you... and if you have extensions installed to your vscode then i guess you ought to make a backup or something.
Link to the video: https://youtu.be/iP5FKZXtDBs