Gruntfuggly / todo-tree

Use ripgrep to find TODO tags and display the results in a tree view
Other
1.4k stars 135 forks source link

The list seems not honor `.gitignore`, and (maybe) strange behavior on binary files. #711

Closed yw662 closed 1 year ago

yw662 commented 1 year ago

I noticed recently that when I build the project, TODO Tree may list files in build dir and build cache, but they would disappear after I click the refresh button. like this: it is a binary build cache already excluded in gitignore, and it does not seem to contain any search terms.

截屏2022-12-21 下午5 11 18

It does go back to normal after I clicked the refresh button though.

Gruntfuggly commented 1 year ago

Could you post your todo-tree settings? There are settings to exclude specific files/folders so it might be worth trying those.

Gruntfuggly commented 1 year ago

ripgrep (which the extension uses) honours .gitignore by default so I'm surprised it is picking up an excluded file.

yw662 commented 1 year ago

Sadly I can no longer reproduce it :-(

yw662 commented 1 year ago

It happens again

{
  "todo-tree.highlights.highlightDelay": 0,
  "todo-tree.general.tags": [  ],
  "todo-tree.general.tagGroups": {  },
  "todo-tree.general.statusBar": "tags",
  "todo-tree.highlights.enabled": true,
  "todo-tree.general.showIconsInsteadOfTagsInStatusBar": true,
  "todo-tree.highlights.customHighlight": { },
  "todo-tree.tree.scanMode": "workspace",
  "todo-tree.tree.expanded": true,
  "todo-tree.tree.showCountsInTree": true,
  "todo-tree.general.showActivityBarBadge": true,
  "todo-tree.filtering.ignoreGitSubmodules": true,
  "todo-tree.general.enableFileWatcher": true
}

It is a cf pages project using parcel. The command I run when it happens is wrangler pages dev --proxy NNNN -- parcel --port NNNN --no-autoinstall

yw662 commented 1 year ago

It does not happen with "todo-tree.tree.scanMode": "workspace only"

Gruntfuggly commented 1 year ago

Why do you have "todo-tree.general.tags": [ ] ? Using that with the default regex may have very confusing results because it replaces $TAGS in the regex with the contents of that setting.

The extension is intended to find things marked 'TODO', etc. What are you expecting it to find with your configuration?

yw662 commented 1 year ago

Hmmm no it is not "todo-tree.general.tags": [ ], it is a long tag list I am not willing to post here :-). And the same for tagGroups. And the same for customHighlight. It is just plain string tags, no empty string, no void values, just things like 'TODO', 'FIXME', 'BUG' and so on, and also 'eslint' and '@ ts', and some other tags.

Gruntfuggly commented 1 year ago

Are you using the default regex?

yw662 commented 1 year ago

This is all the settings so yes.

Gruntfuggly commented 1 year ago

OK - first thing - set this back to false: "todo-tree.general.enableFileWatcher": false. It won't be helping and is highly unlikely to be useful.

Can you post an example of a file (or part of a file) with the filename and what you're expecting it to match?

yw662 commented 1 year ago

I think disabling todo-tree.general.enableFileWatcher works.

yw662 commented 1 year ago

And an example:

// file: nominal.ts
declare global {
  type Nominal<T, name extends string> = T & { __name: name }
  type Structural<N extends Nominal<unknown, string>> = Omit<N, '__name'>
}

export function nominal<N extends Nominal<T, string>, T = Structural<N>>(v: T) {
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
  return v as unknown as N
}

Expecting to match: // eslint-disable-next-line @typescript-eslint/consistent-type-assertions

Gruntfuggly commented 1 year ago

so eslint-disable-next-line is one of the tags?

The file watcher setting is due to be removed as it causes way more problems than it solves.

yw662 commented 1 year ago

Actually no. The tag is eslint, so it matches all // eslint-*.