-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
果然简单的才是最好用的 Co-authored-by: ygqygq2 <[email protected]>
- Loading branch information
Showing
6 changed files
with
62 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { Message } from '@/typings'; | ||
import { TextEditor } from 'vscode'; | ||
|
||
export const checkRangeOverlapping = (logMessages: Message[], editor: TextEditor) => { | ||
const rangeToCheck = editor.selections[0]; | ||
const overlappingMessages = logMessages.filter(({ lines }) => { | ||
return lines.some((lineRange) => { | ||
const intersectionRange = lineRange.intersection(rangeToCheck); | ||
if (intersectionRange !== undefined) { | ||
console.log('范围重叠的信息:'); | ||
console.log( | ||
'范围A:', | ||
lineRange.start.line, | ||
lineRange.start.character, | ||
'-', | ||
lineRange.end.line, | ||
lineRange.end.character, | ||
); | ||
console.log( | ||
'范围B:', | ||
rangeToCheck.start.line, | ||
rangeToCheck.start.character, | ||
'-', | ||
rangeToCheck.end.line, | ||
rangeToCheck.end.character, | ||
); | ||
console.log( | ||
'重叠范围:', | ||
intersectionRange.start.line, | ||
intersectionRange.start.character, | ||
'-', | ||
intersectionRange.end.line, | ||
intersectionRange.end.character, | ||
); | ||
} | ||
return intersectionRange !== undefined; | ||
}); | ||
}); | ||
|
||
return overlappingMessages.length > 0; | ||
}; |
This file was deleted.
Oops, something went wrong.