saibing / bingo

Bingo is a Go language server that speaks Language Server Protocol.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Conditional compilation not working

fpsqdb opened this issue · comments

commented

Here is the sample
bingo-bug.zip

How to reproduce:

  1. open b_linux.go
  2. open b_windows.go
  3. edit b_windows.go and save (just trigger bingo server)

Will show error other declaration of test2

bingo_bug

I created an example that uses conditional complication which seems to work https://github.com/banaio/golanguageservertests/tree/conditional_compilation_issue_139. The branch name is conditional_compilation_issue_139. This package uses conditional compilation https://github.com/banaio/golanguageservertests/tree/conditional_compilation_issue_139/conditional_compilation_issue_139/fastwalk.

However, bingo itself seems to error on these files when I use VSCode:

  • langserver/internal/cache/fsnotify_darwin.go:
    • other declaration of fsSubject
    • other declaration of notify.
  • langserver/internal/cache/fsnotify.go:
    • fsSubject redeclared in this block
    • method notify already declared for type fsSubject struct{observer Observer}
    • s.watched undefined (type *fsSubject has no field or method watched)
    • s.watched undefined (type *fsSubject has no field or method watched)

Can you create a repository can you can clone, please. Not a zip file.

@mbana

Thank your advice, I hope we can fix it in gopls