fix sqls bug, add start.sh

This commit is contained in:
git
2022-07-08 04:03:03 +08:00
parent 24cdd07e35
commit 9cd1989c5c
9 changed files with 61 additions and 7 deletions
+5 -1
View File
@@ -2,7 +2,7 @@
-- https://github.com/mattn/efm-langserver
return {
init_options = { documentFormatting = true },
filetypes = { 'python', 'json', 'css' },
filetypes = { 'python', 'json', 'css', 'yaml' },
settings = {
rootMarkers = { ".git/" },
languages = {
@@ -15,6 +15,10 @@ return {
{ formatCommand = "fixjson", formatStdin = true }
},
-- yarn global add yaml-lint
yaml = {
{ formatCommand = "yamllint -f parsable -", formatStdin = true }
},
css = {
-- yarn global add prettier
{ formatCommand = "prettier --tab-width=4 ${--single-quote:singleQuote} --parser css", formatStdin = true }
+1
View File
@@ -35,6 +35,7 @@ local servers = {
pyright = require "lsp.base",
rust_analyzer = require "lsp.base",
tailwindcss = require "lsp.tailwind",
sqls = require "lsp.sql",
efm = require "lsp.efm"
}
+30
View File
@@ -0,0 +1,30 @@
#! /usr/bin/env lua
--
-- sql.lua
-- Copyright (C) 2022 veypi <i@veypi.com>
--
-- Distributed under terms of the Apache license.
--
return {
settings = {
sqls = {
connections = {
{
driver = 'mysql',
dataSourceName = 'root:123456@tcp(127.0.0.1:3306)/test',
},
},
},
},
on_attach = function(client)
-- sqls there seem a bug when format file
client.resolved_capabilities.document_formatting = false
client.resolved_capabilities.document_range_formatting = false
client.server_capabilities.documentFormattingProvider = false
client.server_capabilities.documentRangeFormattingProvider = false
-- print(vim.inspect(client))
end,
}
-1
View File
@@ -53,7 +53,6 @@ return require('packer').startup(function()
use 'lewis6991/gitsigns.nvim'
use 'ybian/smartim'
use 'aperezdc/vim-template'