I have tried almost everything but could not figure out how could i remove the horizontal scrollbar from my vs code i have changed every setting but could not figure out how to on my word wrap on vs code. At first it worked but suddenly it stopped working a month before could not figure out what could be the reason maybe some extension. Any help would be appreciated.
Following is code for my setting.json and screen shot of my settings and the horizontal scroll bar.
{
"editor.mouseWheelZoom": true,
"code-runner.runInTerminal": true,
"liveServer.settings.donotShowInfoMsg": true,
"C_Cpp.updateChannel": "Insiders",
"code-runner.saveFileBeforeRun": true,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"debug.terminal.clearBeforeReusing": true,
"code-runner.clearPreviousOutput": true,
"latex-workshop.view.pdf.viewer": "browser",
"workbench.colorTheme": "Visual Studio Dark",
"workbench.iconTheme": "vscode-icons",
"diffEditor.wordWrap": "on",
"emmet.triggerExpansionOnTab": true,
"editor.accessibilitySupport": "on",
"bracket-pair-colorizer-2.depreciation-notice": false,
"editor.wrappingColumn": 0,
"kite.showWelcomeNotificationOnStartup": false,
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell"
},
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"args": [],
"icon": "terminal-cmd"
},
"Git Bash": {
"source": "Git Bash"
},
"Ubuntu-18.04 (WSL)": {
"path": "C:\\WINDOWS\\System32\\wsl.exe",
"args": [
"-d",
"Ubuntu-18.04"
]
}
},
"terminal.integrated.defaultProfile.windows": "PowerShell",
"security.workspace.trust.untrustedFiles": "open",
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"files.associations": {
"*.css": "css"
},
"[css]": {
"editor.defaultFormatter": "vscode.css-language-features"
},
"workbench.startupEditor": "none",
"editor.wordWrap": "on"
}
Q: You'd like to see word wrap in the editor window, as you're editing an HTML file in VSCode, correct?
Q: And you DON'T want the editor to insert line breaks in the actual HTML - you just don't want to have to scroll left and right. Correct?
Q: Have you tried Alt-Z? Or View > Toggle word wrap?
NOTE: be sure the HTML editor pane is "Selected" when you try "Alt-Z".
Related
I am using VSCode autoimport on daily basis with this extension
soates autoimport.
https://github.com/soates/Auto-Import/issues/104.
It suddenly stopped to work. I have tried reinstall vscode, changing extension version, disabling plugins, clearing cache ...etc
I have tried this https://www.youtube.com/watch?v=1yu5tB4KOis and also tried add
checkjs: true to my jsconfig.json. Its very hard to live without auto import.
these are my settings.json
{
"dart.flutterSdkPath": "C:\\Users\\rolni\\AppData\\Roaming\\flutter_windows_v1.12.13+hotfix.9-stable\\flutter\\bin",
"explorer.confirmDelete": false,
"workbench.colorCustomizations": {
"[Material Theme Darker]": {
"statusBar.debuggingBackground": "#212121"
}
},
"material-icon-theme.folders.associations": {
"global_state": "global",
"ui": "layout",
"bloc": "controller"
},
"workbench.iconTheme": "material-icon-theme",
"debug.node.autoAttach": "on",
"[json]": {
"editor.quickSuggestions": {
"strings": true
},
"editor.suggest.insertMode": "replace",
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"typescript.updateImportsOnFileMove.enabled": "always",
"notebook.kernelProviderAssociations": [],
"emmet.triggerExpansionOnTab": true,
"emmet.showSuggestionsAsSnippets": true,
"editor.snippetSuggestions": "top",
"explorer.confirmDragAndDrop": false,
"javascript.updateImportsOnFileMove.enabled": "always",
"highlight-matching-tag.customEmptyElements": null,
"emmet.excludeLanguages": [
"markdown"
],
"emmet.includeLanguages": {
"javascript": "html"
},
"autoimport.filesToScan": "**/*.{ts,tsx,js,jsx}",
"autoimport.showNotifications": true,
"extensions.ignoreRecommendations": true,
"workbench.editor.enablePreview": false,
"outline.showVariables": false,
"debug.javascript.autoAttachFilter": "disabled",
"debug.javascript.terminalOptions": {
"trace": true
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"terminal.integrated.shell.windows": "C:\\Program Files\\PowerShell\\7-preview\\pwsh.exe",
"debug.onTaskErrors": "debugAnyway",
"[go]": {
"editor.insertSpaces": false
},
"go.formatTool": "gofmt",
"go.useLanguageServer": true,
"gopls": {
"usePlaceholders": true, // add parameter placeholders when completing a function
},
"todo-tree.tree.showScanModeButton": false,
"todo-tree.highlights.customHighlight": {
"TODO": {
"icon": "check",
"type": "line",
"iconColour": "yellow",
"foreground": "red",
"background": "yellow"
},
"FIXME": {
"icon": "beaker",
"iconColour": "red",
"foreground": "white",
"background": "red"
}
},
"debug.inlineValues": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"tabnine.experimentalAutoImports": true,
"gitlens.hovers.currentLine.over": "line",
"terminal.integrated.tabs.enabled": true,
"go.toolsManagement.autoUpdate": true,
"workbench.colorTheme": "Material Theme",
"git.enableSmartCommit": true,
"todo-tree.general.tags": [
"BUG",
"HACK",
"FIXME",
"TODO",
"XXX",
"[ ]",
"[x]"
],
"todo-tree.regex.regex": "(//|#|<!--|;|/\\*|^|^\\s*(-|\\d+.))\\s*($TAGS)",
"terminal.integrated.defaultProfile.windows": "PowerShell",
"editor.formatOnSave": true,
}
Can't also debug extension all my breakpoints are unbound...can't figure out how to debug it to find root cause of problem.
This log is in my output Log (Extension Host)
[error] [vscode.json-language-features] provider FAILED
[2021-07-05 13:23:44.550] [exthost] [error] Canceled: Canceled
at b.makeCancelError (c:\Users\rolni\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\json-language-features\client\dist\node\jsonClientMain.js:1:64563)
at b.handleFailedRequest (c:\Users\rolni\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\json-language-features\client\dist\node\jsonClientMain.js:1:64414)
at c:\Users\rolni\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\json-language-features\client\dist\node\jsonClientMain.js:1:24756
EDIT:
I have tried remove plugins, directories, settings, but still
autoimport extension is not enabled even it says yes. Its even missing
the log in extension host output.
For JavaScript projects
VSCode in general starts to fail after a while, it OFTEN doesn't suggest imports from package dependencies and even starts to stop hinting auto import for local project src folder files...
As soon as you open the file it will all of a sudden become available...
It's not a plugin issue, it's just VS code, it's starting to get bloated...
For TypeScript projects
It's not so bad, they seem mainly focused on TS these days, but when it goes wrong it goes wrong. I've started un-installing, go to install folders make sure nothing is there and re-install and it works again. No login sync.
Alternative (which I am not a fan off but just works... grrr)
PHPStorm / WebStorm, it gets the import right every time.
And ctrl click on sub methods of class's will auto open that file and locate you on that method. VSCode will just open that file, if it can find it...
With auto complete (in JS Projects) on variables assigned to a class. I think VS Code will only do that if the file is open in the editor.
I keep both open now, VSCode for speed of editing but when (not if) VSCode start to play up, I switch over. Also for the stacking of file tabs feature in PHPStorm instead of a scroll bar of tabs. I find it easier to just switch over to PHPStorm and back again instead of that scroll thing.
I have been trying to configure VSCode to use GitBash as the integrated terminal. However no mater what I try the integrated terminal always shows up as PowerShell. I have disable PowerShell, uninstall Windows Terminal, and Windows Terminal Preview. Here is my settings.json:
{
"sync.gist": "16ea877040ee819fae27275ae71be30b",
"sync.quietSync": true,
"workbench.iconTheme": "material-icon-theme",
"editor.minimap.enabled": false,
"workbench.colorCustomizations": {
"editorGutter.background": "#30208b",
"statusBar.background": "#1b5c12",
"statusBar.debuggingBackground": "#1b5c12",
"statusBar.noFolderBackground": "#1b5c12",
"statusBar.border": "#ff0000"
},
"python.autoComplete.addBrackets": true,
"python.dataScience.themeMatplotlibPlots": true,
"python.linting.pylamaEnabled": true,
"python.linting.pycodestyleEnabled": true,
"git.autofetch": true,
"python.pythonPath": "/usr/bin/python3",
"code-runner.respectShebang": false,
"code-runner.fileDirectoryAsCwd": true,
"code-runner.runInTerminal": true,
"editor.fontSize": 12,
"editor.fontFamily": "'Aurulent Sans Mono Regular','Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.formatOnPaste": true,
"prettier.printWidth": 120,
"prettier.singleQuote": true,
"prettier.tabWidth": 4,
"prettier.jsxSingleQuote": true,
"prettier.jsxBracketSameLine": true,
"browser-preview.startUrl": "http://127.0.0.1:8000/",
"browser-preview.verbose": false,
"python.linting.pylintArgs": ["--extension-pkg-whitelist=PyQt5"],
"[python]": {
"editor.defaultFormatter": "iansan5653.format-python-docstrings"
},
"explorer.confirmDragAndDrop": false,
"explorer.confirmDelete": false,
"git.enableSmartCommit": true,
"files.associations": {
"**/*.html": "html",
"**/templates/**/*.html": "django-html",
"**/templates/**/*": "django-txt",
"**/requirements{/**,*}.{txt,in}": "pip-requirements"
},
"terminal.integrated.fontFamily": "'Fira Code Medium'",
"terminal.integrated.fontSize": 12,
"terminal.integrated.inheritEnv": true,
"#terminal.integrated.defaultProfile.osx#": "C:\\Windows\\System32\\cmd.exe",
"#terminal.integrated.defaultProfile.windows": "C:\\Windows\\System32\\cmd.exe",
"terminal.integrated.cwd": "C:\\Users\\DawsonSchaffer\\Documents\\Projects",
"workbench.colorTheme": "Monokai",
"workbench.editorAssociations": [
{
"viewType": "jupyter.notebook.ipynb",
"filenamePattern": "*.ipynb"
}
],
"terminal.integrated.profiles.windows": {
"Git Bash": {
"source": "Git Bash",
"path": "C:\\Program Files\\Git\\git-bash.exe",
}
},
"terminal.integrated.defaultProfile.windows": "Git Bash",
"python.analysis.completeFunctionParens": true,
"settingsSync.ignoredSettings": [
"terminal.external.windowsExec"
],
"terminal.explorerKind": "external",
}
Any help in finding a solution for this would be greatly appreciated.
Thanks
Dawson
I finally got it working using the following:
"terminal.integrated.profiles.windows": {
"Git Bash": {
"source": "Git Bash",
"path": "C:\\Program Files\\Git\\git-bash.exe",
"icon": "C:\\Program Files\\gitbash.png"
}
},
"terminal.integrated.defaultProfile.windows": "Git Bash",
As a temporary workaround you may use the deprecated setting:
"terminal.integrated.shell.windows": "C:\Program Files\Git\bin\bash.exe"
For example i make a new create-react-app and i remove App import from index.js. ESLint shows the problem and i can fix it by clicking on App and pressing "Ctrl + Space" or "Ctrl + ." and import App with a click, but i want files to be imported on save.
Source Action > Add all missing imports doesn't work, but interestingly organize imports does.
I don't know what could be the problem. I want to use organize imports and add missing imports on save together.
My Settings.json
+
One thing i realized that vs code can't tell what files are missing at all, because when i removed the auto import extension both ctrl + space and ctrl + . stopped working.
{
"workbench.iconTheme": "vscode-icons",
"liveServer.settings.donotShowInfoMsg": true,
"window.zoomLevel": 1,
"git.enableSmartCommit": true,
"eslint.format.enable": true,
"editor.formatOnSave": true,
"javascript.updateImportsOnFileMove.enabled": "always",
// "files.autoSave": "afterDelay",
"diffEditor.renderSideBySide": false,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"explorer.confirmDragAndDrop": false,
"emmet.triggerExpansionOnTab": true,
"emmet.includeLanguages": {
"javascript": "javascriptreact"
},
"emmet.syntaxProfiles": {
"javascript": "jsx"
},
"prettier.arrowParens": "always",
"editor.fontLigatures": true,
"workbench.activityBar.visible": true,
"workbench.preferredDarkColorTheme": "One Dark Pro",
"oneDarkPro.bold": true,
"oneDarkPro.editorTheme": "Onedark Pro",
"oneDarkPro.vivid": true,
"workbench.preferredHighContrastColorTheme": "One Dark Pro",
"workbench.preferredLightColorTheme": "One Dark Pro",
"workbench.colorTheme": "One Dark Pro",
"editor.fontFamily": "Fira Code, Fira Code iScript, Consolas, 'Courier New', monospace",
"gitlens.advanced.messages": {
"suppressCommitHasNoPreviousCommitWarning": true
},
"eslint.workingDirectories": [{ "mode": "auto" }],
"prettier.trailingComma": "es5",
"autoimport.filesToScan": "**/*.{jsx,js,ts,tsx}",
"autoimport.doubleQuotes": true,
"autoimport.showNotifications": true,
"explorer.compactFolders": false,
"eslint.codeAction.showDocumentation": {
"enable": true
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"typescript.tsdk": "",
"path-intellisense.mappings": {},
"relativePath.excludedExtensions": [".js"],
"typescript.updateImportsOnFileMove.enabled": "always",
"typescript.preferences.includePackageJsonAutoImports": "on",
"prettier.useTabs": true,
"editor.codeActionsOnSave": {
"source.addMissingImports": true
// "source.fixAll.eslint": true
// "source.organizeImports": true
},
"editor.snippetSuggestions": "top"
}
Please create a new jsconfig.json file in the root of your app, with:
{
"compilerOptions": {
"baseUrl": "./src",
"checkJs": true,
"jsx": "react"
}
}
and then try it with:
import React from 'react'
const Component = () => {
const [test] = useState(0)
return <div>{test}</div>
}
export default Component
I'm having a super annoying issue where a settings conflict of some sort is preventing the lint from adjusting the file as it should. I am using Wes Bos' ESLint/Prettier configuration. For example, I have a Vue file:
<script>
import { mapState, mapActions } from "vuex";
export default {
data: () => ({
valid: false <-------- Also receive eslint(comma-dangle) error here
}),
computed: {
...mapState("account", ["status"]),
},
methods: {
...mapActions("account", ["login", "logout"]),
},
created() {}
};
</script>
However in my .eslintrc I have this rule, because I prefer script code to be indented once:
"vue/script-indent": [
"warn",
2,
{
"baseIndent": 1
}
],
When I save the file to allow Prettier to reformat and fix those errors, I can see the comma-dangle and indent issues be fixed for a split second before they revert back and show all of the errors again. Where is the conflict occurring?
ESLint/Prettier is very new to me, and I'm just trying to get a good system in place! Any help would be greatly appreciated.
Other related files:
VSCode settings.json
{
"breadcrumbs.enabled": true,
"editor.autoClosingBrackets": "always",
"editor.autoClosingQuotes": "always",
"editor.formatOnPaste": true,
"editor.formatOnType": true,
"editor.fontFamily": "FiraCode-Retina",
"editor.fontWeight": "500",
"editor.letterSpacing": 0.5,
"editor.lineHeight": 20,
"editor.minimap.enabled": false,
"editor.tabSize": 2,
"emmet.includeLanguages": {
"erb": "html",
"javascript": "javascriptreact",
"vue-html": "html",
"vue": "html",
"scss": "scss"
},
"files.associations": {
"*.js.erb": "javascript"
},
"gitlens.codeLens.authors.enabled": false,
"gitlens.codeLens.recentChange.enabled": false,
"gitlens.hovers.currentLine.over": "line",
"html.format.indentInnerHtml": true,
"javascript.preferences.quoteStyle": "single",
"search.useReplacePreview": false,
"terminal.integrated.fontWeightBold": "normal",
"workbench.colorTheme": "Atom One Dark",
"workbench.editor.tabCloseButton": "left",
"workbench.iconTheme": "material-icon-theme",
"vim.statusBarColors.normal": "#f4f4f4",
// These are all my auto-save configs
"editor.formatOnSave": true,
// turn it off for JS and JSX, we will do this via eslint
"[javascript]": {
"editor.formatOnSave": false
},
"[javascriptreact]": {
"editor.formatOnSave": false
},
// tell the ESLint plugin to run on save
"editor.codeActionsOnSave": {
"source.fixAll": true
},
// Optional BUT IMPORTANT: If you have the prettier extension enabled for other languages like CSS and HTML, turn it off for JS since we are doing it through Eslint already
"prettier.disableLanguages": [
"javascript",
"javascriptreact"
],
}
package.json
{
"name": "app",
"version": "0.1.0",
"private": true,
"scripts": {
"start": "node --max_old_space_size=4096 node_modules/.bin/vue-cli-service serve",
"build": "vue-cli-service build --mode production",
"lint": "vue-cli-service lint"
},
"dependencies": {
"#vuex-orm/core": "0.33.0",
"#vuex-orm/plugin-axios": "^0.7.0",
"axios": "^0.19.0",
"convert-units": "^2.3.4",
"core-js": "^2.6.5",
"dayjs": "^1.8.16",
"echarts": "^4.3.0",
"fibers": "^4.0.1",
"lodash": "^4.17.15",
"material-design-icons-iconfont": "^5.0.1",
"sass": "^1.23.0",
"sass-loader": "7.1.0",
"vee-validate": "^3.0.11",
"vue": "^2.6.10",
"vue-headful": "^2.0.1",
"vue-router": "^3.0.3",
"vuedraggable": "^2.23.2",
"vuetify": "2.1.9",
"vuex": "^3.0.1"
},
"devDependencies": {
"#vue/cli-plugin-babel": "^3.12.0",
"#vue/cli-plugin-eslint": "^3.12.0",
"#vue/cli-service": "^3.12.0",
"#vue/eslint-config-airbnb": "^4.0.0",
"babel-eslint": "^10.0.1",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"vue-cli-plugin-vuetify": "^1.0.1",
"vue-template-compiler": "^2.6.10",
"vuetify-loader": "^1.2.2"
}
}
I think the cause of the conflict is this setting in settings.json:
"editor.formatOnSave": true,
the editor is set to "editor.tabSize": 2, and the default prettier setting is
"none" for the trailing comma. So it must be overriding whatever settings you had for eslint that runs on save. You can try setting:
"editor.formatOnSave": false,
alternatively you can change the editor.tabSize setting and add
"prettier.trailingComma": "es5",
Same issue, it's working for me.
{
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
After latest VS-Code update, tab feature changes to "focus change" instead of adding space or identation. i try change every setting in setting.json but it not wotrking. it is really annoying as i am use to it.
Any Help would be appreciated.
{
"workbench.iconTheme": "material-icon-theme",
"editor.formatOnSave": true,
"prettier.singleQuote": true,
"workbench.startupEditor": "newUntitledFile",
"window.zoomLevel": 0,
"indenticator.hover.peekBack": 0,
"indenticator.hover.peekForward": 1,
"indenticator.inner.hover.peekBack": 0,
"indenticator.inner.hover.peekForward": 1,
"indenticator.inner.showHighlight": true,
"html.format.endWithNewline": true,
"javascript.implicitProjectConfig.experimentalDecorators": true,
"prettier.printWidth": 110,
"html.format.indentHandlebars": true,
"html.format.indentInnerHtml": true,
"liveServer.settings.AdvanceCustomBrowserCmdLine": "C:\\Program Files\\Firefox Developer Edition\\firefox.exe",
"prettier.jsxBracketSameLine": true,
"prettier.trailingComma": "es5",
"prettier.useTabs": true,
"angular2-switcher.openSideBySide": true,
"editor.foldingStrategy": "indentation",
"editor.mouseWheelZoom": true,
"[html]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"[less]": {
"editor.defaultFormatter": "michelemelluso.code-beautifier"
},
"workbench.statusBar.visible": true,
"workbench.activityBar.visible": true,
"editor.renderControlCharacters": false,
"editor.showFoldingControls": "always",
"editor.smoothScrolling": true,
"breadcrumbs.enabled": false,
"terminal.integrated.rendererType": "dom",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
}
This is my settings file. Extensions settings are same as before.
In the command palette, use Toggle Tab Key Moves Focus (Ctrl + M by default as of 1.36.0) to switch between these modes.
While backing up my VS-Code settings on cloud i found (in C:\Users\[username]\AppData\Roaming\Code\User > keybindings.json) that tab was assigned as -tab labeled to move-focus. which did'nt appear on UI settings on Vs-Code.
i dont know where it came from (after 2nd Last VS-Code Update):
{
"key": "tab",
"command": "-tab",
"when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus"
}
i just removed it . And it Works same as DEFAULT.
Sharing this as answer if anyone faces this problem from nowhere.
Thank You. :)