Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicated messages for nim check #4183

Closed
StefanSalewski opened this issue May 18, 2016 · 4 comments
Closed

Duplicated messages for nim check #4183

StefanSalewski opened this issue May 18, 2016 · 4 comments
Labels
Nim Check stale Staled PR/issues; remove the label after fixing them

Comments

@StefanSalewski
Copy link

StefanSalewski commented May 18, 2016

import strutils
var a = "aa.bb.cc"

a.setLen(100)
a[99] = 'x'

if a.len > 0:
  echo(

$ nim check test.nim
Hint: system [Processing]
Hint: test [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
test.nim(9, 1) Error: invalid indentation
test.nim(9, 1) Error: invalid indentation
test.nim(9, 1) Error: ')' expected

Maybe we can filter the check messages for duplicates?

@StefanSalewski
Copy link
Author

And maybe sorting messages for column also -- would make use of nimsuggest easier:

import strutils
var a = "aa.bb.cc"

a.seten+++++++++++++(100)
a[99] = 'x'

if a.len > 0:
echo(0)

$ nim check test.nim
test.nim(4, 8) Error: undeclared identifier: '+++++++++++++'
test.nim(4, 2) Error: undeclared field: 'seten'
test.nim(4, 2) Error: expression '.' cannot be called
test.nim(4, 8) Error: attempting to call undeclared routine: '+++++++++++++'
test.nim(4, 8) Error: expression '+++++++++++++' cannot be called

@StefanSalewski
Copy link
Author

But maybe nimsuggest should sent the erros in a more structured format like JSON?

@Araq
Copy link
Member

Araq commented Jun 1, 2016

That's planned but note that valid nimsuggest output has tabs and the usual error message never have tabs, so it's already quite easy to filter proper nimsuggest output.

@narimiran
Copy link
Member

The first example now gives no duplications anymore:

proba3.nim(8, 1) Error: invalid indentation
proba3.nim(9, 1) Error: expected: ')', but got: '[EOF]'

The second example:

proba3.nim(8, 1) Error: invalid indentation
proba3.nim(4, 8) Error: undeclared identifier: '+++++++++++++'
proba3.nim(4, 2) Error: undeclared field: 'seten' for type system.string [declared in lib/system.nim(49, 3)]
proba3.nim(4, 2) Error: undeclared field: '.' for type system.string [declared in lib/system.nim(49, 3)]
proba3.nim(4, 2) Error: expression '.' cannot be called
proba3.nim(4, 8) Error: attempting to call routine: '+++++++++++++'
  found '+++++++++++++' of kind 'unknown'
proba3.nim(4, 8) Error: attempting to call routine: '+++++++++++++'
  found '+++++++++++++' of kind 'unknown'
proba3.nim(4, 8) Error: expression '+++++++++++++' cannot be called

@ringabout ringabout added the stale Staled PR/issues; remove the label after fixing them label Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Nim Check stale Staled PR/issues; remove the label after fixing them
Projects
None yet
Development

No branches or pull requests

6 participants