@shopify/theme-language-server-common
Advanced tools
Comparing version 2.3.1 to 2.3.2
# @shopify/theme-language-server-common | ||
## 2.3.2 | ||
### Patch Changes | ||
- 2bd19d66: Fixed bug where filter completions wouldn't work on Liquid assignments | ||
## 2.3.1 | ||
@@ -4,0 +10,0 @@ |
@@ -77,3 +77,3 @@ "use strict"; | ||
// ignore the pipe and any spaces for our starting position. | ||
const pipeRegex = new RegExp(`(\\s*\\|\\s*)(?:${node.name}\\}\\})`); | ||
const pipeRegex = new RegExp(`(\\s*\\|\\s*)(?:${node.name}(?:\\}|\\%)\\})`); | ||
const matchFilterPipe = node.source.match(pipeRegex); | ||
@@ -80,0 +80,0 @@ const startOffet = matchFilterPipe ? matchFilterPipe[1].length : 0; |
{ | ||
"name": "@shopify/theme-language-server-common", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
@@ -175,2 +175,29 @@ import { FilterEntry, MetafieldDefinitionMap, ObjectEntry } from '@shopify/theme-check-common'; | ||
it('handles assignment the same way as output', async () => { | ||
// char 31 ⌄ ⌄ char 33 | ||
const liquid = '{% assign imageUrl = product | de█ %}'; | ||
const textEdit: TextEdit = { | ||
newText: 'default', | ||
range: { | ||
end: { line: 0, character: 33 }, | ||
start: { line: 0, character: 31 }, | ||
}, | ||
}; | ||
await expect(provider).to.complete(liquid, [ | ||
expect.objectContaining({ | ||
label: 'default', | ||
insertTextFormat: InsertTextFormat.PlainText, | ||
textEdit, | ||
}), | ||
]); | ||
const textDocument = TextDocument.create('', 'liquid', 0, liquid.replace(CURSOR, '')); | ||
expect(TextDocument.applyEdits(textDocument, [textEdit])).toBe( | ||
'{% assign imageUrl = product | default %}', | ||
); | ||
}); | ||
describe('when there are no required parameters', () => { | ||
@@ -177,0 +204,0 @@ it('should not include parameters in the insertText of the completion', async () => { |
@@ -86,3 +86,3 @@ import { LiquidFilter, NodeTypes } from '@shopify/liquid-html-parser'; | ||
// ignore the pipe and any spaces for our starting position. | ||
const pipeRegex = new RegExp(`(\\s*\\|\\s*)(?:${node.name}\\}\\})`); | ||
const pipeRegex = new RegExp(`(\\s*\\|\\s*)(?:${node.name}(?:\\}|\\%)\\})`); | ||
const matchFilterPipe = node.source.match(pipeRegex); | ||
@@ -89,0 +89,0 @@ const startOffet = matchFilterPipe ? matchFilterPipe[1].length : 0; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1351822
22681