vlang / v-analyzer

The @vlang language server, for all your editing needs like go-to-definition, code completion, type hints, and more.
MIT License
86 stars 9 forks source link

Files outside the `src` folder are not fully analyzed #107

Open Vehmloewff opened 1 month ago

Vehmloewff commented 1 month ago

Describe the bug

*.v files that are not in the src folder do not appear to be fully analyzed.

Here is a screenshot from VS Code: image

As you can see, semantic highlighting is working, but not diagnostics. There is no function http.new_resonse in scope.

Expected Behavior

An editor diagnostic similar to what happens in the CLI when the file is invoked.

main.v:22:14: error: unknown function: net.http.new_resonse .
Did you mean `net.http.new_response`?
   20 | header.add(http.CommonHeader.content_type, 'text/html')
   21 | 
   22 |     return http.new_resonse(http.ResponseConfig{ body: 'Hello', header: header })
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   23 | }

Current Behavior

No diagnostic was presented.

Reproduction Steps

mkdir example
cd example
v init
mv src/main.v main.v
echo "module main

fn main() {
    printlm('Hi there!')
}
" > main.v
code .

Possible Solution

No response

Additional Information/Context

No response

Environment details (v doctor output)

V full version: V 0.4.6 100b3b0 OS: macos, macOS, 14.5, 23F79 Processor: 8 cpus, 64bit, little endian, Apple M1 Pro

getwd: /Users/elijah.mooring/Projects/v vexe: /Users/elijah.mooring/Projects/v/v vexe mtime: 2024-06-11 02:11:54

vroot: OK, value: /Users/elijah.mooring/Projects/v VMODULES: OK, value: /Users/elijah.mooring/.vmodules VTMP: OK, value: /tmp/v_503

Git version: git version 2.39.3 (Apple Git-146) Git vroot status: weekly.2024.24-1-gdfdd7521-dirty .git/config present: true

CC version: Apple clang version 15.0.0 (clang-1500.3.9.4) thirdparty/tcc status: thirdparty-macos-arm64 5c1d002f

Editor name

VSCode

v-analyzer Version

v-analyzer version 0.0.4-beta.1.7e11a6f

VS Code Extension Version

v0.0.2