intellisense for var expression
This commit is contained in:
parent
b04ada66d0
commit
e91b92b024
|
|
@ -5980,6 +5980,12 @@ namespace CodeCompletion
|
|||
var ne = new new_expr(ntr, new expression_list(new uint64_const(bi.val)), bi.source_context);
|
||||
ne.visit(this);
|
||||
}
|
||||
|
||||
public override void visit(let_var_expr _let_var_expr)
|
||||
{
|
||||
var_def_statement vds = new var_def_statement(_let_var_expr.id, _let_var_expr.ex, _let_var_expr.source_context);
|
||||
vds.visit(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -244,6 +244,19 @@ namespace CodeCompletion
|
|||
_var_def_statement.inital_value.visit(this);
|
||||
}
|
||||
|
||||
public override void visit(let_var_expr _let_var_expr)
|
||||
{
|
||||
if (for_refactoring)
|
||||
{
|
||||
IBaseScope ss = entry_scope.FindScopeByLocation(_let_var_expr.id.source_context.begin_position.line_num, _let_var_expr.id.source_context.begin_position.column_num);
|
||||
if (ss != null && ss.IsEqual(founded_scope))
|
||||
pos_list.Add(get_position(_let_var_expr.id));
|
||||
}
|
||||
|
||||
if (_let_var_expr.ex != null)
|
||||
_let_var_expr.ex.visit(this);
|
||||
}
|
||||
|
||||
public override void visit(declaration _declaration)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
|
|
|||
5
TestSuite/intellisense_tests/let1.pas
Normal file
5
TestSuite/intellisense_tests/let1.pas
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
begin
|
||||
var a := (var b{@var b: integer;@} := 1);
|
||||
writeln(b{@var b: integer;@});
|
||||
var r{@var r: real;@} := (var r2 := 2.3);
|
||||
end.
|
||||
4
TestSuite/refactoring_tests/rename_tests/let1.pas
Normal file
4
TestSuite/refactoring_tests/rename_tests/let1.pas
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
begin
|
||||
var a := (var {@}b := 1);
|
||||
writeln({!}b);
|
||||
end.
|
||||
Loading…
Reference in a new issue