PL / SQL的Vim errorformat / efm

时间:2009-09-08 04:50:04

标签: vim plsql errorformat

我试图获得标准的vim:clist,:应对vim的功能。

具体来说,我正在尝试(并且失败)从编译器输出中捕获文件名。

我有PL / SQL代码编译正常(好吧,没有错误=),我有错误格式提取错误消息,行号和列号,但我无法选择它文件名(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

有谁知道如何让它拿起文件名?

由于 Dave Smylie

2 个答案:

答案 0 :(得分:1)

您正在使用的语法看起来不错。所以我所要提供的只是想法......

  1. 即使没有显示文件名,您仍然可以跳转到quickfix窗口中的正确行吗?
  2. 编译器是否在文件名之前生成任何输出?在%+ P之前尝试了%E?
  3. 即使它不是您要查找的错误格式,您是否尝试过oracle.vim插件?

答案 1 :(得分:0)

知道关于efm或vim的NOTHING或者你正在尝试的这种解析,我会说你可能会更好地运行查询以获取错误信息。看看视图 user_errors收集错误信息。使用此方法以您希望的方式获取数据应该更容易。