代码之家  ›  专栏  ›  技术社区  ›  Chad Miller

Tabexpansion函数不解析变量

  •  0
  • Chad Miller  · 技术社区  · 15 年前

    我正在尝试重写并实现我自己的TabExpansion。在函数中,我希望在匹配某个$lastword条件时解析$psise.CurrentFile.Editor.Text的内容。我遇到的问题是变量$psise.CurrentFile.Editor.Text被解析为TabExpansion函数的内容,而不是PowerShell ISE选项卡中的任何文本。

    function tabexpansion
    { $psise.CurrentFile.Editor.Text }
    

    在ISE中运行脚本。接下来在ISE中打开另一个选项卡键入一些文本并按tab键

    函数扩展
    {$psise.CurrentFile.Editor.Text}
    

    1 回复  |  直到 15 年前
        1
  •  0
  •   Chad Miller    15 年前