You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On master, I can do: v -vls-mode -line-info "examples/hello_world.v:1:gd^println" examples/hello_world.v
and get /home/delian/v/vlib/builtin/builtin.c.v:326:0 in return, and I can jump to that location with my editor.
How can I do the same here? The same command on this PR panics.
#0 10:08:41 ^ vls-fix-goto-definition ~/v>v -vls-mode -line-info "examples/hello_world.v:1:gd^println" examples/hello_world.v
================ V panic ================
module: v.ast
function: default_table_panic_handler()
message: table.sym: invalid type (typ=ast.Type(0x0 = 0) idx=0). Compiler bug. This should never happen. Please report the bug using `v bug file.v`.
file: /home/delian/v/vlib/v/ast/table.v:150
v hash: 24f2f4f
=========================================
/home/delian/v/vlib/builtin/builtin.c.v:88: at builtin__panic_debug: Backtrace
/home/delian/v/vlib/v/ast/table.v:150: by v__ast__default_table_panic_handler
/home/delian/v/vlib/v/ast/table.v:156: by v__ast__Table_panic
/home/delian/v/vlib/v/ast/table.v:777: by v__ast__Table_sym
/home/delian/v/vlib/v/gen/c/cgen.v:1696: by v__gen__c__Gen_cc_type
/home/delian/v/vlib/v/gen/c/cgen.v:1284: by v__gen__c__Gen_base_type
/home/delian/v/vlib/v/gen/c/cgen.v:1261: by v__gen__c__Gen_styp
/home/delian/v/vlib/v/gen/c/consts_and_globals.v:316: by v__gen__c__Gen_const_decl_init_later
/home/delian/v/vlib/v/gen/c/consts_and_globals.v:126: by v__gen__c__Gen_const_decl
/home/delian/v/vlib/v/gen/c/cgen.v:2567: by v__gen__c__Gen_stmt
/home/delian/v/vlib/v/gen/c/cgen.v:2284: by v__gen__c__Gen_stmts_with_tmp_var
/home/delian/v/vlib/v/gen/c/cgen.v:2121: by v__gen__c__Gen_stmts
/home/delian/v/vlib/v/gen/c/cgen.v:934: by v__gen__c__Gen_gen_file
/home/delian/v/vlib/v/gen/c/cgen.v:496: by v__gen__c__gen
/home/delian/v/vlib/v/builder/cbuilder/cbuilder.v:80: by v__builder__cbuilder__gen_c
/home/delian/v/vlib/v/builder/cbuilder/cbuilder.v:60: by v__builder__cbuilder__build_c
/home/delian/v/vlib/v/builder/cbuilder/cbuilder.v:50: by v__builder__cbuilder__compile_c
/home/delian/v/vlib/v/builder/rebuilding.v:326: by v__builder__Builder_rebuild
/home/delian/v/vlib/v/builder/compile.v:17: by v__builder__compile
/home/delian/v/cmd/v/v.v:211: by main__rebuild
/home/delian/v/cmd/v/v.v:169: by main__main
/home/delian/v/vlib/builtin/closure/closure.c.v:860: by main
#1 10:08:42 ^ vls-fix-goto-definition ~/v>
Adding -check too, prevents the panic, but does not produce any result either:
On master, I can do: v -vls-mode -line-info "examples/hello_world.v:1:gd^println" examples/hello_world.v and get /home/delian/v/vlib/builtin/builtin.c.v:326:0 in return, and I can jump to that location with my editor.
How can I do the same here? The same command on this PR panics.
#0 10:08:41 ^ vls-fix-goto-definition ~/v>v -vls-mode -line-info "examples/hello_world.v:1:gd^println" examples/hello_world.v
================ V panic ================
module: v.ast
function: default_table_panic_handler()
message: table.sym: invalid type (typ=ast.Type(0x0 = 0) idx=0). Compiler bug. This should never happen. Please report the bug using `v bug file.v`.
file: /home/delian/v/vlib/v/ast/table.v:150
v hash: 24f2f4f
=========================================
/home/delian/v/vlib/builtin/builtin.c.v:88: at builtin__panic_debug: Backtrace
/home/delian/v/vlib/v/ast/table.v:150: by v__ast__default_table_panic_handler
/home/delian/v/vlib/v/ast/table.v:156: by v__ast__Table_panic
/home/delian/v/vlib/v/ast/table.v:777: by v__ast__Table_sym
/home/delian/v/vlib/v/gen/c/cgen.v:1696: by v__gen__c__Gen_cc_type
/home/delian/v/vlib/v/gen/c/cgen.v:1284: by v__gen__c__Gen_base_type
/home/delian/v/vlib/v/gen/c/cgen.v:1261: by v__gen__c__Gen_styp
/home/delian/v/vlib/v/gen/c/consts_and_globals.v:316: by v__gen__c__Gen_const_decl_init_later
/home/delian/v/vlib/v/gen/c/consts_and_globals.v:126: by v__gen__c__Gen_const_decl
/home/delian/v/vlib/v/gen/c/cgen.v:2567: by v__gen__c__Gen_stmt
/home/delian/v/vlib/v/gen/c/cgen.v:2284: by v__gen__c__Gen_stmts_with_tmp_var
/home/delian/v/vlib/v/gen/c/cgen.v:2121: by v__gen__c__Gen_stmts
/home/delian/v/vlib/v/gen/c/cgen.v:934: by v__gen__c__Gen_gen_file
/home/delian/v/vlib/v/gen/c/cgen.v:496: by v__gen__c__gen
/home/delian/v/vlib/v/builder/cbuilder/cbuilder.v:80: by v__builder__cbuilder__gen_c
/home/delian/v/vlib/v/builder/cbuilder/cbuilder.v:60: by v__builder__cbuilder__build_c
/home/delian/v/vlib/v/builder/cbuilder/cbuilder.v:50: by v__builder__cbuilder__compile_c
/home/delian/v/vlib/v/builder/rebuilding.v:326: by v__builder__Builder_rebuild
/home/delian/v/vlib/v/builder/compile.v:17: by v__builder__compile
/home/delian/v/cmd/v/v.v:211: by main__rebuild
/home/delian/v/cmd/v/v.v:169: by main__main
/home/delian/v/vlib/builtin/closure/closure.c.v:860: by main
#1 10:08:42 ^ vls-fix-goto-definition ~/v>
Adding -check too, prevents the panic, but does not produce any result either:
Original vls send a gd^println to v, but I think it is not enough. So I changed it to send the column info instead, something like gd^6. This will help find out which indent is the right one by compare it's pos's line_nr and col, not by string compare.
$ v -vls-mode -line-info "examples/hello_world.v:0:gd^1" examples/hello_world.v
{"uri":"/media/HD/github/kbkpbot/v/vlib/builtin/builtin.c.v","range":{"start":{"line":326,"character":7},"end":{"line":326,"character":7}}}
Is there an easy way to restore the ability to output just the file:line:col information on this PR?
(i.e. given source_file:source_line:source_col -> definition_file:definition_line)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
vlsdesign, as PR fix goto-definition, code cleanup vls#470