Bläddra i källkod

User config option to change Rust inline hint/param prefixes (#774)

* User configurable Rust inline hint prefixes

* Ordered the language list

* Rust param hints and ordered lang list
Henrik Nilsson 4 år sedan
förälder
incheckning
d9fc6ec826
2 ändrade filer med 68 tillägg och 67 borttagningar
  1. 2 2
      ftplugin/rust.lua
  2. 66 65
      lua/default-config.lua

+ 2 - 2
ftplugin/rust.lua

@@ -32,11 +32,11 @@ if O.lang.rust.rust_tools.active then
 
         -- prefix for parameter hints
         -- default: "<-"
-        parameter_hints_prefix = "<-",
+        parameter_hints_prefix = O.lang.rust.rust_tools.parameter_hints_prefix,
 
         -- prefix for all the other hints (type, chaining)
         -- default: "=>"
-        other_hints_prefix = "=>",
+        other_hints_prefix = O.lang.rust.rust_tools.other_hints_prefix,
 
         -- whether to align to the lenght of the longest line in the file
         max_len_align = false,

+ 66 - 65
lua/default-config.lua

@@ -101,76 +101,76 @@ O = {
   },
 
   lang = {
-    python = {
-      linter = "",
-      isort = false,
+    cmake = {},
+    clang = {
       diagnostics = {
         virtual_text = { spacing = 0, prefix = "" },
         signs = true,
         underline = true,
       },
-      analysis = {
-        type_checking = "basic",
-        auto_search_paths = true,
-        use_library_code_types = true,
-      },
+      cross_file_rename = true,
+      header_insertion = "never",
+    },
+    css = {
+      virtual_text = true,
     },
     dart = {
       sdk_path = "/usr/lib/dart/bin/snapshots/analysis_server.dart.snapshot",
     },
-    lua = {
+    docker = {},
+    efm = {},
+    elm = {},
+    emmet = { active = true },
+    elixir = {},
+    graphql = {},
+    go = {},
+    html = {},
+    java = {},
+    json = {
       diagnostics = {
         virtual_text = { spacing = 0, prefix = "" },
         signs = true,
         underline = true,
       },
     },
-    sh = {
-      -- @usage can be 'shellcheck'
-      linter = "",
-      -- @usage can be 'shfmt'
+    kotlin = {},
+    latex = {},
+    lua = {
       diagnostics = {
         virtual_text = { spacing = 0, prefix = "" },
         signs = true,
         underline = true,
       },
     },
-    tsserver = {
-      -- @usage can be 'eslint'
-      linter = "",
-      diagnostics = {
-        virtual_text = { spacing = 0, prefix = "" },
-        signs = true,
-        underline = true,
+    php = {
+      format = {
+        format = {
+          default = "psr12",
+        },
+      },
+      environment = {
+        php_version = "7.4",
       },
-    },
-    json = {
       diagnostics = {
         virtual_text = { spacing = 0, prefix = "" },
         signs = true,
         underline = true,
       },
+      filetypes = { "php", "phtml" },
     },
-    tailwindcss = {
-      active = false,
-      filetypes = {
-        "html",
-        "css",
-        "scss",
-        "javascript",
-        "javascriptreact",
-        "typescript",
-        "typescriptreact",
-      },
-    },
-    clang = {
+    python = {
+      linter = "",
+      isort = false,
       diagnostics = {
         virtual_text = { spacing = 0, prefix = "" },
         signs = true,
         underline = true,
       },
-      cross_file_rename = true,
-      header_insertion = "never",
+      analysis = {
+        type_checking = "basic",
+        auto_search_paths = true,
+        use_library_code_types = true,
+      },
     },
     ruby = {
       diagnostics = {
@@ -180,14 +180,11 @@ O = {
       },
       filetypes = { "rb", "erb", "rakefile", "ruby" },
     },
-    go = {},
-    elixir = {},
-    vim = {},
-    yaml = {},
-    terraform = {},
     rust = {
       rust_tools = {
         active = false,
+        parameter_hints_prefix = "<-",
+        other_hints_prefix = "=>", -- prefix for all the other hints (type, chaining)
       },
       linter = "",
       diagnostics = {
@@ -196,37 +193,41 @@ O = {
         underline = true,
       },
     },
-    svelte = {},
-
-    php = {
-      format = {
-        format = {
-          default = "psr12",
-        },
+    sh = {
+      -- @usage can be 'shellcheck'
+      linter = "",
+      -- @usage can be 'shfmt'
+      diagnostics = {
+        virtual_text = { spacing = 0, prefix = "" },
+        signs = true,
+        underline = true,
       },
-      environment = {
-        php_version = "7.4",
+    },
+    svelte = {},
+    tailwindcss = {
+      active = false,
+      filetypes = {
+        "html",
+        "css",
+        "scss",
+        "javascript",
+        "javascriptreact",
+        "typescript",
+        "typescriptreact",
       },
+    },
+    terraform = {},
+    tsserver = {
+      -- @usage can be 'eslint'
+      linter = "",
       diagnostics = {
         virtual_text = { spacing = 0, prefix = "" },
         signs = true,
         underline = true,
       },
-      filetypes = { "php", "phtml" },
-    },
-    latex = {},
-    kotlin = {},
-    html = {},
-    elm = {},
-    emmet = { active = true },
-    graphql = {},
-    efm = {},
-    docker = {},
-    cmake = {},
-    java = {},
-    css = {
-      virtual_text = true,
     },
+    vim = {},
+    yaml = {},
   },
 
   dashboard = {