deakjahn / vscode-php-allfactor

Comprehensive PHP refactoring (Visual Studio Code)
https://marketplace.visualstudio.com/items?itemName=tramontana.php-allfactor
1 stars 0 forks source link

Version 1.3.5 - Code Action does not work #8

Closed lexman1958 closed 12 months ago

lexman1958 commented 1 year ago

Hi,

I am not sure why the refactoring in version 1.3.5 using the code actions does not seem to work anymore.

Original code:

Screenshot_18a

Refactored code after using Code Action for "if"

Screenshot_19

lexman1958 commented 1 year ago

Hi,

Is there any response for this?

deakjahn commented 1 year ago

It's hard to see from a screenshot like this. Do you have a specific code section selected when you choose the Surround action?

lexman1958 commented 1 year ago

Hi,

It is appears to be worse than i thought. Its randomly inserting code even before i select the Surrond and then inserts the code i want inside the inserted code. I am not sure if there is some settings conflict but i would appreciate your help.

(1) Screencap of the block for Code Action

Screenshot_1

(2) Screencap of the Code Action options

Screenshot_2

(3) Screencap of the result after i select the "if" Surround

Screenshot_3

(4) Following is the settings.json

{
    "editor.wordWrap": "on",
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.colorDecorators": true,
    "editor.colorDecoratorsActivatedOn": "hover",
    "workbench.iconTheme": "vscode-great-icons",
    "workbench.colorTheme": "Monokai Dark Soda",
    "html-css-class-completion.CSSLanguages": [
        "php",
        "css",
        "sass",
        "scss",
        "vue"
    ],
    "html-css-class-completion.enableEmmetSupport": true,
    "html-css-class-completion.HTMLLanguages": [
        "php",
        "html",
        "vue",
        "razor",
        "handlebars",
        "twig",
        "django-html",
        "php",
        "markdown",
        "erb",
        "ejs",
        "svelte"
    ],
    "html-css-class-completion.JavaScriptLanguages": [
        "php",
        "javascript",
        "javascriptreact",
        "typescriptreact"
    ],
    "editor.minimap.enabled": false,
    "auto-close-tag.activationOnLanguage": [
        "twig",
        "xml",
        "php",
        "ejs",
        "jinja",
        "javascript",
        "javascriptreact",
        "typescript",
        "typescriptreact",
        "plaintext",
        "markdown",
        "vue",
        "liquid",
        "erb",
        "lang-cfml",
        "cfml",
        "HTML (EEx)",
        "HTML (Eex)",
        "plist"
    ],
    "auto-close-tag.insertSpaceBeforeSelfClosingTag": true,
    "emmet.showSuggestionsAsSnippets": true,
    "emmet.useInlineCompletions": true,
    "emmet.triggerExpansionOnTab": true,
    "editor.formatOnSave": true,
    "auto-rename-tag.activationOnLanguage": ["*"],
    "open-in-browser.default": "chrome",
    "highlight-matching-tag.highlightFromContent": true,
    "highlight-matching-tag.highlightSelfClosing": true,
    "html.format.wrapLineLength": 120,
    "prettier.bracketSameLine": true,
    "prettier.printWidth": 80,
    "prettier.bracketSpacing": false,
    "prettier.vueIndentScriptAndStyle": true,
    "css.enabledLanguages": ["php", "twig", "astro", "html"],
    "liveSassCompile.settings.useNewCompiler": true,
    "path-intellisense.extensionOnImport": true,
    "path-intellisense.autoTriggerNextSuggestion": true,
    "path-autocomplete.extensionOnImport": true,
    "bookmarks.label.suggestion": "suggestWhenSelected",
    "bookmarks.navigateThroughAllFiles": false,
    "bookmarks.useWorkaroundForFormatters": true,
    "workbench.startupEditor": "none",
    "php.executables": {
        "v8.1.17": "c:/xampp/php"
    },
    "php.completion.autoimport-docblock": "auto-import",
    "php.completion.autoimport": "auto-import",
    "php.completion.parameters": "parameters",
    "php.executablePath": "c:/xampp/php",
    "php.problems.scope": "all",
    "php.problems.exclude": {
        "/": [406, 437, 6406, 6602],
        // "/": [406, 6406],
        "vendor/": true
    },
    "php.problems.excludeGitIgnore": true,
    "php.version": "8.1.22",
    "php.format.rules.alignConsecutiveAssignments": true,
    "php.format.rules.arrayInitializersAlignKeyValuePairs": true,
    "php.format.rules.arrayInitializersNewLineAfterLastElement": true,
    "php.format.rules.arrayInitializersNewLineBeforeFirstElement": true,
    "php.format.rules.callParametersNewLineAfterLeftParen": true,
    "php.format.rules.declParametersNewLineAfterLeftParen": true,
    "php.format.rules.openBraceOnNewLineForFunctions": true,
    "php.format.rules.openBraceOnNewLineForLambdas": true,
    "php.format.rules.spaceAroundConcatenation": true,
    "php.format.rules.spaceBeforeColonInControlStatements": true,
    "php-docblocker.alignParams": true,
    "php-docblocker.alignReturn": true,
    "php-docblocker.useShortNames": true,
    "files.associations": {
        "*.embeddedhtml": "html",
        ".env*": "dotenv"
    },
    "editor.tokenColorCustomizations": {
        "[*Light*]": {
            "textMateRules": [
                {
                    "scope": "ref.matchtext",
                    "settings": {
                        "foreground": "#000"
                    }
                }
            ]
        },
        "[*Dark*]": {
            "textMateRules": [
                {
                    "scope": "ref.matchtext",
                    "settings": {
                        "foreground": "#fff"
                    }
                }
            ]
        },
        "textMateRules": []
    },
    "phpserver.browser": "google-chrome",
    "template-string-converter.autoRemoveTemplateString": true,
    "tailwindCSS.emmetCompletions": true,
    "[php]": {
        "editor.defaultFormatter": "DEVSENSE.phptools-vscode"
    },
    "emmet.excludeLanguages": ["markdown"],
    "emmet.includeLanguages": {
        "php": "html",
        "vue": "html",
        "javascript": "javascriptreact",
        "blade": "html",
        "blade.php": "html"
    },
    "php-cs-fixer.autoFixBySemicolon": true,
    "php-cs-fixer.formatHtml": true,
    "php.validate.enable": true,
    "php.debug.executablePath": "",
    "rapidapi.terminalLink.enabled": false,
    "liveServer.settings.donotShowInfoMsg": true,
    "colorize.include": [
        "**/*.php",
        "**/*.css",
        "**/*.scss",
        "**/*.sass",
        "**/*.less",
        "**/*.styl",
        "**/*.html"
    ],
    "colorize.languages": [
        "vue",
        "astro",
        "php",
        "blade",
        "css",
        "sass",
        "scss",
        "less",
        "postcss",
        "sss",
        "stylus",
        "xml",
        "svg",
        "html"
    ],
    "phpGettersSetters.generatePHPDoc": false,
    "editor.inlineSuggest.enabled": true,
    "[twig]": {
        "editor.defaultFormatter": "junstyle.twig-language"
    },
    "github.copilot.enable": {
        "*": true,
        "plaintext": true,
        "markdown": false,
        "scminput": false,
        "php": true
    },
    "terminal.integrated.sendKeybindingsToShell": true,
    "dotenv.enableAutocloaking": false,
    "php.format.rules.ifStatementNewLineAfterLeftParen": true,
    "php.format.rules.openBraceOnNewLineForBlocks": false,
    "window.commandCenter": false,
    "inline-css-color.enablePhpStyle": true,
    "inline-css-color.enableHtmlCommentStyle": true,
    "[blade]": {
        "editor.autoClosingBrackets": "always"
    },
    "laravel_goto_view.extensions": [".blade.php", ".vue", "blade.view"],
    "bladeFormatter.format.noMultipleEmptyLines": true,
    "colorize.colorized_colors": ["BROWSERS_COLORS", "HEXA", "RGB", "HSL"],
    "colorize.exclude": [
        "**/.git",
        "**/.svn",
        "**/.hg",
        "**/CVS",
        "**/.DS_Store",
        "**/.git",
        "**/node_modules",
        "**/bower_components",
        "**/tmp",
        "**/dist",
        "**/tests"
    ],
    "colorize.colorized_variables": ["CSS"],
    "blade.format.enable": true,
    "css.validate": false,
    "prettier.tabWidth": 4,
    "html.format.indentInnerHtml": true,
    "html.format.templating": true,
    "sqltools.useNodeRuntime": true,
    "security.workspace.trust.untrustedFiles": "open",
    "php.format.rules.addCommaAfterLastArrayElement": true,
    "php.format.rules.alignConstants": true,
    "php.format.rules.alignEnumCases": true,
    "php.format.rules.booleanConstantCasing": "lowercase",
    "php.format.rules.nullConstantCasing": "uppercase",
    "phpRefactor.showReadonly": true,
    "intelephense.environment.phpVersion": "8.1.22",
    "php.inlayHints.types.suppressVariableFromLiteral": false,
    "php-allfactor.case.defaultClass": "camelCase",
    "php-allfactor.case.defaultConstants": "camelCase",
    "php-allfactor.case.defaultFunction": "camelCase",
    "php-allfactor.files.exclude": [
        "**/.git/**",
        "**/.svn/**",
        "**/CVS/**",
        "**/.DS_Store/**",
        "**/vendor/**"
    ],
    "php.inlayHints.types.return": true,
    "php.format.rules.addCommaAfterLastCallParameter": true,
    "php.format.rules.addCommaAfterLastDeclParameter": true,
    "php.format.rules.openBraceOnNewLineForAnonymousClasses": true,
    "php.format.rules.declParametersNewLineBeforeRightParen": true,
    "php.format.rules.callParametersWrap": "on_every_item",
    "php.format.rules.callParametersNewLineBeforeRightParen": true,
    "editor.quickSuggestions.comments": true,
    "php.format.rules.forStatementNewLineBeforeRightParen": true
}
deakjahn commented 1 year ago

The problem with screenshots is that it's nearly impossible to reproduce because it's not likely someone would type it in again. :-) So, please, if you have an identifiable code section that triggers the error you experience, include it in some copyable form.

lexman1958 commented 1 year ago

Hi,

I am not sure i understood when you said identifiable code. So i am attaching a the source code file itself.

ProjectController.zip

lexman1958 commented 12 months ago

With the latest version 1.3.5, the problem seems to be resolved.