我试图让标准的 vim :clist, :cope 功能与 vim 一起工作。
具体来说,我正在尝试(但失败)从编译器输出中捕获文件名。
我的 PL/SQL 代码编译好了(好吧,当没有错误时 =),我有 errorformat 拾取错误消息、行号和列号,但我无法获取文件名(vim 需要哪个才能跳转到文件)。
这是我能想到的最好的错误格式:
:set efm=%+P[%f],%E%l/%c%m,%C%m,%Z
这是编译器的输出。它只有第一行的文件名(我尝试使用 +P[%f].
输出:
[code/voyager/db/db_source/pck_policy_2.pks]
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Sep 8 14:51:24 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
Warning: Package created with compilation errors.
SQL> Errors for PACKAGE PCK_POLICY_2:
LINE/COL ERROR
-------- --------------------------------------------------------------
21/7 PLS-00103: Encountered the symbol "EXP_PBIT_ID" when expecting
one of the following:
:= . ) , @ % default character
The symbol "," was substituted for "EXP_PBIT_ID" to continue.
185/1 PLS-00103: Encountered the symbol "END" when expecting one of the
following:
constant exception <an identifier>
<a double-quoted delimited-identifier> table long double ref
char time timestamp interval date binary national character
nchar
LINE/COL ERROR
-------- -------------------------------------------------------------
SQL> Disconnected from Oracle Database 11g Enterprise Edition
:clist 之后显示错误已被捕获,但不是文件名: :clist
19:21 col 7 error: PLS-00103: Encountered the symbol "EXP_PBIT_ID" when expecting one of the following: := . ) , @ % default character The symbol "," was substituted for "EXP_PBIT_ID" to continue.
21:185 col 1 error: PLS-00103: Encountered the symbol "END" when expecting one of the following: constant exception <an identifier> <a double-quoted delimited-identifier> table long double ref char time timestamp interval date binary national character nchar
有谁知道我怎样才能让这个文件名?
谢谢戴夫·斯迈利