Skip to content

[Feature] [nimsuggest] semantik highlight for unused imports and dead code #22804

Open
@aMOPel

Description

@aMOPel

Summary

Feature Request

Semantik tokens for

  • unused imports
  • dead code sections

after a highlight request to nimsuggest.

This would allow the LSP the give semantic tokens to the editor and the editor to then highlight those sections as comments or similar, which would improve the developer experience.

Description

Since chk does already know about these things, it shouldn't be too complicated to give the same information to highlight.

Alternatives

No response

Examples

import std/strutils # unused import

if true:
  echo "hi"
else: 
  echo "hi" # dead code # not detected by nimsuggest chk yet

for i in 0..5:
  echo "hi"
  break
  echo "hi" # dead code

proc a() =
  echo "hi"
  return
  echo "hi" # dead code

Backwards Compatibility

No response

Links

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions