0

This is the inverse of How to manually set language for syntax highlighting in Visual Studio Code

Basically what I'd want is something similar in VI where it will detect some string that would specify the format of a file specifically for Azure Pipelines

# --language-mode: azure-pipelines

Or something similar.

Archimedes Trajano
  • 35,625
  • 19
  • 175
  • 265

1 Answers1

0

you can write an extension that uses vscode.languages.setTextDocumentLanguage like the extension Change Language Mode.

Add a hook for document change and open and analyse the content and search for a particular string and set the mode if it is different.

Configure the strings to search for and the language id to set in the settings

rioV8
  • 24,506
  • 3
  • 32
  • 49