vscode-odata icon indicating copy to clipboard operation
vscode-odata copied to clipboard

Can't get "metadata-driven code completion" to work

Open xenadmin opened this issue 6 years ago • 7 comments

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. grafik Any hint about how I can troubleshoot this? Attached the file. metadata.txt

xenadmin avatar Aug 03 '18 10:08 xenadmin

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 avatar Feb 27 '19 07:02 LinusCenterstrom

@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.

StanislawSwierc avatar Feb 27 '19 21:02 StanislawSwierc

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.

LinusCenterstrom avatar Mar 07 '19 10:03 LinusCenterstrom

To me it dose not work at all using this url: http://localhost/odata/ I get "Unexpected character detected."

LucaGabi avatar Jun 04 '19 04:06 LucaGabi

image

It dose not provide the collections in the autocomplete items :(

LucaGabi avatar Jun 04 '19 06:06 LucaGabi

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 avatar Jun 04 '19 06:06 StanislawSwierc

@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 ?

LucaGabi avatar Jun 13 '19 06:06 LucaGabi