Skip to content

Commit f64158a

Browse files
committed
docs(compiler): improve DirInsCommand class documentation
#257 Enhance the documentation for `DirInsCommand` to provide a detailed description of its purpose, functionality, and example output. The updated documentation clarifies the tree-like structure representation and the order of file and directory listing.
1 parent 60378f7 commit f64158a

File tree

1 file changed

+19
-1
lines changed
  • exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec

1 file changed

+19
-1
lines changed

β€Žexts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/DirInsCommand.kt

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,25 @@ import com.intellij.psi.PsiDirectory
66
import com.intellij.psi.PsiManager
77

88
/**
9-
* Dir List files and directories in a tree-like structure
9+
* The `DirInsCommand` class is responsible for listing files and directories in a tree-like structure for a given directory path within a project.
10+
* It implements the `InsCommand` interface and provides an `execute` method to perform the directory listing operation asynchronously.
11+
*
12+
* The tree structure is visually represented using indentation and symbols (`β”œβ”€β”€`, `└──`) to denote files and subdirectories. Files are listed
13+
* first, followed by subdirectories, which are recursively processed to display their contents.
14+
*
15+
* Example output:
16+
* ```
17+
* myDirectory/
18+
* β”œβ”€β”€ file1.txt
19+
* β”œβ”€β”€ file2.txt
20+
* └── subDirectory/
21+
* β”œβ”€β”€ file3.txt
22+
* └── subSubDirectory/
23+
* └── file4.txt
24+
* ```
25+
*
26+
* @param myProject The project instance in which the directory resides.
27+
* @param dir The path of the directory to list.
1028
*/
1129
class DirInsCommand(private val myProject: Project, private val dir: String) : InsCommand {
1230
private val output = StringBuilder()

0 commit comments

Comments
Β (0)