-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: improve default haxe_language_server init_options #3284
Conversation
@@ -1,18 +1,36 @@ | |||
local util = require 'lspconfig.util' | |||
|
|||
local function find_hxml(path) | |||
return vim.fs.find(function(name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use vim.fs.root
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vim.fs.root
seems to return the parent directory, but I'd like to find a file. e.g. /path/to/project/build.hxml
init_options = {}, | ||
on_new_config = function(new_config, new_root_dir) | ||
if new_config.init_options.displayArguments then | ||
print 'displayArguments already set. Skipping' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use vim.notify replace print
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one I left in by mistake while debugging. I've replaced the other one with vim.notify
.
dc97f6c
to
964497f
Compare
Previously, it would detect the root dir by matching with "*.hxml", however, it would use "build.hxml" as the default `displayArguments` even though it may not exist. This could cause the error: ``` haxe_language_server: -32603: Error: Could not process argument build.hxml (file not found) Invalid character: ``` Now it will use the first ".hxml" file that is found in the project. It will only do this if no `displayArguments` value has been set in the `setup()` call, so it will still respect user set values. If no hxml file is found, then it uses empty `displayArguments`, which is still better than a broken configuration.
964497f
to
f342b7f
Compare
Adds
.git
as a root directory pattern.Previously, it would detect the root dir by matching with "*.hxml", however, it
would use "build.hxml" as the default
displayArguments
even though it may notexist. This could cause the error:
Now it will use the first ".hxml" file that is found in the project. It will
only do this if no
displayArguments
value has been set in thesetup()
call,so it will still respect user set values.
If no hxml file is found, then it uses empty
displayArguments
, which is stillbetter than a broken configuration.