Castalia 内联变量声明在 Delphi XE8 中如何工作?
How does Castalia inline variable declaration work in Delphi XE8?
我正在尝试使用 Castalia 的内联变量声明 described here。
以上 link 中的相关摘录如下:
Inline Variable Declaration
Castalia provides inline variable declaration. In the main body of your code, you can declare variables and Castalia will
automatically add it to the variable declaration section of your
function or procedure as soon as you press the space bar, the
declaration you typed in the main body is replaced by a reference to
the variable.
但是,它似乎对我不起作用。例如,如果我在此代码中按 myVar: integer
之后的 space 栏:
procedure test;
begin
myVar: integer
end;
我没有自动得到这个(实际上什么也没发生):
procedure test;
var
myVar: integer;
begin
myVar
end;
在 Castalia->Castalia 选项 中似乎没有针对 enable/disable 的任何特定 Castalia 设置用于内联变量并且 Embarcadero 文档也没有提及任何设置。
Castalia 内联变量声明是如何工作的?
参见How_to_Use_Inline_Variable_Declaration_(Castalia)。
你需要写:
begin
var myVar: Integer[space]
end;
获得
var
myVar: Integer;
begin
myVar
end;
我正在尝试使用 Castalia 的内联变量声明 described here。
以上 link 中的相关摘录如下:
Inline Variable Declaration Castalia provides inline variable declaration. In the main body of your code, you can declare variables and Castalia will automatically add it to the variable declaration section of your function or procedure as soon as you press the space bar, the declaration you typed in the main body is replaced by a reference to the variable.
但是,它似乎对我不起作用。例如,如果我在此代码中按 myVar: integer
之后的 space 栏:
procedure test;
begin
myVar: integer
end;
我没有自动得到这个(实际上什么也没发生):
procedure test;
var
myVar: integer;
begin
myVar
end;
在 Castalia->Castalia 选项 中似乎没有针对 enable/disable 的任何特定 Castalia 设置用于内联变量并且 Embarcadero 文档也没有提及任何设置。
Castalia 内联变量声明是如何工作的?
参见How_to_Use_Inline_Variable_Declaration_(Castalia)。
你需要写:
begin
var myVar: Integer[space]
end;
获得
var
myVar: Integer;
begin
myVar
end;