Sublime Forum

Command + R Behavior issue in Build 3114

#1

In previous builds, I can using Command + R on OS X to properly scroll through Functions. The issue in Build 3114 is it will only pick out the return variable type if the return variable type and the function name are not on the same line.

3114 Issue:
In previous versions, Command + R will show you “foo” in the “@” function scroller. But now it shows just “int”. Just showing the return type is not useful. The editor was smarter in the previous versions where it can pick out “foo”.

Can someone help fix this?

int
foo (int var1) {
int var2

return var2;
}

0 Likes

#2

Which language ?
I tried for C (it looks like it) and it works for me, so your issue might be a caused by plugin.

0 Likes

#3

Works for me in C too

0 Likes

#4

You are correct. This works ok in if return type is int. I’m using C with EFI.

In UEFI, EfiBind.h

typedef uint32_t UINT32;

typedef UINT32 EFI_STATUS;

Then if I do the following, it doesn’t work.

EFI_STATUS
foo (int var1) {
EFI_STATUS var2

return var2;
}

0 Likes

#5

Issue pictures attached.

typedef STATIC static
typedef unsigned int uint32_t;

typedef uint32_t UINT32;

typedef UINT32 EFI_STATUS;

STATIC
EFI_STATUS
_foo (int var1) {
EFI_STATUS var2;

var2 = (EFI_STATUS)var1;
return var2;

}

0 Likes

#6

No issue on Build 3103.

0 Likes

#7

This seems to be caused by the STATIC storage type definition you have there, which is confusing the syntax parser and making it think that this is a function call and not a function definition, which stops it from populating in the list.

In particular, see the following:

The definition works if it’s all on a single line (as you noticed), but it will also work over multiple lines if the storage modifier is static and not STATIC (which I assume is a conditional define that may or may not have other modifiers, etc).

This indeed seems like a bug. Notice how in the case of the foo3 line, not only is foo3 considered to be a function call and not a function definition, but EFI_STATUS becomes entity.name.function.c in its place, making it appear in the symbol list twice.

I included the same image here in your github issue as well, in case it helps narrow what’s going wrong.

0 Likes