├── .gitignore ├── .travis.yml ├── LICENSE ├── Lin.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ ├── Lin.xcscheme │ └── LinTests.xcscheme ├── Lin ├── Completions.plist ├── DVTCompletingTextView.h ├── DVTFilePath.h ├── DVTSourceCodeLanguage+Lin.h ├── DVTSourceCodeLanguage+Lin.m ├── DVTSourceCodeLanguage.h ├── DVTSourceTextView+Lin.h ├── DVTSourceTextView+Lin.m ├── DVTSourceTextView.h ├── DVTTextCompletionController+Lin.h ├── DVTTextCompletionController+Lin.m ├── DVTTextCompletionController.h ├── DVTTextCompletionDataSource+Lin.h ├── DVTTextCompletionDataSource+Lin.m ├── DVTTextCompletionDataSource.h ├── DVTTextCompletionSession.h ├── DVTTextStorage.h ├── IDEIndex.h ├── IDEIndexCollection.h ├── IDEIndexCompletionItem.h ├── IDEWorkspace+Lin.h ├── IDEWorkspace+Lin.m ├── IDEWorkspace.h ├── Info.plist ├── LINLocalization.h ├── LINLocalization.m ├── LINLocalizationParser.h ├── LINLocalizationParser.m ├── LINTextCompletionItem.h ├── LINTextCompletionItem.m ├── Lin.h ├── Lin.m ├── MethodSwizzle.h ├── MethodSwizzle.m └── Xcode.h ├── LinTests ├── Info.plist ├── LINLocalizationParserTests.m └── Localizations.strings ├── Makefile ├── README.md └── screenshot.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io 2 | 3 | ### OSX ### 4 | .DS_Store 5 | .AppleDouble 6 | .LSOverride 7 | 8 | # Icon must end with two \r 9 | Icon 10 | 11 | # Thumbnails 12 | ._* 13 | 14 | # Files that might appear on external disk 15 | .Spotlight-V100 16 | .Trashes 17 | 18 | # Directories potentially created on remote AFP share 19 | .AppleDB 20 | .AppleDesktop 21 | Network Trash Folder 22 | Temporary Items 23 | .apdisk 24 | 25 | 26 | ### Xcode ### 27 | build/ 28 | *.pbxuser 29 | !default.pbxuser 30 | *.mode1v3 31 | !default.mode1v3 32 | *.mode2v3 33 | !default.mode2v3 34 | *.perspectivev3 35 | !default.perspectivev3 36 | xcuserdata 37 | *.xccheckout 38 | *.moved-aside 39 | DerivedData 40 | *.xcuserstate 41 | 42 | 43 | ### Objective-C ### 44 | # Xcode 45 | # 46 | build/ 47 | *.pbxuser 48 | !default.pbxuser 49 | *.mode1v3 50 | !default.mode1v3 51 | *.mode2v3 52 | !default.mode2v3 53 | *.perspectivev3 54 | !default.perspectivev3 55 | xcuserdata 56 | *.xccheckout 57 | *.moved-aside 58 | DerivedData 59 | *.hmap 60 | *.ipa 61 | *.xcuserstate 62 | 63 | # CocoaPods 64 | # 65 | # We recommend against adding the Pods directory to your .gitignore. However 66 | # you should judge for yourself, the pros and cons are mentioned at: 67 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 68 | # 69 | # Pods/ 70 | 71 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | script: 3 | - make clean test 4 | 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2015 Katsuma Tanaka 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /Lin.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | AA1313A31A82884B0080D488 /* MethodSwizzle.m in Sources */ = {isa = PBXBuildFile; fileRef = AA1313A21A82884B0080D488 /* MethodSwizzle.m */; }; 11 | AA1313AA1A8289360080D488 /* DVTSourceTextView+Lin.m in Sources */ = {isa = PBXBuildFile; fileRef = AA1313A91A8289360080D488 /* DVTSourceTextView+Lin.m */; }; 12 | AA1313AD1A8289D50080D488 /* IDEFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1313AB1A8289D50080D488 /* IDEFoundation.framework */; }; 13 | AA1313AE1A8289D50080D488 /* IDEKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1313AC1A8289D50080D488 /* IDEKit.framework */; }; 14 | AA1313B11A8289E00080D488 /* DVTFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1313AF1A8289E00080D488 /* DVTFoundation.framework */; }; 15 | AA1313B21A8289E00080D488 /* DVTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1313B01A8289E00080D488 /* DVTKit.framework */; }; 16 | AA1313B41A8289E80080D488 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1313B31A8289E80080D488 /* Cocoa.framework */; }; 17 | AA1DB1181A828CD500856B10 /* DVTTextCompletionController+Lin.m in Sources */ = {isa = PBXBuildFile; fileRef = AA1DB1171A828CD500856B10 /* DVTTextCompletionController+Lin.m */; }; 18 | AA1DB1221A828FBF00856B10 /* LINTextCompletionItem.m in Sources */ = {isa = PBXBuildFile; fileRef = AA1DB1211A828FBF00856B10 /* LINTextCompletionItem.m */; }; 19 | AA49B1961A8295F6003EA1A3 /* IDEWorkspace+Lin.m in Sources */ = {isa = PBXBuildFile; fileRef = AA49B1951A8295F6003EA1A3 /* IDEWorkspace+Lin.m */; }; 20 | AA49B19C1A829B02003EA1A3 /* Completions.plist in Resources */ = {isa = PBXBuildFile; fileRef = AA49B19B1A829B02003EA1A3 /* Completions.plist */; }; 21 | AA4A0AA81A874D20005109B0 /* DVTSourceCodeLanguage+Lin.m in Sources */ = {isa = PBXBuildFile; fileRef = AA4A0AA71A874D20005109B0 /* DVTSourceCodeLanguage+Lin.m */; }; 22 | AA80F3471A82805B007687A3 /* Lin.m in Sources */ = {isa = PBXBuildFile; fileRef = AA80F3461A82805B007687A3 /* Lin.m */; }; 23 | AA89B4FD1A872ED600E8CCD6 /* DVTTextCompletionDataSource+Lin.m in Sources */ = {isa = PBXBuildFile; fileRef = AA89B4FC1A872ED600E8CCD6 /* DVTTextCompletionDataSource+Lin.m */; }; 24 | AAB604931A83933F00C0E59B /* Localizations.strings in Resources */ = {isa = PBXBuildFile; fileRef = AAB604921A83933F00C0E59B /* Localizations.strings */; }; 25 | AAB604951A8393B800C0E59B /* LINLocalizationParserTests.m in Sources */ = {isa = PBXBuildFile; fileRef = AAB604941A8393B800C0E59B /* LINLocalizationParserTests.m */; }; 26 | AAB604981A8393F700C0E59B /* LINLocalization.m in Sources */ = {isa = PBXBuildFile; fileRef = AAB604971A8393F700C0E59B /* LINLocalization.m */; }; 27 | AAB6049D1A839A0C00C0E59B /* LINLocalization.m in Sources */ = {isa = PBXBuildFile; fileRef = AAB604971A8393F700C0E59B /* LINLocalization.m */; }; 28 | AAB604A51A83C3B900C0E59B /* LINLocalizationParser.m in Sources */ = {isa = PBXBuildFile; fileRef = AAB604A41A83C3B900C0E59B /* LINLocalizationParser.m */; }; 29 | AAB604AB1A83CBD400C0E59B /* LINLocalizationParser.m in Sources */ = {isa = PBXBuildFile; fileRef = AAB604A41A83C3B900C0E59B /* LINLocalizationParser.m */; }; 30 | /* End PBXBuildFile section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | AA023C121A82A2E700D4AE5F /* LinTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LinTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | AA023C151A82A2E700D4AE5F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 35 | AA12BEBC1AC52947001A97ED /* DVTTextCompletionSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTTextCompletionSession.h; sourceTree = ""; }; 36 | AA1313A11A82884B0080D488 /* MethodSwizzle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MethodSwizzle.h; sourceTree = ""; }; 37 | AA1313A21A82884B0080D488 /* MethodSwizzle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MethodSwizzle.m; sourceTree = ""; }; 38 | AA1313A51A82890D0080D488 /* DVTCompletingTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTCompletingTextView.h; sourceTree = ""; }; 39 | AA1313A81A8289360080D488 /* DVTSourceTextView+Lin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DVTSourceTextView+Lin.h"; sourceTree = ""; }; 40 | AA1313A91A8289360080D488 /* DVTSourceTextView+Lin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "DVTSourceTextView+Lin.m"; sourceTree = ""; }; 41 | AA1313AB1A8289D50080D488 /* IDEFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEFoundation.framework; path = /Applications/Xcode.app/Contents/Frameworks/IDEFoundation.framework; sourceTree = ""; }; 42 | AA1313AC1A8289D50080D488 /* IDEKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEKit.framework; path = /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework; sourceTree = ""; }; 43 | AA1313AF1A8289E00080D488 /* DVTFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTFoundation.framework; path = /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework; sourceTree = ""; }; 44 | AA1313B01A8289E00080D488 /* DVTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTKit.framework; path = /Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework; sourceTree = ""; }; 45 | AA1313B31A8289E80080D488 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 46 | AA1DB1111A828C9800856B10 /* DVTTextCompletionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTTextCompletionController.h; sourceTree = ""; }; 47 | AA1DB1161A828CD500856B10 /* DVTTextCompletionController+Lin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DVTTextCompletionController+Lin.h"; sourceTree = ""; }; 48 | AA1DB1171A828CD500856B10 /* DVTTextCompletionController+Lin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "DVTTextCompletionController+Lin.m"; sourceTree = ""; }; 49 | AA1DB1201A828FBF00856B10 /* LINTextCompletionItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LINTextCompletionItem.h; sourceTree = ""; }; 50 | AA1DB1211A828FBF00856B10 /* LINTextCompletionItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LINTextCompletionItem.m; sourceTree = ""; }; 51 | AA49B1931A82959D003EA1A3 /* IDEWorkspace.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEWorkspace.h; sourceTree = ""; }; 52 | AA49B1941A8295F6003EA1A3 /* IDEWorkspace+Lin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IDEWorkspace+Lin.h"; sourceTree = ""; }; 53 | AA49B1951A8295F6003EA1A3 /* IDEWorkspace+Lin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "IDEWorkspace+Lin.m"; sourceTree = ""; }; 54 | AA49B1971A8296AD003EA1A3 /* IDEIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEIndex.h; sourceTree = ""; }; 55 | AA49B19A1A829977003EA1A3 /* DVTFilePath.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTFilePath.h; sourceTree = ""; }; 56 | AA49B19B1A829B02003EA1A3 /* Completions.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Completions.plist; sourceTree = ""; }; 57 | AA4A0AA61A874D20005109B0 /* DVTSourceCodeLanguage+Lin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DVTSourceCodeLanguage+Lin.h"; sourceTree = ""; }; 58 | AA4A0AA71A874D20005109B0 /* DVTSourceCodeLanguage+Lin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "DVTSourceCodeLanguage+Lin.m"; sourceTree = ""; }; 59 | AA4A0AAF1A877250005109B0 /* IDELanguageSupportCore.ideplugin */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = IDELanguageSupportCore.ideplugin; path = ../../../../Applications/Xcode.app/Contents/PlugIns/IDELanguageSupportCore.ideplugin; sourceTree = ""; }; 60 | AA4A0AB01A877250005109B0 /* IDELanguageSupportUI.ideplugin */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = IDELanguageSupportUI.ideplugin; path = ../../../../Applications/Xcode.app/Contents/PlugIns/IDELanguageSupportUI.ideplugin; sourceTree = ""; }; 61 | AA69EE811A87B9ED00139C5D /* IDEIndexCompletionItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEIndexCompletionItem.h; sourceTree = ""; }; 62 | AA80F33B1A82804C007687A3 /* Lin.xcplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Lin.xcplugin; sourceTree = BUILT_PRODUCTS_DIR; }; 63 | AA80F33F1A82804C007687A3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 64 | AA80F3451A82805B007687A3 /* Lin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Lin.h; sourceTree = ""; }; 65 | AA80F3461A82805B007687A3 /* Lin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Lin.m; sourceTree = ""; }; 66 | AA89B4F71A872D0200E8CCD6 /* DVTTextCompletionDataSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTTextCompletionDataSource.h; sourceTree = ""; }; 67 | AA89B4F81A872D2000E8CCD6 /* DVTSourceCodeLanguage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTSourceCodeLanguage.h; sourceTree = ""; }; 68 | AA89B4FB1A872ED600E8CCD6 /* DVTTextCompletionDataSource+Lin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DVTTextCompletionDataSource+Lin.h"; sourceTree = ""; }; 69 | AA89B4FC1A872ED600E8CCD6 /* DVTTextCompletionDataSource+Lin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "DVTTextCompletionDataSource+Lin.m"; sourceTree = ""; }; 70 | AAB604921A83933F00C0E59B /* Localizations.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; path = Localizations.strings; sourceTree = ""; }; 71 | AAB604941A8393B800C0E59B /* LINLocalizationParserTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LINLocalizationParserTests.m; sourceTree = ""; }; 72 | AAB604961A8393F700C0E59B /* LINLocalization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LINLocalization.h; sourceTree = ""; }; 73 | AAB604971A8393F700C0E59B /* LINLocalization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LINLocalization.m; sourceTree = ""; }; 74 | AAB6049F1A83A18400C0E59B /* IDEIndexCollection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEIndexCollection.h; sourceTree = ""; }; 75 | AAB604A11A83A72600C0E59B /* DVTSourceTextView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTSourceTextView.h; sourceTree = ""; }; 76 | AAB604A31A83C3B900C0E59B /* LINLocalizationParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LINLocalizationParser.h; sourceTree = ""; }; 77 | AAB604A41A83C3B900C0E59B /* LINLocalizationParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LINLocalizationParser.m; sourceTree = ""; }; 78 | AAB604AC1A83D3B900C0E59B /* DVTTextStorage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTTextStorage.h; sourceTree = ""; }; 79 | AAC2027C1A868C730010FDF7 /* Xcode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Xcode.h; sourceTree = ""; }; 80 | /* End PBXFileReference section */ 81 | 82 | /* Begin PBXFrameworksBuildPhase section */ 83 | AA023C0F1A82A2E700D4AE5F /* Frameworks */ = { 84 | isa = PBXFrameworksBuildPhase; 85 | buildActionMask = 2147483647; 86 | files = ( 87 | ); 88 | runOnlyForDeploymentPostprocessing = 0; 89 | }; 90 | AA80F3381A82804C007687A3 /* Frameworks */ = { 91 | isa = PBXFrameworksBuildPhase; 92 | buildActionMask = 2147483647; 93 | files = ( 94 | AA1313B41A8289E80080D488 /* Cocoa.framework in Frameworks */, 95 | AA1313AD1A8289D50080D488 /* IDEFoundation.framework in Frameworks */, 96 | AA1313AE1A8289D50080D488 /* IDEKit.framework in Frameworks */, 97 | AA1313B11A8289E00080D488 /* DVTFoundation.framework in Frameworks */, 98 | AA1313B21A8289E00080D488 /* DVTKit.framework in Frameworks */, 99 | ); 100 | runOnlyForDeploymentPostprocessing = 0; 101 | }; 102 | /* End PBXFrameworksBuildPhase section */ 103 | 104 | /* Begin PBXGroup section */ 105 | AA023C131A82A2E700D4AE5F /* LinTests */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | AAB604941A8393B800C0E59B /* LINLocalizationParserTests.m */, 109 | AAB604921A83933F00C0E59B /* Localizations.strings */, 110 | AA023C141A82A2E700D4AE5F /* Supporting Files */, 111 | ); 112 | path = LinTests; 113 | sourceTree = ""; 114 | }; 115 | AA023C141A82A2E700D4AE5F /* Supporting Files */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | AA023C151A82A2E700D4AE5F /* Info.plist */, 119 | ); 120 | name = "Supporting Files"; 121 | sourceTree = ""; 122 | }; 123 | AA1313B51A8289EC0080D488 /* Frameworks */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | AA4A0AAF1A877250005109B0 /* IDELanguageSupportCore.ideplugin */, 127 | AA4A0AB01A877250005109B0 /* IDELanguageSupportUI.ideplugin */, 128 | AA1313B31A8289E80080D488 /* Cocoa.framework */, 129 | AA1313AF1A8289E00080D488 /* DVTFoundation.framework */, 130 | AA1313B01A8289E00080D488 /* DVTKit.framework */, 131 | AA1313AB1A8289D50080D488 /* IDEFoundation.framework */, 132 | AA1313AC1A8289D50080D488 /* IDEKit.framework */, 133 | ); 134 | name = Frameworks; 135 | sourceTree = ""; 136 | }; 137 | AA1DB1141A828CBA00856B10 /* Categories */ = { 138 | isa = PBXGroup; 139 | children = ( 140 | AA1313A11A82884B0080D488 /* MethodSwizzle.h */, 141 | AA1313A21A82884B0080D488 /* MethodSwizzle.m */, 142 | AA4A0AA61A874D20005109B0 /* DVTSourceCodeLanguage+Lin.h */, 143 | AA4A0AA71A874D20005109B0 /* DVTSourceCodeLanguage+Lin.m */, 144 | AA1313A81A8289360080D488 /* DVTSourceTextView+Lin.h */, 145 | AA1313A91A8289360080D488 /* DVTSourceTextView+Lin.m */, 146 | AA1DB1161A828CD500856B10 /* DVTTextCompletionController+Lin.h */, 147 | AA1DB1171A828CD500856B10 /* DVTTextCompletionController+Lin.m */, 148 | AA89B4FB1A872ED600E8CCD6 /* DVTTextCompletionDataSource+Lin.h */, 149 | AA89B4FC1A872ED600E8CCD6 /* DVTTextCompletionDataSource+Lin.m */, 150 | AA49B1941A8295F6003EA1A3 /* IDEWorkspace+Lin.h */, 151 | AA49B1951A8295F6003EA1A3 /* IDEWorkspace+Lin.m */, 152 | ); 153 | name = Categories; 154 | sourceTree = ""; 155 | }; 156 | AA1DB1151A828CC100856B10 /* Xcode */ = { 157 | isa = PBXGroup; 158 | children = ( 159 | AAC2027C1A868C730010FDF7 /* Xcode.h */, 160 | AAB604A71A83C96600C0E59B /* DVTFoundation */, 161 | AAB604A61A83C93800C0E59B /* DVTKit */, 162 | AAB604A81A83C99F00C0E59B /* IDEFoundation */, 163 | ); 164 | name = Xcode; 165 | sourceTree = ""; 166 | }; 167 | AA80F3321A82804C007687A3 = { 168 | isa = PBXGroup; 169 | children = ( 170 | AA80F33D1A82804C007687A3 /* Lin */, 171 | AA023C131A82A2E700D4AE5F /* LinTests */, 172 | AA1313B51A8289EC0080D488 /* Frameworks */, 173 | AA80F33C1A82804C007687A3 /* Products */, 174 | ); 175 | sourceTree = ""; 176 | }; 177 | AA80F33C1A82804C007687A3 /* Products */ = { 178 | isa = PBXGroup; 179 | children = ( 180 | AA80F33B1A82804C007687A3 /* Lin.xcplugin */, 181 | AA023C121A82A2E700D4AE5F /* LinTests.xctest */, 182 | ); 183 | name = Products; 184 | sourceTree = ""; 185 | }; 186 | AA80F33D1A82804C007687A3 /* Lin */ = { 187 | isa = PBXGroup; 188 | children = ( 189 | AA1DB1151A828CC100856B10 /* Xcode */, 190 | AA1DB1141A828CBA00856B10 /* Categories */, 191 | AAB6049E1A839BC500C0E59B /* Models */, 192 | AA80F3451A82805B007687A3 /* Lin.h */, 193 | AA80F3461A82805B007687A3 /* Lin.m */, 194 | AA80F33E1A82804C007687A3 /* Supporting Files */, 195 | ); 196 | path = Lin; 197 | sourceTree = ""; 198 | }; 199 | AA80F33E1A82804C007687A3 /* Supporting Files */ = { 200 | isa = PBXGroup; 201 | children = ( 202 | AA80F33F1A82804C007687A3 /* Info.plist */, 203 | AA49B19B1A829B02003EA1A3 /* Completions.plist */, 204 | ); 205 | name = "Supporting Files"; 206 | sourceTree = ""; 207 | }; 208 | AAB6049E1A839BC500C0E59B /* Models */ = { 209 | isa = PBXGroup; 210 | children = ( 211 | AAB604A31A83C3B900C0E59B /* LINLocalizationParser.h */, 212 | AAB604A41A83C3B900C0E59B /* LINLocalizationParser.m */, 213 | AAB604961A8393F700C0E59B /* LINLocalization.h */, 214 | AAB604971A8393F700C0E59B /* LINLocalization.m */, 215 | AA1DB1201A828FBF00856B10 /* LINTextCompletionItem.h */, 216 | AA1DB1211A828FBF00856B10 /* LINTextCompletionItem.m */, 217 | ); 218 | name = Models; 219 | sourceTree = ""; 220 | }; 221 | AAB604A61A83C93800C0E59B /* DVTKit */ = { 222 | isa = PBXGroup; 223 | children = ( 224 | AA1313A51A82890D0080D488 /* DVTCompletingTextView.h */, 225 | AAB604A11A83A72600C0E59B /* DVTSourceTextView.h */, 226 | AA1DB1111A828C9800856B10 /* DVTTextCompletionController.h */, 227 | AA89B4F71A872D0200E8CCD6 /* DVTTextCompletionDataSource.h */, 228 | AA12BEBC1AC52947001A97ED /* DVTTextCompletionSession.h */, 229 | AAB604AC1A83D3B900C0E59B /* DVTTextStorage.h */, 230 | ); 231 | name = DVTKit; 232 | sourceTree = ""; 233 | }; 234 | AAB604A71A83C96600C0E59B /* DVTFoundation */ = { 235 | isa = PBXGroup; 236 | children = ( 237 | AA49B19A1A829977003EA1A3 /* DVTFilePath.h */, 238 | AA89B4F81A872D2000E8CCD6 /* DVTSourceCodeLanguage.h */, 239 | ); 240 | name = DVTFoundation; 241 | sourceTree = ""; 242 | }; 243 | AAB604A81A83C99F00C0E59B /* IDEFoundation */ = { 244 | isa = PBXGroup; 245 | children = ( 246 | AA49B1971A8296AD003EA1A3 /* IDEIndex.h */, 247 | AA69EE811A87B9ED00139C5D /* IDEIndexCompletionItem.h */, 248 | AAB6049F1A83A18400C0E59B /* IDEIndexCollection.h */, 249 | AA49B1931A82959D003EA1A3 /* IDEWorkspace.h */, 250 | ); 251 | name = IDEFoundation; 252 | sourceTree = ""; 253 | }; 254 | /* End PBXGroup section */ 255 | 256 | /* Begin PBXNativeTarget section */ 257 | AA023C111A82A2E700D4AE5F /* LinTests */ = { 258 | isa = PBXNativeTarget; 259 | buildConfigurationList = AA023C181A82A2E700D4AE5F /* Build configuration list for PBXNativeTarget "LinTests" */; 260 | buildPhases = ( 261 | AA023C0E1A82A2E700D4AE5F /* Sources */, 262 | AA023C0F1A82A2E700D4AE5F /* Frameworks */, 263 | AA023C101A82A2E700D4AE5F /* Resources */, 264 | ); 265 | buildRules = ( 266 | ); 267 | dependencies = ( 268 | ); 269 | name = LinTests; 270 | productName = LinTests; 271 | productReference = AA023C121A82A2E700D4AE5F /* LinTests.xctest */; 272 | productType = "com.apple.product-type.bundle.unit-test"; 273 | }; 274 | AA80F33A1A82804C007687A3 /* Lin */ = { 275 | isa = PBXNativeTarget; 276 | buildConfigurationList = AA80F3421A82804C007687A3 /* Build configuration list for PBXNativeTarget "Lin" */; 277 | buildPhases = ( 278 | AA80F3371A82804C007687A3 /* Sources */, 279 | AA80F3381A82804C007687A3 /* Frameworks */, 280 | AA80F3391A82804C007687A3 /* Resources */, 281 | ); 282 | buildRules = ( 283 | ); 284 | dependencies = ( 285 | ); 286 | name = Lin; 287 | productName = Lin; 288 | productReference = AA80F33B1A82804C007687A3 /* Lin.xcplugin */; 289 | productType = "com.apple.product-type.bundle"; 290 | }; 291 | /* End PBXNativeTarget section */ 292 | 293 | /* Begin PBXProject section */ 294 | AA80F3331A82804C007687A3 /* Project object */ = { 295 | isa = PBXProject; 296 | attributes = { 297 | LastUpgradeCheck = 0720; 298 | ORGANIZATIONNAME = "Katsuma Tanaka"; 299 | TargetAttributes = { 300 | AA023C111A82A2E700D4AE5F = { 301 | CreatedOnToolsVersion = 6.1; 302 | }; 303 | AA80F33A1A82804C007687A3 = { 304 | CreatedOnToolsVersion = 6.1; 305 | }; 306 | }; 307 | }; 308 | buildConfigurationList = AA80F3361A82804C007687A3 /* Build configuration list for PBXProject "Lin" */; 309 | compatibilityVersion = "Xcode 3.2"; 310 | developmentRegion = English; 311 | hasScannedForEncodings = 0; 312 | knownRegions = ( 313 | en, 314 | ); 315 | mainGroup = AA80F3321A82804C007687A3; 316 | productRefGroup = AA80F33C1A82804C007687A3 /* Products */; 317 | projectDirPath = ""; 318 | projectRoot = ""; 319 | targets = ( 320 | AA80F33A1A82804C007687A3 /* Lin */, 321 | AA023C111A82A2E700D4AE5F /* LinTests */, 322 | ); 323 | }; 324 | /* End PBXProject section */ 325 | 326 | /* Begin PBXResourcesBuildPhase section */ 327 | AA023C101A82A2E700D4AE5F /* Resources */ = { 328 | isa = PBXResourcesBuildPhase; 329 | buildActionMask = 2147483647; 330 | files = ( 331 | AAB604931A83933F00C0E59B /* Localizations.strings in Resources */, 332 | ); 333 | runOnlyForDeploymentPostprocessing = 0; 334 | }; 335 | AA80F3391A82804C007687A3 /* Resources */ = { 336 | isa = PBXResourcesBuildPhase; 337 | buildActionMask = 2147483647; 338 | files = ( 339 | AA49B19C1A829B02003EA1A3 /* Completions.plist in Resources */, 340 | ); 341 | runOnlyForDeploymentPostprocessing = 0; 342 | }; 343 | /* End PBXResourcesBuildPhase section */ 344 | 345 | /* Begin PBXSourcesBuildPhase section */ 346 | AA023C0E1A82A2E700D4AE5F /* Sources */ = { 347 | isa = PBXSourcesBuildPhase; 348 | buildActionMask = 2147483647; 349 | files = ( 350 | AAB6049D1A839A0C00C0E59B /* LINLocalization.m in Sources */, 351 | AAB604951A8393B800C0E59B /* LINLocalizationParserTests.m in Sources */, 352 | AAB604AB1A83CBD400C0E59B /* LINLocalizationParser.m in Sources */, 353 | ); 354 | runOnlyForDeploymentPostprocessing = 0; 355 | }; 356 | AA80F3371A82804C007687A3 /* Sources */ = { 357 | isa = PBXSourcesBuildPhase; 358 | buildActionMask = 2147483647; 359 | files = ( 360 | AAB604981A8393F700C0E59B /* LINLocalization.m in Sources */, 361 | AA89B4FD1A872ED600E8CCD6 /* DVTTextCompletionDataSource+Lin.m in Sources */, 362 | AAB604A51A83C3B900C0E59B /* LINLocalizationParser.m in Sources */, 363 | AA4A0AA81A874D20005109B0 /* DVTSourceCodeLanguage+Lin.m in Sources */, 364 | AA49B1961A8295F6003EA1A3 /* IDEWorkspace+Lin.m in Sources */, 365 | AA1DB1221A828FBF00856B10 /* LINTextCompletionItem.m in Sources */, 366 | AA1313AA1A8289360080D488 /* DVTSourceTextView+Lin.m in Sources */, 367 | AA1DB1181A828CD500856B10 /* DVTTextCompletionController+Lin.m in Sources */, 368 | AA80F3471A82805B007687A3 /* Lin.m in Sources */, 369 | AA1313A31A82884B0080D488 /* MethodSwizzle.m in Sources */, 370 | ); 371 | runOnlyForDeploymentPostprocessing = 0; 372 | }; 373 | /* End PBXSourcesBuildPhase section */ 374 | 375 | /* Begin XCBuildConfiguration section */ 376 | AA023C191A82A2E700D4AE5F /* Debug */ = { 377 | isa = XCBuildConfiguration; 378 | buildSettings = { 379 | COMBINE_HIDPI_IMAGES = YES; 380 | FRAMEWORK_SEARCH_PATHS = ( 381 | "$(DEVELOPER_FRAMEWORKS_DIR)", 382 | "$(inherited)", 383 | ); 384 | GCC_PREPROCESSOR_DEFINITIONS = ( 385 | "DEBUG=1", 386 | "$(inherited)", 387 | ); 388 | INFOPLIST_FILE = LinTests/Info.plist; 389 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 390 | PRODUCT_BUNDLE_IDENTIFIER = "jp.questbeat.$(PRODUCT_NAME:rfc1034identifier)"; 391 | PRODUCT_NAME = "$(TARGET_NAME)"; 392 | }; 393 | name = Debug; 394 | }; 395 | AA023C1A1A82A2E700D4AE5F /* Release */ = { 396 | isa = XCBuildConfiguration; 397 | buildSettings = { 398 | COMBINE_HIDPI_IMAGES = YES; 399 | FRAMEWORK_SEARCH_PATHS = ( 400 | "$(DEVELOPER_FRAMEWORKS_DIR)", 401 | "$(inherited)", 402 | ); 403 | INFOPLIST_FILE = LinTests/Info.plist; 404 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 405 | PRODUCT_BUNDLE_IDENTIFIER = "jp.questbeat.$(PRODUCT_NAME:rfc1034identifier)"; 406 | PRODUCT_NAME = "$(TARGET_NAME)"; 407 | }; 408 | name = Release; 409 | }; 410 | AA80F3401A82804C007687A3 /* Debug */ = { 411 | isa = XCBuildConfiguration; 412 | buildSettings = { 413 | ALWAYS_SEARCH_USER_PATHS = NO; 414 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 415 | CLANG_CXX_LIBRARY = "libc++"; 416 | CLANG_ENABLE_MODULES = YES; 417 | CLANG_ENABLE_OBJC_ARC = YES; 418 | CLANG_WARN_BOOL_CONVERSION = YES; 419 | CLANG_WARN_CONSTANT_CONVERSION = YES; 420 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 421 | CLANG_WARN_EMPTY_BODY = YES; 422 | CLANG_WARN_ENUM_CONVERSION = YES; 423 | CLANG_WARN_INT_CONVERSION = YES; 424 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 425 | CLANG_WARN_UNREACHABLE_CODE = YES; 426 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 427 | COPY_PHASE_STRIP = NO; 428 | ENABLE_STRICT_OBJC_MSGSEND = YES; 429 | ENABLE_TESTABILITY = YES; 430 | GCC_C_LANGUAGE_STANDARD = gnu99; 431 | GCC_DYNAMIC_NO_PIC = NO; 432 | GCC_OPTIMIZATION_LEVEL = 0; 433 | GCC_PREPROCESSOR_DEFINITIONS = ( 434 | "DEBUG=1", 435 | "$(inherited)", 436 | ); 437 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 438 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 439 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 440 | GCC_WARN_UNDECLARED_SELECTOR = YES; 441 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 442 | GCC_WARN_UNUSED_FUNCTION = YES; 443 | GCC_WARN_UNUSED_VARIABLE = YES; 444 | MACOSX_DEPLOYMENT_TARGET = 10.10; 445 | MTL_ENABLE_DEBUG_INFO = YES; 446 | ONLY_ACTIVE_ARCH = YES; 447 | SDKROOT = macosx; 448 | }; 449 | name = Debug; 450 | }; 451 | AA80F3411A82804C007687A3 /* Release */ = { 452 | isa = XCBuildConfiguration; 453 | buildSettings = { 454 | ALWAYS_SEARCH_USER_PATHS = NO; 455 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 456 | CLANG_CXX_LIBRARY = "libc++"; 457 | CLANG_ENABLE_MODULES = YES; 458 | CLANG_ENABLE_OBJC_ARC = YES; 459 | CLANG_WARN_BOOL_CONVERSION = YES; 460 | CLANG_WARN_CONSTANT_CONVERSION = YES; 461 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 462 | CLANG_WARN_EMPTY_BODY = YES; 463 | CLANG_WARN_ENUM_CONVERSION = YES; 464 | CLANG_WARN_INT_CONVERSION = YES; 465 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 466 | CLANG_WARN_UNREACHABLE_CODE = YES; 467 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 468 | COPY_PHASE_STRIP = YES; 469 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 470 | ENABLE_NS_ASSERTIONS = NO; 471 | ENABLE_STRICT_OBJC_MSGSEND = YES; 472 | GCC_C_LANGUAGE_STANDARD = gnu99; 473 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 474 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 475 | GCC_WARN_UNDECLARED_SELECTOR = YES; 476 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 477 | GCC_WARN_UNUSED_FUNCTION = YES; 478 | GCC_WARN_UNUSED_VARIABLE = YES; 479 | MACOSX_DEPLOYMENT_TARGET = 10.10; 480 | MTL_ENABLE_DEBUG_INFO = NO; 481 | SDKROOT = macosx; 482 | }; 483 | name = Release; 484 | }; 485 | AA80F3431A82804C007687A3 /* Debug */ = { 486 | isa = XCBuildConfiguration; 487 | buildSettings = { 488 | COMBINE_HIDPI_IMAGES = YES; 489 | DEPLOYMENT_LOCATION = YES; 490 | DSTROOT = "$(HOME)"; 491 | FRAMEWORK_SEARCH_PATHS = ( 492 | "$(inherited)", 493 | "$(DEVELOPER_DIR)/../Frameworks", 494 | "$(DEVELOPER_DIR)/../SharedFrameworks", 495 | ); 496 | INFOPLIST_FILE = Lin/Info.plist; 497 | INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins"; 498 | PRODUCT_BUNDLE_IDENTIFIER = "jp.questbeat.$(PRODUCT_NAME:rfc1034identifier)"; 499 | PRODUCT_NAME = "$(TARGET_NAME)"; 500 | SKIP_INSTALL = NO; 501 | WRAPPER_EXTENSION = xcplugin; 502 | }; 503 | name = Debug; 504 | }; 505 | AA80F3441A82804C007687A3 /* Release */ = { 506 | isa = XCBuildConfiguration; 507 | buildSettings = { 508 | COMBINE_HIDPI_IMAGES = YES; 509 | DEPLOYMENT_LOCATION = YES; 510 | DSTROOT = "$(HOME)"; 511 | FRAMEWORK_SEARCH_PATHS = ( 512 | "$(inherited)", 513 | "$(DEVELOPER_DIR)/../Frameworks", 514 | "$(DEVELOPER_DIR)/../SharedFrameworks", 515 | ); 516 | INFOPLIST_FILE = Lin/Info.plist; 517 | INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins"; 518 | PRODUCT_BUNDLE_IDENTIFIER = "jp.questbeat.$(PRODUCT_NAME:rfc1034identifier)"; 519 | PRODUCT_NAME = "$(TARGET_NAME)"; 520 | SKIP_INSTALL = NO; 521 | WRAPPER_EXTENSION = xcplugin; 522 | }; 523 | name = Release; 524 | }; 525 | /* End XCBuildConfiguration section */ 526 | 527 | /* Begin XCConfigurationList section */ 528 | AA023C181A82A2E700D4AE5F /* Build configuration list for PBXNativeTarget "LinTests" */ = { 529 | isa = XCConfigurationList; 530 | buildConfigurations = ( 531 | AA023C191A82A2E700D4AE5F /* Debug */, 532 | AA023C1A1A82A2E700D4AE5F /* Release */, 533 | ); 534 | defaultConfigurationIsVisible = 0; 535 | defaultConfigurationName = Release; 536 | }; 537 | AA80F3361A82804C007687A3 /* Build configuration list for PBXProject "Lin" */ = { 538 | isa = XCConfigurationList; 539 | buildConfigurations = ( 540 | AA80F3401A82804C007687A3 /* Debug */, 541 | AA80F3411A82804C007687A3 /* Release */, 542 | ); 543 | defaultConfigurationIsVisible = 0; 544 | defaultConfigurationName = Release; 545 | }; 546 | AA80F3421A82804C007687A3 /* Build configuration list for PBXNativeTarget "Lin" */ = { 547 | isa = XCConfigurationList; 548 | buildConfigurations = ( 549 | AA80F3431A82804C007687A3 /* Debug */, 550 | AA80F3441A82804C007687A3 /* Release */, 551 | ); 552 | defaultConfigurationIsVisible = 0; 553 | defaultConfigurationName = Release; 554 | }; 555 | /* End XCConfigurationList section */ 556 | }; 557 | rootObject = AA80F3331A82804C007687A3 /* Project object */; 558 | } 559 | -------------------------------------------------------------------------------- /Lin.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Lin.xcodeproj/xcshareddata/xcschemes/Lin.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 65 | 68 | 69 | 70 | 76 | 77 | 78 | 79 | 80 | 81 | 87 | 88 | 94 | 95 | 96 | 97 | 99 | 100 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /Lin.xcodeproj/xcshareddata/xcschemes/LinTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 65 | 71 | 72 | 73 | 74 | 75 | 76 | 82 | 83 | 89 | 90 | 91 | 92 | 94 | 95 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /Lin/Completions.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | LINFunctionName 7 | NSLocalizedString 8 | LINTableNameCompletionPatterns 9 | 10 | Swift 11 | 12 | NSLocalizedString\s*\(\s*"(?:[^\\"]|\\.)*"\s*,\s*tableName\s*:\s*(<#String\?#>) 13 | NSLocalizedString\s*\(\s*"(?:[^\\"]|\\.)*"\s*,\s*tableName\s*:\s*(<#T##String\?#>) 14 | NSLocalizedString\s*\(\s*"(?:[^\\"]|\\.)*"\s*,\s*tableName\s*:\s*("(?:[^\\"]|\\.)*") 15 | 16 | 17 | LINKeyCompletionPatterns 18 | 19 | Objective-C 20 | 21 | NSLocalizedString\s*\(\s*(<#key#>) 22 | NSLocalizedString\s*\(\s*(\w*) 23 | 24 | Swift 25 | 26 | NSLocalizedString\s*\(\s*(<#key: String#>) 27 | NSLocalizedString\s*\(\s*(<#T##key: String##String#>) 28 | NSLocalizedString\s*\(\s*(\w*) 29 | 30 | 31 | 32 | 33 | LINFunctionName 34 | NSLocalizedStringFromTable 35 | LINTableNameCompletionPatterns 36 | 37 | Objective-C 38 | 39 | NSLocalizedStringFromTable\s*\(\s*@"(?:[^\\"]|\\.)*"\s*,\s*(<#tbl#>) 40 | NSLocalizedStringFromTable\s*\(\s*@"(?:[^\\"]|\\.)*"\s*,\s*(@"(?:[^\\"]|\\.)*") 41 | 42 | 43 | LINKeyCompletionPatterns 44 | 45 | Objective-C 46 | 47 | NSLocalizedStringFromTable\s*\(\s*(<#key#>) 48 | NSLocalizedStringFromTable\s*\(\s*(\w*) 49 | 50 | 51 | 52 | 53 | LINFunctionName 54 | NSLocalizedStringFromTableInBundle 55 | LINTableNameCompletionPatterns 56 | 57 | Objective-C 58 | 59 | NSLocalizedStringFromTableInBundle\s*\(\s*@"(?:[^\\"]|\\.)*"\s*,\s*(<#tbl#>) 60 | NSLocalizedStringFromTableInBundle\s*\(\s*@"(?:[^\\"]|\\.)*"\s*,\s*(@"(?:[^\\"]|\\.)*") 61 | 62 | 63 | LINKeyCompletionPatterns 64 | 65 | Objective-C 66 | 67 | NSLocalizedStringFromTableInBundle\s*\(\s*(<#key#>) 68 | NSLocalizedStringFromTableInBundle\s*\(\s*(\w*) 69 | 70 | 71 | 72 | 73 | LINFunctionName 74 | NSLocalizedStringWithDefaultValue 75 | LINTableNameCompletionPatterns 76 | 77 | Objective-C 78 | 79 | NSLocalizedStringWithDefaultValue\s*\(\s*@"(?:[^\\"]|\\.)*"\s*,\s*(<#tbl#>) 80 | NSLocalizedStringWithDefaultValue\s*\(\s*@"(?:[^\\"]|\\.)*"\s*,\s*(@"(?:[^\\"]|\\.)*") 81 | 82 | 83 | LINKeyCompletionPatterns 84 | 85 | Objective-C 86 | 87 | NSLocalizedStringWithDefaultValue\s*\(\s*(<#key#>) 88 | NSLocalizedStringWithDefaultValue\s*\(\s*(\w*) 89 | 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /Lin/DVTCompletingTextView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DVTCompletingTextView.h 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DVTTextCompletionDataSource; 12 | 13 | @interface DVTCompletingTextView : NSTextView 14 | 15 | @property (readonly) DVTTextCompletionDataSource *completionsDataSource; 16 | 17 | - (BOOL)shouldAutoCompleteAtLocation:(unsigned long long)arg1; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Lin/DVTFilePath.h: -------------------------------------------------------------------------------- 1 | // 2 | // DVTFilePath.h 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DVTFilePath : NSObject 12 | 13 | @property (readonly) NSString *fileName; 14 | @property (readonly) NSURL *fileURL; 15 | @property (readonly) NSArray *pathComponents; 16 | @property (readonly) NSString *pathString; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Lin/DVTSourceCodeLanguage+Lin.h: -------------------------------------------------------------------------------- 1 | // 2 | // DVTSourceCodeLanguage+Lin.h 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/08. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import "DVTSourceCodeLanguage.h" 10 | 11 | @interface DVTSourceCodeLanguage (Lin) 12 | 13 | - (BOOL)lin_isObjectiveC; 14 | - (BOOL)lin_isSwift; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Lin/DVTSourceCodeLanguage+Lin.m: -------------------------------------------------------------------------------- 1 | // 2 | // DVTSourceCodeLanguage+Lin.m 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/08. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import "DVTSourceCodeLanguage+Lin.h" 10 | 11 | @implementation DVTSourceCodeLanguage (Lin) 12 | 13 | - (BOOL)lin_isObjectiveC 14 | { 15 | return [self.languageName isEqualToString:@"Objective-C"]; 16 | } 17 | 18 | - (BOOL)lin_isSwift 19 | { 20 | return [self.languageName isEqualToString:@"Swift"]; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Lin/DVTSourceCodeLanguage.h: -------------------------------------------------------------------------------- 1 | // 2 | // DVTSourceCodeLanguage.h 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DVTSourceCodeLanguage : NSObject 12 | 13 | @property (readonly) BOOL isHidden; 14 | @property (readonly) BOOL supportsIndentation; 15 | @property (readonly) Class nativeSourceModelParserClass; 16 | @property (readonly, copy) NSString *documentationAbbreviation; 17 | @property (readonly, copy) NSString *languageName; 18 | @property (readonly, copy) NSString *identifier; 19 | 20 | @property (readonly, copy) NSArray *conformedToLanguages; 21 | @property (readonly, copy) NSArray *fileDataTypes; 22 | 23 | + (id)sourceCodeLanguageForFileDataType:(id)arg1; 24 | + (id)sourceCodeLanguageWithIdentifier:(id)arg1; 25 | + (id)sourceCodeLanguages; 26 | + (id)_sourceCodeLanguageForExtension:(id)arg1; 27 | 28 | - (BOOL)conformsToLanguage:(id)arg1; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Lin/DVTSourceTextView+Lin.h: -------------------------------------------------------------------------------- 1 | // 2 | // DVTCompletingTextView+Lin.h 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import "DVTSourceTextView.h" 10 | 11 | @interface DVTSourceTextView (Lin) 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Lin/DVTSourceTextView+Lin.m: -------------------------------------------------------------------------------- 1 | // 2 | // DVTCompletingTextView+Lin.m 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import "DVTSourceTextView+Lin.h" 10 | #import "MethodSwizzle.h" 11 | #import "Lin.h" 12 | 13 | @implementation DVTSourceTextView (Lin) 14 | 15 | + (void)load 16 | { 17 | MethodSwizzle(self, 18 | @selector(shouldAutoCompleteAtLocation:), 19 | @selector(lin_shouldAutoCompleteAtLocation:)); 20 | } 21 | 22 | - (BOOL)lin_shouldAutoCompleteAtLocation:(unsigned long long)arg1 23 | { 24 | BOOL shouldAutoComplete = [self lin_shouldAutoCompleteAtLocation:arg1]; 25 | 26 | if (!shouldAutoComplete) { 27 | shouldAutoComplete = [[Lin sharedInstance] shouldAutoCompleteInTextView:self]; 28 | } 29 | 30 | return shouldAutoComplete; 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Lin/DVTSourceTextView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DVTSourceTextView.h 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import "DVTCompletingTextView.h" 10 | 11 | @interface DVTSourceTextView : DVTCompletingTextView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Lin/DVTTextCompletionController+Lin.h: -------------------------------------------------------------------------------- 1 | // 2 | // DVTTextCompletionController+Lin.h 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import "DVTTextCompletionController.h" 10 | 11 | @interface DVTTextCompletionController (Lin) 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Lin/DVTTextCompletionController+Lin.m: -------------------------------------------------------------------------------- 1 | // 2 | // DVTTextCompletionController+Lin.m 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import "DVTTextCompletionController+Lin.h" 10 | #import "MethodSwizzle.h" 11 | #import "Xcode.h" 12 | #import "Lin.h" 13 | #import "LINLocalization.h" 14 | #import "LINTextCompletionItem.h" 15 | 16 | @implementation DVTTextCompletionController (Lin) 17 | 18 | + (void)load 19 | { 20 | MethodSwizzle(self, 21 | @selector(acceptCurrentCompletion), 22 | @selector(lin_acceptCurrentCompletion)); 23 | } 24 | 25 | - (BOOL)lin_acceptCurrentCompletion 26 | { 27 | // Get selected completion 28 | DVTTextCompletionSession *session = self.currentSession; 29 | id selectedCompletion = nil; 30 | 31 | if (session.selectedCompletionIndex < session.filteredCompletionsAlpha.count) { 32 | selectedCompletion = session.filteredCompletionsAlpha[session.selectedCompletionIndex]; 33 | } 34 | 35 | // Original method must be called after referencing selected completion 36 | BOOL acceptCurrentCompletion = [self lin_acceptCurrentCompletion]; 37 | 38 | DVTSourceTextView *textView = (DVTSourceTextView *)self.textView; 39 | DVTTextStorage *textStorage = (DVTTextStorage *)textView.textStorage; 40 | DVTSourceCodeLanguage *language = textStorage.language; 41 | 42 | if ([selectedCompletion isKindOfClass:[LINTextCompletionItem class]]) { 43 | // Replace table name 44 | NSRange tableNameRange = [[Lin sharedInstance] replacableTableNameRangeInTextView:textView]; 45 | 46 | if (tableNameRange.location != NSNotFound) { 47 | LINLocalization *localization = [[(LINTextCompletionItem *)selectedCompletion localizations] lastObject]; 48 | 49 | NSString *text; 50 | if ([language lin_isObjectiveC]) { 51 | text = [NSString stringWithFormat:@"@\"%@\"", localization.tableName]; 52 | } else { 53 | text = [NSString stringWithFormat:@"\"%@\"", localization.tableName]; 54 | } 55 | 56 | [textView insertText:text replacementRange:tableNameRange]; 57 | } 58 | } else { 59 | // Replace key 60 | NSRange keyRange = [[Lin sharedInstance] replacableKeyRangeInTextView:textView]; 61 | 62 | if (keyRange.location != NSNotFound) { 63 | [textView insertText:@"" replacementRange:keyRange]; 64 | [self _showCompletionsAtCursorLocationExplicitly:YES]; 65 | } 66 | } 67 | 68 | return acceptCurrentCompletion; 69 | } 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /Lin/DVTTextCompletionController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DVTTextCompletionController.h 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DVTCompletingTextView; 12 | @class DVTTextCompletionSession; 13 | 14 | @interface DVTTextCompletionController : NSObject 15 | 16 | @property (readonly) DVTCompletingTextView *textView; 17 | @property (retain) DVTTextCompletionSession *currentSession; 18 | 19 | - (BOOL)acceptCurrentCompletion; 20 | - (BOOL)_showCompletionsAtCursorLocationExplicitly:(BOOL)arg1; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Lin/DVTTextCompletionDataSource+Lin.h: -------------------------------------------------------------------------------- 1 | // 2 | // DVTTextCompletionDataSource+Lin.h 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/08. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import "DVTTextCompletionDataSource.h" 10 | 11 | @interface DVTTextCompletionDataSource (Lin) 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Lin/DVTTextCompletionDataSource+Lin.m: -------------------------------------------------------------------------------- 1 | // 2 | // DVTTextCompletionDataSource+Lin.m 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/08. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import "DVTTextCompletionDataSource+Lin.h" 10 | #import "MethodSwizzle.h" 11 | #import "Xcode.h" 12 | #import "Lin.h" 13 | #import "LINTextCompletionItem.h" 14 | 15 | @implementation DVTTextCompletionDataSource (Lin) 16 | 17 | + (void)load 18 | { 19 | MethodSwizzle(self, 20 | @selector(generateCompletionsForDocumentLocation:context:completionBlock:), 21 | @selector(lin_generateCompletionsForDocumentLocation:context:completionBlock:)); 22 | } 23 | 24 | - (void)lin_generateCompletionsForDocumentLocation:(id)arg1 context:(id)arg2 completionBlock:(void (^)(id, id))arg3 25 | { 26 | DVTSourceTextView *textView = [arg2 objectForKey:@"DVTTextCompletionContextTextView"]; 27 | DVTTextStorage *textStorage = (DVTTextStorage *)textView.textStorage; 28 | DVTSourceCodeLanguage *language = textStorage.language; 29 | 30 | BOOL shouldAutoComplete = [[Lin sharedInstance] shouldAutoCompleteInTextView:textView]; 31 | 32 | if (shouldAutoComplete) { 33 | IDEWorkspace *workspace = [arg2 objectForKey:@"IDETextCompletionContextWorkspaceKey"]; 34 | NSArray *items = [[Lin sharedInstance] completionItemsForWorkspace:workspace]; 35 | 36 | LINSourceCodeLanguage sourceCodeLanguage = [language lin_isObjectiveC] ? LINSourceCodeLanguageObjectiveC : LINSourceCodeLanguageSwift; 37 | for (LINTextCompletionItem *item in items) { 38 | item.sourceCodeLanguage = sourceCodeLanguage; 39 | } 40 | 41 | void (^completionBlock)(id, id) = ^(id obj1, id obj2) { 42 | if (arg3) arg3(items, obj2); 43 | }; 44 | 45 | [self lin_generateCompletionsForDocumentLocation:arg1 context:arg2 completionBlock:completionBlock]; 46 | } else { 47 | [self lin_generateCompletionsForDocumentLocation:arg1 context:arg2 completionBlock:arg3]; 48 | } 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Lin/DVTTextCompletionDataSource.h: -------------------------------------------------------------------------------- 1 | // 2 | // DVTTextCompletionDataSource.h 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DVTSourceCodeLanguage; 12 | 13 | @interface DVTTextCompletionDataSource : NSObject 14 | 15 | @property (retain, nonatomic) DVTSourceCodeLanguage *language; 16 | 17 | - (void)generateCompletionsForDocumentLocation:(id)arg1 context:(id)arg2 completionBlock:(id)arg3; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Lin/DVTTextCompletionSession.h: -------------------------------------------------------------------------------- 1 | // 2 | // DVTTextCompletionSession.h 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/03/27. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DVTTextCompletionSession : NSObject 12 | 13 | @property (retain) NSArray *filteredCompletionsAlpha; 14 | @property (nonatomic) long long selectedCompletionIndex; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Lin/DVTTextStorage.h: -------------------------------------------------------------------------------- 1 | // 2 | // DVTTextStorage.h 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DVTSourceLanguageService; 12 | @class DVTSourceModel; 13 | @class DVTSourceCodeLanguage; 14 | 15 | @interface DVTTextStorage : NSTextStorage 16 | 17 | @property (readonly) DVTSourceModel *sourceModelWithoutParsing; 18 | @property (readonly) DVTSourceModel *sourceModel; 19 | @property (readonly) DVTSourceLanguageService *sourceModelService; 20 | @property (readonly, nonatomic) NSDictionary *sourceLanguageServiceContext; 21 | @property (readonly) DVTSourceLanguageService *languageService; 22 | @property (copy) DVTSourceCodeLanguage *language; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Lin/IDEIndex.h: -------------------------------------------------------------------------------- 1 | // 2 | // IDEIndex.h 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DVTFilePath; 12 | 13 | @interface IDEIndex : NSObject 14 | 15 | @property (readonly, nonatomic) DVTFilePath *workspaceFile; 16 | @property (readonly, nonatomic) NSString *workspaceName; 17 | 18 | - (id)filesContaining:(id)arg1 anchorStart:(BOOL)arg2 anchorEnd:(BOOL)arg3 subsequence:(BOOL)arg4 ignoreCase:(BOOL)arg5 cancelWhen:(id)arg6; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Lin/IDEIndexCollection.h: -------------------------------------------------------------------------------- 1 | // 2 | // IDEIndexCollection.h 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface IDEIndexCollection : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Lin/IDEIndexCompletionItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // IDEIndexCompletionItem.h 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DVTSourceCodeSymbolKind; 12 | 13 | @interface IDEIndexCompletionItem : NSObject 14 | 15 | @property double priority; 16 | @property (readonly) NSString *name; 17 | @property (readonly) BOOL notRecommended; 18 | @property (readonly) DVTSourceCodeSymbolKind *symbolKind; 19 | @property (readonly) NSAttributedString *descriptionText; 20 | @property (readonly, copy) NSString *parentText; 21 | @property (readonly) NSString *completionText; 22 | @property (readonly) NSString *displayType; 23 | @property (readonly) NSString *displayText; 24 | 25 | - (id)initWithCompletionResult:(void *)arg1; 26 | - (void)_fillInTheRest; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Lin/IDEWorkspace+Lin.h: -------------------------------------------------------------------------------- 1 | // 2 | // IDEWorkspace+Lin.h 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import "IDEWorkspace.h" 10 | 11 | @interface IDEWorkspace (Lin) 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Lin/IDEWorkspace+Lin.m: -------------------------------------------------------------------------------- 1 | // 2 | // IDEWorkspace+Lin.m 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import "IDEWorkspace+Lin.h" 10 | #import "MethodSwizzle.h" 11 | #import "Lin.h" 12 | 13 | @implementation IDEWorkspace (Lin) 14 | 15 | + (void)load 16 | { 17 | MethodSwizzle(self, 18 | @selector(_updateIndexableFiles:), 19 | @selector(lin__updateIndexableFiles:)); 20 | } 21 | 22 | - (void)lin__updateIndexableFiles:(id)arg1 23 | { 24 | [self lin__updateIndexableFiles:arg1]; 25 | 26 | [[Lin sharedInstance] indexNeedsUpdate:self.index]; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Lin/IDEWorkspace.h: -------------------------------------------------------------------------------- 1 | // 2 | // IDEWorkspace.h 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class IDEIndex; 12 | @class DVTFilePath; 13 | 14 | @interface IDEWorkspace : NSObject 15 | 16 | @property (retain) IDEIndex *index; 17 | @property (readonly) DVTFilePath *representingFilePath; 18 | 19 | - (void)_updateIndexableFiles:(id)arg1; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Lin/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 3.1.5 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | DVTPlugInCompatibilityUUIDs 24 | 25 | ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C 26 | C4A681B0-4A26-480E-93EC-1218098B9AA0 27 | FEC992CC-CA4A-4CFD-8881-77300FCB848A 28 | 992275C1-432A-4CF7-B659-D84ED6D42D3F 29 | A16FF353-8441-459E-A50C-B071F53F51B7 30 | 9F75337B-21B4-4ADC-B558-F9CADF7073A7 31 | E969541F-E6F9-4D25-8158-72DC3545A6C6 32 | 7FDF5C7A-131F-4ABB-9EDC-8C5F8F0B8A90 33 | AABB7188-E14E-4433-AD3B-5CD791EAD9A3 34 | F41BD31E-2683-44B8-AE7F-5F09E919790E 35 | 36 | NSHumanReadableCopyright 37 | Copyright © 2015年 Katsuma Tanaka. All rights reserved. 38 | NSPrincipalClass 39 | Lin 40 | XC4Compatible 41 | 42 | XC5Compatible 43 | 44 | XCGCReady 45 | 46 | XCPluginHasUI 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Lin/LINLocalization.h: -------------------------------------------------------------------------------- 1 | // 2 | // LINLocalization.h 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LINLocalization : NSObject 12 | 13 | @property (nonatomic, copy, readonly) NSString *key; 14 | @property (nonatomic, copy, readonly) NSString *value; 15 | @property (nonatomic, copy, readonly) NSString *languageDesignation; 16 | @property (nonatomic, copy, readonly) NSString *tableName; 17 | 18 | - (instancetype)initWithKey:(NSString *)key value:(NSString *)value languageDesignation:(NSString *)languageDesignation tableName:(NSString *)tableName; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Lin/LINLocalization.m: -------------------------------------------------------------------------------- 1 | // 2 | // LINLocalization.m 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import "LINLocalization.h" 10 | 11 | @interface LINLocalization () 12 | 13 | @property (nonatomic, copy, readwrite) NSString *key; 14 | @property (nonatomic, copy, readwrite) NSString *value; 15 | @property (nonatomic, copy, readwrite) NSString *languageDesignation; 16 | @property (nonatomic, copy, readwrite) NSString *tableName; 17 | 18 | @end 19 | 20 | @implementation LINLocalization 21 | 22 | - (instancetype)initWithKey:(NSString *)key value:(NSString *)value languageDesignation:(NSString *)languageDesignation tableName:(NSString *)tableName 23 | { 24 | self = [super init]; 25 | 26 | if (self) { 27 | self.key = key; 28 | self.value = value; 29 | self.languageDesignation = languageDesignation; 30 | self.tableName = tableName; 31 | } 32 | 33 | return self; 34 | } 35 | 36 | - (BOOL)isEqual:(id)object 37 | { 38 | if (object == self) 39 | return YES; 40 | if (!object || ![[object class] isEqual:[self class]]) 41 | return NO; 42 | 43 | return ([[self key] isEqualToString:[object key]] 44 | && [[self value] isEqualToString:[object value]] 45 | && [[self languageDesignation] isEqualToString:[object languageDesignation]] 46 | && [[self tableName] isEqualToString:[object tableName]]); 47 | } 48 | 49 | - (NSUInteger)hash 50 | { 51 | return [self.key hash]; 52 | } 53 | 54 | - (NSString *)description 55 | { 56 | return [NSString stringWithFormat: 57 | @"<%@: %p; key = %@; value = %@; languageDesignation = %@; tableName = %@>", 58 | NSStringFromClass([self class]), 59 | self, 60 | self.key, 61 | self.value, 62 | self.languageDesignation, 63 | self.tableName 64 | ]; 65 | } 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /Lin/LINLocalizationParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // LINLocalizationParser.h 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/06. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LINLocalizationParser : NSObject 12 | 13 | - (NSArray *)localizationsFromContentsOfFile:(NSString *)filePath; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Lin/LINLocalizationParser.m: -------------------------------------------------------------------------------- 1 | // 2 | // LINLocalizationParser.m 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/06. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import "LINLocalizationParser.h" 10 | #import "LINLocalization.h" 11 | 12 | static NSString * const kRegularExpressionPattern = @"(\"(\\S+.*\\S+)\"|(\\S+.*\\S+))\\s*=\\s*\"(.*)\";$"; 13 | 14 | @implementation LINLocalizationParser 15 | 16 | #pragma mark - Parsing Localizations 17 | 18 | - (NSArray *)localizationsFromContentsOfFile:(NSString *)filePath 19 | { 20 | NSString *tableName = [[filePath lastPathComponent] stringByDeletingPathExtension]; 21 | if (tableName == nil) return nil; 22 | 23 | // Load contents 24 | NSString *string = [NSString stringWithContentsOfFile:filePath usedEncoding:nil error:nil]; 25 | if (string == nil) return nil; 26 | 27 | // Extract language designation 28 | NSArray *pathComponents = [filePath pathComponents]; 29 | NSString *languageDesignation = [[pathComponents objectAtIndex:pathComponents.count - 2] stringByDeletingPathExtension]; 30 | 31 | // Parse localizations 32 | NSMutableArray *localizations = [NSMutableArray array]; 33 | 34 | NSRegularExpression *regularExpression = [NSRegularExpression regularExpressionWithPattern:kRegularExpressionPattern 35 | options:0 36 | error:nil]; 37 | 38 | __block NSInteger lineOffset = 0; 39 | 40 | [string enumerateLinesUsingBlock:^(NSString *line, BOOL *stop) { 41 | NSRange keyRange; 42 | NSRange valueRange; 43 | NSString *key = nil; 44 | NSString *value = nil; 45 | 46 | // Find definition 47 | NSTextCheckingResult *result = [regularExpression firstMatchInString:line 48 | options:0 49 | range:NSMakeRange(0, line.length)]; 50 | 51 | if (result.range.location != NSNotFound && result.numberOfRanges == 5) { 52 | keyRange = [result rangeAtIndex:2]; 53 | if (keyRange.location == NSNotFound) keyRange = [result rangeAtIndex:3]; 54 | 55 | valueRange = [result rangeAtIndex:4]; 56 | 57 | key = [line substringWithRange:keyRange]; 58 | value = [line substringWithRange:valueRange]; 59 | } 60 | 61 | // Create localization 62 | if (key && value) { 63 | LINLocalization *localization = [[LINLocalization alloc] initWithKey:key 64 | value:value 65 | languageDesignation:languageDesignation 66 | tableName:tableName]; 67 | [localizations addObject:localization]; 68 | } 69 | 70 | // Move offset 71 | NSRange lineRange = [string lineRangeForRange:NSMakeRange(lineOffset, 0)]; 72 | lineOffset += lineRange.length; 73 | }]; 74 | 75 | return localizations; 76 | } 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /Lin/LINTextCompletionItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // LINTextCompletionItem.h 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import "IDEIndexCompletionItem.h" 10 | 11 | typedef NS_ENUM(NSUInteger, LINSourceCodeLanguage) { 12 | LINSourceCodeLanguageObjectiveC, 13 | LINSourceCodeLanguageSwift 14 | }; 15 | 16 | @interface LINTextCompletionItem : IDEIndexCompletionItem 17 | 18 | @property (nonatomic, copy, readonly) NSArray *localizations; 19 | @property (nonatomic, assign) LINSourceCodeLanguage sourceCodeLanguage; 20 | 21 | - (instancetype)initWithLocalizations:(NSArray *)localizations; 22 | 23 | - (NSString *)key; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Lin/LINTextCompletionItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // LINTextCompletionItem.m 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import "LINTextCompletionItem.h" 10 | #import 11 | 12 | // Models 13 | #import "LINLocalization.h" 14 | 15 | @interface LINTextCompletionItem () 16 | 17 | @property (nonatomic, copy, readwrite) NSArray *localizations; 18 | @property (nonatomic, copy) NSString *body; 19 | 20 | @end 21 | 22 | @implementation LINTextCompletionItem 23 | 24 | - (instancetype)initWithLocalizations:(NSArray *)localizations 25 | { 26 | self = [super init]; 27 | 28 | if (self) { 29 | self.priority = 999.0; 30 | self.localizations = localizations; 31 | 32 | // Build description text 33 | NSMutableString *body = [NSMutableString string]; 34 | 35 | [self.localizations enumerateObjectsUsingBlock:^(LINLocalization *localization, NSUInteger index, BOOL *stop) { 36 | if (index > 0) [body appendString:@"\n"]; 37 | [body appendFormat:@"(%@) %@", localization.languageDesignation, localization.value]; 38 | }]; 39 | 40 | self.body = body; 41 | } 42 | 43 | return self; 44 | } 45 | 46 | 47 | #pragma mark - Accessors 48 | 49 | - (NSString *)name 50 | { 51 | return [self key]; 52 | } 53 | 54 | - (BOOL)notRecommended 55 | { 56 | return NO; 57 | } 58 | 59 | - (DVTSourceCodeSymbolKind *)symbolKind 60 | { 61 | return nil; 62 | } 63 | 64 | - (NSAttributedString *)descriptionText 65 | { 66 | return [[NSAttributedString alloc] initWithString:self.body]; 67 | } 68 | 69 | - (NSString *)parentText 70 | { 71 | return nil; 72 | } 73 | 74 | - (NSString *)completionText 75 | { 76 | if (self.sourceCodeLanguage == LINSourceCodeLanguageObjectiveC) { 77 | return [NSString stringWithFormat:@"@\"%@\"", [self key]]; 78 | } else { 79 | return [NSString stringWithFormat:@"\"%@\"", [self key]]; 80 | } 81 | } 82 | 83 | - (NSString *)displayType 84 | { 85 | return (self.sourceCodeLanguage == LINSourceCodeLanguageObjectiveC) ? @"NSString *" : @"String"; 86 | } 87 | 88 | - (NSString *)displayText 89 | { 90 | if (self.sourceCodeLanguage == LINSourceCodeLanguageObjectiveC) { 91 | return [NSString stringWithFormat:@"@\"%@\"", [self key]]; 92 | } else { 93 | return [NSString stringWithFormat:@"\"%@\"", [self key]]; 94 | } 95 | } 96 | 97 | - (void)_fillInTheRest 98 | { 99 | } 100 | 101 | 102 | #pragma mark - Additional Accessors 103 | 104 | - (NSString *)key 105 | { 106 | return [[self.localizations firstObject] key]; 107 | } 108 | 109 | @end 110 | -------------------------------------------------------------------------------- /Lin/Lin.h: -------------------------------------------------------------------------------- 1 | // 2 | // Lin.h 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class IDEIndex; 12 | @class DVTCompletingTextView; 13 | @class IDEWorkspace; 14 | 15 | @interface Lin : NSObject 16 | 17 | + (void)pluginDidLoad:(NSBundle *)bundle; 18 | + (instancetype)sharedInstance; 19 | 20 | - (void)indexNeedsUpdate:(IDEIndex *)index; 21 | 22 | - (NSArray *)completionItemsForWorkspace:(IDEWorkspace *)workspace; 23 | - (BOOL)shouldAutoCompleteInTextView:(DVTCompletingTextView *)textView; 24 | - (NSRange)replacableKeyRangeInTextView:(DVTCompletingTextView *)textView; 25 | - (NSRange)replacableTableNameRangeInTextView:(DVTCompletingTextView *)textView; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Lin/Lin.m: -------------------------------------------------------------------------------- 1 | // 2 | // Lin.m 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import "Lin.h" 10 | 11 | // Xcode 12 | #import "Xcode.h" 13 | 14 | // Models 15 | #import "LINLocalizationParser.h" 16 | #import "LINLocalization.h" 17 | #import "LINTextCompletionItem.h" 18 | 19 | static id _sharedInstance = nil; 20 | 21 | @interface Lin () 22 | 23 | @property (nonatomic, copy) NSArray *configurations; 24 | @property (nonatomic, strong) LINLocalizationParser *parser; 25 | @property (nonatomic, strong) NSMutableDictionary *completionItems; 26 | @property (nonatomic, strong) NSOperationQueue *indexingQueue; 27 | 28 | @end 29 | 30 | @implementation Lin 31 | 32 | + (void)pluginDidLoad:(NSBundle *)bundle 33 | { 34 | static dispatch_once_t _onceToken; 35 | dispatch_once(&_onceToken, ^{ 36 | _sharedInstance = [self new]; 37 | }); 38 | } 39 | 40 | + (instancetype)sharedInstance 41 | { 42 | return _sharedInstance; 43 | } 44 | 45 | - (instancetype)init 46 | { 47 | self = [super init]; 48 | 49 | if (self) { 50 | // Load configurations 51 | NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"Completions" ofType:@"plist"]; 52 | self.configurations = [NSArray arrayWithContentsOfFile:filePath]; 53 | 54 | self.parser = [LINLocalizationParser new]; 55 | self.completionItems = [NSMutableDictionary dictionary]; 56 | 57 | // Create indexing queue 58 | NSOperationQueue *indexingQueue = [NSOperationQueue new]; 59 | indexingQueue.maxConcurrentOperationCount = 1; 60 | self.indexingQueue = indexingQueue; 61 | } 62 | 63 | return self; 64 | } 65 | 66 | 67 | #pragma mark - Indexing Localizations 68 | 69 | - (void)indexNeedsUpdate:(IDEIndex *)index 70 | { 71 | IDEWorkspace *workspace = [index valueForKey:@"_workspace"]; 72 | NSString *workspaceFilePath = workspace.representingFilePath.pathString; 73 | if (workspaceFilePath == nil) return; 74 | 75 | // Add indexing operation 76 | NSBlockOperation *operation = [NSBlockOperation new]; 77 | 78 | __weak __typeof(self) weakSelf = self; 79 | __weak NSBlockOperation *weakOperation = operation; 80 | 81 | [operation addExecutionBlock:^{ 82 | // Find strings files 83 | IDEIndexCollection *indexCollection = [index filesContaining:@".strings" anchorStart:NO anchorEnd:NO subsequence:NO ignoreCase:YES cancelWhen:nil]; 84 | 85 | if ([weakOperation isCancelled]) return; 86 | 87 | // Classify localizations by key 88 | NSMutableDictionary *localizationsByKey = [NSMutableDictionary dictionary]; 89 | 90 | for (DVTFilePath *filePath in indexCollection) { 91 | if ([weakOperation isCancelled]) return; 92 | 93 | NSArray *parsedLocalizations = [self.parser localizationsFromContentsOfFile:filePath.pathString]; 94 | 95 | for (LINLocalization *localization in parsedLocalizations) { 96 | NSMutableArray *localizations = localizationsByKey[localization.key]; 97 | 98 | if (localizations) { 99 | [localizations addObject:localization]; 100 | } else { 101 | localizations = [NSMutableArray array]; 102 | [localizations addObject:localization]; 103 | localizationsByKey[localization.key] = localizations; 104 | } 105 | } 106 | } 107 | 108 | if ([weakOperation isCancelled]) return; 109 | 110 | // Convert localizations to completions 111 | NSMutableArray *completionItems = [NSMutableArray array]; 112 | 113 | for (NSString *key in [localizationsByKey allKeys]) { 114 | if ([weakOperation isCancelled]) return; 115 | 116 | NSMutableArray *localizations = localizationsByKey[key]; 117 | 118 | // Sort localizations 119 | [localizations sortUsingComparator:^NSComparisonResult(LINLocalization *lhs, LINLocalization *rhs) { 120 | return [[lhs languageDesignation] caseInsensitiveCompare:[rhs languageDesignation]]; 121 | }]; 122 | 123 | // Create completion item 124 | LINTextCompletionItem *completionItem = [[LINTextCompletionItem alloc] initWithLocalizations:localizations]; 125 | [completionItems addObject:completionItem]; 126 | } 127 | 128 | if ([weakOperation isCancelled]) return; 129 | 130 | // Sort completions 131 | [completionItems sortUsingComparator:^NSComparisonResult(LINTextCompletionItem *lhs, LINTextCompletionItem *rhs) { 132 | return [[lhs key] caseInsensitiveCompare:[rhs key]]; 133 | }]; 134 | 135 | if ([weakOperation isCancelled]) return; 136 | 137 | weakSelf.completionItems[workspaceFilePath] = completionItems; 138 | }]; 139 | 140 | [self.indexingQueue cancelAllOperations]; 141 | [self.indexingQueue addOperation:operation]; 142 | } 143 | 144 | 145 | #pragma mark - Auto Completion 146 | 147 | - (NSArray *)completionItemsForWorkspace:(IDEWorkspace *)workspace 148 | { 149 | NSString *workspaceFilePath = workspace.representingFilePath.pathString; 150 | if (workspaceFilePath == nil) return nil; 151 | 152 | return self.completionItems[workspaceFilePath]; 153 | } 154 | 155 | - (BOOL)shouldAutoCompleteInTextView:(DVTCompletingTextView *)textView 156 | { 157 | NSRange keyRange = [self replacableKeyRangeInTextView:textView]; 158 | return (keyRange.location != NSNotFound); 159 | } 160 | 161 | - (NSRange)replacableKeyRangeInTextView:(DVTCompletingTextView *)textView 162 | { 163 | if (textView == nil) return NSMakeRange(NSNotFound, 0); 164 | 165 | DVTTextStorage *textStorage = (DVTTextStorage *)textView.textStorage; 166 | DVTSourceCodeLanguage *language = textStorage.language; 167 | NSString *string = textStorage.string; 168 | NSRange selectedRange = textView.selectedRange; 169 | 170 | for (NSDictionary *configuration in self.configurations) { 171 | NSDictionary *patterns = configuration[@"LINKeyCompletionPatterns"][language.languageName]; 172 | 173 | for (NSString *pattern in patterns) { 174 | if (pattern && pattern.length > 0) { 175 | NSRegularExpression *regularExpression = [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:nil]; 176 | NSArray *matches = [regularExpression matchesInString:string options:0 range:NSMakeRange(0, string.length)]; 177 | 178 | for (NSTextCheckingResult *match in matches) { 179 | if (match.numberOfRanges == 0) continue; 180 | NSRange keyRange = [match rangeAtIndex:match.numberOfRanges - 1]; 181 | 182 | if (NSMaxRange(keyRange) == NSMaxRange(selectedRange)) { 183 | return keyRange; 184 | } 185 | } 186 | } 187 | } 188 | } 189 | 190 | return NSMakeRange(NSNotFound, 0); 191 | } 192 | 193 | - (NSRange)replacableTableNameRangeInTextView:(DVTCompletingTextView *)textView 194 | { 195 | if (textView == nil) return NSMakeRange(NSNotFound, 0); 196 | 197 | DVTTextStorage *textStorage = (DVTTextStorage *)textView.textStorage; 198 | DVTSourceCodeLanguage *language = textStorage.language; 199 | NSString *string = textStorage.string; 200 | NSRange selectedRange = textView.selectedRange; 201 | 202 | for (NSDictionary *configuration in self.configurations) { 203 | NSDictionary *patterns = configuration[@"LINTableNameCompletionPatterns"][language.languageName]; 204 | 205 | for (NSString *pattern in patterns) { 206 | if (pattern && pattern.length > 0) { 207 | NSRegularExpression *regularExpression = [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:nil]; 208 | NSArray *matches = [regularExpression matchesInString:string options:0 range:NSMakeRange(0, string.length)]; 209 | 210 | for (NSTextCheckingResult *match in matches) { 211 | if (match.numberOfRanges == 0) continue; 212 | NSRange tableNameRange = [match rangeAtIndex:match.numberOfRanges - 1]; 213 | 214 | if (NSLocationInRange(selectedRange.location, match.range)) { 215 | return tableNameRange; 216 | } 217 | } 218 | } 219 | } 220 | } 221 | 222 | return NSMakeRange(NSNotFound, 0); 223 | } 224 | 225 | @end 226 | -------------------------------------------------------------------------------- /Lin/MethodSwizzle.h: -------------------------------------------------------------------------------- 1 | // 2 | // MethodSwizzle.h 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | void MethodSwizzle(Class cls, SEL org_sel, SEL alt_sel); 12 | -------------------------------------------------------------------------------- /Lin/MethodSwizzle.m: -------------------------------------------------------------------------------- 1 | // 2 | // MethodSwizzle.m 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import "MethodSwizzle.h" 10 | 11 | void MethodSwizzle(Class cls, SEL org_sel, SEL alt_sel) 12 | { 13 | Method org_method = nil, alt_method = nil; 14 | 15 | org_method = class_getInstanceMethod(cls, org_sel); 16 | alt_method = class_getInstanceMethod(cls, alt_sel); 17 | 18 | if (org_method != nil && alt_method != nil) { 19 | method_exchangeImplementations(org_method, alt_method); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Lin/Xcode.h: -------------------------------------------------------------------------------- 1 | // 2 | // Xcode.h 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/08. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | // DVTFoundation 10 | #import "DVTFilePath.h" 11 | #import "DVTSourceCodeLanguage.h" 12 | #import "DVTSourceCodeLanguage+Lin.h" 13 | 14 | // DVTKit 15 | #import "DVTCompletingTextView.h" 16 | #import "DVTSourceTextView.h" 17 | #import "DVTTextCompletionController.h" 18 | #import "DVTTextCompletionDataSource.h" 19 | #import "DVTTextCompletionSession.h" 20 | #import "DVTTextStorage.h" 21 | 22 | // IDEFoundation 23 | #import "IDEIndex.h" 24 | #import "IDEIndexCollection.h" 25 | #import "IDEIndexCompletionItem.h" 26 | #import "IDEWorkspace.h" 27 | -------------------------------------------------------------------------------- /LinTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /LinTests/LINLocalizationParserTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // LINLocalizationTests.m 3 | // Lin 4 | // 5 | // Created by Katsuma Tanaka on 2015/02/05. 6 | // Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "LINLocalizationParser.h" 12 | #import "LINLocalization.h" 13 | 14 | @interface LINLocalizationParserTests : XCTestCase 15 | 16 | @end 17 | 18 | @implementation LINLocalizationParserTests 19 | 20 | - (void)testParsingLocalizations 21 | { 22 | // Create test set 23 | struct LINLocalizationTestSet { 24 | __unsafe_unretained NSString *key; 25 | __unsafe_unretained NSString *value; 26 | } testSets[] = { 27 | {@"key0", @"value0"}, 28 | {@"key1", @"value1"}, 29 | {@"key2", @"value2"}, 30 | {@"key3", @"value3"}, 31 | {@"key4", @"value4"}, 32 | {@"key5", @"value5"}, 33 | {@"key6", @"value6"}, 34 | {@"key7", @"value7"}, 35 | {@"key8", @"value8"}, 36 | {@"key 9", @"value9"}, 37 | {@"key 10", @"value10"}, 38 | {@"key 11", @"value11"}, 39 | {@"key 12", @"value12"}, 40 | {@"key 13", @"value13"}, 41 | {@"key 14", @"value14"}, 42 | {@"key 15", @"value15"}, 43 | {@"key 16", @"value16"}, 44 | {@"key.17", @"value17"}, 45 | {@"key.18", @"value18"}, 46 | {@"key.19", @"value19"}, 47 | {@"key.20", @"value20"}, 48 | {@"key.21", @"value21"} 49 | }, *testSetsPtr; 50 | testSetsPtr = testSets; // This avoids the compiler error 'cannot refer to declaration with an array type inside block' 51 | 52 | // Parse localizations 53 | LINLocalizationParser *parser = [LINLocalizationParser new]; 54 | NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"Localizations" ofType:@"strings"]; 55 | NSArray *localizations = [parser localizationsFromContentsOfFile:filePath]; 56 | 57 | // Test results 58 | NSUInteger numberOfTestSets = sizeof(testSets) / sizeof(struct LINLocalizationTestSet); 59 | XCTAssertEqual(localizations.count, numberOfTestSets); 60 | 61 | [localizations enumerateObjectsUsingBlock:^(LINLocalization *localization, NSUInteger index, BOOL *stop) { 62 | XCTAssertTrue([localization.key isEqualToString:testSetsPtr[index].key]); 63 | XCTAssertTrue([localization.value isEqualToString:testSetsPtr[index].value]); 64 | }]; 65 | } 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /LinTests/Localizations.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizations.strings 3 | Lin 4 | 5 | Created by Katsuma Tanaka on 2015/02/05. 6 | Copyright (c) 2015年 Katsuma Tanaka. All rights reserved. 7 | */ 8 | 9 | key0 = "value0"; 10 | key1 = "value1"; 11 | key2= "value2"; 12 | key3="value3"; 13 | "key4" = "value4"; 14 | "key5" = "value5"; 15 | "key6"= "value6"; 16 | "key7"="value7"; 17 | key8 = "value8"; 18 | "key 9"="value9"; 19 | "key 10" ="value10"; 20 | "key 11"="value11"; 21 | "key 12" ="value12"; 22 | "key 13" = "value13"; 23 | "key 14" = "value14"; 24 | "key 15" ="value15"; 25 | "key 16" = "value16"; 26 | "key.17" = "value17"; 27 | key.18 = "value18"; 28 | key.19 = "value19"; 29 | key.20="value20"; 30 | key.21="value21"; 31 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PROJECT=Lin.xcodeproj 2 | SCHEME=LinTests 3 | 4 | clean: 5 | xcodebuild \ 6 | -project ${PROJECT} \ 7 | clean 8 | 9 | test: 10 | xcodebuild \ 11 | -project ${PROJECT} \ 12 | -scheme ${SCHEME} \ 13 | -configuration Debug \ 14 | test 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Lin 2 | 3 | Lin is a Xcode plugin that provides auto-completion for `NSLocalizedString`. 4 | Both Objective-C and Swift are supported. 5 | 6 | [![Build Status](https://travis-ci.org/questbeat/Lin.svg?branch=master)](https://travis-ci.org/questbeat/Lin) 7 | 8 | ![Screenshot](https://raw.github.com/questbeat/Lin/master/screenshot.gif) 9 | 10 | 11 | ## Installation 12 | 13 | Download the project and build it, and then relaunch Xcode. 14 | Lin will be installed in `~/Library/Application Support/Developer/Shared/Xcode/Plug-ins` automatically. 15 | 16 | If you want to uninstall Lin, remove Lin.xcplugin in the `Plug-ins` directory. 17 | 18 | 19 | ## Notes 20 | 21 | * Xcode 6 or later is supported 22 | * Supported functions 23 | * NSLocalizedString 24 | * NSLocalizedStringFromTable 25 | * NSLocalizedStringFromTableInBundle 26 | * NSLocalizedStringWithDefaultValue 27 | 28 | 29 | ## Troubleshooting 30 | 31 | ### I installed Lin by using Alcatraz, and it doesn't work. 32 | 33 | 1. Remove all cached data of Alcatraz: `rm -rf ~/Library/Application\ Support/Alcatraz` 34 | 2. Reinstall Lin and restart Xcode. 35 | 36 | 37 | ## License 38 | 39 | Lin is released under the **MIT License**. 40 | 41 | > Copyright (c) 2014-2015 Katsuma Tanaka 42 | > 43 | > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 44 | > 45 | > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 46 | > 47 | > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 48 | -------------------------------------------------------------------------------- /screenshot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nek023/Lin/f88d8b929bff6b56f1c7588dae146398da3bef14/screenshot.gif --------------------------------------------------------------------------------