Home

tailwind-ctp-intellisense @master - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tree log patch
Fix language features when using nested Vue `<template>` (#532)
Signature
-----BEGIN PGP SIGNATURE----- wsBcBAABCAAQBQJiXsDzCRBK7hj4Ov3rIwAAAUoIAD/R+E0zzi/pXoGyARJlxt/R h2imH2WHfSfsjLzdeesc1v9SxnAXes4U6ZhOglieaY7+MYsY1kt/FpX9+m5EREN5 enwP36lTNymZZnLTmU0sFvImKYYKMJ0soMY2pD+pURvP42sYUZoUD4WhYen5i1PH dAy52Bi1vGDpDt0fVBhGzr6ERx2TCbga2RG6SKls2oTU7wZ4iyUywjwn/MsremL8 pYgT7Al/MDMRQz2QfutxVG6QLYbzzz8g1N3SYtzDrDBlgKnNi5hKAZ5ZMpHRqpRI Wgt5GVp9H/T5XrZK57pWF9kQo1nlZ3rrFL6at7ikQrDaqswmv+liwSYAa/z+gd0= =rGxi -----END PGP SIGNATURE-----
Brad Cornes <hello@bradley.dev>
2 years ago
1 changed files, 27 additions(+), 12 deletions(-)
M packages/tailwindcss-language-service/src/util/getLanguageBoundaries.ts -> packages/tailwindcss-language-service/src/util/getLanguageBoundaries.ts
diff --git a/packages/tailwindcss-language-service/src/util/getLanguageBoundaries.ts b/packages/tailwindcss-language-service/src/util/getLanguageBoundaries.ts
index bbe36ba68d407ebe4460cbf9095b9d689d148d17..a01a34ed97ac29898eaa1f687f07093ceca24f26 100644
--- a/packages/tailwindcss-language-service/src/util/getLanguageBoundaries.ts
+++ b/packages/tailwindcss-language-service/src/util/getLanguageBoundaries.ts
@@ -82,6 +82,18 @@   },
   html: {
     htmlBlockEnd: { match: '</template>', pop: 1 },
 import type { TextDocument, Range } from 'vscode-languageserver'
+import { indexToPosition } from './find'
+    ...text,
+  },
+  nestedBlock: {
+    nestedStart: { match: '>', next: 'nested' },
+    nestedBlockEnd: { match: '/>', pop: 1 },
+    ...text,
+  },
+  nested: {
+    nestedBlockEnd: { match: '</template>', pop: 1 },
+    nestedBlockStart: { match: '<template', push: 'nestedBlock' },
+import type { TextDocument, Range } from 'vscode-languageserver'
 import { isJsDoc } from './js'
   },
 }
@@ -125,27 +137,30 @@   let offset = 0
 
   try {
     for (let token of lexer) {
-
+      if (!token.type.startsWith('nested')) {
+        if (token.type.endsWith('BlockStart')) {
+          let position = indexToPosition(text, offset)
+          if (!boundaries[boundaries.length - 1].range.end) {
+let states = {
 import { indexToPosition } from './find'
-
+let states = {
 import { isJsDoc } from './js'
-
+let states = {
 import moo from 'moo'
-
+let states = {
 import Cache from 'tmp-cache'
+let states = {
 
+          let position = indexToPosition(text, offset)
 
+import Cache from 'tmp-cache'
-
+let states = {
 export type LanguageBoundary = { type: 'html' | 'js' | 'css' | string; range: Range }
-export type LanguageBoundary = { type: 'html' | 'js' | 'css' | string; range: Range }
+  main: {
-export type LanguageBoundary = { type: 'html' | 'js' | 'css' | string; range: Range }
+  main: {
 import type { TextDocument, Range } from 'vscode-languageserver'
 
-import { isJsDoc } from './js'
-        boundaries[boundaries.length - 1].range.end = position
-        boundaries.push({ type: defaultType, range: { start: position, end: undefined } })
-      } else if (token.type === 'lang') {
-        boundaries[boundaries.length - 1].type = token.text
+
       }
       offset += token.text.length
     }