harper_zed icon indicating copy to clipboard operation
harper_zed copied to clipboard

Can not start ls

Open failable opened this issue 1 year ago • 15 comments

Debug log

Server initialized!
stderr: [2m2024-11-12T03:06:42.748722Z[0m [31mERROR[0m [2mharper_ls::backend[0m[2m:[0m Unable to change config: Settings must contain a "harper-ls" key.
stderr: [2m2024-11-12T03:06:42.750954Z[0m [31mERROR[0m [2mharper_ls::backend[0m[2m:[0m Unable to change config: Settings must contain a "harper-ls" key.
stderr: [2m2024-11-12T03:06:42.751174Z[0m [31mERROR[0m [2mharper_ls::backend[0m[2m:[0m Unable to change config: Settings must contain a "harper-ls" key.
stderr: [2m2024-11-12T03:06:43.196347Z[0m [31mERROR[0m [2mharper_ls::backend[0m[2m:[0m Unable to change config: Settings must contain a "harper-ls" key.
stderr: [2m2024-11-12T03:06:43.196526Z[0m [31mERROR[0m [2mharper_ls::backend[0m[2m:[0m Unable to change config: Settings must contain a "harper-ls" key.
stderr: [2m2024-11-12T03:06:43.234872Z[0m [31mERROR[0m [2mharper_ls::backend[0m[2m:[0m Unable to change config: Settings must contain a "harper-ls" key.
stderr: [2m2024-11-12T03:06:43.241316Z[0m [31mERROR[0m [2mharper_ls::backend[0m[2m:[0m Unable to change config: Settings must contain a "harper-ls" key.

failable avatar Nov 12 '24 03:11 failable

Hi, to me this looks like an issue with your Zed configuration. Without more information I can't really help here.

Stef16Robbe avatar Nov 13 '24 18:11 Stef16Robbe

Hello, below is my whole config, do I need to install the LS manually?

{
  "vim_mode": false,
  "show_wrap_guides": false,
  "projects_online_by_default": false,
  "theme": "One Light",
  "ui_font_size": 14,
  "ui_font_family": "SF Pro",
  "buffer_font_family": "DM Mono",
  "buffer_font_size": 12,
  "buffer_line_height": "standard",
  "default_dock_anchor": "expanded",
  "cursor_blink": false,
  "confirm_quit": true,
  "always_treat_brackets_as_autoclosed": true,
  "show_completion_documentation": false,
  "hover_popover_enabled": false,
  "extend_comment_on_newline": false,
  "use_system_path_prompts": false,
  "features": {
    "inline_completion_provider": "copilot"
  },
  "tabs": {
    "close_position": "left"
  },
  "inlay_hints": {
    "enabled": false
  },
  "collaboration_panel": {
    "button": false
  },
  "chat_panel": {
    "button": false
  },
  "notification_panel": {
    "button": false
  },
  "outline_panel": {
    "button": false
  },
  "assistant": {
    "default_model": {
      "provider": "anthropic",
      "model": "claude-3-5-sonnet-latest"
    },
    "provider": null,
    "version": "2",
    "button": false,
    "default_width": 640,
    "open_on_startup": false,
    "enable_experimental_live_diffs": true
  },
  "file_finder": {
    "file_icons": false
  },
  "gutter": {
    "line_numbers": false,
    "code_actions": false,
    "folds": false,
    "runnables": false
  },
  "toolbar": {
    "breadcrumbs": true,
    "quick_actions": false
  },
  "tab_bar": {
    "show": false,
    "show_nav_history_buttons": false
  },
  "task": {
    "show_status_indicator": false
  },
  "git": {
    "inline_blame": {
      "enabled": false
    },
    "git_gutter": "tracked_files"
  },
  "project_panel": {
    "button": false,
    "scrollbar": {
      "show": "never"
    }
  },
  "scrollbar": {
    "show": "never"
  },
  "indent_guides": {
    "enabled": false
  },
  "calls": {
    "mute_on_join": true,
    "share_on_join": false
  },
  "journal": {
    "hour_format": "hour24"
  },
  "file_scan_exclusions": [
    "typings",
    "**/.git",
    "**/.svn",
    "**/.hg",
    "**/CVS",
    "**/.DS_Store",
    "**/Thumbs.db",
    "**/.classpath",
    "**/.settings"
  ],
  "languages": {
    "Python": {
      "language_servers": ["basedpyright", "ruff", "!pyright"],
      "format_on_save": "on",
      "formatter": [
        {
          "code_actions": {
            "source.organizeImports.ruff": true,
            "source.fixAll.ruff": true
          }
        },
        {
          "language_server": {
            "name": "ruff"
          }
        }
      ]
    }
  },
  "lsp": {
    "rust-analyzer": {
      "initialization_options": {
        "checkOnSave": {
          "command": "clippy"
        }
      }
    }
  },
  "file_types": {
    "Shell Script": [".env.*", ".env-*"],
    "Dockerfile": ["Dockerfile*"]
  },
  "terminal": {
    "dock": "right",
    "button": false,
    "blinking": "off",
    "line_height": "standard",
    "env": {
      "EDITOR": "zed --wait"
    },
    "cursor_shape": "bar"
  },
  "telemetry": {
    "diagnostics": false,
    "metrics": false
  },
  // One Light
  "experimental.theme_overrides": {
    "status_bar.background": "#fafafa",
    "title_bar.background": "#fafafa",
    "tab_bar.background": "#f6f6f6",
    "tab.inactive_background": "#f6f6f6",
    "panel.background": "#fafafa",
    "border": "#f6f6f6",
    "border.variant": "#f0f0f0",
    "hint": "#bbbbbbf0",
    "editor.active_line.background": "#aaaaaa0f",
    "ghost_element.selected": "#f1f1f1",
    "ghost_element.hover": "#eaeaea",
    "ghost_element.active": "#dadada",
    "warning": "#ffa54fcc",
    "background": "#fafafa",
    "text": "#454545",
    "text.muted": "#a0a0a0",
    "elevated_surface.background": "#f6f6f6",
    "editor.document_highlight.write_background": "#DCE1E6",
    "conflict": "#8839ef",
    "conflict.border": "#8839ef",
    "conflict.background": "#e6e9ef",
    "created": "#1ba01bc0",
    "created.border": "#1ba01bc0",
    "created.background": "#e6e9ef",
    "deleted": "#d20f09c0",
    "deleted.border": "#d20f09c0",
    "deleted.background": "#e6e9ef",
    "modified": "#df8e1dc0",
    "modified.border": "#df8e1dc0",
    "modified.background": "#e6e9ef"
  }
}

failable avatar Nov 15 '24 06:11 failable

Same issue on macOS with freshly installed (default config) Zed.

Jollywatt avatar Nov 21 '24 22:11 Jollywatt

This is because the binary expects a "harper-ls" key in the "lsp" section

nuIIpointerexception avatar Nov 21 '24 22:11 nuIIpointerexception

In which file should that key be put, and what should its value be? (Sorry, Zed novice speaking.)

Jollywatt avatar Nov 21 '24 23:11 Jollywatt

In which file should that key be put, and what should its value be? (Sorry, Zed novice speaking.)

does it not work for you even though this error is being thrown? im currently exploring optimal solutions, but it isnt that obvious im afraid. suddenly i start getting it with my new fork too @.@

nuIIpointerexception avatar Nov 21 '24 23:11 nuIIpointerexception

In which file should that key be put, and what should its value be? (Sorry, Zed novice speaking.)

Alright, i pushed a commit in my #6 pr

It is resolved there. I'd recommend to just wait until it gets completed and merged and then use it properly, shouldn't take too long.

nuIIpointerexception avatar Nov 21 '24 23:11 nuIIpointerexception

I do not understand what is happening, but in my settings.json I have

"lsp" : {
    "harper-ls": {
      "settings": {
        "harper-ls": {
          "completionEnabled": true,
          "userDictPath": "~/dict.txt",
          "fileDictPath": "~/.harper/",
          "diagnosticSeverity": "information",
          "codeActions": {
            "forceStable": false, // Force code actions to appear in "stable" positions
          },
          "linters": {
            "spell_check": true,
            "spelled_numbers": true,
            "an_a": true,
            "sentence_capitalization": true,
            "unclosed_quotes": true,
            "wrong_quotes": true,
            "long_sentences": true,
            "repeated_words": true,
            "spaces": true,
            "matcher": true,
            "correct_number_suffix": true,
            "number_suffix_capitalization": true,
            "multiple_sequential_pronouns": true,
            "linking_verbs": true,
            "avoid_curses": true,
            "terminating_conjunctions": true
          },
        },
      },
    },
}

and despite this I still get the error messages the OP experienced. And it does not correct spelling, nor grammar.

mocenigo avatar Dec 20 '24 17:12 mocenigo

I do not understand what is happening, but in my settings.json I have


"lsp" : {

    "harper-ls": {

      "settings": {

        "harper-ls": {

          "completionEnabled": true,

          "userDictPath": "~/dict.txt",

          "fileDictPath": "~/.harper/",

          "diagnosticSeverity": "information",

          "codeActions": {

            "forceStable": false, // Force code actions to appear in "stable" positions

          },

          "linters": {

            "spell_check": true,

            "spelled_numbers": true,

            "an_a": true,

            "sentence_capitalization": true,

            "unclosed_quotes": true,

            "wrong_quotes": true,

            "long_sentences": true,

            "repeated_words": true,

            "spaces": true,

            "matcher": true,

            "correct_number_suffix": true,

            "number_suffix_capitalization": true,

            "multiple_sequential_pronouns": true,

            "linking_verbs": true,

            "avoid_curses": true,

            "terminating_conjunctions": true

          },

        },

      },

    },

}

and despite this I still get the error messages the OP experienced. And it does not correct spelling, nor grammar.

Are you using my fork? On Master this isnt possible yet

nuIIpointerexception avatar Dec 21 '24 13:12 nuIIpointerexception

I do not understand what is happening, but in my settings.json I have


"lsp" : {

    "harper-ls": {

      "settings": {

[...]

  },

},

}


    
  
and despite this I still get the error messages the OP experienced. And it does not correct spelling, nor grammar.

Are you using my fork? On Master this isnt possible yet

Oh, I haven't. Is this a fork of harper-ls? In that case, I wil have a look.

mocenigo avatar Dec 21 '24 14:12 mocenigo

Ok, @nuIIpointerexception we have made progress. I have cloned your repo, switched to the settings branch, built is, and now I get "server initialised!" in the logs, which I take to be a good sign. Still, no list of suggestions occurs. For LaTeX files I have it enabled — I added "harper-ls" to the list of language servers, and the logs show that it is open in the current workspace. i also have a "harper-ls" process running. But it seems not to be doing anything :-/

mocenigo avatar Dec 21 '24 15:12 mocenigo

Ok, @nuIIpointerexception we have made progress. I have cloned your repo, switched to the settings branch, built is, and now I get "server initialised!" in the logs, which I take to be a good sign. Still, no list of suggestions occurs. For LaTeX files I have it enabled — I added "harper-ls" to the list of language servers, and the logs show that it is open in the current workspace. i also have a "harper-ls" process running. But it seems not to be doing anything :-/

Hmm alright. And you are sure you have grammatical mistakes detected by Harper in your file?

Maybe some of the settings cause this issue?

nuIIpointerexception avatar Dec 21 '24 22:12 nuIIpointerexception

Ok, @nuIIpointerexception we have made progress. I have cloned your repo, switched to the settings branch, built is, and now I get "server initialised!" in the logs, which I take to be a good sign. Still, no list of suggestions occurs. For LaTeX files I have it enabled — I added "harper-ls" to the list of language servers, and the logs show that it is open in the current workspace. i also have a "harper-ls" process running. But it seems not to be doing anything :-/

Hmm alright. And you are sure you have grammatical mistakes detected by Harper in your file?

Maybe some of the settings cause this issue?

nuIIpointerexception avatar Dec 21 '24 22:12 nuIIpointerexception

Ok, @nuIIpointerexception we have made progress. I have cloned your repo, switched to the settings branch, built is, and now I get "server initialised!" in the logs, which I take to be a good sign. Still, no list of suggestions occurs. For LaTeX files I have it enabled — I added "harper-ls" to the list of language servers, and the logs show that it is open in the current workspace. i also have a "harper-ls" process running. But it seems not to be doing anything :-/

Hmm alright. And you are sure you have grammatical mistakes detected by Harper in your file?

Maybe some of the settings cause this issue?

I see the problem now. It is in harper, LaTeX is not enabled. In C programs or in pure text files it works. I tried to recompile the harper branch with LaTeX support but compilation fails...

mocenigo avatar Dec 22 '24 15:12 mocenigo

Ok, @nuIIpointerexception we have made progress. I have cloned your repo, switched to the settings branch, built is, and now I get "server initialised!" in the logs, which I take to be a good sign. Still, no list of suggestions occurs. For LaTeX files I have it enabled — I added "harper-ls" to the list of language servers, and the logs show that it is open in the current workspace. i also have a "harper-ls" process running. But it seems not to be doing anything :-/

Hmm alright. And you are sure you have grammatical mistakes detected by Harper in your file?

Maybe some of the settings cause this issue?

I see the problem now. It is in harper, LaTeX is not enabled. In C programs or in pure text files it works.

I tried to recompile the harper branch with LaTeX support but compilation fails...

Yeah the language or file support seems very limited for now. Hopefully it picks up.

nuIIpointerexception avatar Dec 22 '24 15:12 nuIIpointerexception