im using fvm to use flutter 1.22 for some purpose, already install everything for fvm and only change the path in settings.json but the file is not there in .vscode i cannot find it anywhere
You need to create the file manually.
.vscode/settings.json:
{
"dart.flutterSdkPath": ".fvm/flutter_sdk",
// Remove .fvm files from search
"search.exclude": {
"**/.fvm": true
},
// Remove from file watching
"files.watcherExclude": {
"**/.fvm": true
}
}
Source: Configure fvm for VSCode
Related
I added fvm to my project and set it up like this. Now I can run all the commands for example fvm use x.x.x or fvm flutter pub get. Everything works.
BUT when running the application through VSCode directly (Play button or shortcut) it always uses my latest install SDK version. Why is it not starting with the current flutter version ?
This is my settings.json:
{
"dart.flutterSdkPaths": [
"/Users/usr/fvm/versions"
],
// Remove .fvm files from search
"search.exclude": {
"**/.fvm": true
},
// Remove from file watching
"files.watcherExclude": {
"**/.fvm": true
}
}
What am I missing here? How do I configure fvm to work correctly with VSCode?
I'm assuming you have the .fvm folder set up properly? ie. It contains the symlink flutter_sdk (which points to the currently selected SDK) and the fvm_config.json.
In your settings.json file, you also need to set the location of the SDK itself:
"dart.flutterSdkPath": ".fvm/flutter_sdk",
Which will point to the same symlink.
which folder has to be delete for clean uninstall FVM package/Flutter Version Management ?
First apply the official uninstallation steps in the following page in the official docs for the package, select the platform from the taps above and check the Uninstall section.
If you want to also delete all the configs of FVM along with all the installed SDKs, you can type the following in the Terminal/Command Prompt:
fvm config
You will see an output similar to the following:
FVM Settings:
Located at C:\Users\moaze\fvm\.settings
cachePath: D:\Development\Flutter-SDK\versions
skipSetup: false
gitCache: false
You can see to paths in the output, one for the FVM Settings and one for the SDKs which is cachePath, you can delete both folders.
Background
In a repo, we have a pre-commit configuration that requires version 2.2.1 of prettier:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v2.2.1"
hooks:
- id: prettier
And in my .devcontainer I specify use of prettier, so that my code gets formatted on save:
{
// ...
"settings": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
// ...
}
}
Prettier is installed by the vscode extension, not globally, so doing:
npm list -g | grep prettier
in my dev container doesn't list anything installed.
The problem
A different version of prettier is being used, and I get a conflict in how it formats arrays in json files. Every time I open up a particular json file, it gets reformatted by my editor.
Also, if I rebuild my devcontainer, I'm then liable to unknowingly switch the version of code formatter I use, leading to git hell.
The question
How can I specify that my devcontainer use an exact prettier version so I can enforce the same behaviour in my dev environment as in our code quality tools?
I have already tried this:
You can set up the prettier extension to use a resolved version of prettier, according to the instructions under "Prettier Resolution" here.
So I added to the Dockerfile:
# Ensure prettier is installed globally so the esbenp.prettier-vscode can find a specific version
# as discussed here:
# https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
# NB You can remove the -g flag if you have a node project. I install globally because I use prettier on all projects, whether they have a node_modules folder or not.
RUN npm install prettier#2.2.1 -g -D --save-exact
And in the .devcontainer.json settings, told the extension to resolve the prettier module instead of using its own:
{
// ...
"settings": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"prettier.resolveGlobalModules": true,
// ...
}
}
That didn't work so I also tried adding:
"prettier.prettierPath": "$(npm root -g)/prettier",
Which also didn't work; the prettier extension is still using it's own version.
You can set the version in the .devcontainer like this:
"extensions": ["esbenp.prettier-vscode#8.0.1"],
The trick is you also have to turn off extension automatic updates:
"settings": {
"extensions.autoCheckUpdates": false,
"extensions.autoUpdate": false
},
Note: This turns off automatic updates for all extensions.
Also, RUN npm install prettier#2.2.1 -g -D --save-exact in the Dockerfile adds the prettier CLI to the environment, not the VS Code extension.
I create an empty project using Visual Studio Code's terminal. Then I add bower.json and bower_config.bowerrc files then using terminal run the bower update command. The files contains next code:
bower.json
{
"name": "asp.net",
"private": true,
"directory": "wwwroot/lib",
"dependencies": {
"bootstrap": "4.0.0-alpha.6"
}
}
bower_config.bowerrc
{
"directory": "wwwroot/lib"
}
But even I configured it to download files into wwwrooot/lib folder it still install into bower_comoponents folder. How can I resolve that?
P.S. I need to use Visual Studio Code not Visual Studio.
Your bower configuration file should be named .bowerrc (no bower_config prefix).
I accidentally hit “Ignore forever” in an ionic doctor issue.
Is there any option to re-enable this issue? I looked in the projects config files but didn't find any changes. I also uninstalled / installed ionic but the issue is still ignored.
It seems to be setting an ignored array in config.json file in .ionic folder or app configuration folder present in home directory. It may be that it is not a project level setting but cli config level.
"state": {
"lastCommand": "date-stamp",
"doctor": {
"ignored": [
"app-scripts-update-available",
"ionic-native-update-available"
]
}
Deleting the contents of the array seems to show the ignored issues when doing ionic doctor check.