feat!(lsp): move ltex-ls-plus to neovim native LSP config
- BREAKING CHANGE: need neovim >0.11 - https://neovim.io/doc/user/news-0.11.html#_lsp
This commit is contained in:
		
							
								
								
									
										56
									
								
								lsp/ltex_plus.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										56
									
								
								lsp/ltex_plus.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,56 @@
 | 
			
		||||
local language_id_mapping = {
 | 
			
		||||
  bib = 'bibtex',
 | 
			
		||||
  pandoc = 'markdown',
 | 
			
		||||
  plaintex = 'tex',
 | 
			
		||||
  rnoweb = 'rsweave',
 | 
			
		||||
  rst = 'restructuredtext',
 | 
			
		||||
  tex = 'latex',
 | 
			
		||||
  text = 'plaintext',
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
local function get_language_id(_, filetype)
 | 
			
		||||
  return language_id_mapping[filetype] or filetype
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
return {
 | 
			
		||||
  cmd = { 'ltex-ls-plus' },
 | 
			
		||||
  filetypes = {
 | 
			
		||||
    'markdown',
 | 
			
		||||
    'pandoc',
 | 
			
		||||
    'latex',
 | 
			
		||||
    'text',
 | 
			
		||||
    'norg',
 | 
			
		||||
    'gitcommit',
 | 
			
		||||
    'jj',
 | 
			
		||||
    'rst',
 | 
			
		||||
    'typst'
 | 
			
		||||
  },
 | 
			
		||||
  get_language_id = get_language_id,
 | 
			
		||||
  single_file_support = true,
 | 
			
		||||
  settings = {
 | 
			
		||||
    ltex = {
 | 
			
		||||
      language = "auto",
 | 
			
		||||
      diagnosticSeverity = "information",
 | 
			
		||||
      checkFrequency = "save",
 | 
			
		||||
      sentenceCacheSize = 2000,
 | 
			
		||||
      additionalRules = {
 | 
			
		||||
        enablePickyRules = true,
 | 
			
		||||
        motherTongue = "fr",
 | 
			
		||||
      },
 | 
			
		||||
      enabledRules = {
 | 
			
		||||
        en = { "EN_CONSISTENT_APOS" },
 | 
			
		||||
      },
 | 
			
		||||
      disabledRules = {
 | 
			
		||||
        fr = { "APOS_TYP", "FRENCH_WHITESPACE", "CHANGE", "ISSUE" },
 | 
			
		||||
        en = { "DASH_RULE", "TWO_HYPHENS", "CHANGE", "ISSUE", "CHECK",
 | 
			
		||||
          "ACTUALLY", "CONSISTENT" },
 | 
			
		||||
      },
 | 
			
		||||
      dictionary = {
 | 
			
		||||
        fr = { "CryptPad", "Chouhartem",
 | 
			
		||||
          -- field names
 | 
			
		||||
          "authors", "categories", "created", "updated", "title", "meta" },
 | 
			
		||||
        en = { "CryptPad", },
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										39
									
								
								lua/lsp.lua
									
									
									
									
									
								
							
							
						
						
									
										39
									
								
								lua/lsp.lua
									
									
									
									
									
								
							@@ -154,42 +154,6 @@ servers = {
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  gdscript = {},
 | 
			
		||||
  ltex_plus = {
 | 
			
		||||
    filetypes = {
 | 
			
		||||
      'markdown',
 | 
			
		||||
      'latex',
 | 
			
		||||
      'text',
 | 
			
		||||
      'norg',
 | 
			
		||||
      'gitcommit',
 | 
			
		||||
      'jj',
 | 
			
		||||
      'rst',
 | 
			
		||||
      'typst'
 | 
			
		||||
    },
 | 
			
		||||
    ltex = {
 | 
			
		||||
      language = "auto",
 | 
			
		||||
      diagnosticSeverity = "information",
 | 
			
		||||
      checkFrequency = "save",
 | 
			
		||||
      sentenceCacheSize = 2000,
 | 
			
		||||
      additionalRules = {
 | 
			
		||||
        enablePickyRules = true,
 | 
			
		||||
        motherTongue = "fr",
 | 
			
		||||
      },
 | 
			
		||||
      enabledRules = {
 | 
			
		||||
        en = { "EN_CONSISTENT_APOS" },
 | 
			
		||||
      },
 | 
			
		||||
      disabledRules = {
 | 
			
		||||
        fr = { "APOS_TYP", "FRENCH_WHITESPACE", "CHANGE", "ISSUE" },
 | 
			
		||||
        en = { "DASH_RULE", "TWO_HYPHENS", "CHANGE", "ISSUE", "CHECK",
 | 
			
		||||
          "ACTUALLY", "CONSISTENT" },
 | 
			
		||||
      },
 | 
			
		||||
      dictionary = {
 | 
			
		||||
        fr = { "CryptPad", "Chouhartem",
 | 
			
		||||
          -- field names
 | 
			
		||||
          "authors", "categories", "created", "updated", "title", "meta" },
 | 
			
		||||
        en = { "CryptPad", },
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
for server_name, server_settings in pairs(servers) do
 | 
			
		||||
@@ -222,4 +186,7 @@ local setup_godot_dap = function()
 | 
			
		||||
  }
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
vim.diagnostic.config({ virtual_lines = true })
 | 
			
		||||
vim.lsp.enable({ "ltex_plus" })
 | 
			
		||||
 | 
			
		||||
setup_godot_dap()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user