Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documenting the new generic config for plugins #1433

Closed
jneira opened this issue Feb 24, 2021 · 6 comments · Fixed by #2203
Closed

Documenting the new generic config for plugins #1433

jneira opened this issue Feb 24, 2021 · 6 comments · Fixed by #2203
Labels
type: enhancement New feature or request

Comments

@jneira
Copy link
Member

jneira commented Feb 24, 2021

{
    "haskell": {
        "plugin" : {
            "importLens" : {
                "globalOn" : false,
                "codeActionsOn" : false,
                "codeLensOn" : false,
                "diagnosticsOn" :false,
                "hoverOn" :false,
                "symbolsOn"  :false,
                "formattingOn" :false,
                "completionOn" :false,
                "renameOn" :false,
                "config": {}
            },
            "hlint" : {
                "globalOn" : false,
                 "codeActionsOn" : false,
                "codeLensOn" : false,
                "diagnosticsOn" :false,
                "hoverOn" :false,
                "symbolsOn"  :false,
                "formattingOn" :false,
                "completionOn" :false,
                "renameOn" :false,
                "config": {}
            },
            "eval" : {
                "globalOn" : false,
                "codeActionsOn" : false,
                "codeLensOn" : false,
                "diagnosticsOn" :false,
                "hoverOn" :false,
                "symbolsOn"  :false,
                "formattingOn" :false,
                "completionOn" :false,
                "renameOn" :false,
                "config": {}
            },
            "moduleName" : {
                "globalOn" : false,
                 "codeActionsOn" : false,
                "codeLensOn" : false,
                "diagnosticsOn" :false,
                "hoverOn" :false,
                "symbolsOn"  :false,
                "formattingOn" :false,
                "completionOn" :false,
                "renameOn" :false,
                "config": {}
            },
            "splice" : {
                "globalOn" : false,
                 "codeActionsOn" : false,
                "codeLensOn" : false,
                "diagnosticsOn" :false,
                "hoverOn" :false,
                "symbolsOn"  :false,
                "formattingOn" :false,
                "completionOn" :false,
                "renameOn" :false,
                "config": {}
            },
            "haddockComments" : {
                "globalOn" : false,
                 "codeActionsOn" : false,
                "codeLensOn" : false,
                "diagnosticsOn" :false,
                "hoverOn" :false,
                "symbolsOn"  :false,
                "formattingOn" :false,
                "completionOn" :false,
                "renameOn" :false,
                "config": {}
            },
            "class" : {
                "globalOn" : false,
                 "codeActionsOn" : false,
                "codeLensOn" : false,
                "diagnosticsOn" :false,
                "hoverOn" :false,
                "symbolsOn"  :false,
                "formattingOn" :false,
                "completionOn" :false,
                "renameOn" :false,
                "config": {}
            },
            "retrie" : {
                "globalOn" : false,
                 "codeActionsOn" : false,
                "codeLensOn" : false,
                "diagnosticsOn" :false,
                "hoverOn" :false,
                "symbolsOn"  :false,
                "formattingOn" :false,
                "completionOn" :false,
                "renameOn" :false,
                "config": {}
            },
            "tactic" : {
                "globalOn" : false,
                 "codeActionsOn" : false,
                "codeLensOn" : false,
                "diagnosticsOn" :false,
                "hoverOn" :false,
                "symbolsOn"  :false,
                "formattingOn" :false,
                "completionOn" :false,
                "renameOn" :false,
                "config": { 
                      "features": "not exposed?",
                      "max_use_ctor_actions": "Int"
                 }
            },
            "pragmas" : {
                "globalOn" : false,
                 "codeActionsOn" : false,
                "codeLensOn" : false,
                "diagnosticsOn" :false,
                "hoverOn" :false,
                "symbolsOn"  :false,
                "formattingOn" :false,
                "completionOn" :false,
                "renameOn" :false,
                "config": {}
            },
            "ghcide-hover-and-symbols" : {
                "globalOn" : false,
                 "codeActionsOn" : false,
                "codeLensOn" : false,
                "diagnosticsOn" :false,
                "hoverOn" :false,
                "symbolsOn"  :false,
                "formattingOn" :false,
                "completionOn" :false,
                "renameOn" :false,
                "config": {}
            },
            "ghcide-code-actions" : {
                "globalOn" : false,
                 "codeActionsOn" : false,
                "codeLensOn" : false,
                "diagnosticsOn" :false,
                "hoverOn" :false,
                "symbolsOn"  :false,
                "formattingOn" :false,
                "completionOn" :false,
                "renameOn" :false,
                "config": {}
            },
            "ghcide-completions" : {
                "globalOn" : false,
                 "codeActionsOn" : false,
                "codeLensOn" : false,
                "diagnosticsOn" :false,
                "hoverOn" :false,
                "symbolsOn"  :false,
                "formattingOn" :false,
                "completionOn" :false,
                "renameOn" :false,
                "config": {}
            },
            "ghcide-type-lenses" : {
                "globalOn" : false,
                 "codeActionsOn" : false,
                "codeLensOn" : false,
                "diagnosticsOn" :false,
                "hoverOn" :false,
                "symbolsOn"  :false,
                "formattingOn" :false,
                "completionOn" :false,
                "renameOn" :false,
                "config": {
                    "mode": "Always | Exported | Diagnostics"
                }
            }
        }
    }
}
  • Not all plugins provide all features so we should cut down them
  • We should mention that existing configuration is deprecated cause is already covered by the generic one (hlintOn)
  • I think tactic plugin already have a dedicated configuration under config (@isovector)
@jneira
Copy link
Member Author

jneira commented Mar 8, 2021

@jneira
Copy link
Member Author

jneira commented Mar 8, 2021

  • full configuration updated
  • but not all plugins has all capacities so it would be nice to remove non useful info, to make it more compact and focused
  • the tactic specific config should be added

@jneira
Copy link
Member Author

jneira commented Mar 8, 2021

  • configuration completed with wingman and ghcide-type-lenses specific configuration
  • i guess we dont want expose wingman features to the user in any way? what would be a concise description of max_use_ctor_actions? (@isovector)

@berberman
Copy link
Collaborator

The value of ghcide-type-lenses' mode is case insensitive

@isovector
Copy link
Collaborator

@jneira

max_use_ctor_actions lets you set the maximum number of Use constructor <x> code actions that can appear. For types like Maybe (2 ctors) it's fine to just show them all, but for HsExpr (~30), that's only going to overwhelm the user, so we don't show them.

max_use_ctor_actions is the cutoff between "OK" and "too many".

I think it's ok to expose features, but maybe with an unhelpful description "Features to enable in the plugin"

@jneira
Copy link
Member Author

jneira commented Mar 8, 2021

  • This would be the configuration including only the actual capacities of each plugin. In plugins with only one of them globalOn is enough to control it.
  • Formatters could be included here but there are an option to choose what formatter is using and being able to disable only can cause users disabling the formatter chosen.
{
    "haskell": {
        "plugin" : {
            "importLens" : {
                "globalOn" : false,
                "codeActionsOn" : false,
                "codeLensOn" : false
            },
            "hlint" : {
                "globalOn" : false,
                "codeActionsOn" : false,
                "diagnosticsOn" :false
            },
            "eval" : {
                "globalOn" : false,
                "codeLensOn" : false
            },
            "moduleName" : {
                "globalOn" : false,
                "codeLensOn" : false
            },
            "splice" : {
                "globalOn" : false,
                "codeActionsOn" : false
            },
            "haddockComments" : {
                "globalOn" : false,
                "codeActionsOn" : false
            },
            "class" : {
                "globalOn" : false,
                "codeActionsOn" : false
            },
            "retrie" : {
                "globalOn" : false,
                "codeActionsOn" : false
            },
            "tactic" : {
                "globalOn" : false,
                "codeActionsOn" : false,
                "config": { 
                      "features": "not exposed?",
                      "max_use_ctor_actions": "Int"
                 }
            },
            "pragmas" : {
                "globalOn" : false,
                "codeActionsOn" : false,
                "completionOn" : false
            },
            "ghcide-hover-and-symbols" : {
                "globalOn" : false,
                "hoverOn" :false,
                "symbolsOn"  :false
            },
            "ghcide-code-actions" : {
                "globalOn" : false,
                "codeActionsOn" : false
            },
            "ghcide-completions" : {
                "globalOn" : false,
                "completionOn" :false
            },
            "ghcide-type-lenses" : {
                "globalOn" : false,
                "codeLensOn" : false,
                "config": {
                    "mode": "always | exported | diagnostics"
                }
            }
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants