Skip to content

Commit

Permalink
Improved C code completion
Browse files Browse the repository at this point in the history
Added Objective-C code completion
Added PHP keyword and global variable completion
  • Loading branch information
blach committed May 26, 2012
1 parent 05dab5f commit 1bcdfa9
Show file tree
Hide file tree
Showing 3 changed files with 990 additions and 6 deletions.
162 changes: 157 additions & 5 deletions CodeCompletion/c.json
Expand Up @@ -16,7 +16,7 @@
{ "string": "do", "append": " {\n\t$0\n} while ($1);" },
{ "string": "else", "append": " {\n\t$0\n}" },
{ "string": "for", "append": " (${1:i = 0}; i ${3:< count}; ${4:i++}) {\n\t$0\n}" },
{ "string": "goto", "append": "${1:label};" },
{ "string": "goto", "append": " ${1:label};" },
{ "string": "if", "append": " ($1) {\n\t$0\n}" },
{ "string": "switch", "append": " ($1) {\n\t$0\n}" },
{ "string": "while", "append": " ($1) {\n\t$2\n}" }
Expand Down Expand Up @@ -105,7 +105,159 @@

"strings": [
{ "string": "free", "append": "(${1:pointer})" },
{ "string": "malloc", "append": "(${1:size})" }
{ "string": "malloc", "append": "(${1:size})" },
"abort",
"abs",
"acos",
"asctime",
"asin",
"assert",
"atan",
"atan2",
"atexit",
"atof",
"atoi",
"atol",
"bsearch",
"calloc",
"ceil",
"clearerr",
"clock",
"cos",
"cosh",
"ctime",
"difftime",
"div",
"ecvt",
"exit",
"exp",
"fabs",
"fclose",
"fcvt",
"feof",
"ferror",
"fflush",
"fgetc",
"fgetpos",
"fgets",
"floor",
"fmod",
"fopen",
"fprintf",
"fputc",
"fputchar",
"fputs",
"fread",
"free",
"freopen",
"frexp",
"fscanf",
"fseek",
"fsetpos",
"ftell",
"fwrite",
"gcvt",
"getc",
"getchar",
"getenv",
"gets",
"getw",
"gmtime",
"isalnum",
"isalpha",
"iscntrl",
"isdigit",
"isgraph",
"islower",
"isprint",
"ispunct",
"isspace",
"isupper",
"isxdigit",
"itoa",
"labs",
"ldexp",
"ldiv",
"lfind",
"localtime",
"log",
"log10",
"lsearch",
"ltoa",
"malloc",
"max",
"memchr",
"memcmp",
"memcpy",
"memmove",
"memset",
"min",
"mktime",
"modf",
"offsetof",
"perror",
"pow",
"printf",
"putc",
"putchar",
"putenv",
"puts",
"putw",
"qsort",
"raise",
"rand",
"realloc",
"remove",
"rename",
"rewind",
"scanf",
"setbuf",
"setvbuf",
"signal",
"sin",
"sinh",
"sprintf",
"sqrt",
"srand",
"sscanf",
"strcat",
"strchr",
"strcmp",
"strcoll",
"strcpy",
"strcspn",
"strerror",
"strftime",
"strlen",
"strncat",
"strncmp",
"strncpy",
"strpbrk",
"strrchr",
"strspn",
"strstr",
"strtod",
"strtok",
"strtol",
"strtoul",
"strxfrm",
"swab",
"system",
"tan",
"tanh",
"time",
"tmpfile",
"tmpnam",
"tolower",
"toupper",
"ultoa",
"ungetc",
"va_arg",
"va_end",
"va_start",
"vfprintf",
"vprintf",
"vsprintf"
]
},
{
Expand Down Expand Up @@ -135,7 +287,7 @@
{
"description": "Control keywords",
"scope": "(source.c | source.c++ | source.objc | source.objc++) - comment - string",
"pattern": "(?<!\\.|\\[|\\(|,)\\b([a-zA-Z]*)",
"pattern": "(?<!\\.|\\[|\\(|,|@)\\b([a-zA-Z]*)",
"completionCaptureIndex": 1,
"completionSetNames": [
"c.keywords.control"
Expand All @@ -144,7 +296,7 @@
{
"description": "else if keyword",
"scope": "(source.c | source.c++ | source.objc | source.objc++) - comment - string",
"pattern": "(?<!\\.|\\[|\\(|,)\\b(e[lse if]*)",
"pattern": "(?<!\\.|\\[|\\(|,|@)\\b(e[lse if]*)",
"completionCaptureIndex": 1,
"completionSetNames": [
"c.keywords.control.else-if"
Expand All @@ -162,7 +314,7 @@
{
"description": "Non-control keywords",
"scope": "(source.c | source.c++ | source.objc | source.objc++) - comment - string",
"pattern": "(?<!\\.)\\b([a-zA-Z]*)",
"pattern": "(?<!\\.|@)\\b([a-zA-Z]*)",
"completionCaptureIndex": 1,
"completionSetNames": [
"c.keywords.structures",
Expand Down

0 comments on commit 1bcdfa9

Please sign in to comment.