Open vorburger opened 11 months ago
I also encounter the same issue using Neovim. It seems like this is a regression. Multidoc used to work as far as I remember.
this previously resolved issue might be related: #16 ( Multiple YAML documents in single file features work for first section but not the rest ) and there is also this currently open issue #869 ( intellisense completion breaks with multiple documents in a single file )
Is this problem only occurring when using the # yaml-language-server
inline directive to specify the schema? I think that's intended behavior in that it only applies to the YAML document (not the entire file) it's a part of. If you copy # yaml-language-server: $schema=enola.schema.jsonc
into the second document, do you start seeing autocompletion etc work as expected? It's working that way for me currently in VSCode.
If that's true, this is probably more of a feature request than a bug report, as making the inline directives fallthrough to subsequent documents would probably be a breaking change in a lot of cases. If a single file has multiple distinct types of YAML documents requiring different schemas, fallthrough is probably not what you'd want, as it will cause spurious errors. Maybe there could be additional syntax in the directive to indicate you'd like it to fallthrough to subsequent documents?
@thieman It used to work on my end with multiple # yaml-language-server
per YAML document. However, this is no longer the case and the top # yaml-language-server
affects the whole file instead of a document.
It happens to me without using the inline # yaml-language-server
directive.
Ah ok, it seems like we have at least two different things being reported here? Please let me know if any of this is wrong.
@vorburger is saying that the current behavior is inline directives only apply to the document, not the file. I am also experiencing this.
@AnhQuanTrl is saying the opposite! That the inline directives apply to the entire file.
@nikaro could you elaborate on your issue, or let us know if it fits into one of the other descriptions?
Could you all please report your version numbers? I'm using the VSCode extension at v1.15.0, which is also using the language server at 1.15.0.
@thieman sorry i ended up following this issue as its title seemed more aligned with my issue. But it fits more with the comments on this one: https://github.com/redhat-developer/yaml-language-server/issues/869
I'm using Helix editor with yaml-language-server version 1.15.0.
[Originally reported as https://github.com/redhat-developer/vscode-yaml/issues/995, before I understood this really belongs more here.]
I wrote my first trivial JSON schema
enola.schema.jsonc
, like this:Then I wrote an
test.yaml
file using that schema, like this:Current Behavior
It does put a "red squiggle" on the first
doc: enola.md#URL
but not on the seconddoc: enola.md#ID
.In fact the 2nd
name: enola.dev/id
doesn't have the "hover" with thedescription
from the schema either.It looks like the YAML
---
syntax for "multiple documents within a single stream" isn't supported / doesn't work?Expected Behavior
I expected it to flag the
doc
attribute as red in both my URL and ID attributes.