Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0c59ba3

Browse files
committedFeb 25, 2025·
fix: compatibility issue
1 parent 4aa731a commit 0c59ba3

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed
 

‎CHANGELOG.md

-7
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010

1111
- Claude 3.7 Sonnet model (CodeGPT)
1212

13-
## [2.17.0-241.1] - 2025-02-12
14-
15-
### Renamed
16-
17-
- Plugin name
18-
1913
## [2.16.3-241.1] - 2025-02-11
2014

2115
### Added
@@ -919,7 +913,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
919913
- `OPENAI_API_KEY` persistence, key is saved in the OS password safe from now on
920914

921915
[Unreleased]: https://github.com/carlrobertoh/CodeGPT/compare/v2.17.0-241.1...HEAD
922-
[2.17.0-241.1]: https://github.com/carlrobertoh/CodeGPT/compare/v2.16.3-241.1...v2.17.0-241.1
923916
[2.16.3-241.1]: https://github.com/carlrobertoh/CodeGPT/compare/v2.16.2-241.1...v2.16.3-241.1
924917
[2.16.2-241.1]: https://github.com/carlrobertoh/CodeGPT/compare/v2.16.1-241.1...v2.16.2-241.1
925918
[2.16.1-241.1]: https://github.com/carlrobertoh/CodeGPT/compare/v2.16.0-241.1...v2.16.1-241.1

‎src/main/kotlin/ee/carlrobert/codegpt/CodeGPTProjectActivity.kt

+12-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import ee.carlrobert.codegpt.settings.service.ServiceType
1313
import ee.carlrobert.codegpt.settings.service.codegpt.CodeGPTService
1414
import ee.carlrobert.codegpt.toolwindow.chat.ui.textarea.AttachImageNotifier
1515
import ee.carlrobert.codegpt.ui.OverlayUtil
16-
import io.ktor.util.*
16+
import java.nio.file.Path
1717
import java.nio.file.Paths
1818
import kotlin.io.path.absolutePathString
1919

@@ -34,7 +34,7 @@ class CodeGPTProjectActivity : ProjectActivity {
3434
) {
3535
val desktopPath = Paths.get(System.getProperty("user.home"), "Desktop")
3636
project.service<FileWatcher>().watch(desktopPath) {
37-
if (watchExtensions.contains(it.extension.lowercase())) {
37+
if (watchExtensions.contains(getFileExtension(it))) {
3838
showImageAttachmentNotification(
3939
project,
4040
desktopPath.resolve(it).absolutePathString()
@@ -44,6 +44,16 @@ class CodeGPTProjectActivity : ProjectActivity {
4444
}
4545
}
4646

47+
private fun getFileExtension(path: Path): String {
48+
val fileName = path.fileName.toString()
49+
val lastIndexOfDot = fileName.lastIndexOf('.')
50+
return if (lastIndexOfDot != -1) {
51+
fileName.substring(lastIndexOfDot + 1).lowercase()
52+
} else {
53+
""
54+
}
55+
}
56+
4757
private fun showImageAttachmentNotification(project: Project, filePath: String) {
4858
OverlayUtil.getDefaultNotification(
4959
CodeGPTBundle.get("imageAttachmentNotification.content"),

0 commit comments

Comments
 (0)
Please sign in to comment.