tailwind-ctp-intellisense @master -
refs -
log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Fix first-party plugin usage when using bundled version of `tailwindcss` (#751)
Signature
-----BEGIN PGP SIGNATURE-----
wsBcBAABCAAQBQJkJVbMCRBK7hj4Ov3rIwAAqT4IAH2fck9YBenduj9/OVZkE10x
IPWgS2asbcxcXFT4X1eysuNZQkX8JMUXN1mwhwNFe83d2Ek5ds40KDfiGWGAVIVF
7dGObXvEuAG4hBfbT246Rvv4pXLW6AKQ5BWHhnPC91/1CLQWNtXzSdId0Wo7STct
4j5u/7muPiK2WPCdh/ZHmqC0Ioa6SkGMzz42j00ztzSQ7FcMYdIfLpffAWe2NvE2
yirhIw07oio2meqBj5wtktqslKlmZOcG9BTCmOgQEIvQ76jPuFXfw9srW3ysT2WB
v+EjAYSGBPlocD6ew+KCpU8rB5j9Ui0JqbbaQ5pH9jf8fATX7XQXjfNlv2CK0+s=
=7N47
-----END PGP SIGNATURE-----
diff --git a/packages/tailwindcss-language-server/src/lib/hook.ts b/packages/tailwindcss-language-server/src/lib/hook.ts
index 400704feee14d055dce2403689159c3e94097b00..3b1bcf05e9d81c7935186b116eb0656bcbc8188c 100644
--- a/packages/tailwindcss-language-server/src/lib/hook.ts
+++ b/packages/tailwindcss-language-server/src/lib/hook.ts
@@ -20,7 +20,7 @@ private _unhooked: boolean = false
private _origRequire = Module.prototype.require
private _require: (req: string) => any
- constructor(find: string, callback: (x) => {}) {
+ constructor(find: string, callback: (x) => {} = (x) => x) {
// @ts-ignore
if (typeof Module._resolveFilename !== 'function') {
throw new Error(
diff --git a/packages/tailwindcss-language-server/src/server.ts b/packages/tailwindcss-language-server/src/server.ts
index 912e9df2d80f9533e82425ecd958f4c560081709..06f042521aaecdbe3d21e6656ef1771ceef2a49b 100644
--- a/packages/tailwindcss-language-server/src/server.ts
+++ b/packages/tailwindcss-language-server/src/server.ts
@@ -910,11 +910,16 @@ let isV3 = semver.gte(tailwindcss.version, '2.99.0')
let hook: Hook
if (loadConfig.module) {
-import { provideDiagnostics } from './lsp/diagnosticsProvider'
+ hook = new Hook(fs.realpathSync(state.configPath))
+ try {
+ originalConfig = await loadConfig.module(state.configPath)
+ enabled: () => boolean
CompletionItem,
-import { provideDiagnostics } from './lsp/diagnosticsProvider'
+ enabled: () => boolean
CompletionList,
- state.jit = true
+ } finally {
+ hook.unhook()
+ }
} else {
hook = new Hook(fs.realpathSync(state.configPath), (exports) => {
originalConfig = klona(exports)