-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathSCKSourceFile.h
More file actions
86 lines (83 loc) · 2.44 KB
/
SCKSourceFile.h
File metadata and controls
86 lines (83 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#include <Foundation/NSObject.h>
#include <Foundation/NSGeometry.h>
#include <Foundation/NSRange.h>
@class SCKIndex;
@class NSMutableArray;
@class NSMutableAttributedString;
@class SCKSourceCollection;
@class SCKCodeCompletionResult;
/**
* The SCKSyntaxHighlighter class is responsible for performing lexical and
* syntax highlighting on a single source file. Highlighting involves three steps:
*
* 1) Lexical markup.
* 2) Syntax markup.
* 3) Presentation markup.
*
* Lexical highlighting is faster than full syntax highlighting, so it can be
* used more frequently in an editor. For example, you might run the lexical
* highlighter after every key press but defer the syntax highlighter until
* after a whitespace character had been entered.
*
* The third step is optional. If you are not using AppKit, then you can
* ignore it and handle the presentation yourself. This is useful, for
* example, when generating semantic HTML from a source file.
*/
@interface SCKSourceFile : NSObject
{
NSMutableAttributedString *source;
NSString *fileName;
}
/**
* Text storage object representing the source file.
*/
@property (retain, nonatomic) NSMutableAttributedString *source;
/**
* Name of this source file.
*/
@property (retain, nonatomic) NSString *fileName;
/**
* The source collection containing this file.
*/
@property (nonatomic, unsafe_unretained) SCKSourceCollection *collection;
+ (SCKSourceFile*)fileUsingIndex: (SCKIndex*)anIndex;
/**
* Parses the contents of the file. Must be called before reapplying
* highlighting after the file has changed.
*/
- (void)reparse;
/**
* Performs lexical highlighting on the entire file.
*/
- (void)lexicalHighlightFile;
/**
* Perform syntax highlighting on the whole file.
*/
- (void)syntaxHighlightFile;
/**
* Performs syntax highlighting on the specified range.
*/
- (void)syntaxHighlightRange: (NSRange)r;
/**
* Adds an include path to search when performing syntax highlighting.
*/
- (void)addIncludePath: (NSString*)includePath;
/**
* Checks for errors and adds kSCKDiagnostic attributes to ranges in the source
* attributed string which contain them.
*/
- (void)collectDiagnostics;
/**
* Returns completion result at the location
*/
- (SCKCodeCompletionResult*)completeAtLocation: (NSUInteger) location;
@end
@interface SCKSourceLocation : NSObject
{
@public
NSString *file;
NSUInteger offset;
}
@property (retain, nonatomic) NSString *file;
@property (readonly, nonatomic) NSUInteger offset;
@end