Closed shth closed 2 years ago
I've also been experiencing this, no matter what configuration I add, the LSP can't seem to pair the feature files and the context / glue files together.
I may say something terribly wrong, but I'll give it a try π β
In vscode, the settings "features" and "glue" are arrays, not plain object. Is it different here?
@aurelien-reeves so workspace/didChangeConfiguration
reqeuest is supported right now?
Yes, didChangeConfiguration should be supported. What I was saying is that your configuration seems to be wrong.
Try to replace your plain object with an array:
settings = {
- features= {'features/**/*.feature'},
+ features= ['features/**/*.feature'],
- glue = {'src/Behat/*.php'}
+ glue = ['src/Behat/*.php']
}
@shth what kind of syntax is this? It resembles JSON, but looks different. Is it something from Vim?
settings = {
features= {'features/**/*.feature'},
glue = {'src/Behat/*.php'}
}
Does {'features/**/*.feature'}
mean "array with one element"? Where are you specifying that these settings are to be picked up by the Cucumber Language Server?
There are some nvim docs for cucumber-language-server (presumably generated by a script/bot).
Although it's absent from these docs, other language servers have an init_options
section and a settings
section. Do you have something like this?
require'lspconfig'.cucumber_language_server.setup{
settings = {
features= { "features/**/*.feature" },
glue = { "src/Behat/*.php" }
}
}
@aslakhellesoy here's what my config looks like. The syntax is lua syntax, which is used by neovim.
require("lvim.lsp.manager").setup("cucumber_language_server", {
cmd = { "cucumber-language-server", "--stdio" },
filetypes = { "cucumber", "feature" },
root_dir = require("lspconfig").util.find_git_ancestor,
settings = {
features= {'features/**/*.feature'},
glue = {'src/Behat/*.php'}
}
})
features= { "features/**/*.feature" }
should equal features: [ "features/**/*.feature" ]
in json, but I have yet to confirm with downstream if the lsp client actually emits array.
Thanks @shth. Would you be able to:
(*) Add logging statements above and below this line: https://github.com/cucumber/language-server/blob/1641d3612bcbea8e7fe51e2cd05198b2a1289703/src/CucumberLanguageServer.ts#L65
this.connection.console.info('*** client supports workspace/configuration')
connection.onDidChangeConfiguration((params) => {
this.connection.console.info(`*** client supplied configuration: JSON.stringify(params, null, 2)`)
this.reindex(<Settings>params.settings).catch((err) => {
connection.console.error(`Failed to reindex: ${err.stack}`)
})
})
Then share the logging output in this ticket? Thanks!
... The syntax is lua syntax, which is used by neovim.
Sorry for the confusion :(
@shth have you tried cucumber
instead of cucumber_language_server
?
Also, please try the latest version (I published 12.2.1 today)
@aurelien-reeves no worries!
@aslakhellesoy The log message confirms that it is an array
[DEBUG][2022-05-30 18:17:20] .../vim/lsp/rpc.lua:454 "rpc.receive" { jsonrpc = "2.0", method = "window/logMessage", params = { message = '*** client supplied configuration: {\n "settings": {\n "glue": [\n "src/Behat/*.php"\n ],\n "features": [\n "features/**/*.feature"\n ]\n }\n}', type = 3 }}
However, I think the glue files are loaded properly after updating to 0.12.9
. Thanks! I'm closing it now
[TRACE][2022-05-30 18:20:25] .../lua/vim/lsp.lua:792 "notification" "window/logMessage" { message = '* Found 13 glue file(s) in ["src/Behat/*.php"]', type = 3}
[TRACE][2022-05-30 18:20:25] ...lsp/handlers.lua:487 "default_handler" "window/logMessage" { ctx = '{\n client_id = 1,\n method = "window/logMessage"\n}', result = { message = '* Found 13 glue file(s) in ["src/Behat/*.php"]', type = 3 }}
[INFO][2022-05-30 18:20:25] ...lsp/handlers.lua:458 '* Found 13 glue file(s) in ["src/Behat/*.php"]'
π€ What's the problem you're trying to solve?
I am using neovim with
cucumber_language_server
installed, but the language server cannot find the glue files with the following config.the log file shows that the config was passed to server with
workspace/didChangeConfiguration
request⨠What's your proposed solution?
Support
workspace/didChangeConfiguration
request so that the setting can be passed with this requestβ Have you considered any alternatives or workarounds?
π Any additional context?
This text was originally generated from a template, then edited by hand. You can modify the template here.