DEVSENSE / phptools-docs

PHP Tools public content
Apache License 2.0
80 stars 10 forks source link

PHP Tools VS Code still reports vendor problems #315

Closed lexman1958 closed 1 year ago

lexman1958 commented 1 year ago

Previously, i reported on PHP Tools extension reporting vendors problems. I was advise add the following code into settings.json:


"php.problems.exclude" : {
    "vendor/" : true,
}

I have added this and yet the vendors are still be highlighted. The version is am using is 1.32.12895. The following is my setting.json codes:


{
  "eslint.format.enable": true,
  "liveServer.settings.CustomBrowser": "firefox",
  "splitHTMLAttributes.sortOrder": [
    "^v-if",
    "^v-else",
    "^v-show",
    "^v-model",
    "^v-for",
    "^:key",
    "^key",
    "^v-",
    "^:",
    "^@click",
    "^@",
    "^id",
    "^class",
    "^.*=\""
  ],
  "splitHTMLAttributes.closingBracketOnNewLine": true,
  "css.enabledLanguages": ["html", "php"],
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "javascript.format.semicolons": "insert",
  "typescript.format.semicolons": "insert",
  "editor.formatOnSave": true,
  "editor.wordWrap": "on",
  "html.format.indentHandlebars": true,
  "html.format.indentInnerHtml": true,
  "[jsonc]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "editor.tokenColorCustomizations": {
    "comments": "#ffa500"
  },
  "workbench.iconTheme": "vscode-great-icons",
  "workbench.colorTheme": "Monokai Dark Soda",
  "emmet.triggerExpansionOnTab": true,
  "emmet.includeLanguages": {
    "vue-html": "html",
    "vue": "html",
    "astro": "html",
    "blade": "html",
    "blade.php": "html",
    "postcss": "css",
    "javascript": "javascriptreact",
    "php": "html",
    "twig": "html"
  },
  "emmet.useInlineCompletions": true,
  "emmet.syntaxProfiles": {
    "html": {
      "inline_break": 1
    }
  },
  "intelephense.completion.fullyQualifyGlobalConstantsAndFunctions": true,
  "emmet.excludeLanguages": [],
  "emmet.showSuggestionsAsSnippets": true,
  "editor.minimap.enabled": false,
  "[php]": {
    "editor.defaultFormatter": "bmewburn.vscode-intelephense-client"
  },
  "[html]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "liveServer.settings.donotShowInfoMsg": true,
  "turboConsoleLog.addSemicolonInTheEnd": true,
  "volar.autoCompleteRefs": true,
  "volar.codeLens.scriptSetupTools": true,
  "alpine-intellisense.settings.languageScopes": "html, php",
  "blade.format.enable": true,
  "open-in-browser.default": "chrome",
  "prettier.bracketSameLine": true,
  "javascript.format.insertSpaceAfterConstructor": true,
  "tabnine.experimentalAutoImports": true,
  "workbench.startupEditor": "none",
  "rapidapi.terminalLink.enabled": false,
  "laravel_goto_view.folders": {
    "default": "/resources/views",
    "theme_xxx": "/resources/views/theme_xxx",
    "js": "/resources/js/Pages",
    "vendor": "/resources/views/vendor"
  },
  "phpCreateClass.strictTypes": true,
  "php-docblocker.alignParams": true,
  "php-docblocker.alignReturn": true,
  "html.format.wrapAttributesIndentSize": 4,
  "phpfmt.detect_indent": true,
  "phpfmt.indent_with_space": 0,
  "phpfmt.enable_auto_align": true,
  "alignmenthash.indentBase": "activeline",
  "phpfmt.psr1": true,
  "redhat.telemetry.enabled": false,
  "[blade]": {
    "editor.defaultFormatter": "onecentlin.laravel-blade"
  },
  "files.refactoring.autoSave": false,
  "php-allfactor.prefer.reformat": false,
  "php.problems.exclude": {
    "vendor/": true
  },
  "php.suggest.basic": true,
  "editor.cursorBlinking": "expand",
  "terminal.integrated.env.windows": {},
  "volar.inlayHints.eventArgumentInInlineHandlers": false,
  "volar.inlayHints.missingRequiredProps": false,
  "php.format.rules.arrayInitializersAlignKeyValuePairs": true,
  "php.format.rules.forStatementNewLineBeforeRightParen": true,
  "php.format.rules.ifStatementNewLineAfterLeftParen": true,
  "php.format.rules.openBraceOnNewLineForAnonymousClasses": false,
  "php.format.rules.indentBraces": true,
  "php.format.rules.openBraceOnNewLineForTypes": true,
  "php.format.rules.spaceAfterCast": true,
  "php.format.rules.spaceAfterUnaryNot": true,
  "php.format.rules.spaceBeforeColonInControlStatements": true,
  "php.docblock.functionSnippet": {}
}
jakubmisek commented 1 year ago

@lexman1958 thank you for reporting the issue.

So far as I'm trying, "php.problems.exclude" works as expected. There are (intentionally) a few exceptions:

Do you see (yellow) warnings or only (red) errors?

lexman1958 commented 1 year ago

@jakubmisek

I see red and yellow ones. Anyway, i think i sorted out the problem. I changed the settings:

from

"php.problems.exclude": {
    "vendor/": true
  },

to:


"php.problems.exclude": {
    "vendor": true
  },

I just removed the "/" and it seems to work. Not sure why but it worked. Perhaps you can explain this.

jakubmisek commented 1 year ago

@lexman1958 thank you for the update. You're right, the / character messes the glob pattern.