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

display extra gitlens in vue file with vetur #50

Closed
beeplin opened this issue Mar 13, 2017 · 11 comments
Closed

display extra gitlens in vue file with vetur #50

beeplin opened this issue Mar 13, 2017 · 11 comments
Assignees
Labels
needs-more-info Needs further information, steps, details, etc. question

Comments

@beeplin
Copy link

beeplin commented Mar 13, 2017

When working together with vetur (vscode's officially recommended vue plugin) vuejs/vetur#87, .vue files <style> part has extra gitlens displays:

image

If using other vue support plugins such asvue or vue-component there is no this issue. Simply renaming .vue file to .html file doesn't show the extra gitlens either. This happens only with vetur.

@eamodio
Copy link
Member

eamodio commented Mar 15, 2017

@beeplin this is by design -- GitLens uses the symbol information provided by vscode to add its CodeLens (and extensions can extend/provide this symbol information). So the Vue extension must be providing a symbol for those classes.

You can control the behavior of the CodeLens via a few GitLens configuration settings (you can find the documentation for each setting here: https://github.com/eamodio/vscode-gitlens#extension-settings):

gitlens.codeLens.location
gitlens.codeLens.locationCustomSymbols
gitlens.codeLens.languageLocations

If you have any of the above set, please let me know how you have them configured.

Also if you upgrade to v2.12.1, you can also set "gitlens.advanced.codeLens.debug" = true which will add debug information into the CodeLens themselves (symbol name, line range, etc). If you turn that on, and send a screenshot I can help you configure your settings appropriately.

@eamodio eamodio added the needs-more-info Needs further information, steps, details, etc. label Mar 15, 2017
@eamodio eamodio self-assigned this Mar 15, 2017
@beeplin
Copy link
Author

beeplin commented Mar 15, 2017

thanks. I will feedback to the author of vetur.

@beeplin beeplin closed this as completed Mar 15, 2017
@octref
Copy link

octref commented Mar 15, 2017

Hey I'm working on vetur.

VSCode added symbols for html/css in Feb release:

https://code.visualstudio.com/updates/v1_10#_html

image

If this breaks for vetur, it must be breaking for html too.

@beeplin Would you mind setting gitlens.codeLens.locationCustomSymbols? Seems this would fix the problem as @eamodio suggested.

@eamodio
Copy link
Member

eamodio commented Mar 15, 2017

@octref sorry -- I definitely wasn't suggesting anything was wrong in vetur -- nor do I consider this something "broken" in GitLens. GitLens allows you to configure the CodeLens how ever you want given enough provided symbols from vscode/extensions.

But since css in html now add a symbol of class (which I consider to be a container type symbol) it will render with CodeLens by default (since the default is to render CodeLens at the document and "container" level). I've already added specific default overrides for json, css, scss, less to only render at the document level. I probably should just add html and vue to that.

@octref what is the language type for vue?

@octref
Copy link

octref commented Mar 15, 2017

No worries! Thanks for fast response.

The whole document is language type vue. Each embedded region has embedded language type such as vue-html, css, scss, less, javascript, etc.

lang

@eamodio
Copy link
Member

eamodio commented Mar 15, 2017

@beeplin can you try the following setting:

"gitlens.codeLens.languageLocations": [
                        {
                            "language": "html",
                            "location": "document"
                        },
                        {
                            "language": "vue",
                            "location": "document"
                        },
                        {
                            "language": "json",
                            "location": "document"
                        },
                        {
                            "language": "css",
                            "location": "document"
                        },
                        {
                            "language": "scss",
                            "location": "document"
                        },
                        {
                            "language": "less",
                            "location": "document"
                        }
                    ];

And let me know if that resolves the issue for you? If so, then I will add those into the defaults for the next release.

@eamodio eamodio reopened this Mar 15, 2017
@beeplin
Copy link
Author

beeplin commented Mar 15, 2017

@eamodio thanks for the quick response! Yes, this setting resolve my issue perfectly.

@eamodio
Copy link
Member

eamodio commented Mar 15, 2017

@beeplin great -- look for that to be in the defaults of the next release and you'll be able to remove those explicit settings

@eamodio
Copy link
Member

eamodio commented Mar 15, 2017

@beeplin it's now in 2.12.2

@octref
Copy link

octref commented Mar 15, 2017

Thanks a lot. gitlens looks pretty useful. I'll give it a try this weekend.

billsedison added a commit to noside911/vscode-gitlens that referenced this issue Jan 4, 2019
@github-actions
Copy link

github-actions bot commented Dec 9, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-more-info Needs further information, steps, details, etc. question
Projects
None yet
Development

No branches or pull requests

3 participants