theme-tools: Shopify Liquid VS Code extension: Request textDocument/documentLink failed.
Describe the bug After having issues with Shopify Liquid formatter outputting an empty response, I uninstalled and reinstalled the Shopify Liquid VS Code extension. Since then, all functionalities return an error.
The summarized error (within the VS Code popup) is:
Request textDocument/documentLink failed.
The verbose error is:
Request textDocument/documentLink failed with message: [UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")
Verbose log
[Trace - 1:49:25 PM] Sending request 'initialize - (0)'.
Params: {
"processId": 26109,
"clientInfo": {
"name": "Visual Studio Code",
"version": "1.95.2"
},
"locale": "en",
"rootPath": "/home/wake",
"rootUri": "file:///home/wake",
"capabilities": {
"workspace": {
"applyEdit": true,
"workspaceEdit": {
"documentChanges": true,
"resourceOperations": [
"create",
"rename",
"delete"
],
"failureHandling": "textOnlyTransactional",
"normalizesLineEndings": true,
"changeAnnotationSupport": {
"groupsOnLabel": true
}
},
"configuration": true,
"didChangeWatchedFiles": {
"dynamicRegistration": true,
"relativePatternSupport": true
},
"symbol": {
"dynamicRegistration": true,
"symbolKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26
]
},
"tagSupport": {
"valueSet": [
1
]
},
"resolveSupport": {
"properties": [
"location.range"
]
}
},
"codeLens": {
"refreshSupport": true
},
"executeCommand": {
"dynamicRegistration": true
},
"didChangeConfiguration": {
"dynamicRegistration": true
},
"workspaceFolders": true,
"semanticTokens": {
"refreshSupport": true
},
"fileOperations": {
"dynamicRegistration": true,
"didCreate": true,
"didRename": true,
"didDelete": true,
"willCreate": true,
"willRename": true,
"willDelete": true
},
"inlineValue": {
"refreshSupport": true
},
"inlayHint": {
"refreshSupport": true
},
"diagnostics": {
"refreshSupport": true
}
},
"textDocument": {
"publishDiagnostics": {
"relatedInformation": true,
"versionSupport": false,
"tagSupport": {
"valueSet": [
1,
2
]
},
"codeDescriptionSupport": true,
"dataSupport": true
},
"synchronization": {
"dynamicRegistration": true,
"willSave": true,
"willSaveWaitUntil": true,
"didSave": true
},
"completion": {
"dynamicRegistration": true,
"contextSupport": true,
"completionItem": {
"snippetSupport": true,
"commitCharactersSupport": true,
"documentationFormat": [
"markdown",
"plaintext"
],
"deprecatedSupport": true,
"preselectSupport": true,
"tagSupport": {
"valueSet": [
1
]
},
"insertReplaceSupport": true,
"resolveSupport": {
"properties": [
"documentation",
"detail",
"additionalTextEdits"
]
},
"insertTextModeSupport": {
"valueSet": [
1,
2
]
},
"labelDetailsSupport": true
},
"insertTextMode": 2,
"completionItemKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25
]
},
"completionList": {
"itemDefaults": [
"commitCharacters",
"editRange",
"insertTextFormat",
"insertTextMode"
]
}
},
"hover": {
"dynamicRegistration": true,
"contentFormat": [
"markdown",
"plaintext"
]
},
"signatureHelp": {
"dynamicRegistration": true,
"signatureInformation": {
"documentationFormat": [
"markdown",
"plaintext"
],
"parameterInformation": {
"labelOffsetSupport": true
},
"activeParameterSupport": true
},
"contextSupport": true
},
"definition": {
"dynamicRegistration": true,
"linkSupport": true
},
"references": {
"dynamicRegistration": true
},
"documentHighlight": {
"dynamicRegistration": true
},
"documentSymbol": {
"dynamicRegistration": true,
"symbolKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26
]
},
"hierarchicalDocumentSymbolSupport": true,
"tagSupport": {
"valueSet": [
1
]
},
"labelSupport": true
},
"codeAction": {
"dynamicRegistration": true,
"isPreferredSupport": true,
"disabledSupport": true,
"dataSupport": true,
"resolveSupport": {
"properties": [
"edit"
]
},
"codeActionLiteralSupport": {
"codeActionKind": {
"valueSet": [
"",
"quickfix",
"refactor",
"refactor.extract",
"refactor.inline",
"refactor.rewrite",
"source",
"source.organizeImports"
]
}
},
"honorsChangeAnnotations": false
},
"codeLens": {
"dynamicRegistration": true
},
"formatting": {
"dynamicRegistration": true
},
"rangeFormatting": {
"dynamicRegistration": true
},
"onTypeFormatting": {
"dynamicRegistration": true
},
"rename": {
"dynamicRegistration": true,
"prepareSupport": true,
"prepareSupportDefaultBehavior": 1,
"honorsChangeAnnotations": true
},
"documentLink": {
"dynamicRegistration": true,
"tooltipSupport": true
},
"typeDefinition": {
"dynamicRegistration": true,
"linkSupport": true
},
"implementation": {
"dynamicRegistration": true,
"linkSupport": true
},
"colorProvider": {
"dynamicRegistration": true
},
"foldingRange": {
"dynamicRegistration": true,
"rangeLimit": 5000,
"lineFoldingOnly": true,
"foldingRangeKind": {
"valueSet": [
"comment",
"imports",
"region"
]
},
"foldingRange": {
"collapsedText": false
}
},
"declaration": {
"dynamicRegistration": true,
"linkSupport": true
},
"selectionRange": {
"dynamicRegistration": true
},
"callHierarchy": {
"dynamicRegistration": true
},
"semanticTokens": {
"dynamicRegistration": true,
"tokenTypes": [
"namespace",
"type",
"class",
"enum",
"interface",
"struct",
"typeParameter",
"parameter",
"variable",
"property",
"enumMember",
"event",
"function",
"method",
"macro",
"keyword",
"modifier",
"comment",
"string",
"number",
"regexp",
"operator",
"decorator"
],
"tokenModifiers": [
"declaration",
"definition",
"readonly",
"static",
"deprecated",
"abstract",
"async",
"modification",
"documentation",
"defaultLibrary"
],
"formats": [
"relative"
],
"requests": {
"range": true,
"full": {
"delta": true
}
},
"multilineTokenSupport": false,
"overlappingTokenSupport": false,
"serverCancelSupport": true,
"augmentsSyntaxTokens": true
},
"linkedEditingRange": {
"dynamicRegistration": true
},
"typeHierarchy": {
"dynamicRegistration": true
},
"inlineValue": {
"dynamicRegistration": true
},
"inlayHint": {
"dynamicRegistration": true,
"resolveSupport": {
"properties": [
"tooltip",
"textEdits",
"label.tooltip",
"label.location",
"label.command"
]
}
},
"diagnostic": {
"dynamicRegistration": true,
"relatedDocumentSupport": false
}
},
"window": {
"showMessage": {
"messageActionItem": {
"additionalPropertiesSupport": true
}
},
"showDocument": {
"support": true
},
"workDoneProgress": true
},
"general": {
"staleRequestSupport": {
"cancel": true,
"retryOnContentModified": [
"textDocument/semanticTokens/full",
"textDocument/semanticTokens/range",
"textDocument/semanticTokens/full/delta"
]
},
"regularExpressions": {
"engine": "ECMAScript",
"version": "ES2020"
},
"markdown": {
"parser": "marked",
"version": "1.1.0"
},
"positionEncodings": [
"utf-16"
]
},
"notebookDocument": {
"synchronization": {
"dynamicRegistration": true,
"executionSummarySupport": true
}
}
},
"trace": "verbose",
"workspaceFolders": [
{
"uri": "file:///home/wake",
"name": "wake"
}
]
}
[Trace - 1:49:25 PM] Received response 'initialize - (0)' in 514ms.
Result: {
"capabilities": {
"textDocumentSync": {
"change": 1,
"save": true,
"openClose": true
},
"codeActionProvider": {
"codeActionKinds": [
"source.fixAll",
"quickfix"
]
},
"completionProvider": {
"triggerCharacters": [
".",
"{{ ",
"{% ",
"<",
"/",
"[",
"\"",
"'",
":"
]
},
"documentOnTypeFormattingProvider": {
"firstTriggerCharacter": " ",
"moreTriggerCharacter": [
"{",
"%",
"-",
">"
]
},
"documentLinkProvider": {
"resolveProvider": false,
"workDoneProgress": false
},
"documentHighlightProvider": true,
"linkedEditingRangeProvider": true,
"renameProvider": {
"prepareProvider": true
},
"executeCommandProvider": {
"commands": [
"themeCheck/applyFixes",
"themeCheck/applySuggestion",
"themeCheck/runChecks"
]
},
"hoverProvider": {
"workDoneProgress": false
},
"workspace": {
"fileOperations": {
"didRename": {
"filters": [
{
"pattern": {
"glob": "**/*.{liquid,json}"
}
},
{
"pattern": {
"glob": "**/assets/*"
}
}
]
},
"didCreate": {
"filters": [
{
"pattern": {
"glob": "**/*.{liquid,json}"
}
},
{
"pattern": {
"glob": "**/assets/*"
}
}
]
},
"didDelete": {
"filters": [
{
"pattern": {
"glob": "**/*.{liquid,json}"
}
},
{
"pattern": {
"glob": "**/assets/*"
}
}
]
}
}
}
},
"serverInfo": {
"name": "theme-language-server",
"version": "2.1.0"
}
}
[Trace - 1:49:25 PM] Sending notification 'initialized'.
Params: {}
[Trace - 1:49:25 PM] Sending notification 'textDocument/didOpen'.
Params: {
"textDocument": {
"uri": "file:///home/wake/shopify_shops/foo.liquid",
"languageId": "liquid",
"version": 1,
"text": "<script src=\"https://tags.tiqcdn.com/utag/sony-marketing/sna/prod/utag.sync.js\"></script>\n<script type='text/javascript'>\n\n //Data Layer\n window.buildSonyDataLayer = function(){\n\n var dataLayer = {\n user : {\n id : \"{{ customer.id }}\"\n },\n page : {\n country : \"CA\",\n section : \"sso\",\n currency : \"CAD\",\n language : document.documentElement.lang\n }\n };\n\n {% if template contains 'index' %}\n \n dataLayer.page.name = 'home';\n dataLayer.page.template = 'home';\n dataLayer.page.template_revision = 'home';\n\n {% elsif template contains 'collection' %}\n\n dataLayer.page.name = 'category';\n dataLayer.page.template = 'category';\n dataLayer.page.template_revision = 'category';\n \n dataLayer.product = {\n category1 : \"{{ collection.title }}\"\n }\n \n {% elsif template contains 'product' %}\n\n dataLayer.page.name = 'product_details';\n dataLayer.page.template = 'product_details';\n dataLayer.page.template_revision = 'product_details';\n\n dataLayer.product = {\n category1 : \"{{ product.collections[ 0 ].handle }}\",\n category2 : \"{{ product.collections[ 1 ].handle }}\",\n sku : [\n {% for variant in product.variants %}\n\n \"{{ variant.sku }}\",\n\n \t{% endfor %}\n ],\n price : [\n {% for variant in product.variants %}\n\n \"{{ variant.price | money_without_currency }}\",\n\n \t{% endfor %}\n ]\n }\n \n {% elsif template contains 'search' %}\n\n dataLayer.page.name = 'other:search';\n dataLayer.page.template = 'other';\n dataLayer.page.template_revision = 'other';\n\n dataLayer.search = {\n term : \"{{ search.terms }}\",\n resultCount : {{ search.results_count }}\n }\n \n {% elsif template contains 'cart' %}\n\n dataLayer.page.name = 'cart';\n dataLayer.page.template = 'cart';\n dataLayer.page.template_revision = 'cart';\n\n dataLayer.cart = {\n price : [\n {% for item in cart.items %}\n\n \"{{ item.original_price | money_without_currency }}\",\n\n {% endfor %}\n ],\n quantity : [\n {% for item in cart.items %}\n\n \"{{ item.quantity }}\",\n\n {% endfor %}\n ],\n sellingPrice : [\n {% for item in cart.items %}\n\n \"{{ item.final_price | money_without_currency }}\",\n\n {% endfor %}\n ],\n sku : [\n {% for item in cart.items %}\n\n \"{{ item.sku }}\",\n\n {% endfor %}\n ],\n tax : [\n {% for item in cart.items %}\n\n \"{{ item.taxLine.price | money_without_currency }}\",\n\n {% endfor %}\n ],\n total : \"{{ cart.total_price | money_without_currency }}\" \n }\n \n {% elsif template contains 'customers/account' %} \n\n dataLayer.page.name = 'account';\n dataLayer.page.template = 'account';\n dataLayer.page.template_revision = 'account';\n \n {% elsif template contains 'customers/login' %} \n\n dataLayer.page.name = 'log_in';\n dataLayer.page.template = 'log_in';\n dataLayer.page.template_revision = 'log_in';\n \n {% elsif template contains 'customers/register' %} \n\n dataLayer.page.name = 'register';\n dataLayer.page.template = 'register';\n dataLayer.page.template_revision = 'register';\n \n {% elsif template contains 'customers/order' %} \n\n dataLayer.page.name = 'order';\n dataLayer.page.template = 'order';\n dataLayer.page.template_revision = 'order';\n \n \n {% elsif template contains 'customers/addresses' %} \n\n dataLayer.page.name = 'addresses';\n dataLayer.page.template = 'addresses';\n dataLayer.page.template_revision = 'addresses';\n \n {% elsif template contains 'contact' %} \n\n dataLayer.page.name = 'contact us';\n dataLayer.page.template = 'contact us';\n dataLayer.page.template_revision = 'contact us';\n\n {% elsif template contains '404' %} \n\n dataLayer.page.name = 'error';\n dataLayer.page.template = 'error';\n dataLayer.page.template_revision = 'error';\n\n {% elsif page_title contains 'Refund policy' %} \n\n dataLayer.page.name = 'refund policy';\n dataLayer.page.template = 'refund policy';\n dataLayer.page.template_revision = 'refund policy';\n \n {% elsif page_title contains 'Privacy policy' %} \n\n dataLayer.page.name = 'privacy policy';\n dataLayer.page.template = 'privacy policy';\n dataLayer.page.template_revision = 'privacy policy';\n \n {% elsif page_title contains 'Terms of service' %} \n\n dataLayer.page.name = 'terms of service';\n dataLayer.page.template = 'terms of service';\n dataLayer.page.template_revision = 'terms of service';\n\n {% endif %}\n\n dataLayer.version = '1';\n \n window.sony = window.sony || {};\n sony.digitalData = sony.digitalData || {}\n sony.digitalData = dataLayer;\n\n return sony;\n\n }\n \n document.addEventListener(\"DOMContentLoaded\", function() {\n \n {% if template contains 'product' %}\n \t\t\n \t\tvar addToCartTrigger = document.querySelector( '.product-form--atc-button' );\n\t\t\t\n addToCartTrigger.addEventListener( 'click', function(){\n\t\t\t\n var event = new CustomEvent(\n 'addToCart',\n {\n detail: { \n sku: [\n {% for variant in product.variants %}\n\n '{{ variant.sku }}',\n\n {% endfor %}\n ],\n quantity: [\n document.querySelector( '.form-field-select' ).value\n ],\n price: [\n {% for variant in product.variants %}\n\n '{{ variant.price | money_without_currency }}',\n\n {% endfor %}\n ],\n category: [\n '{{ product.collections[ 0 ].handle }}',\n '{{ product.collections[ 1 ].handle }}'\n ]\n }\n } \n );\n \n\t\t\t\t\n document.dispatchEvent( \n event\n );\n\n });\n \n \t {% endif %}\n \n });\n \n var utag_data = { website_platform : \"regional:ecommerce\" };\n\n</script>\n\n\n"
}
}
[SERVER] Let's roll!
[Trace - 1:49:25 PM] Received request 'workspace/configuration - (0)'.
Params: {
"items": [
{
"section": "themeCheck.checkOnOpen"
},
{
"section": "themeCheck.checkOnSave"
},
{
"section": "themeCheck.checkOnChange"
}
]
}
[Trace - 1:49:25 PM] Sending response 'workspace/configuration - (0)'. Processing request took 0ms
Result: [
false,
true,
false
]
[Trace - 1:49:25 PM] Received request 'client/registerCapability - (1)'.
Params: {
"registrations": [
{
"id": "bc607cb0-452c-4716-98c2-290b743e7a04",
"method": "workspace/didChangeConfiguration",
"registerOptions": {}
}
]
}
[Trace - 1:49:25 PM] Sending response 'client/registerCapability - (1)'. Processing request took 1ms
No result returned.
[Trace - 1:49:25 PM] Received request 'client/registerCapability - (2)'.
Params: {
"registrations": [
{
"id": "7d4fc265-fc71-449d-be6d-d0772eb7a063",
"method": "workspace/didChangeWatchedFiles",
"registerOptions": {
"watchers": [
{
"globPattern": "**/.shopify/*"
}
]
}
}
]
}
[Trace - 1:49:25 PM] Sending response 'client/registerCapability - (2)'. Processing request took 0ms
No result returned.
[Trace - 1:49:25 PM] Sending request 'textDocument/documentLink - (1)'.
Params: {
"textDocument": {
"uri": "file:///home/wake/shopify_shops/foo.liquid"
}
}
Loaded resource from /home/wake/.cache/theme-liquid-docs-nodejs/manifest_theme.json
Loaded resource from /home/wake/.cache/theme-liquid-docs-nodejs/manifest_theme_app_extension.json
[Trace - 1:49:25 PM] Received response 'textDocument/documentLink - (1)' in 121ms. Request failed: Request textDocument/documentLink failed with message: [UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//") (-32603).
[Error - 1:49:25 PM] Request textDocument/documentLink failed.
Message: Request textDocument/documentLink failed with message: [UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")
Code: -32603
Loaded schema from /home/wake/.cache/theme-liquid-docs-nodejs/translations.json
Loaded schema from /home/wake/.cache/theme-liquid-docs-nodejs/theme_block.json
Loaded schema from /home/wake/.cache/theme-liquid-docs-nodejs/theme_settings.json
Loaded schema from /home/wake/.cache/theme-liquid-docs-nodejs/section.json
Loaded schema from /home/wake/.cache/theme-liquid-docs-nodejs/settings.json
Loaded schema from /home/wake/.cache/theme-liquid-docs-nodejs/setting.json
Loaded schema from /home/wake/.cache/theme-liquid-docs-nodejs/default_setting_values.json
Loaded schema from /home/wake/.cache/theme-liquid-docs-nodejs/app_block_entry.json
Loaded schema from /home/wake/.cache/theme-liquid-docs-nodejs/theme_block_entry.json
Loaded schema from /home/wake/.cache/theme-liquid-docs-nodejs/targetted_block_entry.json
Loaded schema from /home/wake/.cache/theme-liquid-docs-nodejs/local_block_entry.json
Loaded schema from /home/wake/.cache/theme-liquid-docs-nodejs/translations.json
[Trace - 1:49:30 PM] Sending request 'textDocument/documentLink - (2)'.
Params: {
"textDocument": {
"uri": "file:///home/wake/shopify_shops/foo.liquid"
}
}
[Trace - 1:49:30 PM] Received response 'textDocument/documentLink - (2)' in 5ms. Request failed: Request textDocument/documentLink failed with message: [UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//") (-32603).
[Error - 1:49:30 PM] Request textDocument/documentLink failed.
Message: Request textDocument/documentLink failed with message: [UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")
Code: -32603
[Trace - 1:49:31 PM] Sending request 'textDocument/hover - (3)'.
Params: {
"textDocument": {
"uri": "file:///home/wake/shopify_shops/foo.liquid"
},
"position": {
"line": 236,
"character": 12
}
}
[Trace - 1:49:31 PM] Received response 'textDocument/hover - (3)' in 3ms. Request failed: Request textDocument/hover failed with message: [UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//") (-32603).
[Error - 1:49:31 PM] Request textDocument/hover failed.
Message: Request textDocument/hover failed with message: [UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")
Code: -32603
Debugging information
- OS: WSL with Ubuntu 22.04
- VS Code Extension version: Shopify Liquid v3.1.0
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 25 (18 by maintainers)
Commits related to this issue
- Fix hardcoded `file:` scheme in resolveConfig I think it should have been `file://` and is probably the cause of #586. Can't confirm this fixes it because I couldn't figure out a way to reproduce th... — committed to Shopify/theme-tools by charlespwd 2 years ago
- Fix hardcoded `file:` scheme in resolveConfig I think it should have been `file://` and is probably the cause of #586. Can't confirm this fixes it because I couldn't figure out a way to reproduce th... — committed to Shopify/theme-tools by charlespwd 2 years ago
- Fix hardcoded `file:` scheme in resolveConfig I think it should have been `file://` and is probably the cause of #586. Can't confirm this fixes it because I couldn't figure out a way to reproduce th... — committed to Shopify/theme-tools by charlespwd 2 years ago
- Fix hardcoded `file:` scheme in resolveConfig I think it should have been `file://` and is probably the cause of #586. Can't confirm this fixes it because I couldn't figure out a way to reproduce th... — committed to Shopify/theme-tools by charlespwd 2 years ago
- Fix hardcoded `file:` scheme in resolveConfig I think it should have been `file://` and is probably the cause of #586. Can't confirm this fixes it because I couldn't figure out a way to reproduce th... — committed to Shopify/theme-tools by charlespwd 2 years ago
- Fix fun URI.parse error when root finding didn't work We had a weird issue that made it so `rootURI` resolved to `file:///` And when that happened the first time `readDirectory` was called on the ro... — committed to Shopify/theme-tools by charlespwd a year ago
- Fix fun URI.parse error when root finding didn't work (#954) We had a weird issue that made it so `rootURI` resolved to `file:///` And when that happened the first time `readDirectory` was called on... — committed to Shopify/theme-tools by charlespwd a year ago
With
uri = 'file:///, the first entry becomes${'file:///'}/${whatever}which becomesfile:////whatever.Talk about an edge case…
In the meantime, @ajiho @benediktgrether, all you need is a way to instruct the tooling that you are in a theme. So a
.git, a.theme-check.ymlor asnippetsfolder would do the trick.@ajiho @benediktgrether I’m looking into this today. With editions out of the way, it’s time I do a little bug hunting.