前提・実現したいこと
vscodeでphpを使っていると、インデントが4文字に設定されていました。
2文字に変えたいと思い、下記のコードのようにphpの付近を追加しました。
すると、元々はタブキーを押すと自動で4文字、その後はインデントを保っていてくれたのですがそれも無くなってしまいました。
今はタブキーを押すと4文字分のインデントをされて、すぐにその行のインデントが全て消えるようになっています。
元のように自動でインデントを保ってくれるのと、インデントを2文字にしたいです。
よろしくお願い致します。
出ているエラー
comsol
1GET http://engress.local/wp-json/wp/v2/media/1023?context=edit&_locale=user 404 (Not Found)
該当のソースコード
json
1{ 2 "files.autoSave": "afterDelay", 3 "editor.fontSize": 14, 4 "editor.tabSize": 2, 5 "editor.wordWrap": "on", 6 "editor.fontFamily": "Ricty Diminished", 7 "workbench.startupEditor": "newUntitledFile", 8 "editor.linkedEditing": true, 9 "workbench.colorCustomizations": {}, 10 "cSpell.userWords": [ 11 "Dotinstall", 12 "ERRMODE", 13 "bbsp", 14 "bspside", 15 "bspsides", 16 "chara", 17 "disp", 18 "gazou", 19 "ipad", 20 "lbsp", 21 "mainvisual", 22 "procode", 23 "sipad", 24 "sspc", 25 "staffcode", 26 "swiper", 27 "titletext" 28 ], 29 "files.insertFinalNewline": true, 30 "files.trimFinalNewlines": true, 31 "files.trimTrailingWhitespace": true, 32 "workbench.editor.enablePreview": false, 33 "[css]": { 34 "editor.tabSize": 2, 35 "editor.suggest.insertMode": "replace" 36 }, 37 "[scss]": { 38 "editor.tabSize": 2, 39 "editor.suggest.insertMode": "replace" 40 }, 41 "editor.detectIndentation": false, 42 "[php]": { 43 "editor.tabSize": 2, 44 "editor.insertSpaces": true, 45 "editor.defaultFormatter": "vscode.configuration-editing", 46 "editor.detectIndentation": false, 47 // "editor.insertSpaces": false 48 }, 49 "editor.formatOnPaste": true, 50 "editor.formatOnSave": true, 51 "intelephense.stubs": [ 52 "apache", 53 "bcmath", 54 "bz2", 55 "calendar", 56 "com_dotnet", 57 "Core", 58 "ctype", 59 "curl", 60 "date", 61 "dba", 62 "dom", 63 "enchant", 64 "exif", 65 "FFI", 66 "fileinfo", 67 "filter", 68 "fpm", 69 "ftp", 70 "gd", 71 "gettext", 72 "gmp", 73 "hash", 74 "iconv", 75 "imap", 76 "intl", 77 "json", 78 "ldap", 79 "libxml", 80 "mbstring", 81 "meta", 82 "mysqli", 83 "oci8", 84 "odbc", 85 "openssl", 86 "pcntl", 87 "pcre", 88 "PDO", 89 "pdo_ibm", 90 "pdo_mysql", 91 "pdo_pgsql", 92 "pdo_sqlite", 93 "pgsql", 94 "Phar", 95 "posix", 96 "pspell", 97 "readline", 98 "Reflection", 99 "session", 100 "shmop", 101 "SimpleXML", 102 "snmp", 103 "soap", 104 "sockets", 105 "sodium", 106 "SPL", 107 "sqlite3", 108 "standard", 109 "superglobals", 110 "sysvmsg", 111 "sysvsem", 112 "sysvshm", 113 "tidy", 114 "tokenizer", 115 "xml", 116 "xmlreader", 117 "xmlrpc", 118 "xmlwriter", 119 "xsl", 120 "Zend OPcache", 121 "zip", 122 "zlib", 123 "wordpress" 124 ], 125 "liveServer.settings.donotShowInfoMsg": true, 126 "git.autofetch": true 127} 128
試したこと
json
1"editor.detectIndentation": false, 2 "[php]": { 3 "editor.tabSize": 2, 4 "editor.insertSpaces": true, 5 "editor.defaultFormatter": "vscode.configuration-editing", 6 "editor.detectIndentation": false, 7 // "editor.insertSpaces": false 8 },
この部分を追加しました。
"editor.insertSpaces": false
と"editor.insertSpaces": true,
は両方試しました。
“editor.trimAutoWhitespace”: false
と記入すると文字が赤くなりました。

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。