serverEncoding = lspserver.caps['~additionalInitResult_offsetEncoding']
endif
+ if lspserver.forceOffsetEncoding != ''
+ serverEncoding = lspserver.forceOffsetEncoding
+ endif
+
# one of 'utf-8', 'utf-16' or 'utf-32'
if serverEncoding == 'utf-8'
lspserver.posEncoding = 8
server.initializationOptions = {}
endif
+ if !server->has_key('forceOffsetEncoding')
+ || server.forceOffsetEncoding->type() != v:t_string
+ || (server.forceOffsetEncoding != 'utf-8'
+ && server.forceOffsetEncoding != 'utf-16'
+ && server.forceOffsetEncoding != 'utf-32')
+ server.forceOffsetEncoding = ''
+ endif
+
if !server->has_key('customNotificationHandlers')
|| server.customNotificationHandlers->type() != v:t_dict
server.customNotificationHandlers = {}
name: serverParams.name,
path: serverParams.path,
args: serverParams.args->deepcopy(),
- syncInit: serverParams.syncInit,
- initializationOptions: serverParams.initializationOptions->deepcopy(),
- customNotificationHandlers: serverParams.customNotificationHandlers->deepcopy(),
- customRequestHandlers: serverParams.customRequestHandlers->deepcopy(),
- processDiagHandler: serverParams.processDiagHandler,
- features: serverParams.features->deepcopy(),
running: false,
ready: false,
job: v:none,
nextID: 1,
caps: {},
requests: {},
+ callHierarchyType: '',
+ completionTriggerChars: [],
+ customNotificationHandlers: serverParams.customNotificationHandlers->deepcopy(),
+ customRequestHandlers: serverParams.customRequestHandlers->deepcopy(),
+ debug: serverParams.debug,
+ features: serverParams.features->deepcopy(),
+ forceOffsetEncoding: serverParams.forceOffsetEncoding,
+ initializationOptions: serverParams.initializationOptions->deepcopy(),
+ messages: [],
+ omniCompletePending: false,
+ peekSymbolFilePopup: -1,
+ peekSymbolPopup: -1,
+ processDiagHandler: serverParams.processDiagHandler,
rootSearchFiles: serverParams.rootSearch->deepcopy(),
runIfSearchFiles: serverParams.runIfSearch->deepcopy(),
runUnlessSearchFiles: serverParams.runUnlessSearch->deepcopy(),
- omniCompletePending: false,
- completionTriggerChars: [],
+ selection: {},
signaturePopup: -1,
- typeHierPopup: -1,
+ syncInit: serverParams.syncInit,
+ traceLevel: serverParams.traceLevel,
typeHierFilePopup: -1,
- workspaceSymbolPopup: -1,
- workspaceSymbolQuery: '',
- peekSymbolPopup: -1,
- peekSymbolFilePopup: -1,
- callHierarchyType: '',
- selection: {},
+ typeHierPopup: -1,
workspaceConfig: serverParams.workspaceConfig->deepcopy(),
- messages: [],
- debug: serverParams.debug,
- traceLevel: serverParams.traceLevel
+ workspaceSymbolPopup: -1,
+ workspaceSymbolQuery: ''
}
lspserver.logfile = $'lsp-{lspserver.name}.log'
lspserver.errfile = $'lsp-{lspserver.name}.err'
Author: Yegappan Lakshmanan (yegappan AT yahoo DOT com)
For Vim version 9.0 and above
-Last change: June 7, 2023
+Last change: June 18, 2023
==============================================================================
CONTENTS *lsp-contents*
request replies which you might want to silence or
handle. The provided request handlers will be called
with a reference to the "lspserver" and the "request".
- *lsp-cfg-features*
- features
+
+ features *lsp-cfg-features*
(Optional) toggle which features should be enabled for
a given language server. See |lsp-multiple-servers|
and |lsp-features| for more information.
+
+ forceOffsetEncoding *lsp-cfg-forceOffsetEncoding*
+ (Optional) a |String| value that forces the use of a
+ specific offset encoding in LSP messages. If this
+ option is not specified, then the UTF offset encoding
+ is negotiated with the server during initialization.
+ Supported values are 'utf-8' or 'utf-16' or 'utf-32'.
+ The Vim native offset encoding is 'utf-32'. For the
+ 'utf-8' and 'utf-16' encodings, the offsets need to be
+ encoded and decoded in every LSP message and will
+ incur some overhead.
+
*lsp-cfg-omnicompl*
omnicompl (Optional) a boolean value that enables (true)
or disables (false) omni-completion for these file
types. By default this is set to "v:true". This value
is applicable only if auto completion is disabled
(|lsp-opt-autoComplete|).
+
*lsp-cfg-processDiagHandler*
processDiagHandler
(Optional) A |Funcref| or |lambda| that takes a list
call is used to initialize the language server,
otherwise the server is initialized asynchronously.
By default this is set to "false".
+
*lsp-cfg-debug*
debug (Optional) log the messages printed by this language
server in stdout and stderr to a file. Useful for
debugging a language server. By default the
messages are not logged. See |lsp-debug| for more
information.
+
*lsp-cfg-traceLevel*
traceLevel (Optional) set the debug trace level for this language
server. Supported values are: "off", "debug" and