Skip to content

nimsuggest output differ much from nim compiler #24820

@Q-Master

Description

@Q-Master

Nim Version

Nim Compiler Version 2.2.2 [Linux: amd64]
Compiled at 2025-02-06
Copyright (c) 2006-2025 by Andreas Rumpf

git hash: 6c34f62
active boot switches: -d:release

Description

nimsuggest via nim langserver shows an error Redefining UserAuth: line 10, column 3 in this code using my nim library nimble install packets

import std/[parseopt]
import packets/packets
import packets/json/serialization


var uids: seq[string]


packet UserAuth:
  var userId* {.asName: "user_id".}: string
  var token*: string
  var ts: int64


proc main() =
  for kind, key, value in getopt():
    case kind
    of cmdEnd: break
    of cmdShortOption, cmdLongOption:
      discard
    of cmdArgument:
      uids.add(key)


when isMainModule:
  main()

but nim compiles this code and it works perfect.

Current Output


Expected Output


Known Workarounds

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions