vscode-odata
vscode-odata copied to clipboard
Can't get "metadata-driven code completion" to work
Hello, I try to create querys for Citrix Director odata v4 rest api: https://developer-docs.citrix.com/projects/monitor-service-odata-api/en/latest/
I set the following settings in visual studio code:
{
"telemetry.enableTelemetry": false,
"odata.diagnostic.enable": true,
"odata.completion.enable": true,
"odata.format.enable": true,
"odata.format.decode": true,
"odata.format.syntax": true,
"odata.metadata.map": [
{
"url": "http://delivery-controller.local/Citrix/Monitor/OData/v4/Data",
"path": "C:\\Users\\Marco.Hofmann\\Seafile-Work\\Meine Bibliothek\\Git\\odata\\metadata.xml"
}
]
}
But nothing happens at all.
Any hint about how I can troubleshoot this?
Attached the file.
metadata.txt
I had a similar issue with one of my APIs when I was trying this plugin. From what I can tell it's because it doesn't allow numbers in the URL (I also have a version number). Try and see if it works if you change the URL to http://delivery-controller.local/Citrix/Monitor/OData/Data. I'd be happy to PR a fix for this when I have time.
@LinusCenterstrom, could you describe the problem with numbers more? I've got very limited time to work on this project when it comes to new or experimental features but this seems like something that should be supported.
sure @StanislawSwierc I'm using an api with the URL https://api.eduadmin.se/v1/odata
With diagnostics.enable I get the folllowing error:
Expected "/", "?", or [A-Za-z_\-] but "1" found.
at the v1 part of the URL.
If I change the url to https://api.eduadmin.se/odata it works correctly.
To me it dose not work at all using this url: http://localhost/odata/ I get "Unexpected character detected."
It dose not provide the collections in the autocomplete items :(
Hi @LucaGabi, thanks for reporting this problem. With your example URL I was able to reproduce the problem locally. It seems that code completion works fine, but diagnostics component has some problems analyzing this URL and decorates everything with one large squiggly line. So far I was able to observe symptoms. Tomorrow I will see what might be the cause.
@StanislawSwierc @stansw .. it seems to me that this dose almost nothing with that grammar .. I can't even see how it's rules are put together .. where dose the "select" rule goes in ?