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

Feature Request: Navigate to task reference online documentation #430

Open
hymccord opened this issue Nov 19, 2021 · 3 comments
Open

Feature Request: Navigate to task reference online documentation #430

hymccord opened this issue Nov 19, 2021 · 3 comments
Labels
Area: VsCodeExtension more-than-validation New features above and beyond simple YAML validation

Comments

@hymccord
Copy link

hymccord commented Nov 19, 2021

This feature request comes from here: https://stackoverflow.com/questions/70038332/how-can-i-ctrlclick-goto-defintion-of-a-yml-azure-devops-pipeline-task

I have a Azure Devops .yml pipeline with some tasks

- stage: firstStage
  jobs:
  - job: doThing
    steps:
    - task: AzurePowerShell@5    # <--- how to ctrl_click and see docs at 
                                 # https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-powershell?view=azure-devops
      inputs:
        ScriptPath: 'path/script.ps1'
        pwsh: true
    - task: AzureCli@2         #<------ how to ctrl-click and see docs at
                               # https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-cli?view=azure-devops
      inputs:
        ScriptPath: 'scriptAzCli.ps1'
        scriptType: 'pscore'

Everytime i need to check the inputs and keyword definitions, I have to open up a new browser tab and navigate to the documentation. Is there a way to simply ctrl+click and 'goto' the definition of the task like in a regular programming language?

Would there be any way to update the service schema to include the documentation url and the language server to then support a goto definition for the tasks?

@winstliu winstliu added the more-than-validation New features above and beyond simple YAML validation label Nov 19, 2021
@winstliu
Copy link
Member

winstliu commented Nov 19, 2021

Hmm...this is most likely out of scope because I'd prefer that we don't modify the service schema after ingesting it, but I'll take a look anyway and see if there's a trivial mapping we can perform.

@hymccord
Copy link
Author

Appreciate it.

For curiosity's sake, how is the schema generated? I originally found it by looking at the azure-pipelines lang server and seeing that it pulls the schema from http://schemastore.org/api/json/catalog.json which lead me to this repo naturally.

@winstliu
Copy link
Member

and seeing that it pulls the schema from http://schemastore.org/api/json/catalog.json which lead me to this repo naturally.

This isn't correct, what you're likely seeing is the generic "find the schema" code that we got when we forked Red Hat's YAML language server.
For Azure Pipelines specifically, the schema is found using an API endpoint: https://github.com/microsoft/azure-pipelines-vscode#specific-schema. For releases, we copy the schema from an organization with no custom pipeline tasks installed, then update the root service-schema.json.

As for how that endpoint generates the schema, it's a complete black box to me that I would love to know more about because half the issues we get are incorrect schema generation 😓.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: VsCodeExtension more-than-validation New features above and beyond simple YAML validation
Projects
None yet
Development

No branches or pull requests

3 participants