Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid false positives of gd on a variable type if variable type is not declared as STRUC #3

Open
KnoP-01 opened this issue Nov 1, 2017 · 0 comments

Comments

@KnoP-01
Copy link
Owner

KnoP-01 commented Nov 1, 2017

gd can look up declarations of user defined structures. However, it displays false positives if the structure declaration is not present in the current source tree, but a variable declaration is present which comes with more then one word (not only DECL but also GLOBAL and/or CONST) in front of the type.

e.g. in the MsgLib.src

A struct is used called KrlMsgOpt_T. This appear to be an KSS-internal type. So the declaration of this struc is not visible. But gd finds (as false positive) a declaration of a variable of this type:

DECL GLOBAL CONST KRLMSGOPT_T Opt_NOVLSTO...

The pattern to find declarations is defined in

ftplugin\krl.vim

in function

function <SID>KrlGoDefinition()

as

let l:declPrefix = 

.

It's quite complicate already. But I don't get this false positive out of the way.

A more simple example of the false positive would be:

In a line like this

DECL CHAR DMY[3]

hitting gd on the "CHAR", it will find variable declarations which look like this:

DECL GLOBAL CHAR varname="a"

.

PS: If the STRUC declaration is present gd does work correctly with the pattern as it is. So the pattern is not fundamentaly incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant