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

Plugin stops detecting compiler flags after changing source files #54

Closed
Spirarel opened this issue Mar 22, 2024 · 5 comments
Closed

Plugin stops detecting compiler flags after changing source files #54

Spirarel opened this issue Mar 22, 2024 · 5 comments

Comments

@Spirarel
Copy link

Spirarel commented Mar 22, 2024

Here's a small example

include prelude

type GraphNode[T] = ref object
  value: T
  neighbors: seq[GraphNode[T]]

iterator items[T](graphNode: GraphNode[T]): GraphNode[T] =
  var
    s = @[graphNode]
    seen = initHashSet[GraphNode[T]]()
    curr: GraphNode[T]
  while s.len > 0:
    curr = s.pop
    yield curr
    seen.incl curr
    for e in curr.neighbors:
      if e notin seen:
        s.add e

let nodes = GraphNode[int](value: 1, neighbors: @[GraphNode[int](value: 2, neighbors: @[])])

for i in nodes:
  echo i.value

compile with -d:nimPreviewHashRef

Restarting vscode and building on save. The code compiles and runs, there are no problems highlighted:
Screenshot 2024-03-22 at 8 56 27 AM

Add a few newlines to the end and build & run again. The code compiles and runs fine, but the plugin shows problems:

Screenshot 2024-03-22 at 8 57 01 AM

This greatly limits the plugin's usefulness.


extension: v0.9.0
vscode: 1.87.2
nim: 2.0.2

@jmgomez
Copy link
Collaborator

jmgomez commented Mar 26, 2024

Sounds like the issue is that nimsuggest doesnt know about -d:nimPreviewHashRef.
Create a config.nims and --d:nimPreviewHashRef to it
Reopen if it doenst fix it.

@jmgomez jmgomez closed this as completed Mar 26, 2024
@Spirarel
Copy link
Author

Hmm I added this file with the entry to the directory; it's getting picked up by the build task, but the plugin is still showing issues. Does the extension require extra configuration?

@jmgomez
Copy link
Collaborator

jmgomez commented Mar 30, 2024

No, it doesnt require extra configuration. Can you share your file structure? config.nims should be near the entry point

@Spirarel
Copy link
Author

Essentially flat,
Screenshot 2024-03-31 at 6 11 26 PM

Screenshot 2024-03-31 at 6 12 05 PM

@jmgomez
Copy link
Collaborator

jmgomez commented Apr 1, 2024

I mean the actual files with a minimal repro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants