Git Product home page Git Product logo

todo-tree's Introduction

Todo Tree

This extension quickly searches (using ripgrep) your workspace for comment tags like TODO and FIXME, and displays them in a tree view in the activity bar. The view can be dragged out of the activity bar into the explorer pane (or anywhere else you would prefer it to be).

Clicking a TODO within the tree will open the file and put the cursor on the line containing the TODO.

Found TODOs can also be highlighted in open files.

Please see the wiki for configuration examples.

screenshot

Notes:

  • User rg.conf files are ignored.

Highlighting

New!: If you just want to set different colours for tags, you can now enable todo-tree.highlights.useColourScheme. This will apply a set of colours (which can be changed) to the tags in the order that they are defined.

Highlighting tags is configurable. Use defaultHighlight to set up highlights for all tags. If you need to configure individual tags differently, use customHighlight. If settings are not specified in customHighlight, the value from defaultHighlight is used.

Custom highlights can also be specified for sub tags (if used).

Note: defaultHighlight is not applied to sub tags.

Both defaultHighlight and customHighlight allow for the following settings:

foreground - used to set the foreground colour of the highlight in the editor and the marker in the ruler.

background - used to set the background colour of the highlight in the editor.

Note: Foreground and background colours can be specified using HTML/CSS colour names (e.g. "Salmon"), RGB hex values (e.g. "#80FF00"), RGB CSS style values (e.g. "rgb(255,128,0)" or colours from the current theme, e.g. peekViewResult.background. See Theme Color for the details. Hex and RGB values can also have an alpha specified, e.g. "#ff800080" or "rgba(255,128,0,0.5)".

opacity - percentage value used with the background colour. 100% will produce an opaque background which will obscure selection and other decorations.

Note: opacity can only be specified when hex or RGB colours are used.

fontWeight, fontStyle, textDecoration - can be used to style the highlight with standard CSS values.

borderRadius - used to set the border radius of the background of the highlight.

icon - used to set a different icon in the tree view. Must be a valid octicon (see https://octicons.github.com) or codicon (see https://microsoft.github.io/vscode-codicons/dist/codicon.html). If using codicons, specify them in the format "$(icon)". The icon defaults to a tick if it's not valid. You can also use "todo-tree", or "todo-tree-filled" if you want to use the icon from the activity view.

iconColour - used to set the colour of the icon in the tree. If not specified, it will try to use the foreground colour or the background colour. Colour can be specified as per foreground and background colours, but see note below.

Note: Theme colours are only supported when using codicons. Hex, RGB and HTML colours are only supported when using octicons or the default icon.

gutterIcon - set to true to show the icon in the editor gutter.

Note: Unfortunately, only octicons and the todo-tree icon can be displayed in the gutter.

rulerColour - used to set the colour of the marker in the overview ruler. If not specified, it will default to use the foreground colour. Colour can be specified as per foreground and background colours.

rulerOpacity - used to set the opacity of the ruler markers.

Note: Only works with hex and RGB colour settings.

rulerLane - used to set the lane for the marker in the overview ruler. If not specified, it will default to the right hand lane. Use one of "left", "center", "right", or "full". You can also use "none" to disable the ruler markers.

type - used to control how much is highlighted in the editor. Valid values are:

  • tag - highlights just the tag
  • text - highlights the tag and any text after the tag
  • tag-and-comment - highlights the comment characters (or the start of the match) and the tag
  • tag-and-subTag - as above, but allows the sub tag to be highlight too (with colours defined in custom highlights)
  • text-and-comment - highlights the comment characters (or the start of the match), the tag and the text after the tag
  • line - highlights the entire line containing the tag
  • whole-line - highlights the entire line containing the tag to the full width of the editor
  • capture-groups:n,m... - highlights capture groups from the regex, where 'n' is the index into the regex
  • none - disable highlightling in the document

hideFromTree - used to hide tags from the tree, but still highlight in files

hideFromStatusBar - prevents the tag from being included in the status bar counts

hideFromActivityBar - prevents the tag from being included in the activity bar badge count

Example:

"todo-tree.highlights.defaultHighlight": {
    "icon": "alert",
    "type": "text",
    "foreground": "red",
    "background": "white",
    "opacity": 50,
    "iconColour": "blue"
},
"todo-tree.highlights.customHighlight": {
    "TODO": {
        "icon": "check",
        "type": "line"
    },
    "FIXME": {
        "foreground": "black",
        "iconColour": "yellow",
        "gutterIcon": true
    }
}

Note: The highlight configuration is separate from the settings for the search. Adding settings in customHighlight does not automatically add the tags into todo-tree.general.tags.

*Note: Using the capture-groups setting in type may have an impact on performance with large files.

Installing

You can install the latest version of the extension via the Visual Studio Marketplace here.

Alternatively, open Visual Studio code, press Ctrl+P or Cmd+P and type:

ext install Gruntfuggly.todo-tree

Source Code

The source code is available on GitHub here.

Controls

The tree view header can contain the following buttons:

collapse - Collapse all tree nodes
expand - Expand all tree nodes
flat - Show the tree view as a flat list, with the full filename for each TODO
tags - Show the view as a list of tags
tree - Show the tree view as a tree with expandable nodes for each folder (default)
tag - Group the TODOs in the tree by the tag
notag - Organise the TODOs by file (default)
filter - Only show items in the tree which match the entered filter text
clear-filter - Remove any active filter
refresh - Rebuild the tree
scan-open-files - Show tags from open files only
scan-current-file - Show tags from the current file
scan-workspace - Show tags from workspace only
scan-workspace - Show tags from workspace and open files
reveal - Show the current file in the tree
export - Export the tree content to a file

Folder Filter Context Menu

Right clicking in the tree view will bring up a context menu with the following options:

Hide This Folder/Hide This File - removes the folder or file from the tree
Only Show This Folder - remove all other folders and subfolders from the tree
Only Show This Folder And Subfolders - remove other folders from the tree, but keep subfolders
Reset Folder Filter - reset any folders previously filtered using the above
Toggle Badges - enable/disable SCM decorations
Toggle Compact Folders - enable/disable compressed folder names
Toggle Item Counts - enable/disable counts of tags
Scan Open Files Only - show TODOs from files open in VSCode (no search)
Scan Current File Only - show TODOs from the current open file only
Scan Workspace And Open Files - show TODOs from the workspace and any open files
Scan Workspace Only - show TODOs from the workspace only (requires manual refresh)
Expand Tree/Collapse Tree - expand or collapse the whole tree Show Tree View/Show Flat View/Show Tags Only View - change the tree view style Group by Tag/Ungroup by Tag - toggle grouping of items by tag Group by Sub Tag/Ungroup by Sub Tag - toggle grouping of items by sub tag Export Tree - dump the tree contents into a file Reveal Current File in Tree - show the current editor file in tree (if present)

Note: The current filters are shown in the debug log. Also, the filter can always be reset by right clicking the Nothing Found item in the tree. If your tree becomes invisible because everything is filtered and hideTreeWhenEmpty is set to true, you can reset the filter by pressing F1 and selecting the Todo Tree: Reset Folder Filter command.

Commands

Tags

To make it easier to configure the tags, there are two commands available:

Todo Tree: Add Tag - allows entry of a new tag for searching

Todo Tree: Remove Tag - shows a list of current tags which can be selected for removing

Note: The Remove Tag command can be used to show current tags - just press Escape or Enter with out selecting any to close it.

Export

The contents of the tree can be exported using Todo Tree: Export Tree. A read-only file will be created using the path specified with todo-tree.general.exportPath. The file can be saved using File: Save As.... Note: Currently File: Save does not work which seems to be a VSCode bug (see microsoft/vscode#101952).

Switch Scope

Todo Tree: Switch Scope - shows a list of configured scopes which can be selected

Navigation

The commands Todo Tree: Go To Next and Todo Tree: Go To Previous can be used to move to the next and previous TODO within the current editor.

Configuration

The extension can be customised as follows (default values in brackets):

todo-tree.general.debug (false)
Show a debug channel in the output view.

todo-tree.general.periodicRefreshInteval (0)
Interval (in minutes) for automatically refreshing the tree. Set to '0' to disable, or to the number of minutes between refreshes. Note: This is not typically needed as the tree will be refreshed when files change.

todo-tree.general.automaticGitRefreshInterval (0)
Polling interval (in seconds) for automatically refreshing the tree when your repository is updated. This will check if your repository HEAD has changed and trigger a rescan of the workspace if it has. This replaces the file watcher functionality. Set to '0' to disable, or to the number of seconds between checks.

todo-tree.general.exportPath (~/todo-tree-%Y%m%d-%H%M.txt)
Path to use when exporting the tree. Environment variables will be expanded, e.g ${HOME} and the path is passed through strftime (see https://github.com/samsonjs/strftime). Set the extension to .json to export as a JSON record.

todo-tree.general.rootFolder ("")
By default, any open workspaces will have a tree in the view. Use this to force another folder to be the root of the tree. You can include environment variables and also use ${workspaceFolder}. e.g.
"todo-tree.general.rootFolder": "${workspaceFolder}/test"
or
"todo-tree.general.rootFolder": "${HOME}/project".

Note: Other open files (outside of the rootFolder) will be shown (as they are opened) with their full path in brackets.

todo-tree.general.schemes (['file','ssh','untitled'])
Editor schemes to find TODOs in. To find TODOs in settings files, for instance, add vscode-userdata or for output windows, add output.

todo-tree.general.tags (["TODO","FIXME","BUG"])
This defines the tags which are recognised as TODOs. This list is automatically inserted into the regex.

todo-tree.general.tagGroups ({})
This setting allows multiple tags to be treated as a single group. Example:

    "todo-tree.general.tagGroups": {
        "FIXME": [
            "FIXME",
            "FIXIT",
            "FIX",
        ]
    },

This treats any of FIXME, FIXIT or FIX as FIXME. When the tree is grouped by tag, all of these will appear under the FIXME node. This also means that custom highlights are applied to the group, not each tag type.

Note: all tags in the group should also appear in todo-tree.general.tags.

todo-tree.general.revealBehaviour (start of todo)
Change the cursor behaviour when double-clicking a todo in the tree. You can choose from: start of todo (moves the cursor to the beginning of the todo), end of todo (moves the cursor to the end of the todo) or start of line (moves the cursor to the start of the line).

todo-tree.general.statusBar (none)
What to show in the status bar - nothing (none), total count (total), counts per tag (tags), counts for the top three tags (top three) or counts for the current file only (current file).

todo-tree.general.statusBarClickBehaviour (reveal)
Set the behaviour of clicking the status bar to either cycle through the status bar display formats (cycle), reveal the tree (reveal) or to toggle highlights (toggle highlights).

todo-tree.general.showIconsInsteadOfTagsInStatusBar (false)
Show icons instead of tags in the status bar.

todo-tree.general.showActivityBarBadge (false)
Show a badge in the activity bar indicating the total number of found TODOs.

Note: When the tree view is in the Explorer pane, the badge is displayed on the Explorer icon, which may not be desirable.

todo-tree.filtering.includeGlobs ([])
Globs for use in limiting search results by inclusion, e.g. [\"**/unit-tests/*.js\"] to only show .js files in unit-tests subfolders. Globs help.

Note: globs paths are absolute - not relative to the current workspace.

todo-tree.filtering.excludeGlobs (["**/node_modules/*/**"])
Globs for use in limiting search results by exclusion (applied after includeGlobs), e.g. [\"**/*.txt\"] to ignore all .txt files.

Note: node_modules are excluded by default.

todo-tree.filtering.includedWorkspaces ([])
A list of workspace names to include as roots in the tree (wildcards can be used). An empty array includes all workspace folders.

todo-tree.filtering.excludedWorkspaces ([])
A list of workspace names to exclude as roots in the tree (wildcards can be used).

todo-tree.filtering.passGlobsToRipgrep (true)
Set this to false to apply the globs after the search (legacy behaviour).

todo-tree.filtering.useBuiltInExcludes (none)
Set this to use VSCode's built in files or search excludes. Can be one of none, file excludes (uses Files:Exclude), search excludes (Uses Search:Exclude) or file and search excludes (uses both).

todo-tree.filtering.ignoreGitSubmodules (false)
If true, any subfolders containing a .git file will be ignored when searching.

todo-tree.filtering.includeHiddenFiles (false)
If true, files starting with a period (.) will be included.

todo-tree.highlights.enabled (true)
Set this to false to turn off highlighting.

todo-tree.highlights.highlightDelay (500)
The delay before highlighting (milliseconds).

todo-tree.highlights.defaultHighlight ({})
Set default highlights. Example:

{
    "foreground": "white",
    "background": "red",
    "icon": "check",
    "type": "text"
}

todo-tree.highlights.customHighlight ({})
Set highlights per tag (or tag group). Example:

{
    "TODO": {
        "foreground": "white",
        "type": "text"
    },
    "FIXME": {
        "icon": "beaker"
    }
}

todo-tree.highlights.useColourScheme (false)
Use a simple scheme for colouring highlights. This will simply apply a list of colours in the same order as the tags are defined. Use this as a much simpler alternative to setting up custom highlights for each tag.

Note: The colour scheme overrides the colours defined in todo-tree.highlights.defaultHighlight but not todo-tree.highlights.customHighlight.

todo-tree.highlights.backgroundColourScheme (["red","orange","yellow","green","blue","indigo","violet"])
Defines colours for use in conjunction with todo-tree.highlights.useColourScheme to colour highlights. Colours can be defined in the same way as other colours (e.g. hex code, theme names, etc.). If there are more tags than colours, the sequence is repeated.

todo-tree.highlights.foreroundColourScheme (["white","black","black","white","white","white","black"])
Defines colours for use in conjunction with todo-tree.highlights.backgroundColourScheme to colour highlights. These colours should be complementary to the background colours.

todo-tree.regex.enableMultiLine (false)
Normally, multiline support is enabled by detecting the use of \n in the regex. Set this to true, to enable multiline support by default. This allows the use of [\s\S] as an alternative to matching any character including newlines.

todo-tree.regex.regex ( (//|#|<!--|;|/\\*|^|^[ \\t]*(-|\\d+.))\\s*($TAGS))

This defines the regex used to locate TODOs. By default, it searches for tags in comments starting with //, #, ;, <!-- or /*, and also markdown todo lists. This should cover most languages. However if you want to refine it, make sure that the ($TAGS) is kept as ($TAGS) will be replaced by the expanded tag list. For some of the extension features to work, ($TAGS) should be present in the regex, however, the basic functionality should still work if you need to explicitly expand the tag list.

Note: This is a Rust regular expression, not javascript.

todo-tree.regex.subTagRegex This is a regular expression for processing the text to the right of the tag, e.g. for extracting a sub tag, or removing unwanted characters. Anything that the regex matches will be removed from the text. If a capture group is included, the contents are extracted into a sub tag, which will be used in the tree to group similar tags. The sub tag can also be used as a placeholder in todo-tree.tree.subTagClickUrl and todo-tree.tree.labelFormat. Sub tags can also be highlighted by specifying a section in the todo-tree.highlights.customHighlights setting. To highlight the sub tag itself, set "type" to "tag-and-subTag" in custom highlights for the tag.

Examples:

"^:\s*" can be used to remove colons from immediately after tags.

"^\s*\((.*)\)" can be used to extract anything in parentheses after the tag and use it as a sub tag.

todo-tree.regex.regexCaseSensitive (true)
Set to false to allow tags to be matched regardless of case.

todo-tree.ripgrep.ripgrep ("")
Normally, the extension will locate ripgrep itself as and when required. If you want to use an alternate version of ripgrep, set this to point to wherever it is installed.

todo-tree.ripgrep.ripgrepArgs ("--max-columns=1000")
Use this to pass additional arguments to ripgrep. e.g. "-i" to make the search case insensitive. Use with caution!

todo-tree.ripgrep.ripgrepMaxBuffer (200)
By default, the ripgrep process will have a buffer of 200KB. However, this is sometimes not enough for all the tags you might want to see. This setting can be used to increase the buffer size accordingly.

todo-tree.ripgrep.usePatternFile (true)
A pattern file is used with ripgrep by default. If you experience issues with deleting the pattern file, set this to false to use the legacy method of providing the regex to ripgrep.

todo-tree.tree.hideTreeWhenEmpty (true)
Normally, the tree is removed from the explorer view if nothing is found. Set this to false to keep the view present.

todo-tree.tree.filterCaseSensitive (false)
Use this if you need the filtering to be case sensitive.

Note: this does not the apply to the search.

todo-tree.tree.trackFile (true)
Set to false if you want to prevent tracking the open file in the tree view.

todo-tree.tree.showBadges (true)
Set to false to disable SCM status and badges in the tree. *

Note: This also unfortunately turns off themed icons.

todo-tree.tree.expanded* (false)
Set to true if you want new views to be expanded by default.

todo-tree.tree.flat* (false)
Set to true if you want new views to be flat by default.

todo-tree.tree.grouped* (false)
Set to true if you want new views to be grouped by default.

todo-tree.tree.tagsOnly* (false)
Set to true if you want new views with tags only by default.

todo-tree.tree.sortTagsOnlyViewAlphabetically (false)
Sort items in the tags only view alphabetically instead of in order of the tags list.

todo-tree.tree.showCountsInTree (false)
Set to true to show counts of TODOs in the tree.

todo-tree.tree.labelFormat (${tag} ${after})
Format of the TODO item labels. Available placeholders are ${line}, ${column}, ${tag}, ${before} (text from before the tag), ${after} (text from after the tag), ${filename}, ${filepath} and ${afterOrBefore} (use "after" text or "before" text if after is empty). When using ${tag} or ${subTag} you can also transform the text with "uppercase", "lowercase" or "capitalize", e.g. ${tag:lowercase}.

todo-tree.tree.scanMode (workspace)
By default the extension scans the whole workspace (workspace). Use this to limit the search to only open files (open files) or only the current file (current file).

todo-tree.tree.showScanModeButton (false)
Show a button on the tree view header to switch the scanMode (see above).

todo-tree.tree.hideIconsWhenGroupedByTag (false)
Hide item icons when grouping by tag.

todo-tree.tree.sort (true)
ripgrep searches using multiple threads to improve performance. The tree is sorted when it is populated so that it stays stable. If you want to use ripgrep's own sort arguments, set this to false.

Note: Depending on what scan mode you select, you may also want to disable auto-refresh when disabling the sort, otherwise the tree may still be unstable.

todo-tree.tree.disableCompactFolders (false)
The tree will normally respect the VSCode's explorer.compactFolders setting. Set this to true if you want to disable compact folders in the todo tree.

todo-tree.tree.tooltipFormat (${filepath}, ${line})
Format of the tree item tooltips. Uses the same placeholders as todo-tree.tree.labelFormat (see above).

todo-tree.tree.subTagClickUrl
A URL (which can contain placeholders), which will be opened when clicking on a sub tag in the tree, e.g. https://github.com/${subTag} could be used if the sub tag extracts a user name.

todo-tree.tree.buttons.reveal (true)
Show a button in the tree view title bar to reveal the current item (only when track file is not enabled).

todo-tree.tree.buttons.scanMode (false)
Show a button in the tree view title bar to change the Scan Mode setting.

todo-tree.tree.buttons.viewStyle (true)
Show a button in the tree view title bar to change the view style (tree, flat or tags only).

todo-tree.tree.buttons.groupByTag (true)
Show a button in the tree view title bar to enable grouping items by tag.

todo-tree.tree.buttons.groupBySubTag (false)
Show a button in the tree view title bar to enable grouping items by sub tag.

Note: This button will only be visible when sub tags have been found and are present in the tree.

todo-tree.tree.buttons.filter (true)
Show a button in the tree view title bar allowing the tree to be filtered by entering some text.

todo-tree.tree.buttons.refresh (true)
Show a refresh button in the tree view title bar.

todo-tree.tree.buttons.expand (true)
Show a button in the tree view title bar to expand or collapse the whole tree.

todo-tree.tree.buttons.export (false)
Show a button in the tree view title bar to create a text file showing the tree content.

*Only applies to new workspaces. Once the view has been changed in the workspace, the current state is stored.

todo-tree.filtering.scopes ({})
Defines a set of file scopes that can be quickly switched between using the todo-tree.switchScope command.

This is a complex configuration property that can only be configured through the configuration JSON file. For example

"todo-tree.scopes": [
    {
        "name": "Production ",
        "excludeGlobs": [
            "**/tests/**"
        ]
    },
    {
        "name": "Tests",
        "includeGlobs": [
            "**/tests/**"
        ]
    },
    {
        "name": "All"
    }
]

Multiline TODOs

If the regex contains \n, then multiline TODOs will be enabled. In this mode, the search results are processed slightly differently. If results are found which do not contain any tags from todo-tree.general.tags it will be assumed that they belong to the previous result that did have a tag. For example, if you set the regex to something like:

"todo-tree.regex.regex": "(//)\\s*($TAGS).*(\\n\\s*//\\s{2,}.*)*"

This will now match multiline TODOs where the extra lines have at least two spaces between the comment characters and the TODO item. e.g.

// TODO multiline example
//  second line
//  third line

If you want to match multiline TODOs in C++ style multiline comment blocks, you'll need something like:

"todo-tree.regex.regex": "(/\\*)\\s*($TAGS).*(\\n\\s*(//|/\\*|\\*\\*)\\s{2,}.*)*"

which should match:

/* TODO multiline example
**  second line
**  third line
*/

Note: If you are modifying settings using the settings GUI, you don't need to escape each backslash.

Warning: Multiline TODOs will not work with markdown TODOs and may have other unexpected results. There may also be a reduction in performance.

Excluding files and folders

To restrict the set of folders which is searched, you can define todo-tree.filtering.includeGlobs. This is an array of globs which the search results are matched against. If the results match any of the globs, they will be shown. By default the array is empty, which matches everything. See here for more information on globs.

Note: globs paths are absolute - not relative to the current workspace.

To exclude folders/files from your search you can define todo-tree.filtering.excludeGlobs. If the search results match any of these globs, then the results will be ignored.

You can also include and exclude folders from the tree using the context menu. This folder filter is applied separately to the include/exclude globs.

Note: By default, ripgrep ignores files and folders from your .gitignore or .ignore files. If you want to include these files, set todo-tree.ripgrep.ripgrepArgs to --no-ignore.

Markdown Support

When the extension was first written, very basic markdown support was added simply by adding a pattern to the default regex to match "- [ ]". A better way to handle markdown TODOs is to add "(-|\d+.)" to the list of "comments" in the first part of the regex and then adding "[ ]" and "[x]" to the list of tags in settings.json, e.g. :

"todo-tree.regex.regex": "(//|#|<!--|;|/\\*|^|^\\s*(-|\\d+.))\\s*($TAGS)"
"todo-tree.general.tags": [
        "BUG",
        "HACK",
        "FIXME",
        "TODO",
        "XXX",
        "[ ]",
        "[x]"
    ]

Note: If you modify the settings via the GUI, replace every instance of \\ in the regex setting with \.

This will then match all of the following:

- [ ] Do something
- [x] Something I've done

1. [ ] Do this first
2. [ ] Followed by this

This also allows custom highlighting to be applied, e.g.

"todo-tree.highlights.customHighlight": {
    "[ ]": {
        "background": "#ff000080"
    },
    "[x]": {
        "background": "#00ff0080"
    }
}

which will colour pending TODOs red and completed TODOs green.

Lastly, it will allow grouping by tag (and sub tags) to work and also work better when showing counts in the status bar.

Note: The default regex will be updated to reflect these changes at some point in the future.

Known Issues

Grouping by tag will only work when your configuration defines the tags using the todo-tree.general.tags setting. Older versions of the extension had the tags directly defined in the todo-tree.regex.regex whereas now, the regex replaces $TAGS with the contents of todo-tree.general.tags.

Grouping by tag doesn't work for markdown task list items as there is no tag to group with. The tree will show the files alongside the tag groups.

Tracking the file in the tree view when grouping by tag will reveal the first tag found.

When there is no current workspace, default icons will be shown in the tree.

Donate

If you find this extension useful, please feel free to donate here. Thanks!

Credits

Uses a modified version of ripgrep-js.

Main icons originally made by Freepik from www.flaticon.com is licensed by CC 3.0 BY

Tree view icons made by Vaadin from www.flaticon.com is licensed by CC 3.0 BY

Tag icons made by Dave Gandy from www.flaticon.com is licensed by CC 3.0 BY

Tags Icon made by Vectors Market from www.flaticon.com is licensed by CC 3.0 BY

Reveal Icon made by Gregor Cresnar from www.flaticon.com

Lots of the icons have now been updated by johnletey to match the new VS Code 1.37.0 GUI. Much appreciated!

Translations

Simplified Chinese translation by loniceras.

todo-tree's People

Contributors

abelmatser avatar agov avatar baincd avatar benasvip avatar cobey avatar coderpatros avatar dependabot[bot] avatar ericmoritz avatar gruntfuggly avatar jakubkoralewski avatar jletey avatar kcmr avatar kjo-sdds avatar loniceras avatar mtoigo avatar niccolomineo avatar nitesh-singh-5 avatar pd93 avatar pke avatar rhynodesigns avatar sidpagariya avatar somewhatabstract avatar thalesfsp avatar tksh164 avatar tomfreudenberg avatar tristan957 avatar true0r avatar tylerbrockett avatar victorhas avatar zoeytm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

todo-tree's Issues

Maybe a merge with todo-highlight

It would be so great to have your extension and this one wayou/vscode-todo-highlight#101 in one together. Maybe name it just vscode-todos. Because they are both so similar and both have the pros and cons. Treeview here is great (just filtering is missing in the sidebar pannel) and the other ones highlighting works smoother.

Add expand all/collapse all button

Would it be possible to have a collapse/expand all button? I think that would be very helpful if you have a long list of tasks and want to have a quick look at everything that needs to be done. It'd be specially helpful when you use the tree view and have 2/3 levels of folders.

Fails to find todos and throws error

Recently Todo Tree has been failing to find any Todo's in my project and displays the following error message: "todo-tree: Cannot read property 'length' of undefined". My project definitely has several todo's but even if it didn't the extension shouldn't be throwing errors as a result.

Extension version: 0.0.62
VS Code version: Code 1.24.1 (24f62626b222e9a8313213fb64b10d741a326288, 2018-06-13T17:51:32.889Z)
OS version: Windows_NT x64 6.1.7601

How to get started?

Sorry for the silly question, but on my vscode (version 1.23.0), your extension doesn't show up in the side bar.
How do I toggle it, or enable? I installed ripgrep and set its path in the settings.
The sidebar shows Explorer, search, scm, debug, and extensions.
within explorer I can see the gitlens sidebar, but nothing else.
Maybe update the docs if there's a really obvious step that I'm missing
I also tried the commands like todo-tree show tree view, but nothing seems to happen on screen.

Only show issues in open files?

Is that currently possible? Else it would be a very neat addition.

On large projects, with many project owners, the list of TODO:s can become fairly large and the relevant TODO:s for ones task at hand might be hard to spot among the rest.

The TODO-plugin I used for Atom (https://github.com/mrodalgaard/atom-todo-show) had the option to eg. just show TODO:s from ones open files – that was a very useful way to get a focused views of one TODO:s (and would be especially so in this project when combined with the "expand all" option)

Error: stdout maxBuffer exceeded

Hi,
this extension doesn't work for me at all. It displays an error and then shows an empty list.

screen shot 2018-07-15 at 18 09 32

screen shot 2018-07-15 at 18 11 07

I'm not sure how to debug this extension, so reach me out if you need to retireve more info.

VSCode Version 1.25.1
macOS High Sierra 10.13.6

add usage of hex color codes

Hey there,

your extension is pretty nice. i'm using it in combination with the todo highlight extension. the in code highlighting is really nice there, but the todo listing is a pain tbh ;)

to use the same colors (more colors) it would be nice if you could add hex color codes instead of those few predefined colors.

Amount badge [suggestion]

Please, add a badge showing how many TODOs left are there. Just like version control has.

image

It might need to have a toggle button as it might be annoying for some people.

TODOs via task list markdown doesn't support lists defined by asterisk * or plus +

github markdown lists with tasks can be defined with -, *, or +.
Currently, todo-tree only supports -. This is due to the default regex.

I suggest updating the default regex to support all three symbols.

Current default regex: ((//|#|<!--|;|/\\*)\\s*($TAGS)|^\\s*- \\[ \\])

Suggested default regex: ((//|#|<!--|;|/\\*)\\s*($TAGS))|(^\\s*(-|\\*|\\+) \\[ \\])

Unfortunately, I did not understand in your extension how your tree view removes the initial comment symbols from the comment-style todo's. Therefore, the - [] is still in front of every markdown task. Do you see a way to remove them?

Open Editors

Great extension!

Would it be possible for it to also look at files in the "Open Editors" pane as well as those in the "Workspace" folder?

Much thanks!

Add `/*`

Hello :) Thank you for the very useful extension!
I wanted to suggest add symbols /* in the new version.
The symbols /* */ are comments in CSS-files. And TODO-TREE doesn't see them.
I already added them in my settings:
"todo-tree.regex" : "(//|#|<!--|;|/*)\\s*(TODO|FIXME|NOTE)"
I think it will be useful, that people don't search solution to this problem.
settings json - - visual studio code_2018_04_08 18 06 16
settings json - - visual studio code_2018_04_08 18 06 33

No Todo (etc) in Explorer ?

When the extension is installed, and I type // TODO <comment> explorer within vs code should automatically display TODO within the explorer tree, correct ? If this is the case, nothing is showing up within vs code explorer ?

FR: remove from tree labels the comment debrids

If I use old style comments like /* TODO my text */ they are presented in the Tree as TODO my text */

Is it possible to remove the final */ from the Tree label?

This basic requirement could be expanded by allowing removing any substring of the label. For example if I use colors to code the type of comment, maybe I could ask to remove TODO, FIXME prefixes.

[Suggestion] Auto-Refresh enabler option

Hi,

Can you add an option that allows you to block the automatic refresh every time a file is changed ?. There is a Refresh button, which when you press it refreshes the tree, but I do not see it when the tree automatically refreshes itself with each file change.

With this option, it would improve the speed when the tree does not have to be refreshed every time the documents change

Feature Request: Populate Tree View in Order of appearance

As a user I would like to see all of my todo's for a file in the tree view in the order that they appear in the file, to make navigating sequential todo's significantly easier without being jumped to a potentially unrelated segment of the file.

For background I'm using the ToDo feature to navigate everything that needs to be done in a plain text file where one ToDo depends on the previous one.

A way to ignore selected folders ?

Hi,
At first, tank you for sharing this great module, i love it !

I woul'd like to know if there is a solution to ignore folder (plugins) in my project ?

Regards

Highlight keywords with more options

Itβ€˜s nice to have the option now to highlight specific keywords in files with colours but it would be nice to have some more options for the keywords like in https://github.com/wayou/vscode-todo-highlight.

I thought about something like that:

"todo-tree.keywords": [ 
  {
    "keyword": "TODO",
    "color": "#FFF",
    "backgroundColor": "#f44336",
    "icon": "check",
    "iconColor": "#f44336",
    "isWholeLine": false,
    "isActive": true
  }
]

throws error on empty folder

Opening an empty folder leads to the error todo-tree: failed to execute search (No files were searched, which means ripgrep probably applied a filter you didn't expect. Try running again with --debug..

Could you please check if there are any files to search before assuming there is a problem.

ignore markdown.json file (VSCode snippets)

Ignore this file: AppData\Roaming\Code\User\snippets\markdown.json

plus: ignore all "AppData\Roaming\Code\User\snippets" files

im getting this "false positive" 🀣

tks, great extension!

Add GitHub Markdown tasks

Provide support for GitHub flavored Markdown tasks. The current todo-tree regex can be changed to:

"todo-tree.regex": "((//|#|<!--|;)\\s*(TODO|FIXME)|^\\s*- \\[ \\])",

Elsewhere you have commented that you prefer not to add too many defaults in the regex. I understand this feeling. I do think that Markdown tasks are widely used, and it would be a good thing to document how to add support. Many people (even long time programmers) don't understand regular expressions.

Could you show us a specific example?

"The extension can be customised as follows:
todo-tree.regex"

Could you show us the regular expression you are using for TODO or FIXME as an example of how this works. I know regular expressions, but it is nice to have a base to work off from to make our own TODO1 or whatever we may make for priorities.

Actually - if you think about it this could be your standard version and people could "buy" an advanced version where they could make their own custom priority extensions like TODO1, 2, 3 etc. with colors options.... if you were thinking of making money on this.

Great plugin - I use it all the time. I see it used in all the main libraries too!

Thanks!

Errors after updating VS Code to 1.25.0

After latest VSCode June update (v1.25.0), I'm getting following error in developer console every time I switch between documents:

TypeError: Cannot read property 'document' of undefined
	at Timeout.highlight [as _onTimeout] (C:\Users\Andis\.vscode\extensions\gruntfuggly.todo-tree-0.0.64\extension.js:613:36)
	at ontimeout (timers.js:386:14)
	at tryOnTimeout (timers.js:250:5)
	at Timer.listOnTimeout (timers.js:214:5)

Multiple other extensions are also throwing similar errors and some misbehave because of this change in VS Code.

Optimize display of TODOs

A tiny request:
In the explorer view TODOs are shown like: // TODO:.....
The double slash should be skipped, because it adds no information. Just show it like: TODO:......

Feature Request: Show up the occurrences of `System.NotImplementedException`

Scenario:
During bootstrapping of the classes/services I use automatic generator of methods with throw new System.NotImplementedException(); in the body, mainly focusing on a general workflow. When I go to details I have to keep track of methods which are still without implementation by myself.

Suggestion:
Show up all occurrences of System.NotImplementedException in the Todo Tree.

Thanks.

Configuration does not respect ${workspaceFolder} substitution

Unfortunately, it is impossible to use relative paths or ${workspaceFolder} in the rootFolder configuration setting. Only absolute paths work there.

I added the following line to the configuration:

    "todo-tree.rootFolder": "${workspaceFolder}/demo",

but it continuously complains:

todo-tree: root folder not found (${workspaceFolder}/demo)
e.onDidNotificationChange @ notificationsAlerts.ts:39
(anonymous) @ notificationsAlerts.ts:28
e.fire @ event.ts:140
e.notify @ notifications.ts:127
e.notify @ notificationService.ts:65
e._showMessage @ mainThreadMessageService.ts:86
e._showMessage @ mainThreadMessageService.ts:47
e.$showMessage @ mainThreadMessageService.ts:41
e._doInvokeHandler @ rpcProtocol.ts:174
e._invokeHandler @ rpcProtocol.ts:159
e._receiveRequest @ rpcProtocol.ts:108
e._receiveOneMessage @ rpcProtocol.ts:90
(anonymous) @ rpcProtocol.ts:33
(anonymous) @ rpcProtocol.ts:213
e.fire @ event.ts:140
(anonymous) @ ipc.net.ts:81
emitOne @ events.js:96
emit @ events.js:191
readableAddChunk @ _stream_readable.js:178
Readable.push @ _stream_readable.js:136
onread @ net.js:560

Not recursing into subfolders

I cannot seem to persuade this extension to look recursively into all folders of the workspace. I think the glob patterns need to be applied recursively.

UPDATE: I think this is actually an issue with limits. We have a lot of TODOs and things in our codebase and I think we're maxing out on how many the tree can show. Is this a hard limit or something that can be increased?

UPDATE 2: Turns out this is a buffer size issue for the ripgrep process that is launched. See comment thread for info. PR #53 addresses this.

todo-tree: Error: stdout maxBuffer exceeded

Since installing newest version of VSCODE (Version: 1.25.1 Windows) the extension constantly generates the following error and nothing shows up in todo list

todo-tree: Error: stdout maxBuffer exceeded

custom globs config not working

I get the following error when I try to set a custom glob to exclude my composer packages directory:

todo-tree: failed to execute search (error parsing glob ''!vendor/'': invalid use of ; must be one path component

The config parameter I'm using is:
"todo-tree.globs": ["!vendor/**"]

From what I can see it follows the example, just with the directory "vendor", instead of "node_modules".

Any help would be greatly appreciated, so I can see just my TODOs, and not everyone elses :)

Ignored color for marks superset of other marks

I'm trying to simulate the SublimeText ToC functionality by using ToDo tree plus hierarchical marks in this way:

"todo-tree.tags": [
        "TODO",
        "FIXME",
        ">>>",
        ">>",
        ">"
    ],
    "todo-tree.iconColours": {
        "TODO": "magenta",
        "FIXME": "red",
        ">>>": "grey",
        ">>": "green",
        ">": "yellow"
    },

Before yesterday's update, the entries in the side panel where colored correctly as requested in the iconColor configuration. Now they are all yellow independently from the number of ">". What I'm doing wrong?

case sensitivity setting ignored

Steps to reproduce:
Set "todo-tree.filterCaseSensitive": false (default value)

Expected result: all variants of "todo" to show up in results.
Actual result: only uppercase "TODO"s show up.

image

Multi-line CSS comment doesn't work

I'm familiar with JS Regex, but since the plugin uses Rust Regex, I'm not sure how to fix this

File Type: .css

Example:

/* THIS WORKS */
/* TODO: */
/* FIXME: */

/* THIS DOESN'T WORK */
/*
TODO: 
FIXME: 
*/

ripgrep Error

After install the extension, show this message:

todo-tree: Failed to find vscode-ripgrep - please install ripgrep manually and set 'todo-tree.ripgrep' to point to the executable

vs code version 1.21.1

Also I tried to uninstall and install ripgrep, but there weren't changes

cd C:\Users\xxx\.vscode\extensions\Gruntfuggly.todo-tree-0.0.30
npm uninstall vscode-ripgrep
npm install vscode-ripgrep

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.