Skip to content
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

CodeLens range not following LSP-spec #1904

Closed
3 tasks done
fflaten opened this issue Aug 21, 2022 · 2 comments
Closed
3 tasks done

CodeLens range not following LSP-spec #1904

fflaten opened this issue Aug 21, 2022 · 2 comments
Assignees
Labels

Comments

@fflaten
Copy link
Contributor

fflaten commented Aug 21, 2022

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Steps to reproduce

Debug extension or see LSP log while it's looking up code lenses for a function definition, Pester block etc.

Expected behavior

interface CodeLens {
	/**
	 * The range in which this code lens is valid. Should only span a single
	 * line.
	 */
	range: Range;
...

Source: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_codeLens

Actual behavior

Range is for full definition, spanning multiple lines.

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.2.5
PSEdition                      Core
GitCommitId                    7.2.5
OS                             Linux 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Version

2022.8.3 preview

Visuals

image

@ghost ghost added the Needs: Triage Maintainer attention needed! label Aug 21, 2022
@fflaten fflaten changed the title CodeLens range not following to LSP-spec CodeLens range not following LSP-spec Aug 21, 2022
@fflaten
Copy link
Contributor Author

fflaten commented Aug 21, 2022

Code lens should also follow the symbol name. This will be changed in #1886

Currently it's placed above extent start (function keyword), but should follow symbol name in case function-keyword is followed by a linebreak.

Now:
image

Suggestion:
image

Like C#:
image

@andyleejordan
Copy link
Member

I think fixed by #1984

@andyleejordan andyleejordan self-assigned this Feb 2, 2023
@PowerShell PowerShell deleted a comment Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants