Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Android CI

on:
push:
branches-ignore:
- 'renovate-*'
paths-ignore:
- '**.md'
- '**.txt'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,14 @@ class LspCompletionItem(
deprecated = tags.contains(CompletionItemTag.Deprecated)
}

val isFile = kind == CompletionItemKind.File
val isFolder = kind == CompletionItemKind.Folder
val fileIcon = when {
kind == CompletionItemKind.File || kind == CompletionItemKind.Folder -> {
label?.let { drawFileFolder(it.toString()) } ?: desc?.let { drawFileFolder(it.toString()) }
isFile || isFolder -> {
label?.let { drawFileFolder(it.toString(), isFolder) }
?: desc?.let { drawFileFolder(it.toString(), isFolder) }
}

else -> null
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ interface FileIconProvider {
/**
* Attempts to load a file/folder icon from the given source string.
* @param src Source string (e.g., absolute or relative path)
* @param isFolder True if the source is a folder, false if it's a file
* @return A [Drawable] if successful, or null if no icon can be loaded.
*/
fun load(src: String): Drawable?
fun load(src: String, isFolder: Boolean): Drawable?
}

object SimpleCompletionIconDrawer {
Expand All @@ -49,8 +50,8 @@ object SimpleCompletionIconDrawer {
return CircleDrawable(kind, circle)
}

fun drawFileFolder(src: String): Drawable? {
return globalFileIconProvider?.load(src)
fun drawFileFolder(src: String, isFolder: Boolean): Drawable? {
return globalFileIconProvider?.load(src, isFolder)
}

fun drawColorSpan(colorSpan: Int): Drawable {
Expand Down
Loading