Vscode-powershell: Add CodeLens support for PowerShell function references

Created on 16 Feb 2017  路  8Comments  路  Source: PowerShell/vscode-powershell

It would be really handy if there were some CodeLens capabilities added into the vscode-powershell extension, like the number of references for a function\cmdlet, class and its methods from current and all other scripts within the project folder.

Issue-Enhancement

Most helpful comment

CodeLens is more than just "find references" you can add arbitrary markers which launch arbitrary actions on any line of code. I'm curious to see what people will use it for when I add it to the $psEditor API.

All 8 comments

Yep, we'll be getting to that soon.

Of course, until the extension works across a scripts in a workspace, code lens support won't be super useful.

CodeLens is more than just "find references" you can add arbitrary markers which launch arbitrary actions on any line of code. I'm curious to see what people will use it for when I add it to the $psEditor API.

I love the function reference capability in ISESteroids, so this would be a win in VSCode assuming we can get all references in a project. Sounds like that could be a ways off.

@daviwil Could you use the markers for something like "to-do" comments? Any chance these could also be used to fold region comments?

We're trying to get cross-module find references going within the next month or two, Codelens support will line up with that.

What would you expect to see for todo comments? We don't have any control over region folding unfortunately.

@mattmcnabb RE region-based code-folding see https://github.com/Microsoft/vscode/issues/3422#issuecomment-189576426 and vote it up.

@daviwil Just thinking out loud. For instance, in WIP projects we could add to-do comments to sections and then could "goto" those areas.

@rkeithhill I'm aware of that particular issue. I was just thinking we could use the above "arbitrary actions" to fold content between region comments.

@mattmcnabb
I have a Regex to match any tokens of [TokenKind]::Comment that look like todo. This returns the Extent for Todo items. I have only used this for reporting. It could be run as a task with a ProblemMatcher entry for the output to generate a clickable list.

I am looking at two VSCode extensions wayou.vscode-todo-highlight and MattiasPernhult.vscode-todo

The highlight extension needed a few tweaks to settings.json to ID my preferred case of Todo as the default is TODO.

The vscode-todo extension makes the todo list accessible via the Command Pallet.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GQnzo picture GQnzo  路  3Comments

borisimple picture borisimple  路  3Comments

pcgeek86 picture pcgeek86  路  4Comments

guidooliveira picture guidooliveira  路  3Comments

rkeithhill picture rkeithhill  路  3Comments