Coder Social home page Coder Social logo

starlanestudios / vscode-comment-anchors Goto Github PK

View Code? Open in Web Editor NEW
198.0 4.0 30.0 1.61 MB

โš“A Visual Studio Code extension that adds support for comment anchors ๐Ÿ”ญ

Home Page: https://marketplace.visualstudio.com/items?itemName=ExodiusStudios.comment-anchors

License: MIT License

TypeScript 100.00%
visualstudiocode vscode comment anchors todo bookmarks extension

vscode-comment-anchors's Introduction

Comment Anchors

Place anchors within comments or strings to place bookmarks within the context of your code. Anchors can be used to track TODOs, write notes, create foldable sections, or to build a simple navigation making it easier to navigate your files.

Anchors can be viewed for the current file, or throughout the entire workspace, using an easy to use sidebar.

Comment Anchors provides many configuration options, allowing you to tailor this extension to your personal workflow, and increase productivity. Check below for a complete list of features!

Maintenance notice

We do not intend to make any major changes or additions to this project ourselves as we have moved on to other projects, however we will continue to review and merge community submitted pull requests from time to time.

Read more about this here.

Changelog

The changelog can be found here

Feature breakdown

  • Place anchors in any file for any language
  • Anchors can be viewed in the anchor list sidebar
  • Anchor names, colors, highlight colors, and much more can be customized (See below for examples)
  • Click an anchor in the anchor list to scroll it into view
  • Navigate to the previous or next anchor using keybinds
  • Quickly toggle tag visibility with commands
  • View anchors across your entire workspace
  • Scope anchors to be visible in your entire workspace, or just the current file
  • Place your anchors into hierarchical sections using region anchors
  • Group anchors into custom lists by tagging anchors with an epic
  • Export all anchors in your workspace as JSON or CSV

Usage

The default settings come with anchors for the following tags:

  • ANCHOR - Used to indicate a section in your file
  • TODO - An item that is awaiting completion
  • FIXME - An item that requires a bugfix
  • STUB - Used for generated default snippets
  • NOTE - An important note for a specific code section
  • REVIEW - An item that requires additional review
  • SECTION - Used to define a region (See 'Hierarchical anchors')
  • LINK - Used to link to a file that can be opened within the editor (See 'Link Anchors')

Of course you can add your own anchors as well! In order to make an anchor, simply place the tag name in a comment, with an additional anchor message behind it. The anchor will be automatically detected and added to the Anchor List in the activity sidebar.

You can also easily navigate between the anchors in the current file using Alt + PageUp or Alt + PageDown.

Preview

Anchor types

All anchor types have their own highlight color, and background color, and more, which can all be customized in the settings. Anchor tags can be added and removed, and can share the same icon or color. You can specify and use any hex color for the highlighting and icons, giving you full control over your personal set of anchor tags.

All tags

In case you want to disable one or more default tags, simply set the enabled property to false (See configuration section).

Workspace anchors

Besides displaying anchors found in the current file, the sidebar also displays a list of tags it found across all files in your workspace. These anchors are displayed per file, and can be used as quick navigation.

The visibility of anchor tags in the workspace list can be altered using the 'scope' property on each tag (See configuration section).

Workspace Anchors

Anchor epics

Epics give you the power to easily tag classes, methods, and entire sections of codes into personal lists. To get started, tag your individual anchors with an Epic to place them into a specific list. Optionally provide a sequence number to customize the ordering of your anchors.

Workspace Anchors

Lazy loading

Since workspace anchors are usually scanned at startup, this can increase load time for projects containing many files and folders. In this case you can enable lazy loading mode, which will require an additional manual trigger to start the scan.

Lazy workspace loading can be enabled in the settings (See configuration section).

Lazy Loading

Hierarchical anchors

Region Anchors allow you to group relevant Comment Anchors together in regions, which can be folded within the anchor sidebar. These anchors act nearly identical to regular anchors, however they require an end tag to be specified, which is simply a tag of the same type, prefixed with an exclamation mark.

Hierarchical Anchors

In order to mark a tag as Region Tag, set the behavior property to "region" in the tags configuration (See configuration section).

A default region tag is provided, called "SECTION"

Tag customization

Comment Anchors supports a vast range of tag customization options. All tags can be modified, including the default tags. This allows you to define tags useful for your workflow.

See the configuration section for a complete list of tag properties.

Workspace Anchors

Case Sensitive Anchors

Link Anchors

Sometimes you might want to link to a file from within a comment. In these cases, a link anchor might provide to be useful to you. Using the default LINK tag you can provide a relative or absolute path to a file. These anchors will render with a clickable CodeLens line, used to quickly open it within your editor.

Custom link tags can be created by setting behavior to "link"

Linking to a line number

You can specify a line number to scroll to by appending the path with : followed by the line number.

Example: // LINK some/file.txt:50

Linking to a specific anchor

Link anchors can take you to another anchor in the target file by appending the path with # followed by the anchor id. The anchor id can be specified as an attribute.

Example: // LINK some/file.txt#my-anchor
Takes you here: // ANCHOR[id=my-anchor] This is the destination!

You can even omit the path entirely and link directly to an anchor or line within the current file

Example: // LINK #error-handling

Link Anchors

Display cursor position

Enable the commentAnchors.showCursor setting to display a file view entry for your current cursor position, making it even easier to see where you are in your current file relative to your anchors.

Cursor

IntelliSense support

Comment Anchors can be autocompleted by IntelliSense.

IntelliSense

Commands

> List configured anchor tags

Displays all configured tags in a preview tab, useful for when you are creating your own tags.

> Toggle the visibility of comment anchors

Toggles the visibility of comment anchors (Duh!). Note that his command will update your settings in order to toggle the visibility.

> Export all workspace anchors

Export all workspace anchors to a CSV or JSON file

Configuration

Use commentAnchors.parseDelay to alter the delay in milliseconds between when you stop with typing and when the anchor parser starts. Increasing this value can result in better performance. (Default 200)

{
	"commentAnchors.parseDelay": 200
}

Use commentAnchors.scrollPosition to alter where to position the anchor when scrolled to (Default top)

{
	"commentAnchors.scrollPosition": "top"
}

Use commentAnchors.showCursor to display the current cursor as entry in the file anchor view. (Default false)

{
	"commentAnchors.showCursor": false
}

Use commentAnchors.tagHighlights.enabled to set whether tags are highlighted. (Default true)

{
	"commentAnchors.tagHighlights.enabled": true
}

Use commentAnchors.workspace.enabled to activate workspace wide anchor scanning. This will list out all files containing comment anchors in the "Workspace Anchors" view. (Default true)

{
	"commentAnchors.workspace.enabled": true
}

Use commentAnchors.workspace.lazyLoad to delay the loading of workspace anchors until a manual confirmation is given. It is discouraged to disable this setting for large workspaces. (Default true)

{
	"commentAnchors.workspace.lazyLoad": true
}

Use commentAnchors.workspace.maxFiles to change how many workspace files will be indexed and displayed in the workspace anchors list. (Default 50)

{
	"commentAnchors.workspace.maxFiles": 50
}

Use commentAnchors.workspace.matchFiles to define which files are scanned by Comment Anchors. This setting can be used to greatly increase performance in your projects, as by default most files are scanned.

{
	"commentAnchors.workspace.matchFiles": "**/*"
}

Use commentAnchors.workspace.excludeFiles to define which files are excluded from being scanned by Comment Anchors. This setting can be used to greatly increase performance in your projects, as by default only few directories are excluded.

{
	"commentAnchors.workspace.excludeFiles": "**/{node_modules,.git,.idea,target,out,build,bin,obj,vendor}/**/*"
}

Use commentAnchors.workspace.pathFormat to change the way paths are displayed in the workspace anchor tree. You can choose to display full paths, abbreviate folders to single characters, or to hide the path completely. (Default full)

{
	"commentAnchors.workspace.pathFormat": "full"
}

Use commentAnchors.tags.provideAutoCompletion to enable autocompletion support for anchor tags. (Default true)

{
	"commentAnchors.tags.provideAutoCompletion": true
}

Use commentAnchors.tags.displayInSidebar to set whether tags are included in the sidebar list. (Default true)

{
	"commentAnchors.tags.displayInSidebar": true
}

Use commentAnchors.tags.displayInGutter to set whether gutter icons are shown. (Default true)

{
	"commentAnchors.tags.displayInGutter": true
}

Use commentAnchors.tags.displayInRuler to set whether icons are represented by colored bars in the scrollbar ruler. (Default true)

{
	"commentAnchors.tags.displayInRuler": true
}

Use commentAnchors.tags.displayLineNumber to set whether line numbers are displayed in the sidebar (Default true)

{
	"commentAnchors.tags.displayLineNumber": true
}

Use commentAnchors.tags.displayTagName to set whether tag names are displayed in the sidebar (Default true)

{
	"commentAnchors.tags.displayTagName": true
}

Use commentAnchors.tags.rulerStyle to set the appearance in the overview ruler (Default "center")

{
	"commentAnchors.tags.rulerStyle": "center"
}

Use commentAnchors.tags.sortMethod to set the method used to sort anchors by in the sidebar list. Set this to "line" to sort by line number (Default), or "type" to sort by tag type.

{
	"commentAnchors.tags.sortMethod": "line"
}

Use commentAnchors.tags.expandSections to choose whether sections are automatically expanded in the anchor tree.

{
	"commentAnchors.tags.expandSections": true
}

Use commentAnchors.tags.separators to set the list of accepted separators

{
	"commentAnchors.tags.separators": [
		" ",
		": ",
		" - "
	]
}

Use commentAnchors.epic.provideAutoCompletion to enable autocompletion support for epic. (Default true)

{
	"commentAnchors.epic.provideAutoCompletion": true
}

Use commentAnchors.epic.seqStep to config how much should auto-completion-item add on current max-seq. (Default 1)

{
	"commentAnchors.epic.seqStep": 1
}

Custom anchor tags

Use commentAnchors.tags.anchors to configure the anchor tags. Below is a list of properties each tag can have.

  • scope (required) - The scope of a tag. Specifying "file" will only make these visible in the 'File Anchors' list, while "hidden" completely hides it from the anchor list
  • highlightColor - The color used for highlighting the tag
  • backgroundColor - The color used as tag background
  • iconColor - An optional color to apply to the icon, or "auto" for automatic theme detection. Defaults to using highlightColor
  • styleMode - Customize what part of the comment is highlighted
  • borderStyle - Style to be applied to the tag border (See https://www.w3schools.com/cssref/pr_border.asp)
  • borderRadius - The curvature radius of the border (Requires borderStyle)
  • ruler - Overwrite the global setting when false
  • textDecorationStyle - Style to be applied to the tag text-decoration (See https://www.w3schools.com/cssref/pr_text_text-decoration.php)
  • isBold - Whether to apply bold formatting to the tag
  • isItalic - Whether to apply italicized formatting to the tag
  • behavior - Either "link" for link tags, "region" for region tags, or "anchor" for regular tags
  • enabled - Allows the disabling of default (and custom) tags
"commentAnchors.tags.anchors": {
	"ANCHOR": {
		"scope": "file",
		"iconColor": "default",
		"highlightColor": "#A8C023",
		"styleMode": "comment"
	},
	...
}

You can use the enabled property to disable one or more default tags like so:

"commentAnchors.tags.anchors": {
	"ANCHOR": {
		"enabled": false
	},
	...
}

If you would like for tags to only provide highlighting without rendering in the anchor sidebar, set the scope property to hidden:

"commentAnchors.tags.anchors": {
	"NOTE": {
		"scope": "hidden"
	},
	...
}

Icon colors

At startup, anchor icons are generated for all colors specified on your tags. The icon color defaults to using the tags highlightColor, however a custom color may be specified with iconColor. Setting iconColor to auto will allow VSCode to pick an icon based on your currentl theme (black or white).

Besides specifying a custom hex color, the following names may be used as shortcuts.

Color Hex
blue #3ea8ff
blurple #7d5afc
red #F44336
purple #BA68C8
teal #00cec9
orange #ffa100
green #64DD17
pink #e84393
emerald #2ecc71
yellow #f4d13d

Issues

Found a problem or missing feature in Comment Anchors? Issues and suggestions can be submitted in the GitHub repository here

If you prefer more direct help, you can join the Starlane Studios Discord where you can find most developers of this extension.

Poor performance?

Comment Anchor scans your entire workspace for tags. This can cause bad performance when your workspace contains many files, such as dependency directories and logfiles. It is therefore advised to alter the matchFiles and excludeFiles settings to limit the amount of directories and files scanned.

If you'd rather disable workspace anchors all together, you can disable these in the settings.

Contribution

You can contribute to comment-anchors by forking the GitHub repository and submitting pull requests.

Are you enjoying Comment Anchors?

Feel free to leave us a tip to support our development!

Paypal: https://paypal.me/ExodiusStudios

Thanks for using Comment Anchors! โค๏ธ

vscode-comment-anchors's People

Contributors

alanorozco avatar dependabot[bot] avatar devel0 avatar dolsem avatar eggachecat avatar eritbh avatar gorvgoyl avatar jackson-bean avatar jordandi123 avatar kiliankilmister avatar macjuul avatar mikie avatar netizen-ais avatar pit00 avatar zodsmar 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

vscode-comment-anchors's Issues

[Feature request] Total number of anchors

This extension is very helpful, but the problem is that when you come back after a long time to a project and forget everything about the project, even if you have added any comment anchor or not.

In that case, it would be helpful to see a notification number, that how many total number of comment anchor we have.

image

The icon's color become the former icon's color

After setting some configuration for the CommentAnchor extension, the icon's color becomes the former icon's color.

You can find the snapshot as the following URL: https://imgur.com/XrBpoiR

My setting is as follows:

 "commentAnchors.tags.list": [{
        "tag": "ANCHOR",
        "iconColor": "default",
        "highlightColor": "#A8C023",
        "scope": "file",
        "styleComment": true,
        "borderStyle": "1px solid #A8C023",
        "borderRadius": 5
        // "backgroundColor": "#49511d"
    },
    {
        "tag": "TODO",
        "iconColor": "blue",
        "highlightColor": "#3ea8ff",
        "scope": "workspace",
        "styleComment": true,
        "borderStyle": "1px solid #23b2ea",
        "borderRadius": 5
    },
    {
        "tag": "FIXME",
        "iconColor": "red",
        "highlightColor": "#F44336",
        "scope": "workspace",
        "styleComment": true,
        "borderStyle": "1px solid #F44336",
        "borderRadius": 5
    },
    {
        "tag": "STUB",
        "iconColor": "purple",
        "highlightColor": "#BA68C8",
        "scope": "file",
        "styleComment": true,
        "borderStyle": "1px solid #BA68C8",
        "borderRadius": 5
    },
    {
        "tag": "NOTE",
        "iconColor": "orange",
        "highlightColor": "#FFB300",
        "scope": "file",
        "styleComment": true,
        "borderStyle": "1px solid #FFB300",
        "borderRadius": 5
    },
    {
        "tag": "REVIEW",
        "iconColor": "green",
        "highlightColor": "#64DD17",
        "scope": "workspace",
        "styleComment": true,
        "borderStyle": "1px solid #64DD17",
        "borderRadius": 5
    },
    {
        "tag": "SECTION",
        "iconColor": "blurple",
        "highlightColor": "#896afc",
        "scope": "workspace",
        "isRegion": true,
        "styleComment": true,
        "borderStyle": "1px solid #896afc",
        "borderRadius": 5
    },
    {
        "tag": "TEST",
        "iconColor": "yellow",
        "highlightColor": "#f4d13d",
        "scope": "workspace",
        "isRegion": true,
        "styleComment": true,
        "borderStyle": "1px solid #f4d13d",
        "borderRadius": 5
    },
    {
        "tag": "PINK",
        "iconColor": "pink",
        "highlightColor": "#e84393",
        "scope": "workspace",
        "isRegion": true,
        "styleComment": true,
        "borderStyle": "1px solid #e84393",
        "borderRadius": 5
    },
    {
        "tag": "EMERALD",
        "iconColor": "emerald",
        "highlightColor": "#2ecc71",
        "scope": "workspace",
        "isRegion": true,
        "styleComment": true,
        "borderStyle": "1px solid #2ecc71",
        "borderRadius": 5
    },
    {
        "tag": "TEAL",
        "iconColor": "teal",
        "highlightColor": "#00cec9",
        "scope": "workspace",
        "isRegion": true,
        "styleComment": true,
        "borderStyle": "1px solid #00cec9",
        "borderRadius": 5
    }
]

How to normally display the icon's color as the succeeding anchor's color?

Suggestion: Match upper and lowercase

Hello,

When working with other people, sometimes your coworkers write todos and note comments but the keyword is in lowercase.

If the performance hit for checking both upper and lowercase is not too big, it would be very nice that the TODO: key can be matched with todo: as well.

Ideally, this could be done without adding the lowercase key to the settings, or we could end with a VERY large array of settings in our file if we want to add another key.

Maybe make the commentAnchors.tags.list setting additive instead of replacing the default keys

Allow disabling some of the tags

I may use the words "note" and "section" in a writing, and so wouldn't want them to be considered "tags". Simply removing them from the tag list doesn't seem to do anything:

    "commentAnchors.tags.list": [
        {
            "tag": "ANCHOR",
            "iconColor": "default",
            "highlightColor": "#A8C023",
            "scope": "file"
        },
        {
            "tag": "TODO",
            "iconColor": "blue",
            "highlightColor": "#3ea8ff",
            "scope": "workspace"
        },
        {
            "tag": "FIXME",
            "iconColor": "red",
            "highlightColor": "#F44336",
            "scope": "workspace"
        },
        {
            "tag": "STUB",
            "iconColor": "purple",
            "highlightColor": "#BA68C8",
            "scope": "file"
        }
    ]

Disable Sidebar Auto-Folding

I am using comment anchors with nested regions and it works quite fine.
But every time I make changes to a file, the anchor sidebar automatically folds ALL Sub-Sections and only the Sections at the very top are shown which can be really stressful for bigger projects.
So for example my structure looks like this in the sidebar:

โˆจ Top-Section 1
โˆจ Sub-Section 1.1
Sub-Section 1.2
โˆจ Top-Section 2
โˆจ Sub-Section 2.1
Sub-Section 2.2

No I change a line in the respective file, and I automatically get this in the sidebar:

โ‰ป Top-Section 1
โ‰ป Top-Section 2

I didn't even hit 'Save'. It just folds all Sub-Sections and I have to manually re-open them.
Any chance, this behavior can be improved in future releases? A big improvement for example would be to have a 'fold/unfold all anchors' option in the comment anchors sidebar.

[Feature Request] Customizable end Tag

Instead of using ! + TAGNAME, add endTag for user customization. For example,

{
    "tag": "{{{",
    "endTag": "}}}",
    "isRegion": true
}

This is similar to Vim foldmarker

'foldmarker' 'fmr'	string (default: "{{{,}}}")
			local to window
			{not in Vi}
			{not available when compiled without the |+folding|
			feature}
	The start and end marker used when 'foldmethod' is "marker".  There
	must be one comma, which separates the start and end marker.  The
	marker is a literal string (a regular expression would be too slow).
	See |fold-marker|.

option to not show on scrollbar

Allow to disable show-on-scrollbar, which clutters the UI and you're not sure if it's a lint error, git change, or an anchor.

image

[Feature request] Add options for hiding tag text and line number ,and customizable font size for side bar

image

Thank you for your great extension. I really like the anchor side bar. But I prefer a small size one and after I resized it to smaller, useful information will be hided. I think the TODO text in this case is not necessary since the color has already indicate its category. The line number is also unnecessary for me since I use the side bar by clicking on an item. So I think these styles should be customizable for users with different needs.

Besides, if the font size for side bar can be smaller or customizable, the side bar can show more information.

Thank you!

Cannot fold code in Vue file

if i enable this extension, i cant fold any function or HTML tags by using default folding button which is provided by VScode. The button is disappeared.
it looks like a same bug as issue #13, but this time, it happens in Vue file.

Bug: custom tag shows double ahcnor icon in gutter

steps

  • in config: ensure gutter icons are shown
  • in config: add a custom tag, e.g. "TEST"
  • in code: add a comment anchor, e.g. //TEST test this new stuff

results

  • anchor is shown on a line (OK)
  • same anchor also shown on the line below it (BUG)

Note that the bug occurs only when there is no space at the end of the comment, so:

  • ok: "//TEST test this new stuff " <--- note the trailing space
  • bug: "//TEST test this new stuff"

Scroll background

Please can you make this colors optional because I cannot see the any other colors, eslint errors, warnings and other stuff because of it.
image
Actually I can't find this is settings so I believe it's not configurable. So I'd like to see it configurable :)

Thank you in advance!

Default exclusion glob pattern

Hi,

Sadly, the default exclusion glob pattern doesn't mention the "node_modules" directory. This caused VS Code to be terribly slow. I checked everything and spent more than an hour to figure out the problem was caused by the extension. Since, in the new versions, the extension looks for anchors throughout the workspace, and sadly, the default file exclusion glob pattern doesn't take "node_modules" directory into account, it had no choice but checking all modules. I fixed this, by updating my exclusion glob pattern like this:
{node_modules,.git,.idea}/**/*

Please update the defaults to save others' time.

Feature request: group anchors of same type in sidebar

This is not related to "hierarchical anchors" feature.

The sidebar groups anchors by source file. Each source file show all the anchors within.

It is more useful (in my workflow) to show all anchors of a certain type. For example, it is more interesting for me to see all "TODO" tasks together, regardless of which files they come from. I also added an "UNTESTED" custom anchor, and I'd like to see them grouped together, etc.

This could be an option, to maintain backwards compatibility.

Padding support for anchors with background colors

I love the ability to add backgrounds to the anchors. It makes comments stand out so much better.

I don't like, however, that depending on the font you are using in your VS Code theme, there is no space between the beginning of the anchor background and the first letter. This also applies to the end of the anchor as well.

I tried adding a space to the front of my anchors, but this disabled the ability to close off section anchors (Ex: !Section).

A padding attribute would be an awesome edition. Just Padding-Left and Padding-Right would be perfect.

image

Keep up the awesome work. I absolutely love this plugin!

Cannot set breakpoints on lines with anchor

Cannot set breakpoints on lines with anchor. Breakpoint area is not clickable if an anchor is present in the line. I can set the breakpoint by a shortcut but that breakpoint is not showing up on the left side.

screen shot 2018-10-02 at 9 56 48 pm

Suggestion: Match including ':'

Hello,

I would like to propose an improvement to your awesome extension.
With the inclusion of the new section anchor, I find there is a problem that I'm having again the same issue as with the todo anchor.

Section is a fairly common word, as well as todo (in spanish), and teams use it in comments without the intention to add an anchor, for example:

* Hay que eliminar todo esto y rehacerlo de nuevo. (spanish)
* This section needs a refactoring

What I propose here would be adding the colon symbol to the anchor matchmaking by default, so only todo:, section:, todo : or section : are matched as anchors.

Thanks

isWholeLine

Hello!

You mentioned that you released an update that had this feature in the other issue, but I don't see the option anywhere. Am I just blind?

Feature request: I want Tag name shows on/off option.

image

FILE ANCHORS nav bar shows tag name.
And I want to recognize what the comment means on nav bar.
But I was used to small width nav bar. So, there are only to showing tag name.
If you make option with tag name on/off, I will recognize comment on short width nav bar.

Add paths to exclude config option

The exclude config option "commentAnchors.workspace.excludeFiles" has this default:

"**/{node_modules,.git,.idea,target,out,build,vendor}/**/*"

I tried to add .gitignore file:

"**/{node_modules,.git,.idea,target,out,build,vendor}/**/*, .gitignore"

But that doesn't work - it just scans forever.

Hex color for icons?

Right now icon colors are "orange" and "purple", but highlight colors are hex colors. Can we do hex for both for consistency and flexibility?

Anchor Regions (Hierarchical anchors)

Allow hierarchical anchor structures by defining anchor regions.

Thoughts:

  • "Region anchors" would act nearly identical to regular anchors, however they will require an end tag
  • Would act like a collapsible list in the sidebar
  • Defined like any other anchor, except they will use an additional boolean property
    • The presence of this property would require another property to define the "end tag"

(Inspired by VS Marketplace Review by Post Bologny)

Only highlights if there is a character after anchor

The extension seems to only highlight when you have a non-whitespace character after the tag:
image

It also highlights when the tag isn't part of a comment, but I'm not sure if there's an easy way to fix that so I just set matchCase to true.

Edit: It seems to have to be a number, letter, or underscore:
image

navigation shortcuts

When in editor, can we have navigation shortcuts like alt+up and alt+down?

Further, here is some inspiration, in case you want to become the coolest guy in town :-)

Codebrowser (use v. 4.9, later versions dont support relative indentation)

One can navigate into Sections using alt+right/left!

[Feature Request] Disable Intellisense suggestions

Hello! Before anything, I'd like to commend how well done and useful this extension is, especially in huge files or big chunks of code.

I've noticed, however, a small annoyance while using Anchors, and that is how IntelliSense suggestions are executed. There's no setting to turn them off, and at least in my usage (mostly go, dart, python & js) any uppercase letter which starts an Anchor (e.g. "R") goes all way to the top in the suggestions list.

Still, I recognize this issue only matters when you're not too lazy to press a single Down on the keyboard. So take your own time to implement this (and possibly there might be a way within vscode to address the order of words that appear inside the IntelliSense).

Not working with hangul(korean language)

When i use thie with hangul(korean language) highlight is disabled.

For example,

// ANCHOR This is a anchor -> highlight is enabled
// ANCHOR This is a anchor ์ด๊ฒƒ์€ ์•ต์ปค์ž…๋‹ˆ๋‹ค. -> highlight is enabled but just displayed english text in sidebar.
// ANCHOR ์ด๊ฒƒ์€ ์•ต์ปค์ž…๋‹ˆ๋‹ค. -> highlight is disabled.

please check this one.

Unfold when scrolling to anchor

When clicking an anchor in the sidebar to scroll to it, I think the editor should unfold the section and scroll to the anchor.

Here's the current behavior:
fold

[Feature request] Seperate section for folder

We have a section for file and workspace anchors.

code_2019-01-29_22-39-17

But having a folder anchor will help too, where we can get the list of all the anchors from the active root folder.

In the current scenario, showing all the folders in the workspace section is kinda confusing.

Cannot Configire Anchor Tags

I edited my settings.json file to alter the SECTION tag's scope to just the file.

"commentAnchors.tags": [
        {
            "tag": "SECTION",
            "scope": "file",
        }
    ]

Now the SECTION anchor has lost all styling, though still appears in the Workspace Anchors search.
Changing the JSON in an attempt to restore lost styling affects nothing.

"commentAnchors.tags": [
        {
            "tag": "SECTION",
            "scope": "file",
            "iconColor": "red",
            "highlightColor": "#A8C023",
            "styleComment": true,
            "isItalic": true,
            "isBold": true,
            "enabled": true,
        }
    ]

Vscode craches when file scanning takes more then 10s

Sinds the latest vscode update (v1.28.0) a extension needs to response within 10s otherwise vscode will assume the extension is somewhat dead and will give a popup extension host terminated unexpectedly for some reason this disables all other extensions and stops a lot of other editor functions.

For a more detailed issue look at this issue: microsoft/vscode#60465

CPU and RAM usage through the roof

I just uninstalled this extension because it was causing a lot of issues. Today (this did not happen before today, and I had the extension installed for at least a full month), out if nowhere vscode was using 80-90% CPU usage and 4-5 GB of RAM.

After some plugin disabling and troubleshooting, it turns out that its Comment Anchors that was causing this. If the plugin was disabled, vscode behaves normally, if it was enabled, BAM cpu and ram are through the roof.

Relevant specs: 16 GB Ram - i7 6700K 4.6GHz (4 cores - 8 threads)

[ Feature Request ] How can I set break point?

Hi !
I'm sorry that my English is not good.

Now, I'm using comment anchors.
I can't set break point when I want to debug.
When I click the left of the number of line, there's no check of break point.
There's already anchor simbol , so I can't click and set break point.

Is it possible to set break point??

Background highlighting

Could you please add the ability to highlight label backgrounds? With highlighted backgrounds, label are easier to catch.

[Feature Request] Sidebar Folding and Searchable Anchors in Show All Commands Menu

Hi,

First of all thanks for providing such a great extension. it helps a lot in navigation inside large code.

I have some feature request and also have suggestion to improve an existing one.

1- please add an option\command in Show All Commands menu for parsing file on -demand, a feature which parse file current file only when user want it, after parsing it will show a menu containing all anchors in current files (same as, as extension is now showing in sidebar), so user can navigate through anchors quickly by using built-in search as you type feature. like Bookmarks extension which show bookmarks list when user triggered it by command.

2- please add options in settings which make sidebar anchors optional (for less system resources usage), and also an option with that user can disable auto-parsing of file (file parsing will be triggered by command), these two features are to be used along with above feature number 1.

3- I my opinion region anchors feature needs improvement.

For example I've made structure for my code (specially to use with comment anchors) like this.

  • Division (Region Level 1)
    --- Section (Region Level 2)
    ------- Sub Section (Region Level 3)
    ----------- Feature x
    ----------- Feature y
    ----------- Feature z
    ----------- Function x
    ----------- Function y
    ----------- Function z

when I am using current region feature of extension (as it has not have region level system currently)
it is putting a Division inside another Division in sidebar. (when parsing from file start to end).
So something like this will look awesome. in SIDEBAR (hyphens denoted level of folding):

-Division 1
--- Section 1
------- Sub Section 1
----------- Feature x
----------- Feature y
----------- Feature z
------- Sub Section 2
----------- Feature x
----------- Feature y
----------- Feature z
------- Sub Section 3
----------- Feature x
----------- Feature y
----------- Feature z
--- Section 2
------- Sub Section 1
----------- Feature x
----------- Feature y
----------- Feature z
------- Sub Section 2
----------- Feature x
----------- Feature y
----------- Feature z
------- Sub Section 3
----------- Feature x
----------- Feature y
----------- Feature z
--- Section 3
------- Sub Section 1
----------- Feature x
----------- Feature y
----------- Feature z
------- Sub Section 2
----------- Feature x
----------- Feature y
----------- Feature z
------- Sub Section 3
----------- Feature x
----------- Feature y
----------- Feature z

Same for next division found during file parsing like:

-Division 2
--- Section 1
------- Sub Section 1
----------- Feature x
----------- Feature y
----------- Feature z
------- Sub Section 2
----------- Feature x
----------- Feature y
----------- Feature z
------- Sub Section 3
----------- Feature x
----------- Feature y
----------- Feature z
--- Section 2
------- Sub Section 1
----------- Feature x
----------- Feature y
----------- Feature z
------- Sub Section 2
----------- Feature x
----------- Feature y
----------- Feature z
------- Sub Section 3
----------- Feature x
----------- Feature y
----------- Feature z
--- Section 3
------- Sub Section 1
----------- Feature x
----------- Feature y
----------- Feature z
------- Sub Section 2
----------- Feature x
----------- Feature y
----------- Feature z
------- Sub Section 3
----------- Feature x
----------- Feature y
----------- Feature z

I my opinion this can be done by dividing of IsRegion setting to levels, like IsRegionLvl1, IsRegionLvl2, IsRegionLvl3 and so on. I my case I need only three levels but depending on size of files requirement can go upto five levels.

Advance thanks for your response regarding to above.

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.