Skip to content

Commit d58c53a

Browse files
committed
Remove waste code for development.
1 parent 2522613 commit d58c53a

File tree

7 files changed

+15
-90
lines changed

7 files changed

+15
-90
lines changed

SCXcodeSwitchExpander.xcodeproj/project.pbxproj

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
18A1B48118DDA742007CA06A /* IDEFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18A1B48018DDA742007CA06A /* IDEFoundation.framework */; };
1515
18ECEB5718D267A0005F6C59 /* DVTTextCompletionController+SCXcodeSwitchExpander.m in Sources */ = {isa = PBXBuildFile; fileRef = 18ECEB5618D267A0005F6C59 /* DVTTextCompletionController+SCXcodeSwitchExpander.m */; };
1616
B18173D81CBB91E400995105 /* DVTSourceCodeLanguage+SCXCodeSwitchExpander.m in Sources */ = {isa = PBXBuildFile; fileRef = B18173D71CBB91E400995105 /* DVTSourceCodeLanguage+SCXCodeSwitchExpander.m */; };
17-
B1F83C541CB908CF00843242 /* IDEWorkspace+SCXCodeSwitchExpander.m in Sources */ = {isa = PBXBuildFile; fileRef = B1F83C531CB908CF00843242 /* IDEWorkspace+SCXCodeSwitchExpander.m */; };
1817
/* End PBXBuildFile section */
1918

2019
/* Begin PBXFileReference section */
@@ -47,8 +46,6 @@
4746
B18173D71CBB91E400995105 /* DVTSourceCodeLanguage+SCXCodeSwitchExpander.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "DVTSourceCodeLanguage+SCXCodeSwitchExpander.m"; sourceTree = "<group>"; };
4847
B18173D91CBB92C700995105 /* DVTSourceCodeLanguage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTSourceCodeLanguage.h; sourceTree = "<group>"; };
4948
B18173DA1CBB958300995105 /* DVTTextStorage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTTextStorage.h; sourceTree = "<group>"; };
50-
B1F83C521CB908CF00843242 /* IDEWorkspace+SCXCodeSwitchExpander.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IDEWorkspace+SCXCodeSwitchExpander.h"; sourceTree = "<group>"; };
51-
B1F83C531CB908CF00843242 /* IDEWorkspace+SCXCodeSwitchExpander.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "IDEWorkspace+SCXCodeSwitchExpander.m"; sourceTree = "<group>"; };
5249
B1F83C551CB9090F00843242 /* IDEWorkspace.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEWorkspace.h; sourceTree = "<group>"; };
5350
/* End PBXFileReference section */
5451

@@ -71,8 +68,8 @@
7168
isa = PBXGroup;
7269
children = (
7370
0144D9921B06F9F00012D7A2 /* DVTCompletingTextView.h */,
74-
0144D9971B06F9F00012D7A2 /* DVTSourceCodeSymbolKind.h */,
7571
B18173D91CBB92C700995105 /* DVTSourceCodeLanguage.h */,
72+
0144D9971B06F9F00012D7A2 /* DVTSourceCodeSymbolKind.h */,
7673
0144D9991B06F9F00012D7A2 /* DVTSourceTextView.h */,
7774
0144D99A1B06F9F00012D7A2 /* DVTTextCompletionController.h */,
7875
0144D99B1B06F9F00012D7A2 /* DVTTextCompletionListWindowController.h */,
@@ -126,8 +123,6 @@
126123
18990B3518D2529C007A8756 /* SCXcodeSwitchExpander.m */,
127124
18ECEB5518D267A0005F6C59 /* DVTTextCompletionController+SCXcodeSwitchExpander.h */,
128125
18ECEB5618D267A0005F6C59 /* DVTTextCompletionController+SCXcodeSwitchExpander.m */,
129-
B1F83C521CB908CF00843242 /* IDEWorkspace+SCXCodeSwitchExpander.h */,
130-
B1F83C531CB908CF00843242 /* IDEWorkspace+SCXCodeSwitchExpander.m */,
131126
B18173D61CBB91E400995105 /* DVTSourceCodeLanguage+SCXCodeSwitchExpander.h */,
132127
B18173D71CBB91E400995105 /* DVTSourceCodeLanguage+SCXCodeSwitchExpander.m */,
133128
18142E1D18E89497006BD329 /* Xcode Headers */,
@@ -207,7 +202,6 @@
207202
buildActionMask = 2147483647;
208203
files = (
209204
18ECEB5718D267A0005F6C59 /* DVTTextCompletionController+SCXcodeSwitchExpander.m in Sources */,
210-
B1F83C541CB908CF00843242 /* IDEWorkspace+SCXCodeSwitchExpander.m in Sources */,
211205
18990B3618D2529C007A8756 /* SCXcodeSwitchExpander.m in Sources */,
212206
B18173D81CBB91E400995105 /* DVTSourceCodeLanguage+SCXCodeSwitchExpander.m in Sources */,
213207
);

SCXcodeSwitchExpander/DVTSourceCodeLanguage+SCXCodeSwitchExpander.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ typedef NS_ENUM(NSInteger, DVTSourceCodeLanguageKind)
1717

1818
@interface DVTSourceCodeLanguage (SCXCodeSwitchExpander)
1919

20+
/// Returns a kind of language which this instance means.
2021
@property (readonly) DVTSourceCodeLanguageKind kind;
2122

2223
@end

SCXcodeSwitchExpander/DVTTextCompletionController+SCXcodeSwitchExpander.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ - (DVTSourceCodeLanguageKind)currentLanguage;
111111

112112
@interface DVTTextCompletionListWindowController (SCXcodeSwitchExpander)
113113

114-
115114
- (BOOL)tryExpandingSwitchStatementForLanguage:(DVTSourceCodeLanguageKind)language;
116115

117116
/// Returns symbols specified by `fullSymbolName` in Index.

SCXcodeSwitchExpander/IDEWorkspace+SCXCodeSwitchExpander.h

Lines changed: 0 additions & 15 deletions
This file was deleted.

SCXcodeSwitchExpander/IDEWorkspace+SCXCodeSwitchExpander.m

Lines changed: 0 additions & 33 deletions
This file was deleted.

SCXcodeSwitchExpander/SCXcodeSwitchExpander.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@
99
@class IDEIndex;
1010
@class IDEWorkspace;
1111

12-
//#define SCXcodeSwitchExpanderIndexDidChangeNotification @"SCXcodeSwitchExpanderIndexDidChangeNotification"
13-
1412
@interface SCXcodeSwitchExpander : NSObject
1513

1614
+ (instancetype)sharedSwitchExpander;
1715

18-
//@property (nonatomic, weak, readonly) IDEIndex *index;
19-
//@property (nonatomic, assign) isSwift;
20-
@property(readonly) IDEWorkspace *currentWorkspace;
16+
/// This property is unavailable because index will be get from IDEWorkspace directly.
17+
@property (nonatomic, weak, readonly) IDEIndex *index NS_UNAVAILABLE;
2118

22-
- (void)indexNeedsUpdate:(IDEIndex*)index;
19+
/// This property is unavailable because language will be get from IDEEditor directly.
20+
@property (nonatomic, assign) BOOL isSwift NS_UNAVAILABLE;
21+
22+
/// Returns current workspace.
23+
@property(readonly) IDEWorkspace *currentWorkspace;
2324

2425
@end

SCXcodeSwitchExpander/SCXcodeSwitchExpander.m

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ @interface SCXcodeSwitchExpander ()
1919
@property (nonatomic, weak) NSDocument *editorDocument;
2020
@property (nonatomic, assign) NSTextView *editorTextView;
2121

22-
//@property (nonatomic, weak) IDEIndex *index;
22+
/// This property is unavailable because index will be get from IDEWorkspace directly.
23+
@property (nonatomic, weak) IDEIndex *index NS_UNAVAILABLE;
2324

2425
@end
2526

@@ -44,42 +45,19 @@ + (instancetype)sharedSwitchExpander
4445
- (id)init
4546
{
4647
if (self = [super init]) {
47-
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(indexDidChange:) name:@"IDEIndexDidChangeNotification" object:nil];
48-
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(editorDidDidFinishSetup:) name:@"IDESourceCodeEditorDidFinishSetup" object:nil];
49-
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(any:) name:nil object:nil];
50-
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(any:) name:@"IDEIndexDidIndexWorkspaceNotification" object:nil];
5148
}
5249

5350
return self;
5451
}
5552

56-
- (void)any:(NSNotification*)sender
53+
/// Remove this method because other (not current) editor's notification may be received.
54+
- (void)editorDidDidFinishSetup:(NSNotification *)sender NS_UNAVAILABLE
5755
{
58-
NSLog(@"Received: %@ %@", sender, sender.object);
59-
// self.index = sender.object;
6056
}
6157

62-
//- (void)editorDidDidFinishSetup:(NSNotification *)sender
63-
//{
64-
// IDEEditor * editor = sender.object;
65-
// IDEFileTextSettings *fileSettings = editor.fileTextSettings;
66-
// IDEFileReference *fileReference = fileSettings.fileReference;
67-
//
68-
// NSLog(@"DEBUG : File Reference = %@", fileReference);
69-
// NSString *fileReferenceStringBulk = [NSString stringWithFormat:@"%@",fileReference];
70-
// self.isSwift = [fileReferenceStringBulk rangeOfString:@".swift"].location != NSNotFound;
71-
//}
72-
73-
- (void)indexDidChange:(NSNotification *)sender
74-
{
75-
// NSLog(@"Index Did Change : %@", self.index);
76-
// self.index = sender.object;
77-
}
78-
79-
- (void)indexNeedsUpdate:(IDEIndex *)index
58+
/// Remove this method because index will get from current workspace directly.
59+
- (void)indexDidChange:(NSNotification *)sender NS_UNAVAILABLE
8060
{
81-
// NSLog(@"DEBUG: Update Index");
82-
// [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeSwitchExpanderIndexDidChangeNotification object:index];
8361
}
8462

8563
- (IDEWorkspace *)currentWorkspace

0 commit comments

Comments
 (0)