lburgazzoli commented on issue #1538:
URL: https://github.com/apache/camel-k/issues/1538#issuecomment-658746044


   > > We had this discussion already and we added the modeline exactly for the 
reason to avoid having to add `.camelk.yaml|java|groovy|js|xml` and afaik, the 
camel-k support is already either triggered by the file name pattern or by the 
presence of `camel-k` in the modeline
   > 
   > it is the case for Camel Language Server. The Json schema support is not 
provided by the Camel language Server.
   > 
   
   I know but the UX should be the consistent.
   
   > > so imho, the support for the auto completion should work the same way 
and not requiring a different set-up.
   > 
   > The support of auto-completion relies on the Json schema specification and 
the Yaml Language Server. It is not related to the Camel language Server.
   > Referencing the schema from the file itself would be the correct way to do 
it but currently the [Json Schema specification doesn't specify 
it](https://github.com/json-schema-org/json-schema-spec/issues/828) and the 
[Yaml Language Server is not allowing 
it](https://github.com/redhat-developer/yaml-language-server/issues/204).
   > The Json schemastore and all toolings relies on file pattern association.
   
   I never said that it should not follow that path but as we also have the 
modeline to help understanding that we are dealing with a camel-k dsl, then I 
don't see why we can't re-use it so the experience would be consistent.
   
   > 
   > > In camel-k the name of the file is used to determine the name of the 
integration so we would need to remove `.camelk.*` which is not a huge issue 
but then it would become inconsistent and source of issues as i.e. a Java route 
named `MyIntegration.camelk.java` would trigger an error in the IDE as the name 
of the file is not the name of the class and in the code and then the use would 
need to code it's java bits in a different way.
   > 
   > Given that it is possible to provide a specific name using `name` 
parameter, I would not expect to be really a problem.
   > Also, we can always include in examples a specific name in Camel K 
modeline to have even less probability to hit a potential bug in Camel K.
   > 
   
   But it won't solve the Java issue
   
   > > Also, modeline could be used to configure how to locate the schema of 
the dsl.
   > 
   > Using a [specific modeline for 
yaml-language-server](https://github.com/redhat-developer/yaml-language-server/issues/204#issuecomment-658675767)
 seems to be the easiest to not rely on the filename. (I have no hope to have 
the json specification improved, especially on short-term).
   > Specifying it in the Camel K modeline won't help, as there will still need 
of all clients to do the mapping with the Yaml language server or to put 
specific Camel K related code in the Yaml Language Server.
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to