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

Description not returned on hover when using yaml anchors #737

Closed
1 task done
balki opened this issue Jun 22, 2022 · 0 comments · Fixed by #743
Closed
1 task done

Description not returned on hover when using yaml anchors #737

balki opened this issue Jun 22, 2022 · 0 comments · Fixed by #743
Assignees
Milestone

Comments

@balki
Copy link

balki commented Jun 22, 2022

Describe the bug

When hovering over foo's place, description appears but not on bar's place

Input yaml

title: meetup
refs:
  place: &default_place NYC
users:
  - name: foo
    place: SFC
  - name: bar
    place: *default_place

# yaml-language-server: $schema=./schema.yaml

Schema

$schema: http://json-schema.org/draft/2020-12/schema
additionalProperties: false
properties:
    title:
        description: Title of this file
        type: string
    refs:
        type: object
    users:
        type: array
        items:
          type: object
          properties:
            name:
              type: string
              description: Name of the user
            place:
              type: string
              description: Place of residence

Language server stdin

{"method":"textDocument/hover","jsonrpc":"2.0","id":2,"params":{"textDocument":{"uri":"file:///path/to/input.yaml"},"position":{"character":4,"line":5}}}Content-Length: 197

{"method":"textDocument/hover","jsonrpc":"2.0","id":3,"params":{"textDocument":{"uri":"file:///path/to/input.yaml"},"position":{"character":4,"line":7}}}Content-Length: 44

Language server stdout

{"jsonrpc":"2.0","id":2,"result":{"contents":{"kind":"markdown","value":"Place of residence\n\nSource: [schema.yaml](file:///path/to/schema.yaml)"},"range":{"start":{"line":5,"character":4},"end":{"line":5,"character":9}}}}Content-Length: 151

{"jsonrpc":"2.0","id":3,"result":{"contents":{"kind":"markdown","value":""},"range":{"start":{"line":7,"character":4},"end":{"line":7,"character":9}}}}Content-Length: 38

Expected Behavior

Return description value

Current Behavior

Returns empty string

Steps to Reproduce

  1. Hover over the property which has a yaml anchor as value

Environment

  • Linux
@msivasubramaniaan msivasubramaniaan self-assigned this Jun 29, 2022
@msivasubramaniaan msivasubramaniaan linked a pull request Jun 30, 2022 that will close this issue
@msivasubramaniaan msivasubramaniaan added this to the 1.9.0 milestone Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants