Automattic / Automattic/harper

Feat: Toggle diagnostics inside of files

Open
#184 4 comments 10 reactions 0 assignees View on GitHub
harper-ls
Dominant language
Rust
Stars
15.4k
Forks
627
Avg merge
1d 15h
Merged PRs (30d)
106

Description

Some LSP provide a way to disable their diagnostics. For example,
```lua
---@diagnostics disable
```

I think this would be a good feature to add to `harper_ls` as some files can easily create 1000s of warnings otherwise.

## Proposed solution

Provide a way to disable the diagnostics on specific lines.
```md

a line that doesn't start with a capital letter

```

Or something like
```lua
---@harper disable-next-line
---@param buf integer?
local function do_stuf (buf)
-- Do something here
end
```

It might be a good idea to disable specific rules too.

```c
// Ignores only capitalization warnings
// @harper disable capital

// Ignores spelling mistakes
// @harper disable spell

// Ignores too many spaces warning
// @harper disable whitespace

// Ignore warnings on lines that are too long
// @harper disable length
```

Contributor guide

Open the contributing guide

Research direction

Start by reviewing how harper_ls receives file contents and publishes diagnostics; the issue names no files, tests, or entry points. Decide which inline directive syntax and rule-specific behavior are in scope, then define tests that confirm diagnostics are suppressed and re-enabled at the requested lines.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.