Skip to content

Add CodeLens support for PowerShell function references #507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Glober777 opened this issue Feb 16, 2017 · 8 comments
Closed

Add CodeLens support for PowerShell function references #507

Glober777 opened this issue Feb 16, 2017 · 8 comments
Labels
Issue-Enhancement A feature request (enhancement).
Milestone

Comments

@Glober777
Copy link

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.

@daviwil
Copy link
Contributor

daviwil commented Feb 16, 2017

Yep, we'll be getting to that soon.

@daviwil daviwil added the Issue-Enhancement A feature request (enhancement). label Feb 16, 2017
@daviwil daviwil added this to the 0.11.0 milestone Feb 16, 2017
@rkeithhill
Copy link
Contributor

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

@daviwil
Copy link
Contributor

daviwil commented Feb 21, 2017

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.

@mattmcnabb
Copy link
Contributor

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?

@daviwil
Copy link
Contributor

daviwil commented Feb 27, 2017

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.

@rkeithhill
Copy link
Contributor

rkeithhill commented Feb 27, 2017

@mattmcnabb RE region-based code-folding see microsoft/vscode#3422 (comment) and vote it up.

@mattmcnabb
Copy link
Contributor

@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.

@daviwil daviwil modified the milestones: 0.11.0, 0.12.0 Mar 22, 2017
@jmiller76
Copy link

@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.

@daviwil daviwil modified the milestones: 0.12.0, Next Feature Update Apr 4, 2017
@daviwil daviwil modified the milestones: April 2017, May 2017 May 8, 2017
@daviwil daviwil modified the milestones: May 2017, June 2017 Jun 1, 2017
@daviwil daviwil modified the milestones: 1.3.0, June 2017 Jun 8, 2017
@daviwil daviwil changed the title CodeLense support for PowerShell code CodeLens support for PowerShell function references Jun 8, 2017
@daviwil daviwil changed the title CodeLens support for PowerShell function references Add CodeLens support for PowerShell function references Jun 8, 2017
daviwil added a commit to daviwil/vscode-powershell that referenced this issue Jun 8, 2017
This change adds support for CodeLenses that display the number of
references of a given function or cmdlet defined in a script file.  The
actual implementation of this behavior is on the server side but we had
to write a LanguageClient middleware to translate the arguments of the
references command when it was sent from the server.

Resolves PowerShell#507
Resolves PowerShell#827 (unrelated to CodeLenses but related to LanguageClient
output)
@daviwil daviwil closed this as completed in 0590230 Jun 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

No branches or pull requests

5 participants