PMunch / nimlsp

Language Server Protocol implementation for Nim
MIT License
418 stars 51 forks source link

Fix various warnings seen when running nimble test on 1.6.10 #157

Closed marcusramberg closed 1 year ago

marcusramberg commented 1 year ago

Fixes about a million warnings like this by running nimpretty:

/Users/marcus/Source/nimlsp/src/nimlsppkg/messages.nim(592, 25) Warning: Number of spaces around '?:' is not consistent [Spacing]

as well as:

/Users/marcus/Source/nimlsp/src/nimlsppkg/messages.nim(2, 8) Warning: imported and not used: 'messageenums' [UnusedImport]
/Users/marcus/Source/nimlsp/tests/tnimlsp.nim(1, 11) Warning: imported and not used: 'streams' [UnusedImport]
/Users/marcus/Source/nimlsp/tests/tnimlsp.nim(1, 11) Warning: imported and not used: 'asyncfile' [UnusedImport]
PMunch commented 1 year ago

Looks good. The spacing issue was done intentionally though, to make it look similar to TypeScript. Annoying that Nim complains about it though, so I guess I can accept this. Or we could throw ignore spacing issues pragmas around that part.

marcusramberg commented 1 year ago

Looks good. The spacing issue was done intentionally though, to make it look similar to TypeScript. Annoying that Nim complains about it though, so I guess I can accept this. Or we could throw ignore spacing issues pragmas around that part.

I had a suspicion it might be intentional. I can update my PR if you prefer an ignore pragma instead.

marcusramberg commented 1 year ago

Looks good. The spacing issue was done intentionally though, to make it look similar to TypeScript. Annoying that Nim complains about it though, so I guess I can accept this. Or we could throw ignore spacing issues pragmas around that part.

I tested

{.warning[Spacing]:off.}

around the offending code in messages.nim - but it's still throwing warnings, so not sure how to disable it. 😞

PMunch commented 1 year ago

I think you need to use {.push.} and {.pop.}? But I might be wrong, I don't usually disable warnings

marcusramberg commented 1 year ago

I think you need to use {.push.} and {.pop.}? But I might be wrong, I don't usually disable warnings

I tried that variant as well without luck. Maybe it's better to just let it use the recommended formatting though?