Code Monkey home page Code Monkey logo

Comments (5)

VonHeikemen avatar VonHeikemen commented on June 1, 2024

Can you test if this happens just using lspconfig? You can "comment out" lsp-zero config and try this.

require('mason').setup({})
require('mason-lspconfig').setup({})

require('lspconfig').tailwindcss.setup({})

from lsp-zero.nvim.

DanielTate avatar DanielTate commented on June 1, 2024

@VonHeikemen I still get 0 clients attached :(

This works require('lspconfig').tailwindcss.setup({})

But mason doesn't any idea what I've done wrong?

This seems to be causing the issues lsp.preset('recommended')

When I use lsp.preset('system-lsp') I get snippets and suggestions but highlighting is still not working.

This is my config if you're interested. If I can provide any other info please let me know.

local lsp = require('lsp-zero')

lsp.preset('recommended')

lsp.ensure_installed({
	'tsserver',
	'eslint',
	'sumneko_lua',
	'rust_analyzer',
	'phpactor',
    'taplo',
    'jsonls',
	'tailwindcss',
})

local cmp = require('cmp')
local cmp_select = {behaviour = cmp.SelectBehavior.Select}
local cmp_mappings = lsp.defaults.cmp_mappings({
	['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
	['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
	['<C-y>'] = cmp.mapping.confirm({ select = true }),
	['<C-Space>'] = cmp.mapping.complete()
})

lsp.setup_nvim_cmp({
	mapping = cmp_mappings
})

lsp.on_attach(function(client, bufnr)
	local opts = {buffer = bufnr, remap = false}

	vim.keymap.set('n', 'gd', function() vim.lsp.buf.definition() end, opts)
	vim.keymap.set('n', 'K', function() vim.lsp.buf.hover() end, opts)
	vim.keymap.set('n', '<leader>vws', function() vim.lsp.buf.workspace_symbol() end, opts)
	vim.keymap.set('n', '<leader>vd', function() vim.diagnostic.open_float() end, opts)
	vim.keymap.set('n', '[d', function() vim.lsp.buf.goto_next() end, opts)
	vim.keymap.set('n', ']d', function() vim.lsp.buf.goto_prev() end, opts)
	vim.keymap.set('n', '<leader>vca', function() vim.lsp.buf.code_action() end, opts)
	vim.keymap.set('n', '<leader>vrr', function() vim.lsp.buf.references() end, opts)
	vim.keymap.set('n', '<leader>vrn', function() vim.lsp.buf.rename() end, opts)
	vim.keymap.set('n', '<C-h>', function() vim.lsp.buf.signature_help() end, opts)
    vim.keymap.set('n', '<space>gf', function() vim.lsp.buf.format { async = true } end, opts)
end)

lsp.configure('sumneko_lua', {
    settings = {
        Lua = {
            diagnostics = {
                globals = { 'vim' }
            }
        }
    }
})

lsp.setup()


from lsp-zero.nvim.

DanielTate avatar DanielTate commented on June 1, 2024

This is the error i'm getting from :LspLog

[START][2022-12-30 09:31:47] LSP logging initiated
[ERROR][2022-12-30 09:31:47] .../vim/lsp/rpc.lua:733	"rpc"	"tailwindcss-language-server"	"stderr"	"/home/dan/.local/share/nvim/mason/packages/tailwindcss-language-server/node_modules/@tailwindcss/language-server/bin/tailwindcss-language-server:137\n`,f8=class{constructor(e=\"utf-8\"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let H=typeof e==\"string\"?this.fromString(e,this._encoding):e;this._chunks.push(H),this._totalLength+=H.byteLength}tryReadHeaders(){if(this._chunks.length===0)return;let e=0,H=0,r=0,n=0;e:for(;H<this._chunks.length;){let o=this._chunks[H];r=0;t:for(;r<o.length;){switch(o[r]){case Yoe:switch(e){case 0:e=1;break;case 2:e=3;break;default:e=0}break;case Qoe:switch(e){case 1:e=2;break;case 3:e=4,r++;break e;default:e=0}break;default:e=0}r++}n+=o.byteLength,H++}if(e!==4)return;let i=this._read(n+r),s=new Map,a=this.toString(i,\"ascii\").split(eue);if(a.length<2)return s;for(let o=0;o<a.length-2;o++){let u=a[o],l=u.indexOf(\":\");if(l===-1)throw new Error(\"Message header must separate key and value using :\");let p=u.substr(0,l),_=u.substr(l+1).trim();s.set(p,_)}return s}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error(\"Cannot read so many bytes!\");if(this._chunks[0].byteLength===e){let i=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(i)}if(this._chunks[0].byteLength>e){let i=this._chunks[0],s=this.asNative(i,e);return this._chunks[0]=i.slice(e),this._totalLength-=e,s}let H=this.allocNative(e),r=0,n=0;for(;e>0;){let i=this._chunks[n];if(i.byteLength>e){let s=i.slice(0,e);H.set(s,r),r+=e,this._chunks[n]=i.slice(e),this._totalLength-=e,e-=e}else H.set(i,r),r+=i.byteLength,this._chunks.shift(),this._totalLength-=i.byteLength,e-=i.byteLength}return H}};ME.AbstractMessageBuffer=f8});var E8=P(F1=>{\"use strict\";Object.defineProperty(F1,\"__esModule\",{value:!0});var tue=Ca(),p8=require(\"util\"),Zu=O1(),Hue=h8(),ep=class extends Hue.AbstractMessageBuffer{constructor(e=\"utf-8\"){super(e)}emptyBuffer(){return ep.emptyBuffer}fromString(e,H){return Buffer.from(e,H)}toString(e,H){return e instanceof Buffer?e.toString(H):new p8.TextDecoder(H).decode(e)}asNative(e,H){return H===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,H):Buffer.from(e,0,H)}allocNative(e){return Buffer.allocUnsafe(e)}};ep.emptyBuffer=Buffer.allocUnsafe(0);var d8=class{constructor(e){this.stream=e}onClose(e){return this.stream.on(\"close\",e),Zu.Disposable.create(()=>this.stream.off(\"close\",e))}onError(e){return this.stream.on(\"error\",e),Zu.Disposable.create(()=>this.stream.off(\"error\",e))}onEnd(e){return this.stream.on(\"end\",e),Zu.Disposable.create(()=>this.stream.off(\"end\",e))}onData(e){return this.stream.on(\"data\",e),Zu.Disposable.create(()=>this.stream.off(\"data\",e))}},_8=class{constructor(e){this.stream=e}onClose(e){return this.stream.on(\"close\",e),Zu.Disposable.create(()=>this.stream.off(\"close\",e))}onError(e){return this.stream.on(\"error\",e),Zu.Disposable.create(()=>this.stream.off(\"error\",e))}onEnd(e){return this.stream.on(\"end\",e),Zu.Disposable.create(()=>this.stream.off(\"end\",e))}write(e,H){return new Promise((r,n)=>{let i=s=>{s==null?r():n(s)};typeof e==\"string\"?this.stream.write(e,H,i):this.stream.write(e,i)})}end(){this.stream.end()}},L8=Object.freeze({messageBuffer:Object.freeze({create:t=>new ep(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:\"application/json\",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(H){return Promise.reject(H)}}}),decoder:Object.freeze({name:\"application/json\",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new p8.TextDecoder(e.charset).decode(t)))}catch(H){return Promise.reject(H)}}})}),stream:Object.freeze({asReadableStream:t=>new d8(t),asWritableStream:t=>new _8(t)}),console,timer:Object.freeze({setTimeout(t,e,...H){let r=setTimeout(t,e,...H);return{dispose:()=>clearTimeout(r)}},setImmediate(t,...e){let H=setImmediate(t,...e);return{dispose:()=>clearImmediate(H)}},setInterval(t,e,...H){let r=setInterval(t,e,...H);return{dispose:()=>clearInterval(r)}}})});function U1(){return L8}(function(t){function e(){tue.default.install(L8)}t.install=e})(U1||(U1={}));F1.default=U1});var pl=P(ln=>{\"use strict\";Object.defineProperty(ln,\"__esModule\",{value:!0});ln.stringArray=ln.array=ln.func=ln.error=ln.number=ln.string=ln.boolean=void 0;function rue(t){return t===!0||t===!1}ln.boolean=rue;function I8(t){return typeof t==\"string\"||t instanceof String}ln.string=I8;function nue(t){return typeof t==\"number\"||t instanceof Number}ln.number=nue;function iue(t){return t instanceof Error}ln.error=iue;function sue(t){return typeof t==\"function\"}ln.func=sue;function A8(t){return Array.isArray(t)}ln.array=A8;function aue(t){return A8(t)&&t.every(e=>I8(e))}ln.stringArray=aue});var W1=P(Rt=>{\"use strict\";Object.defineProperty(Rt,\"__esModule\",{value:!0});Rt.Message=Rt.NotificationType9=Rt.NotificationType8=Rt.NotificationType7=Rt.NotificationType6=Rt.NotificationType5=Rt.NotificationType4=Rt.NotificationType3=Rt.NotificationType2=Rt.NotificationType1=Rt.NotificationType0=Rt.NotificationType=Rt.RequestType9=Rt.RequestType8=Rt.RequestType7=Rt.RequestType6=Rt.RequestType5=Rt.RequestType4=Rt.RequestType3=Rt.RequestType2=Rt.RequestType1=Rt.RequestType=Rt.RequestType0=Rt.AbstractMessageSignature=Rt.ParameterStructures=Rt.ResponseError=Rt.ErrorCodes=void 0;var Ku=pl(),g8;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(g8=Rt.ErrorCodes||(Rt.ErrorCodes={}));var wE=class extends Error{constructor(e,H,r){super(H);this.code=Ku.number(e)?e:g8.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,wE.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};Rt.ResponseError=wE;var jr=class{constructor(e){this.kind=e}static is(e){return e===jr.auto||e===jr.byName||e===jr.byPosition}toString(){return this.kind}};Rt.ParameterStructures=jr;jr.auto=new jr(\"auto\");jr.byPosition=new jr(\"byPosition\");jr.byName=new jr(\"byName\");var nr=class{constructor(e,H){this.method=e,this.numberOfParams=H}get parameterStructures(){return jr.auto}};Rt.AbstractMessageSignature=nr;var m8=class extends nr{constructor(e){super(e,0)}};Rt.RequestType0=m8;var $8=class extends nr{constructor(e,H=jr.auto){super(e,1);this._parameterStructures=H}get parameterStructures(){return this._parameterStructures}};Rt.RequestType=$8;var S8=class extends nr{constructor(e,H=jr.auto){super(e,1);this._parameterStructures=H}get parameterStructures(){return this._parameterStructures}};Rt.RequestType1=S8;var v8=class extends nr{constructor(e){super(e,2)}};Rt.RequestType2=v8;var D8=class extends nr{constructor(e){super(e,3)}};Rt.RequestType3=D8;var y8=class extends nr{constructor(e){super(e,4)}};Rt.RequestType4=y8;var b8=class extends nr{constructor(e){super(e,5)}};Rt.RequestType5=b8;var P8=class extends nr{constructor(e){super(e,6)}};Rt.RequestType6=P8;var x8=class extends nr{constructor(e){super(e,7)}};Rt.RequestType7=x8;var C8=class extends nr{constructor(e){super(e,8)}};Rt.RequestType8=C8;var M8=class extends nr{constructor(e){super(e,9)}};Rt.RequestType9=M8;var w8=class extends nr{constructor(e,H=jr.auto){super(e,1);this._parameterStructures=H}get parameterStructures(){return this._parameterStructures}};Rt.NotificationType=w8;var T8=class extends nr{constructor(e){super(e,0)}};Rt.NotificationType0=T8;var N8=class extends nr{constructor(e,H=jr.auto){super(e,1);this._parameterStructures=H}get parameterStructures(){return this._parameterStructures}};Rt.NotificationType1=N8;var k8=class extends nr{constructor(e){super(e,2)}};Rt.NotificationType2=k8;var R8=class extends nr{constructor(e){super(e,3)}};Rt.NotificationType3=R8;var O8=class extends nr{constructor(e){super(e,4)}};Rt.NotificationType4=O8;var U8=class extends nr{constructor(e){super(e,5)}};Rt.NotificationType5=U8;var F8=class extends nr{constructor(e){super(e,6)}};Rt.NotificationType6=F8;var W8=class extends nr{constructor(e){super(e,7)}};Rt.NotificationType7=W8;var B8=class extends nr{constructor(e){super(e,8)}};Rt.NotificationType8=B8;var q8=class extends nr{constructor(e){super(e,9)}};Rt.NotificationType9=q8;var oue;(function(t){function e(n){let i=n;return i&&Ku.string(i.method)&&(Ku.string(i.id)||Ku.number(i.id))}t.isRequest=e;function H(n){let i=n;return i&&Ku.string(i.method)&&n.id===void 0}t.isNotification=H;function r(n){let i=n;return i&&(i.result!==void 0||!!i.error)&&(Ku.string(i.id)||Ku.number(i.id)||i.id===null)}t.isResponse=r})(oue=Rt.Message||(Rt.Message={}))});var q1=P(Ma=>{\"use strict\";var X8;Object.defineProperty(Ma,\"__esModule\",{value:!0});Ma.LRUCache=Ma.LinkedMap=Ma.Touch=void 0;var gn;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(gn=Ma.Touch||(Ma.Touch={}));var B1=class{constructor(){this[X8]=\"LinkedMap\",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,H=gn.None){let r=this._map.get(e);if(!!r)return H!==gn.None&&this.touch(r,H),r.value}set(e,H,r=gn.None){let n=this._map.get(e);if(n)n.value=H,r!==gn.None&&this.touch(n,r);else{switch(n={key:e,value:H,next:void 0,previous:void 0},r){case gn.None:this.addItemLast(n);break;case gn.First:this.addItemFirst(n);break;case gn.Last:this.addItemLast(n);break;default:this.addItemLast(n);break}this._map.set(e,n),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let H=this._map.get(e);if(!!H)return this._map.delete(e),this.removeItem(H),this._size--,H.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error(\"Invalid list\");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,H){let r=this._state,n=this._head;for(;n;){if(H?e.bind(H)(n.value,n.key,this):e(n.value,n.key,this),this._state!==r)throw new Error(\"LinkedMap got modified during iteration.\");n=n.next}}keys(){let e=this._state,H=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error(\"LinkedMap got modified during iteration.\");if(H){let n={value:H.key,done:!1};return H=H.next,n}else return{value:void 0,done:!0}}};return r}values(){let e=this._state,H=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error(\"LinkedMap got modified during iteration.\");if(H){let n={value:H.value,done:!1};return H=H.next,n}else return{value:void 0,done:!0}}};return r}entries(){let e=this._state,H=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error(\"LinkedMap got modified during iteration.\");if(H){let n={value:[H.key,H.value],done:!1};return H=H.next,n}else return{value:void 0,done:!0}}};return r}[(X8=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let H=this._head,r=this.size;for(;H&&r>e;)this._map.delete(H.key),H=H.next,r--;this._head=H,this._size=r,H&&(H.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error(\"Invalid list\");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error(\"Invalid list\");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error(\"Invalid list\");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error(\"Invalid list\");e.previous.next=void 0,this._tail=e.previous}else{let H=e.next,r=e.previous;if(!H||!r)throw new Error(\"Invalid list\");H.previous=r,r.next=H}e.next=void 0,e.previous=void 0,this._state++}touch(e,H){if(!this._head||!this._tail)throw new Error(\"Invalid list\");if(!(H!==gn.First&&H!==gn.Last)){if(H===gn.First){if(e===this._head)return;let r=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(r.previous=n,n.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(H===gn.Last){if(e===this._tail)return;let r=e.next,n=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=n,n.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((H,r)=>{e.push([r,H])}),e}fromJSON(e){this.clear();for(let[H,r]of e)this.set(H,r)}};Ma.LinkedMap=B1;var V8=class extends B1{constructor(e,H=1){super();this._limit=e,this._ratio=Math.min(Math.max(0,H),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,H=gn.AsNew){return super.get(e,H)}peek(e){return super.get(e,gn.None)}set(e,H){return super.set(e,H,gn.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Ma.LRUCache=V8});var dl=P(ju=>{\"use strict\";Object.defineProperty(ju,\"__esModule\",{value:!0});ju.Emitter=ju.Event=void 0;var uue=Ca(),cue;(function(t){let e={dispose(){}};t.None=function(){return e}})(cue=ju.Event||(ju.Event={}));var G8=class{add(e,H=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(H),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,H)})}remove(e,H=null){if(!this._callbacks)return;let r=!1;for(let n=0,i=this._callbacks.length;n<i;n++)if(this._callbacks[n]===e)if(this._contexts[n]===H){this._callbacks.splice(n,1),this._contexts.splice(n,1);return}else r=!0;if(r)throw new Error(\"When adding a listener with a context, you should remove it with the same context\")}invoke(...e){if(!this._callbacks)return[];let H=[],r=this._callbacks.slice(0),n=this._contexts.slice(0);for(let i=0,s=r.length;i<s;i++)try{H.push(r[i].apply(n[i],e))}catch(a){(0,uue.default)().console.error(a)}return H}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},tp=class{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,H,r)=>{this._callbacks||(this._callbacks=new G8),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,H);let n={dispose:()=>{!this._callbacks||(this._callbacks.remove(e,H),n.dispose=tp._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(n),n}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};ju.Emitter=tp;tp._noop=function(){}});var Z1=P(zu=>{\"use strict\";Object.defineProperty(zu,\"__esModule\",{value:!0});zu.CancellationTokenSource=zu.CancellationToken=void 0;var lue=Ca(),fue=pl(),X1=dl(),V1;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:X1.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:X1.Event.None});function e(H){let r=H;return r&&(r===t.None||r===t.Cancelled||fue.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(V1=zu.CancellationToken||(zu.CancellationToken={}));var hue=Object.freeze(function(t,e){let H=(0,lue.default)().timer.setTimeout(t.bind(e),0);return{dispose(){H.dispose()}}}),G1=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?hue:(this._emitter||(this._emitter=new X1.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Z8=class{get token(){return this._token||(this._token=new G1),this._token}cancel(){this._token?this._token.cancel():this._token=V1.Cancelled}dispose(){this._token?this._token instanceof G1&&this._token.dispose():this._token=V1.None}};zu.CancellationTokenSource=Z8});var j8=P(wa=>{\"use strict\";Object.defineProperty(wa,\"__esModule\",{value:!0});wa.ReadableStreamMessageReader=wa.AbstractMessageReader=wa.MessageReader=void 0;var K1=Ca(),_l=pl(),j1=dl(),pue;(function(t){function e(H){let r=H;return r&&_l.func(r.listen)&&_l.func(r.dispose)&&_l.func(r.onError)&&_l.func(r.onClose)&&_l.func(r.onPartialMessage)}t.is=e})(pue=wa.MessageReader||(wa.MessageReader={}));var z1=class{constructor(){this.errorEmitter=new j1.Emitter,this.closeEmitter=new j1.Emitter,this.partialMessageEmitter=new j1.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${_l.string(e.message)?e.message:\"unknown\"}`)}};wa.AbstractMessageReader=z1;var J1;(function(t){function e(H){let r,n,i,s=new Map,a,o=new Map;if(H===void 0||typeof H==\"string\")r=H??\"utf-8\";else{if(r=H.charset??\"utf-8\",H.contentDecoder!==void 0&&(i=H.contentDecoder,s.set(i.name,i)),H.contentDecoders!==void 0)for(let u of H.contentDecoders)s.set(u.name,u);if(H.contentTypeDecoder!==void 0&&(a=H.contentTypeDecoder,o.set(a.name,a)),H.contentTypeDecoders!==void 0)for(let u of H.contentTypeDecoders)o.set(u.name,u)}return a===void 0&&(a=(0,K1.default)().applicationJson.decoder,o.set(a.name,a)),{charset:r,contentDecoder:i,contentDecoders:s,contentTypeDecoder:a,contentTypeDecoders:o}}t.fromOptions=e})(J1||(J1={}));var K8=class extends z1{constructor(e,H){super();this.readable=e,this.options=J1.fromOptions(H),this.buffer=(0,K1.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let H=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),H}onData(e){for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders();if(!n)return;let i=n.get(\"Content-Length\");if(!i)throw new Error(\"Header must provide a Content-Length property.\");let s=parseInt(i);if(isNaN(s))throw new Error(\"Content-Length value must be a number.\");this.nextMessageLength=s}let H=this.buffer.tryReadBody(this.nextMessageLength);if(H===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1;let r;this.options.contentDecoder!==void 0?r=this.options.contentDecoder.decode(H):r=Promise.resolve(H),r.then(n=>{this.options.contentTypeDecoder.decode(n,this.options).then(i=>{this.callback(i)},i=>{this.fireError(i)})},n=>{this.fireError(n)})}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,K1.default)().timer.setTimeout((e,H)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:H}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};wa.ReadableStreamMessageReader=K8});var J8=P(TE=>{\"use strict\";Object.defineProperty(TE,\"__esModule\",{value:!0});TE.Semaphore=void 0;var due=Ca(),z8=class{constructor(e=1){if(e<=0)throw new Error(\"Capacity must be greater than 0\");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((H,r)=>{this._waiting.push({thunk:e,resolve:H,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,due.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error(\"To many thunks active\");try{let H=e.thunk();H instanceof Promise?H.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(H),this.runNext())}catch(H){this._active--,e.reject(H),this.runNext()}}};TE.Semaphore=z8});var Hk=P(Ta=>{\"use strict\";Object.defineProperty(Ta,\"__esModule\",{value:!0});Ta.WriteableStreamMessageWriter=Ta.AbstractMessageWriter=Ta.MessageWriter=void 0;var Y8=Ca(),Hp=pl(),_ue=J8(),Q8=dl(),Lue=\"Content-Length: \",ek=`\\r\n                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            \n\nSyntaxError: Unexpected token '.'\n    at wrapSafe (internal/modules/cjs/loader.js:915:16)\n    at Module._compile (internal/modules/cjs/loader.js:963:27)\n    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)\n    at Module.load (internal/modules/cjs/loader.js:863:32)\n    at Function.Module._load (internal/modules/cjs/loader.js:708:14)\n    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)\n    at internal/main/run_main_module.js:17:47\n"

from lsp-zero.nvim.

DanielTate avatar DanielTate commented on June 1, 2024

Ok wow because I was working on an old project I had my nvm set to 12...

Setting nvm use 18 works. Any suggestions on how to have neovim always look at 18 instead of 12?

Edit... Nearly everything LSP, Snippets ect but not highlighting what is this an issue with tailwindcss-language-server?

from lsp-zero.nvim.

VonHeikemen avatar VonHeikemen commented on June 1, 2024

Assuming tailwindcss-language-server executable is a javascript file you could modify the command of the lsp server so it uses the correct node version.

lsp.configure('tailwindcss', {
  cmd = {'/path/to/node', '/path/to/tailwindcss', '--stdio'}
})

The equivalent with lspconfig.

require('lspconfig').tailwindcss.setup({
  cmd = {'/path/to/node', '/path/to/tailwindcss', '--stdio'}
})

from lsp-zero.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.