+ // ^
+ let hover = await doc.hover({ line: 0, character: 13 })
+ expect(hover).toEqual({
+ contents: {
+ language: 'css',
+ value: dedent`
+ .bg-primary {
+ background-color: var(--color-primary) /* rebeccapurple = #663399 */;
+ }
+ `,
+ },
+ range: {
+ start: { line: 0, character: 12 },
+ end: { line: 0, character: 22 },
+ },
+ })
+ },
+})
+
+defineTest({
+ name: 'ignores can be overridden',
+ fs: {
+ 'aaa/app.css': ignored,
+ 'bbb/.git/app.css': found,
+ },
+
+ prepare: async ({ root }) => ({
+ client: await createClient({
+ root,
+ settings: {
+ tailwindCSS: {
+ files: {
+ exclude: ['**/aaa/**'],
+ },
+ },
+ },
+ }),
+ }),
+ handle: async ({ client }) => {
+ let doc = await client.open({
+ lang: 'html',
+ text: '
',
+ })
+
+ //
+ // ^
+ let hover = await doc.hover({ line: 0, character: 13 })
+ expect(hover).toEqual({
+ contents: {
+ language: 'css',
+ value: dedent`
+ .bg-primary {
+ background-color: var(--color-primary) /* rebeccapurple = #663399 */;
+ }
+ `,
+ },
+ range: {
+ start: { line: 0, character: 12 },
+ end: { line: 0, character: 22 },
+ },
+ })
+ },
+})
diff --git a/packages/tailwindcss-language-service/src/util/state.ts b/packages/tailwindcss-language-service/src/util/state.ts
index 26cc2ed0..ecd9d0d8 100644
--- a/packages/tailwindcss-language-service/src/util/state.ts
+++ b/packages/tailwindcss-language-service/src/util/state.ts
@@ -208,7 +208,40 @@ export function getDefaultTailwindSettings(): Settings {
},
showPixelEquivalents: true,
includeLanguages: {},
- files: { exclude: ['**/.git/**', '**/node_modules/**', '**/.hg/**', '**/.svn/**'] },
+ files: {
+ exclude: [
+ // These paths need to be universally ignorable. This means that we
+ // should only consider hidden folders with a commonly understood
+ // meaning unless there is a very good reason to do otherwise.
+ //
+ // This means that things like `build`, `target`, `cache`, etc… are
+ // not appropriate to include even though _in many cases_ they might
+ // be ignorable. The names are too general and ignoring them could
+ // cause us to ignore actual project files.
+
+ // Version Control
+ '**/.git/**',
+ '**/.hg/**',
+ '**/.svn/**',
+
+ // NPM
+ '**/node_modules/**',
+
+ // Yarn v2+ metadata & caches
+ '**/.yarn/**',
+
+ // Python Virtual Environments
+ '**/.venv/**',
+ '**/venv/**',
+
+ // Build caches
+ '**/.next/**',
+ '**/.parcel-cache/**',
+ '**/.svelte-kit/**',
+ '**/.turbo/**',
+ '**/__pycache__/**',
+ ],
+ },
experimental: {
classRegex: [],
configFile: null,
diff --git a/packages/vscode-tailwindcss/CHANGELOG.md b/packages/vscode-tailwindcss/CHANGELOG.md
index 53c9592a..e57ef565 100644
--- a/packages/vscode-tailwindcss/CHANGELOG.md
+++ b/packages/vscode-tailwindcss/CHANGELOG.md
@@ -3,6 +3,9 @@
## Prerelease
- Improve dynamic capability registration in the language server ([#1327](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1327))
+- Ignore Python virtual env directories by default ([#1336](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1336))
+- Ignore Yarn v2+ metadata & cache directories by default ([#1336](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1336))
+- Ignore some build caches by default ([#1336](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1336))
# 0.14.16