Skip to content

Commit 0b089da

Browse files
committed
Reload gitignore files when directories are created and clean up redundant comments in compact file parsers
1 parent a6d263f commit 0b089da

6 files changed

Lines changed: 14 additions & 10 deletions

File tree

‎apps/editor/src/context/providers/workspace/workspace-provider.ts‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,10 @@ export class WorkspaceProvider
380380
// Ignore if file was deleted quickly
381381
}
382382

383+
if (is_directory) {
384+
await this._load_all_gitignore_files()
385+
}
386+
383387
const check_new_files = vscode.workspace
384388
.getConfiguration('codeWebChat')
385389
.get<boolean>('checkNewFiles')
@@ -711,17 +715,17 @@ export class WorkspaceProvider
711715
name,
712716
uri,
713717
vscode.TreeItemCollapsibleState.Collapsed,
714-
true, // Is directory
718+
true,
715719
this._checked_items.get(root) ??
716720
vscode.TreeItemCheckboxState.Unchecked,
717-
false, // Is not symbolic link
718-
false, // Is not open file
721+
false,
722+
false,
719723
total_tokens.total,
720724
total_tokens.compact,
721725
selected_tokens.total,
722726
selected_tokens.compact,
723727
undefined,
724-
true // Is workspace root
728+
true
725729
)
726730
)
727731
if (context_view) {

‎apps/editor/src/context/utils/compact-file/languages/c-style.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const compact_c_style = (content: string): string => {
5050
continue
5151
}
5252

53-
if (char == '"' || char === "'" || char == '`') {
53+
if (char == '"' || char == "'" || char == '`') {
5454
is_in_string = char
5555
if (skip_body_depth == 0) {
5656
processed_line += char
@@ -61,7 +61,7 @@ export const compact_c_style = (content: string): string => {
6161
}
6262

6363
if (char == '/' && next_char == '/') {
64-
break // Ignore the rest of the line
64+
break
6565
}
6666

6767
if (char == '/' && next_char == '*') {

‎apps/editor/src/context/utils/compact-file/languages/css.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const compact_css = (content: string): string => {
4646

4747
// Support // for SCSS/LESS, though not standard CSS
4848
if (char == '/' && next_char == '/') {
49-
break // Ignore the rest of the line
49+
break
5050
}
5151

5252
if (char == '/' && next_char == '*') {

‎apps/editor/src/context/utils/compact-file/languages/python.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const compact_python = (content: string): string => {
5252
continue
5353
}
5454
if (char == '#') {
55-
break // Ignore rest of line
55+
break
5656
}
5757
processed_line += char
5858
i++

‎apps/editor/src/context/utils/compact-file/languages/ruby.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const compact_ruby = (content: string): string => {
4646
continue
4747
}
4848
if (char == '#') {
49-
break // Ignore rest of line
49+
break
5050
}
5151
processed_line += char
5252
i++

‎apps/editor/src/context/utils/compact-file/languages/sql.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const compact_sql = (content: string): string => {
5151
}
5252

5353
if (char == '-' && next_char == '-') {
54-
break // Ignore the rest of the line
54+
break
5555
}
5656

5757
if (char == '/' && next_char == '*') {

0 commit comments

Comments
 (0)