How to use the yaml-language-server/out/server/src/languageservice/services/documentSymbols.YAMLDocumentSymbols function in yaml-language-server

To help you get started, we’ve selected a few yaml-language-server examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github keesschollaart81 / vscode-home-assistant / src / server / yamlLanguageServiceWrapper.ts View on Github external
constructor(completionContributions: JSONWorkerContribution[]) {
        this.jsonSchemaService = new JSONSchemaService(null, {
            resolveRelativePath: (relativePath: string, resource: string) => {
                return path.resolve(resource, relativePath);
            }
        }, null);


        this.yamlValidation = new YAMLValidation(this.jsonSchemaService);
        this.yamlValidation.configure({ validate: true });
        this.yamlDocumentSymbols = new YAMLDocumentSymbols();
        this.yamlCompletion = new YAMLCompletion(this.jsonSchemaService, completionContributions);
        // enables auto completion suggestions for tags like !include ()
        // commeted because they end up at the top of the list which does not look nice :-)
        // this.yamlCompletion.configure(null, this.getValidYamlTags()); 
        this.yamlHover = new YAMLHover(this.jsonSchemaService);
        this.yamlFormatter = new YAMLFormatter();
    }