vfmt: shouldn't need information about imported modules

Created on 5 Mar 2020  路  2Comments  路  Source: vlang/v

V version: V 0.1.25 bcaf72e
OS: Debian 10

What did you do? $ v fmt blog_example.v

What did you expect to see? formatted output of the blog example

What did you see instead?

/home/riordanix/Workspace/v/vlib/vweb/vweb.v:141:9: type `T` has no field or method `vweb`
  139| //fn handle_conn(conn net.Socket) {
  140| 
  141|  //println('handle')
                 ^
  142| 
  143|
vfmt error while formatting file: blog_example.v .
Encountered a total of: 1 errors.

The error gives the correct line number, but the printed code is actually on line 127. Regardless, I don't think vfmt should care about what modules I'm using, but just format the file I give it.
May be related to #3026, but I'm writing a new issue because I think this has more to do with vfmt needing to know about imported modules.

Bug

Most helpful comment

The new fmt module will use a different approach to format code. The issue will be resolved after we switch to the new vfmt.

All 2 comments

The new fmt module will use a different approach to format code. The issue will be resolved after we switch to the new vfmt.

commit 2a06263a5b202a7c494e3c67d4021408e6f8938d fixes this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

markgraydev picture markgraydev  路  3Comments

medvednikov picture medvednikov  路  3Comments

oleg-kachan picture oleg-kachan  路  3Comments

arg2das picture arg2das  路  3Comments

jtkirkpatrick picture jtkirkpatrick  路  3Comments