I was wondering if there's a way to import other json files into your vscode settings.json.
I thought for sure I had found a way to do this in the past but I forgot to attempt to implement it and now I can't find a way to do it.
For example, let's say I have a bunch of editor settings, but then I also have color custommizations as well as certain extension settings.
What I'd like is something like an editor-settings.json and a token-colors.json file that I can include in my main settings.json file with something like
{
"source": [
"./editor-settings.json",
"./token-colors.json"
]
}
Hopefully I've explained well what I'm looking for and someone can help me find it.
Thanks for taking the time to read and respond. :)
Related
I thought this page would be very useful for me. So I wanted to save it on my local computer. But I could not copy the text in it.
I tried several ways:
right-click: invalid
try to find the file: don't know the name
search on Google but there is no solution now
Can somebody help me? Thank you very much!
The file is called vs_code_editor_walkthrough.ts in the GitHub repository for Visual Studio Code. You stated you were after the text of the file, so if you view it in its raw form you can easily get all of the text in its markdown format.
It won't look anywhere near as pretty as Visual Studio Code renders it. If you want to achieve that look, you'll probably need to be savvy with TypeScript, something I am not.
I know this has been answered somewhere before, but for the life of me I cannot figure out how to properly Google this query. I got a new computer and I've mostly setup my Visual Studio Code environment, but I have never liked the shorthand directory structure if defaults to. I want to change my directories to be full dropdowns and not a one-line somedirectory/subdirectory/subdirectory/something.js
Apparently there is some fancy word for it but I have no idea what that word is and it's making my searching surprisingly difficult.
So, what setting do I need to change in VScode to make all of my directories follow the format that Collection has in the example below and not like lessons/flashcards?
Thanks!
TLDR; I want every directory to be a full dropdown. None of this lessons/flashcards nonsense.
To Achieve this go to your vs code settings and search Compact Folders. It will be checked by default. Uncheck that and it will work.
My VScode is jumping to the next line when writing code. It doesn't matter what or where I'm writing.
e.g:
export class FeatureModule{}
becomes
export class
FeatureModule{}
because I was thinking about the name for the module for a second...
It's extremly annoying and I can't find a setting that does the trick.
It also does not seems like it is any extension, because I have another PC where it does not happen and there I have the same Extensions.
Maybe there is a way to copy a "profile" with all settings and Extensions of the working VScode to the non-working one?
Cheers
was able to solve the problem by using Sync Settings Extension
No clue which extension or setting triggers the behavior described above...
I'm going to start developing in Javascript only, since Eclipse's js support isn't as good as it's java's, I did some search and found that VSCode seems to be on the cutting edge of javascript development nowadays. So, I'm migrating from Eclipse to VSCode, never liked Eclipse that much but I simply am way more effective with those two commands/hotkeys. So I'll give this example for those who aren't familiar:
foo.js
var foo = {
doSomething: function(){
console.log("hello world");
}
}
module.exports = foo;
bar.js
var foo = require('./foo')
foo.doSomething();
Assuming this was in Eclipse and it was Java instead of Javascript: so in case I'm looking at bar.js, and I would like to know what the doSomething() is meant to do I would press F3 (Open Implementation) on the doSomething and it would go right to it's implementation on foo.js.
The other command, References in Workspace would be the other way around, if I'm at foo.js and I want to know in what places doSomething() is being called I would hit Ctrl+Shift+G, and in a small window it would show the exact line on bar.js (and any other files using it as well). Also, it's noteworthy to say that it wasn't just a simple search, it would not show any file that is calling a doSomething that isn't the doSomething declared in foo.js.
I've noticed that there's a Find All References in VSCode, but it only applies to the same file.
There's also a Go To Declaration command, and it's actually useful, but it only applies to the same file. If I was on bar.js I could select foo on foo.doSomething(), use Go To Declaration and it would send me to the require statement. That's useful on large files but at the end of the day I'm still stuck at the require statement, and I can't quickly navigate to it's module.exports.
So yeah, I know that implementing these in javascript are way harder than at java, because of the classes/type structures and everything else. But these are my questions:
Is there a way to achieve what I want natively in VSCode? Maybe there's a command that I am overlooking?
Is there any extension that is able to achieve this. I remember trying one extension some time ago but it didn't work really well (it used to fail/crash). Maybe with TypeScript / ES6 it would be easier for a extension to work?
If there isn't an exact alternative, what do you do to deal with these problems? How would you quickly go to a function's declaration that is on another file? Keeping in mind that the required file could be a lib on node_modules as well. And how would you find all the places that a certain function is being called, keeping in mind that there could be many other functions with the same name and in many files within your project.
I appreciate any help, and thanks for reading.
To enable this support across files you need to create a jsconfig.json file.
To quote the docs:
JavaScript IntelliSense will work for single files immediately. If you
use the CommonJS module system that is used by Node.js, then you get
IntelliSense across your modules immediately.
There are two more steps to configure IntelliSense across all the
files in your workspace and external modules:
Create a jsconfig.json file to indicate a JavaScript project. Install
TypeScript Definition files (typings) for external libraries.
The documentation has more information about different settings, but simply creating a file named jsconfig.json in your project root should be sufficient to get started:
{
"compilerOptions": {
"target": "ES6"
},
"exclude": [
"node_modules"
]
}
If you want more information into the workings of the javascript language service that vscode is using, you can look at the Salsa documentation.
Is there a way to achieve what I want natively in VSCode? Maybe
there's a command that I am overlooking?
Yes, I think what you want is built-in. Try pressing F12 (Go To Definition) with the cursor on the symbol you are looking for... Sometimes I have to press it twice for things imported in TypeScript, but it works well for me.
This doesn't seem to require a jsconfig.json, it worked for me with just the two files you mentioned in otherwise-empty directory. I could imagine however that incorrect settings in a config file might block it.
You can change the key-bindings if you want using the Preferences: Open Keyboard Shortcuts command. Unfortunately I think there isn't (yet) a library of key-bindings for emulation of other IDEs.
Kivy (.kv) files use a similar syntax to Python (.py) files. I would like to use the Ctrl-K / Ctrl-C key sequence to comment out lines of code when editing .kv files, as works in Python files. How could I enable that key sequence for .kv files?
This is not officially possible, AFAIK. You could check to see if there's already a UserVoice suggestion to upvote, and if not create one.
It does look like VSCode is prepared to offer such features in the future. If you browse to:
C:\Users\YouUserName\AppData\Local\Code\app-0.3.0\resources\app\plugins\vs.language.python
And open the file ticino.plugin.json, then find:
"extensions": [ ".py" ],
and change it to:
"extensions": [ ".py", ".kv" ],
After doing this, and restarting VSCode, the Ctrl+K, Ctrl+C command also works in .kv files.
Note that (a) this is a hack, of which I don't know the side effects, and (b) that you will likely loose this setup after VSCode is updated.
I'd like to suggest to install the "KvLang" directly from VSCode Marketplace.
Maybe it will be another easy way to do it.
Thanks.
If you will create an text file, it will give you a option 'Select a language';
You can just click on it And - Boom! it will give all languages You can use.
If you want to know more just click ===> https://code.visualstudio.com/docs/languages/overview
Thanks