Browse Source

Merge branch 'rolling' of github.com:ChristianChiarulli/LunarVim into rolling

Chris 4 years ago
parent
commit
96c5ff62f8
2 changed files with 70 additions and 4 deletions
  1. 66 0
      lua/default-config.lua
  2. 4 4
      lua/lv-utils/init.lua

+ 66 - 0
lua/default-config.lua

@@ -497,6 +497,28 @@ lvim.lang = {
       },
     },
   },
+  javascriptreact = {
+    -- @usage can be prettier or eslint
+    formatter = {
+      exe = "prettier",
+      args = {},
+    },
+    linters = {
+      "eslint",
+    },
+    lsp = {
+      provider = "tsserver",
+      setup = {
+        cmd = {
+          -- TODO:
+          DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server",
+          "--stdio",
+        },
+        on_attach = require("lsp").common_on_attach,
+        capabilities = require("lsp").common_capabilities(),
+      },
+    },
+  },
   python = {
     -- @usage can be flake8 or yapf
     formatter = {
@@ -664,6 +686,50 @@ lvim.lang = {
       },
     },
   },
+  typescript = {
+    -- @usage can be prettier or eslint
+    formatter = {
+      exe = "prettier",
+      args = {},
+    },
+    linters = {
+      "eslint",
+    },
+    lsp = {
+      provider = "tsserver",
+      setup = {
+        cmd = {
+          -- TODO:
+          DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server",
+          "--stdio",
+        },
+        on_attach = require("lsp").common_on_attach,
+        capabilities = require("lsp").common_capabilities(),
+      },
+    },
+  },
+  typescriptreact = {
+    -- @usage can be prettier or eslint
+    formatter = {
+      exe = "prettier",
+      args = {},
+    },
+    linters = {
+      "eslint",
+    },
+    lsp = {
+      provider = "tsserver",
+      setup = {
+        cmd = {
+          -- TODO:
+          DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server",
+          "--stdio",
+        },
+        on_attach = require("lsp").common_on_attach,
+        capabilities = require("lsp").common_capabilities(),
+      },
+    },
+  },
   vim = {
     formatter = {
       exe = "",

+ 4 - 4
lua/lv-utils/init.lua

@@ -35,9 +35,9 @@ local function r_inspect_settings(structure, limit, separator)
   separator = separator:gsub("%.%[", "%[")
   if type(structure) == "function" then
     -- don't print functions
-    io.write("-- O", separator:sub(2), " = function ()\n")
+    io.write("-- lvim", separator:sub(2), " = function ()\n")
   else
-    io.write("O", separator:sub(2), " = ", tostring(structure), "\n")
+    io.write("lvim", separator:sub(2), " = ", tostring(structure), "\n")
   end
   return limit - 1
 end
@@ -49,8 +49,8 @@ function lv_utils.generate_settings()
   -- sets the default output file as test.lua
   io.output(file)
 
-  -- write all `O` related settings to `lv-settings.lua` file
-  r_inspect_settings(O, 10000, ".")
+  -- write all `lvim` related settings to `lv-settings.lua` file
+  r_inspect_settings(lvim, 10000, ".")
 
   -- closes the open file
   io.close(file)