Skip to content

Instantly share code, notes, and snippets.

View bolinfest's full-sized avatar

Michael Bolin bolinfest

  • Meta
View GitHub Profile
---- example.h ----
#import <Foundation/Foundation.h>
#ifndef __has_feature // Optional.
#define __has_feature(x) 0 // Compatibility with non-clang compilers.
#endif
#ifndef NS_RETURNS_NOT_RETAINED
#if __has_feature(attribute_ns_returns_not_retained)
#include <stdio.h>
int main(int argc, char **argv) {
// Here is the syntax error:
retur 0;
}
$ ./main.o example.c
Diagnostic count: 1
Diagnostic spelling: use of undeclared identifier 'retur'
Formatted diagnostic: example.c:5:3: error: use of undeclared identifier 'retur' [2, Semantic Issue]
No source ranges for diagnostic.
@bolinfest
bolinfest / -
Created April 23, 2014 23:55
Hello.m
#import <Foundation/Foundation.h>
int main(int argc, char *argv[])
{
NSL
}
@bolinfest
bolinfest / -
Created April 23, 2014 23:56
main.c
#include <clang-c/Index.h>
#include <stdio.h>
#include <stdlib.h>
void printCodeCompletionSuggestions(CXTranslationUnit tu, char* source, unsigned line, unsigned column) {
struct CXUnsavedFile *unsavedFiles = NULL;
unsigned numUnsavedFiles = 0;
unsigned options = clang_defaultCodeCompleteOptions();
CXCodeCompleteResults *results = clang_codeCompleteAt(tu, source, line, column, unsavedFiles, numUnsavedFiles, options);
@bolinfest
bolinfest / -
Created April 23, 2014 23:56
main.c
#include <clang-c/Index.h>
#include <stdio.h>
#include <stdlib.h>
void printCodeCompletionSuggestions(CXTranslationUnit tu, char* source, unsigned line, unsigned column) {
struct CXUnsavedFile *unsavedFiles = NULL;
unsigned numUnsavedFiles = 0;
unsigned options = clang_defaultCodeCompleteOptions();
CXCodeCompleteResults *results = clang_codeCompleteAt(tu, source, line, column, unsavedFiles, numUnsavedFiles, options);
unsigned numResults = results->NumResults;
@bolinfest
bolinfest / -
Created April 23, 2014 23:57
./main.o Hello.m 5 6
Num completions: 8779
Result 0 (priority=34, chunks=2, annotations=0)
int kind=15
argc kind=1
Result 1 (priority=34, chunks=2, annotations=0)
char ** kind=15
argv kind=1
Result 2 (priority=50, chunks=4, annotations=0)
Sampling process 52346 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling Atom Helper (pid 52346) every 1 millisecond
Process: Atom Helper [52346]
Path: /Applications/Nuclide.app/Contents/Frameworks/Atom Helper.app/Contents/MacOS/Atom Helper
Load Address: 0x10c1f6000
Identifier: com.github.atom.helper
Version: 1.0.0 (1.0.0)
Code Type: X86-64
Parent Process: Nuclide.bin [52304]
Node: v0.12.0
npm: v2.13.3
Installing build modules...
Installing apm...
Installing modules ✗
> atom@1.0.5 preinstall /Users/mbolin/src/bolinfest/atom
> node -e 'process.exit(0)'
npm ERR! addLocal Could not install /Users/mbolin/src/bolinfest/atom/git@github.com:facebooknuclideapm/nuclide-code-format.git#0.0.28
@bolinfest
bolinfest / gist:d76cf662b800f26a1c6d
Created September 24, 2015 05:43
apm test output
/Users/mbolin/src/atom$ apm test
[96945:0923/224217:INFO:renderer_main.cc(200)] Renderer process started
Error Downloading Update: Could not get code signature for running application
[96941:0923/224218:INFO:CONSOLE(46)] "Window load time: 1052ms", source: file:///Users/mbolin/src/atom/static/index.js (46)
.............................[96941:0923/224219:INFO:CONSOLE(260)] "Uncaught BufferedProcessError: Failed to spawn command `bad-command-nope`. Make sure `bad-command-nope` is installed and on your PATH", source: /Users/mbolin/src/atom/src/buffered-process.coffee (260)
...................................................................................[96941:0923/224221:INFO:CONSOLE(919)] "Error setting item in object: Validation failed at null.foo.int, null cannot be coerced into an int", source: /Users/mbolin/src/atom/src/config.coffee (919)
[96941:0923/224221:INFO:CONSOLE(919)] "Error setting item in object: Validation failed at foo.int, null cannot be coerced into an int", source: /Users/mbolin/src/atom/s