iamcco / iamcco/diagnostic-languageserver

Support JSON lines output

Open
#87 0 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
TypeScript
Stars
439
Forks
30
PR merge metrics
No merged PRs in 30d

Description

It would be nice if the was an option to parse output from tools that output JSON lines[^1]. For example Selene[^2] is such a tool:

```console
$ selene --display-style json2 --no-summary init.lua
...
{"type":"Diagnostic","severity":"Warning","code":"unscoped_variables","message":"`vim` is not declared locally, and will be available in every scope","primary_label":{"filename":"init.lua","span":{"start":11315,"start_line":339,"start_column":0,"end":11318,"end_line":339,"end_column":3},"message":""},"notes":[],"secondary_labels":[]}
{"type":"Diagnostic","severity":"Error","code":"undefined_variable","message":"`vim` is not defined","primary_label":{"filename":"init.lua","span":{"start":11477,"start_line":346,"start_column":0,"end":11480,"end_line":346,"end_column":3},"message":""},"notes":[],"secondary_labels":[]}
{"type":"Diagnostic","severity":"Error","code":"undefined_variable","message":"`vim` is not defined","primary_label":{"filename":"init.lua","span":{"start":11605,"start_line":349,"start_column":0,"end":11608,"end_line":349,"end_column":3},"message":""},"notes":[],"secondary_labels":[]}
{"type":"Diagnostic","severity":"Warning","code":"unscoped_variables","message":"`vim` is not declared locally, and will be available in every scope","primary_label":{"filename":"init.lua","span":{"start":11605,"start_line":349,"start_column":0,"end":11608,"end_line":349,"end_column":3},"message":""},"notes":[],"secondary_labels":[]}
...
```

Something similar to `errorsRoot` I guess, but `jsonLines: true|false`.

[^1]: https://jsonlines.org/
[^2]: https://github.com/Kampfkarren/selene

Contributor guide

No contributing guide indexed for this repository

Research direction

No files or tests are named. Start by tracing the existing errorsRoot option and the linter-output parsing entry point, then compare the expected Selene JSON-lines records with the current parser. Done means a jsonLines option can parse one diagnostic object per line and expose the resulting diagnostics without breaking existing output formats.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.