From: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Thu, 6 Jul 2023 14:21:20 +0000 (-0700)
Subject: Error loading the plugin if OptionsSet() function is not used
X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=a8b41bb19784425d43a9810d877c27058cb0c8e1;p=vim-lsp.git

Error loading the plugin if OptionsSet() function is not used
---

diff --git a/autoload/lsp/options.vim b/autoload/lsp/options.vim
index b8fbb95..96ba5c8 100644
--- a/autoload/lsp/options.vim
+++ b/autoload/lsp/options.vim
@@ -91,6 +91,8 @@ export const COMPLETIONMATCHER_CASE = 1
 export const COMPLETIONMATCHER_ICASE = 2
 export const COMPLETIONMATCHER_FUZZY = 3
 
+lspOptions.completionMatcherValue = COMPLETIONMATCHER_CASE
+
 # set the LSP plugin options from the user provided option values
 export def OptionsSet(opts: dict<any>)
   lspOptions->extend(opts)
@@ -103,11 +105,12 @@ export def OptionsSet(opts: dict<any>)
 
   # For faster comparison, convert the 'completionMatcher' option value from a
   # string to a number.
-  lspOptions.completionMatcherValue = COMPLETIONMATCHER_CASE
   if lspOptions.completionMatcher == 'icase'
     lspOptions.completionMatcherValue = COMPLETIONMATCHER_ICASE
   elseif lspOptions.completionMatcher == 'fuzzy'
     lspOptions.completionMatcherValue = COMPLETIONMATCHER_FUZZY
+  else
+    lspOptions.completionMatcherValue = COMPLETIONMATCHER_CASE
   endif
 enddef