Skip to content
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

lsp-zig-enable-build-on-save is not working #4516

Open
3 tasks done
iskyd opened this issue Jul 30, 2024 · 0 comments
Open
3 tasks done

lsp-zig-enable-build-on-save is not working #4516

iskyd opened this issue Jul 30, 2024 · 0 comments
Labels

Comments

@iskyd
Copy link

iskyd commented Jul 30, 2024

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain

Bug description

using lsp-zig-enable-build-on-save dont report compile errors.

I'm using the following configuration

(use-package lsp-mode
  :ensure t
  :init
  (setq lsp-print-io t)
  (setq lsp-zig-enable-build-on-save t)
  (setq lsp-zig-build-on-save-step "install")
  :hook (;; replace XXX-mode with concrete major-mode(e. g. python-mode)
         (zig-mode . lsp-deferred)
:commands lsp-deferred)

(use-package zig-mode
  :ensure t
  (add-hook 'zig-mode-hook
            (lambda ()
              (setq compile-command "zig build"))
            )
  )

From lsp-log I see that the configuration sent seems ok, it sent enable_build_on_save and the correct build_on_save_step.

Steps to reproduce

Setup a new zig project with zig init, go to src/main.zig and change anything in a way that the program will not compile.
Save the file, no error will be reported.

Expected behavior

All compile error should be reported

Which Language Server did you use?

lsp-zig

OS

Linux

Error callstack

[Trace - 07:28:01 ] Received request 'workspace/configuration - (i_haz_configuration).
Params: {
  "items": [
    {
      "section": "zls.enable_snippets"
    },
    {
      "section": "zls.enable_argument_placeholders"
    },
    {
      "section": "zls.enable_build_on_save"
    },
    {
      "section": "zls.build_on_save_step"
    },
    {
      "section": "zls.enable_autofix"
    },
    {
      "section": "zls.semantic_tokens"
    },
    {
      "section": "zls.enable_inlay_hints"
    },
    {
      "section": "zls.inlay_hints_show_variable_type_hints"
    },
    {
      "section": "zls.inlay_hints_show_struct_literal_field_type"
    },
    {
      "section": "zls.inlay_hints_show_parameter_name"
    },
    {
      "section": "zls.inlay_hints_show_builtin"
    },
    {
      "section": "zls.inlay_hints_exclude_single_argument"
    },
    {
      "section": "zls.inlay_hints_hide_redundant_param_names"
    },
    {
      "section": "zls.inlay_hints_hide_redundant_param_names_last_token"
    },
    {
      "section": "zls.warn_style"
    },
    {
      "section": "zls.highlight_global_var_declarations"
    },
    {
      "section": "zls.dangerous_comptime_experiments_do_not_enable"
    },
    {
      "section": "zls.skip_std_references"
    },
    {
      "section": "zls.prefer_ast_check_as_child_process"
    },
    {
      "section": "zls.builtin_path"
    },
    {
      "section": "zls.zig_lib_path"
    },
    {
      "section": "zls.zig_exe_path"
    },
    {
      "section": "zls.build_runner_path"
    },
    {
      "section": "zls.global_cache_path"
    },
    {
      "section": "zls.build_runner_global_cache_path"
    },
    {
      "section": "zls.completion_label_details"
    }
  ]
}


[Trace - 07:28:01 ] Sending response 'workspace/configuration - (i_haz_configuration)'. Processing request took 7ms
Params: {
  "jsonrpc": "2.0",
  "id": "i_haz_configuration",
  "result": [
    true,
    true,
    true,
    "install",
    false,
    "partial",
    true,
    true,
    null,
    true,
    true,
    true,
    false,
    false,
    false,
    false,
    false,
    false,
    true,
    "",
    "",
    "",
    "",
    "",
    "",
    false
  ]
}

Anything else?

No response

@iskyd iskyd added the bug label Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant