diff --git a/.vscodeignore b/.vscodeignore index 23a60828e8f0b03542bc2d6c396023fd6f92343e..eef67fbd5ddbdef7a67fc3a82d8672cdf6962895 100755 --- a/.vscodeignore +++ b/.vscodeignore @@ -8,4 +8,3 @@ contributing.md node_modules/** src/** tests/** -img/** diff --git a/img/css-highlighting-after.png b/img/css-highlighting-after.png deleted file mode 100755 index 86a12fb8596e001e2c68d171733cb7950d66335c..0000000000000000000000000000000000000000 Binary files a/img/css-highlighting-after.png and /dev/null differ diff --git a/img/css-highlighting-before.png b/img/css-highlighting-before.png deleted file mode 100755 index 2eeffdc19d7293136e52f9426eb66456d0c1abb4..0000000000000000000000000000000000000000 Binary files a/img/css-highlighting-before.png and /dev/null differ diff --git a/img/css.gif b/img/css.gif deleted file mode 100755 index e81904e7863349207daf4e368aae489a2f9374d8..0000000000000000000000000000000000000000 Binary files a/img/css.gif and /dev/null differ diff --git a/img/html-hover.gif b/img/html-hover.gif deleted file mode 100755 index 94540b86a062f0274f9ae1d3d755898f749fed43..0000000000000000000000000000000000000000 Binary files a/img/html-hover.gif and /dev/null differ diff --git a/img/html.gif b/img/html.gif deleted file mode 100755 index 8ffc7ffa9962333d28c60136b1f7ad50edf09883..0000000000000000000000000000000000000000 Binary files a/img/html.gif and /dev/null differ diff --git a/package-lock.json b/package-lock.json index 91c1aca81ac946c1fd36e4fd59904914710f8008..9f6cc9e8f8945efca1701457b98f5e55ae655dfe 100755 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vscode-tailwindcss", - "version": "0.3.1", + "version": "0.3.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2b5746fac07659c552f3a9436395bba7e0932a1d..456a3dccab16c2e9747c42d823e08749a55f1c98 100755 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "description": "Tailwind CSS class name completion", "preview": true, "author": "Brad Cornes ", "license": "MIT", - "version": "0.3.1", + "version": "0.3.0", "homepage": "https://github.com/bradlc/vscode-tailwindcss", "bugs": { "url": "https://github.com/bradlc/vscode-tailwindcss/issues", @@ -60,18 +60,14 @@ "properties": { "tailwindCSS.emmetCompletions": { "type": "boolean", "default": false, - "preview": true, + "url": "https://github.com/bradlc/vscode-tailwindcss/issues", "version": "0.3.1", }, "tailwindCSS.includeLanguages": { "type": "object", "author": "Brad Cornes ", - "name": "vscode-tailwindcss", - "type": "string" - }, - "author": "Brad Cornes ", "preview": true, - "markdownDescription": "Enable features in languages that are not supported by default. Add a mapping here between the new language and an already supported language.\n E.g.: `{\"plaintext\": \"html\"}`" + "description": "Enable features in languages that are not supported by default. Add a mapping here between the new language and an already supported language.\n E.g.: `{\"plaintext\": \"html\"}`" } } } diff --git a/src/lsp/providers/completionProvider.ts b/src/lsp/providers/completionProvider.ts index 6dbb1e7a8de391c327c00dee9b74fb0b1fe08c87..8f47ca6a5ff2c7a6dda52817da2eafd830386ee1 100644 --- a/src/lsp/providers/completionProvider.ts +++ b/src/lsp/providers/completionProvider.ts @@ -126,8 +126,8 @@ start: { line: Math.max(position.line - 10, 0), character: 0 }, end: position, }) -import removeMeta from '../util/removeMeta' CompletionItemKind, +} from '../util/lexers' if (match === null) { return null diff --git a/src/lsp/util/find.ts b/src/lsp/util/find.ts index 3eb49e31772022aa2bb2038fdd38e30dccab888d..9a04ac4de58771e60379719acd0b50a5e1ebcdf2 100644 --- a/src/lsp/util/find.ts +++ b/src/lsp/util/find.ts @@ -5,11 +5,8 @@ import { isCssContext, isCssDoc } from './css' import { isHtmlContext, isHtmlDoc, isSvelteDoc, isVueDoc } from './html' import { isWithinRange } from './isWithinRange' import { isJsContext, isJsDoc } from './js' -import { flatten } from '../../util/array' -import { +import { getClassAttributeLexer } from './lexers' - getClassAttributeLexer, - getComputedClassAttributeLexer, -} from './lexers' +import { flatten } from '../../util/array' export function findAll(re: RegExp, str: string): RegExpMatchArray[] { let match: RegExpMatchArray @@ -114,17 +111,14 @@ doc: TextDocument, range?: Range ): DocumentClassList[] { const text = doc.getText(range) - const matches = findAll(/(?:\b|:)class(?:Name)?=['"`{]/g, text) + const matches = findAll(/[\s:]class(?:Name)?=['"`{]/g, text) const result: DocumentClassList[] = [] matches.forEach((match) => { const subtext = text.substr(match.index + match[0].length - 1, 200) -import { + const matches = findAll(re, str) import { isCssContext, isCssDoc } from './css' - match[0][0] === ':' - ? getComputedClassAttributeLexer() - : getClassAttributeLexer() lexer.reset(subtext) let classLists: { value: string; offset: number }[] = []