var bufDir = bnr->bufname()->fnamemodify(':p:h')
return ftypeServerMap[ftype]->filter((key, lspserver) => {
- if lspserver.runIfSearchFiles->empty()
- return true
+ # Don't run the server if no path is found
+ if !lspserver.runIfSearchFiles->empty()
+ var path = util.FindNearestRootDir(bufDir, lspserver.runIfSearchFiles)
+
+ if path->empty()
+ return false
+ endif
endif
- var path = util.FindNearestRootDir(bufDir, lspserver.runIfSearchFiles)
+ # Don't run the server if a path is found
+ if !lspserver.runUnlessSearchFiles->empty()
+ var path = util.FindNearestRootDir(bufDir, lspserver.runUnlessSearchFiles)
- # Run the server if the path is found
- return !path->empty()
+ if !path->empty()
+ return false
+ endif
+ endif
+
+ # Run the server
+ return true
})
enddef
server.runIfSearch = []
endif
+ if !server->has_key('runUnlessSearch') || server.runUnlessSearch->type() != v:t_list
+ server.runUnlessSearch = []
+ endif
+
var lspserver: dict<any> = lserver.NewLspServer(server.name, server.path,
args, server.syncInit,
initializationOptions,
server.workspaceConfig,
server.rootSearch,
server.runIfSearch,
+ server.runUnlessSearch,
customNotificationHandlers,
features, server.debug)
workspaceConfig: dict<any>,
rootSearchFiles: list<any>,
runIfSearchFiles: list<any>,
+ runUnlessSearchFiles: list<any>,
customNotificationHandlers: dict<func>,
features: dict<bool>, debug_arg: bool): dict<any>
var lspserver: dict<any> = {
requests: {},
rootSearchFiles: rootSearchFiles,
runIfSearchFiles: runIfSearchFiles,
+ runUnlessSearchFiles: runUnlessSearchFiles,
omniCompletePending: false,
completionTriggerChars: [],
signaturePopup: -1,
started, otherwise it will not.
If this parameter is not specified or is an empty list,
- then the server will always be started.
+ then the server will be started unless
+ |lsp-cfg-runUnlessSearch| prevents it.
+
+ *lsp-cfg-runUnlessSearch*
+ runUnlessSearch (Optional) Opposite of |lsp-cfg-runIfSearch|.
Additionally the following configurations can be made: