File tree Expand file tree Collapse file tree
ChatContextCollectors/WebChatContextCollector Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ public struct ActiveDocumentChatContextCollector: ChatContextCollector {
1717 . replacingOccurrences ( of: content. projectURL. path, with: " " )
1818 let selectionRange = content. editorContent? . selections. first ?? . outOfScope
1919 let editorContent = {
20- if scopes. contains ( " file " ) {
20+ if scopes. contains ( " file " ) || scopes . contains ( " f " ) {
2121 return """
2222 File Content:``` \( content. language. rawValue)
2323 \( content. editorContent? . content ?? " " )
@@ -57,7 +57,7 @@ public struct ActiveDocumentChatContextCollector: ChatContextCollector {
5757 """
5858 }
5959
60- if scopes. contains ( " selection " ) {
60+ if scopes. contains ( " selection " ) || scopes . contains ( " s " ) {
6161 return """
6262 Selected Code \
6363 (start from line \( selectionRange. start. line) ):``` \( content. language. rawValue)
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ public final class WebChatContextCollector: ChatContextCollector {
1212 scopes: Set < String > ,
1313 content: String
1414 ) -> ChatContext ? {
15- guard scopes. contains ( " web " ) else { return nil }
15+ guard scopes. contains ( " web " ) || scopes . contains ( " w " ) else { return nil }
1616 let links = Self . detectLinks ( from: history) + Self. detectLinks ( from: content)
1717 let functions : [ ( any ChatGPTFunction ) ? ] = [
1818 SearchFunction ( ) ,
You can’t perform that action at this time.
0 commit comments