首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Vim errorformat / efm for PL/SQL

Vim errorformat / efm for PL/SQL
EN

Stack Overflow用户
提问于 2009-09-08 04:50:04
回答 2查看 978关注 0票数 2

我正在尝试让标准的vim :clist,:cope功能与vim一起工作。

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

我可以正常编译PL/SQL代码(当没有error =时),我可以使用errorformat来获取错误消息、行号和列号,但是我不能让它获取文件名( vim需要这个文件名才能跳转到文件)。

这是我能想到的最好的错误格式:

代码语言:javascript
复制
  :set efm=%+P[%f],%E%l/%c%m,%C%m,%Z   

这是编译器的输出。它只在第一行有文件名(我试着用+P%f.

输出:

代码语言:javascript
复制
[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

代码语言:javascript
复制
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

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2009-09-09 20:26:01

在我看来,您使用的语法还可以。所以我要说的就是想法...

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

Stack Overflow用户

发布于 2009-09-09 19:26:36

如果您对efm或vim或您正在尝试执行的解析一无所知,我会说您可能会更幸运地执行查询来获取错误信息。查看视图user_errors以收集错误信息。使用这种方法可以更容易地以您想要的方式获取数据。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1392019

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档