language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

๐Ÿ› BUG: Neovim broken lsp on dynamic routes

Open aaronjconway opened this issue 1 year ago โ€ข 35 comments

Describe the Bug

Currently when using dynamic [anything].astro routes I am having issues in neovim. No issues on other .astro files.

I get minimal lsp support but html, css and most ts not working.

Some but not all diagnostics work.

Formatting is either non existent or sometimes breaks on save. If I delete a line and save, it adds the line back.

vscode has no issues.

Thank you!!

Steps to Reproduce

I have a minimal neovim config at https://github.com/aaronjconway/astro_config

Steps to reproduce

  1. Init basic Astro with typescript
npm create astro@latest

Empty: yes
Typescript: yes - strict

  1. Add prettier and prettier-plugin-astro
npm i -D prettier prettier-plugin-astro

  1. Add the recommend .prettierrc.mjs found here: https://github.com/withastro/prettier-plugin-astro

// .prettierrc.mjs
/** @type {import("prettier").Config} */
export default {
  plugins: ['prettier-plugin-astro'],
  overrides: [
    {
      files: '*.astro',
      options: {
        parser: 'astro',
      },
    },
  ],
}

  1. make a [page].astro file test lsp in new astro file and no lsp

aaronjconway avatar Feb 19 '24 10:02 aaronjconway

Hmm, since this works fine in VS Code, Zed and other editors, I assume it's something specific to Neovim. Not too sure what, my guess would be something with the path handling, since this only happens on dynamic routes with []

Princesseuh avatar Feb 19 '24 12:02 Princesseuh

@aaronjconway I have the same problem, but not really sure if it's a problem with astro or with neovim. Please post an update if you find the culprit or a solution to this.

Update: Downgrading astro lsp to version 2.6.3 resolved the issue. Still looking for a proper solution to this.

omoiframe avatar Feb 20 '24 15:02 omoiframe

I have had the exact same issue and the solution with downgrading fixed the problem as @frametreon said.

I will try to see what I can find, when time allows for it on my end.

stauersbol avatar Feb 20 '24 18:02 stauersbol

If there's any logs or something that Neovim outputs, I'd be happy to take a look

Princesseuh avatar Feb 22 '24 11:02 Princesseuh

If there's any logs or something that Neovim outputs, I'd be happy to take a look

I think I have the time during the weekend, so I will give some update then!

stauersbol avatar Feb 22 '24 16:02 stauersbol

I am having the same problem here.

parK-dev avatar Feb 29 '24 06:02 parK-dev

Same issue happend with me today Working on normal routes: /blog.astro, /index.astro etc Not working on dynamic: /blog/[slug]/index.astro ...etc

sirjager avatar Feb 29 '24 17:02 sirjager

All those "It happens to me too" comments are unfortunately not helpful. If there's any logs from either Neovim or the language server, please share them.

Princesseuh avatar Feb 29 '24 17:02 Princesseuh

[DEBUG][2024-02-29 18:53:51] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 35,  jsonrpc = "2.0",  method = "workspace/configuration",  params = {    items = { {        scopeUri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro?virtualCodeId=root",        section = "prettier"      } }  }}
[DEBUG][2024-02-29 18:53:51] .../vim/lsp/rpc.lua:403	"server_request: callback result"	{  result = { vim.NIL },  status = true}
[DEBUG][2024-02-29 18:53:51] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 35,  jsonrpc = "2.0",  result = { vim.NIL }}
[DEBUG][2024-02-29 18:53:52] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 58,  jsonrpc = "2.0",  result = { {      newText = "---\nimport { getEvent } from '../../utils/directusClient'\nimport EventsBody from '../../components/Events/EventsBody.astro'\nconst { id } = Astro.params\n\nif (!id) throw new Error('Missing ID parameter')\n\nconst event = await getEvent(id)\n\nexport const prerender = false\n---\n\n<p></p>\n<div class=\"my-48 flex flex-col items-center justify-center space-y-6\">\n  <EventsBody content={event.event_info} />\n</div>\n",      range = {        ["end"] = {          character = 0,          line = 15        },        start = {          character = 0,          line = 0        }      }    } }}
[DEBUG][2024-02-29 18:53:52] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "textDocument/didChange",  params = {    contentChanges = { {        text = "---\nimport { getEvent } from '../../utils/directusClient'\nimport EventsBody from '../../components/Events/EventsBody.astro'\nconst { id } = Astro.params\n\nif (!id) throw new Error('Missing ID parameter')\n\nconst event = await getEvent(id)\n\nexport const prerender = false\n---\n\n<p></p>\n<div class=\"my-48 flex flex-col items-center justify-center space-y-6\">\n  <EventsBody content={event.event_info} />\n</div>\n</div>\n"      } },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",      version = 38    }  }}
[DEBUG][2024-02-29 18:53:52] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "textDocument/didChange",  params = {    contentChanges = { {        range = {          ["end"] = {            character = 6,            line = 15          },          start = {            character = 3,            line = 0          }        },        rangeLength = 416,        text = "\nimport { getEvent } from '../../utils/directusClient'\nimport EventsBody from '../../components/Events/EventsBody.astro'\nconst { id } = Astro.params\n\nif (!id) throw new Error('Missing ID parameter')\n\nconst event = await getEvent(id)\n\nexport const prerender = false\n---\n\n<p></p>\n<div class=\"my-48 flex flex-col items-center justify-center space-y-6\">\n  <EventsBody content={event.event_info} />\n</div>\n</div>"      } },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",      version = 38    }  }}
[DEBUG][2024-02-29 18:53:52] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "textDocument/didSave",  params = {    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"    }  }}
[DEBUG][2024-02-29 18:53:52] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "textDocument/didSave",  params = {    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"    }  }}
[DEBUG][2024-02-29 18:53:52] .../lua/vim/lsp.lua:1391	"LSP[astro]"	"client.request"	5	"textDocument/documentHighlight"	{  position = {    character = 25,    line = 1  },  textDocument = {    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"  }}	<function 1>	19
[DEBUG][2024-02-29 18:53:52] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 59,  jsonrpc = "2.0",  method = "textDocument/documentHighlight",  params = {    position = {      character = 25,      line = 1    },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"    }  }}
[DEBUG][2024-02-29 18:53:52] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "$/cancelRequest",  params = {    id = 59  }}
[DEBUG][2024-02-29 18:53:52] .../lua/vim/lsp.lua:1391	"LSP[astro]"	"client.request"	5	"textDocument/documentHighlight"	{  position = {    character = 25,    line = 1  },  textDocument = {    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"  }}	<function 1>	19
[DEBUG][2024-02-29 18:53:52] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 60,  jsonrpc = "2.0",  method = "textDocument/documentHighlight",  params = {    position = {      character = 25,      line = 1    },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"    }  }}
[DEBUG][2024-02-29 18:53:52] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 59,  jsonrpc = "2.0",  result = { {      kind = 2,      range = {        ["end"] = {          character = 52,          line = 1        },        start = {          character = 26,          line = 1        }      }    } }}
[DEBUG][2024-02-29 18:53:52] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 60,  jsonrpc = "2.0",  result = { {      kind = 2,      range = {        ["end"] = {          character = 52,          line = 1        },        start = {          character = 26,          line = 1        }      }    } }}
[DEBUG][2024-02-29 18:53:52] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 36,  jsonrpc = "2.0",  method = "workspace/configuration",  params = {    items = { {        section = "typescript.validate.enable"      } }  }}
[DEBUG][2024-02-29 18:53:52] .../vim/lsp/rpc.lua:403	"server_request: callback result"	{  result = { vim.NIL },  status = true}
[DEBUG][2024-02-29 18:53:52] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 36,  jsonrpc = "2.0",  result = { vim.NIL }}
[DEBUG][2024-02-29 18:53:52] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  jsonrpc = "2.0",  method = "textDocument/publishDiagnostics",  params = {    diagnostics = {},    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",    version = 38  }}
[DEBUG][2024-02-29 18:53:52] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  jsonrpc = "2.0",  method = "textDocument/publishDiagnostics",  params = {    diagnostics = {},    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"  }}

After turning on logging in neovim.

Probably a little hard to read, but I can't make it much more readable than this๐Ÿ˜…

Just a note, this is when I save the file after making a change. I added something to the html template and then also something to the JS section(not script element) I will try and show it looks with a recording in a moment.

Using version 2.7.6

stauersbol avatar Feb 29 '24 17:02 stauersbol

https://github.com/withastro/language-tools/assets/9026132/ddb21205-dc5a-47e3-9fe1-6970e919e9aa

Here is a small video of the issue in action, this is purely for reference.

stauersbol avatar Feb 29 '24 18:02 stauersbol

Thank you, the logs are helpful. I assume that perhaps VS Code decodes the paths and Neovim doesn't, not sure who's right. We'll investigate!

Princesseuh avatar Feb 29 '24 18:02 Princesseuh

Thank you, the logs are helpful. I assume that perhaps VS Code decodes the paths and Neovim doesn't, not sure who's right. We'll investigate!

Let me know if you need any more logs, I can always send a lot more๐Ÿ˜†

stauersbol avatar Feb 29 '24 18:02 stauersbol

Thank you, the logs are helpful. I assume that perhaps VS Code decodes the paths and Neovim doesn't, not sure who's right. We'll investigate!

Let me know if you need any more logs, I can always send a lot more๐Ÿ˜†

Something that would be useful is logs from 2.6.3 if you have them, just to see the difference in encoding

Princesseuh avatar Feb 29 '24 18:02 Princesseuh

Thank you, the logs are helpful. I assume that perhaps VS Code decodes the paths and Neovim doesn't, not sure who's right. We'll investigate!

Let me know if you need any more logs, I can always send a lot more๐Ÿ˜†

Something that would be useful is logs from 2.6.3 if you have them, just to see the difference in encoding

Yes let me get them those real quick.

stauersbol avatar Feb 29 '24 18:02 stauersbol

[DEBUG][2024-02-29 19:47:36] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  jsonrpc = "2.0",  method = "textDocument/publishDiagnostics",  params = {    diagnostics = {},    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"  }}
[DEBUG][2024-02-29 19:47:37] .../lua/vim/lsp.lua:1391	"LSP[astro]"	"client.request"	2	"textDocument/documentHighlight"	{  position = {    character = 2,    line = 10  },  textDocument = {    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"  }}	<function 1>	19
[DEBUG][2024-02-29 19:47:37] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 2,  jsonrpc = "2.0",  method = "textDocument/documentHighlight",  params = {    position = {      character = 2,      line = 10    },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"    }  }}
[DEBUG][2024-02-29 19:47:37] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 2,  jsonrpc = "2.0",  method = "workspace/configuration",  params = {    items = { {        section = "typescript.preferences"      } }  }}
[DEBUG][2024-02-29 19:47:37] .../vim/lsp/rpc.lua:403	"server_request: callback result"	{  result = { vim.NIL },  status = true}
[DEBUG][2024-02-29 19:47:37] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 2,  jsonrpc = "2.0",  result = { vim.NIL }}
[DEBUG][2024-02-29 19:47:38] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 3,  jsonrpc = "2.0",  method = "workspace/configuration",  params = {    items = { {        section = "html.customData"      } }  }}
[DEBUG][2024-02-29 19:47:38] .../vim/lsp/rpc.lua:403	"server_request: callback result"	{  result = { vim.NIL },  status = true}
[DEBUG][2024-02-29 19:47:38] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 3,  jsonrpc = "2.0",  result = { vim.NIL }}
[DEBUG][2024-02-29 19:47:38] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  jsonrpc = "2.0",  method = "textDocument/publishDiagnostics",  params = {    diagnostics = {},    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",    version = 0  }}
[DEBUG][2024-02-29 19:47:38] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  jsonrpc = "2.0",  method = "textDocument/publishDiagnostics",  params = {    diagnostics = {},    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",    version = 0  }}
[DEBUG][2024-02-29 19:47:38] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 2,  jsonrpc = "2.0",  result = {}}
[DEBUG][2024-02-29 19:47:38] .../lua/vim/lsp.lua:1391	"LSP[astro]"	"client.request"	2	"textDocument/documentHighlight"	{  position = {    character = 2,    line = 10  },  textDocument = {    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"  }}	<function 1>	19
[DEBUG][2024-02-29 19:47:38] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 3,  jsonrpc = "2.0",  method = "textDocument/documentHighlight",  params = {    position = {      character = 2,      line = 10    },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"    }  }}
[DEBUG][2024-02-29 19:47:38] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 3,  jsonrpc = "2.0",  result = {}}
[DEBUG][2024-02-29 19:47:38] .../lua/vim/lsp.lua:1391	"LSP[astro]"	"client.request"	2	"textDocument/documentHighlight"	{  position = {    character = 3,    line = 10  },  textDocument = {    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"  }}	<function 1>	19
[DEBUG][2024-02-29 19:47:38] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 4,  jsonrpc = "2.0",  method = "textDocument/documentHighlight",  params = {    position = {      character = 3,      line = 10    },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"    }  }}
[DEBUG][2024-02-29 19:47:38] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 4,  jsonrpc = "2.0",  result = {}}
[DEBUG][2024-02-29 19:47:38] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "textDocument/didChange",  params = {    contentChanges = { {        range = {          ["end"] = {            character = 3,            line = 10          },          start = {            character = 3,            line = 10          }        },        rangeLength = 0,        text = "\n"      } },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",      version = 3    }  }}
[DEBUG][2024-02-29 19:47:38] .../lua/vim/lsp.lua:1391	"LSP[astro]"	"client.request"	2	"textDocument/documentHighlight"	{  position = {    character = 0,    line = 11  },  textDocument = {    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"  }}	<function 1>	19
[DEBUG][2024-02-29 19:47:38] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 5,  jsonrpc = "2.0",  method = "textDocument/documentHighlight",  params = {    position = {      character = 0,      line = 11    },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"    }  }}
[DEBUG][2024-02-29 19:47:38] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 5,  jsonrpc = "2.0",  result = {}}
[DEBUG][2024-02-29 19:47:39] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "textDocument/didChange",  params = {    contentChanges = { {        range = {          ["end"] = {            character = 0,            line = 11          },          start = {            character = 0,            line = 11          }        },        rangeLength = 0,        text = "\n"      } },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",      version = 4    }  }}
[DEBUG][2024-02-29 19:47:39] .../lua/vim/lsp.lua:1391	"LSP[astro]"	"client.request"	2	"textDocument/documentHighlight"	{  position = {    character = 0,    line = 12  },  textDocument = {    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"  }}	<function 1>	19
[DEBUG][2024-02-29 19:47:39] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 6,  jsonrpc = "2.0",  method = "textDocument/documentHighlight",  params = {    position = {      character = 0,      line = 12    },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"    }  }}
[DEBUG][2024-02-29 19:47:39] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 6,  jsonrpc = "2.0",  result = {}}
[DEBUG][2024-02-29 19:47:39] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "textDocument/didChange",  params = {    contentChanges = { {        text = "---\nimport { getEvent } from '../../utils/directusClient'\nimport EventsBody from '../../components/Events/EventsBody.astro'\nconst { id } = Astro.params\n\nif (!id) throw new Error('Missing ID parameter')\n\nconst event = await getEvent(id)\n\nexport const prerender = false\n---\n\n\n<div class=\"my-48 flex flex-col items-center justify-center space-y-6\">\n  <EventsBody content={event.event_info} />\n</div>\n"      } },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",      version = 4    }  }}
[DEBUG][2024-02-29 19:47:39] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "textDocument/didChange",  params = {    contentChanges = { {        range = {          ["end"] = {            character = 0,            line = 12          },          start = {            character = 0,            line = 12          }        },        rangeLength = 0,        text = "p"      } },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",      version = 5    }  }}
[DEBUG][2024-02-29 19:47:39] .../lua/vim/lsp.lua:1391	"LSP[astro]"	"client.request"	2	"textDocument/documentHighlight"	{  position = {    character = 1,    line = 12  },  textDocument = {    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"  }}	<function 1>	19
[DEBUG][2024-02-29 19:47:39] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 7,  jsonrpc = "2.0",  method = "textDocument/documentHighlight",  params = {    position = {      character = 1,      line = 12    },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"    }  }}
[DEBUG][2024-02-29 19:47:39] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "textDocument/didChange",  params = {    contentChanges = { {        text = "---\nimport { getEvent } from '../../utils/directusClient'\nimport EventsBody from '../../components/Events/EventsBody.astro'\nconst { id } = Astro.params\n\nif (!id) throw new Error('Missing ID parameter')\n\nconst event = await getEvent(id)\n\nexport const prerender = false\n---\n\np\n<div class=\"my-48 flex flex-col items-center justify-center space-y-6\">\n  <EventsBody content={event.event_info} />\n</div>\n"      } },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",      version = 5    }  }}
[DEBUG][2024-02-29 19:47:39] .../lua/vim/lsp.lua:1391	"LSP[tailwindcss]"	"client.request"	1	"textDocument/completion"	{  context = {    triggerKind = 1  },  position = {    character = 1,    line = 12  },  textDocument = {    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"  }}	<function 1>	19
[DEBUG][2024-02-29 19:47:39] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 2,  jsonrpc = "2.0",  method = "textDocument/completion",  params = {    context = {      triggerKind = 1    },    position = {      character = 1,      line = 12    },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"    }  }}
[DEBUG][2024-02-29 19:47:39] .../lua/vim/lsp.lua:1391	"LSP[astro]"	"client.request"	2	"textDocument/completion"	{  context = {    triggerKind = 1  },  position = {    character = 1,    line = 12  },  textDocument = {    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"  }}	<function 1>	19
[DEBUG][2024-02-29 19:47:39] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 8,  jsonrpc = "2.0",  method = "textDocument/completion",  params = {    context = {      triggerKind = 1    },    position = {      character = 1,      line = 12    },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"    }  }}
[DEBUG][2024-02-29 19:47:39] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 2,  jsonrpc = "2.0"}
[DEBUG][2024-02-29 19:47:39] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 7,  jsonrpc = "2.0",  result = {}}
[DEBUG][2024-02-29 19:47:39] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  jsonrpc = "2.0",  method = "textDocument/publishDiagnostics",  params = {    diagnostics = {},    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",    version = 4  }}
[DEBUG][2024-02-29 19:47:39] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  jsonrpc = "2.0",  method = "textDocument/publishDiagnostics",  params = {    diagnostics = {},    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",    version = 4  }}
[DEBUG][2024-02-29 19:47:39] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 4,  jsonrpc = "2.0",  method = "workspace/configuration",  params = {    items = { {        section = "html.completion"      } }  }}
[DEBUG][2024-02-29 19:47:39] .../vim/lsp/rpc.lua:403	"server_request: callback result"	{  result = { vim.NIL },  status = true}
[DEBUG][2024-02-29 19:47:39] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 4,  jsonrpc = "2.0",  result = { vim.NIL }}
[DEBUG][2024-02-29 19:47:39] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 5,  jsonrpc = "2.0",  method = "workspace/configuration",  params = {    items = { {        section = "emmet"      } }  }}
[DEBUG][2024-02-29 19:47:39] .../vim/lsp/rpc.lua:403	"server_request: callback result"	{  result = { vim.NIL },  status = true}
[DEBUG][2024-02-29 19:47:39] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 5,  jsonrpc = "2.0",  result = { vim.NIL }}
[DEBUG][2024-02-29 19:47:39] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 8,  jsonrpc = "2.0",  result = {    isIncomplete = true,    items = { {        data = {          original = {            textEdit = {              newText = "<p>${0}</p>",              range = {                ["end"] = {                  character = 1,                  line = 2                },                start = {                  character = 0,                  line = 2                }              }            }          },          serviceId = "emmet",          uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",          virtualDocumentUri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5Bid%5D.astro.html"        },        detail = "Emmet Abbreviation",        documentation = "<p>|</p>",        insertTextFormat = 2,        label = "p",        textEdit = {          newText = "<p>${0}</p>",          range = {            ["end"] = {              character = 1,              line = 12            },            start = {              character = 0,              line = 12            }          }        }      }, {        data = {          original = {            textEdit = {              newText = "<pre>${0}</pre>",              range = {                ["end"] = {                  character = 1,                  line = 2                },                start = {                  character = 0,                  line = 2                }              }            }          },          serviceId = "emmet",          uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",          virtualDocumentUri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5Bid%5D.astro.html"        },        detail = "Emmet Abbreviation",        documentation = "<pre>|</pre>",        insertTextFormat = 2,        label = "pre",        textEdit = {          newText = "<pre>${0}</pre>",          range = {            ["end"] = {              character = 1,              line = 12            },            start = {              character = 0,              line = 12            }          }        }      }, {        data = {          original = {            textEdit = {              newText = '<param name="${1}" value="${0}">',              range = {                ["end"] = {                  character = 1,                  line = 2                },                start = {                  character = 0,                  line = 2                }              }            }          },          serviceId = "emmet",          uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",          virtualDocumentUri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5Bid%5D.astro.html"        },        detail = "Emmet Abbreviation",        documentation = '<param name="|" value="|">',        insertTextFormat = 2,        label = "param",        textEdit = {          newText = '<param name="${1}" value="${0}">',          range = {            ["end"] = {              character = 1,              line = 12            },            start = {              character = 0,              line = 12            }          }        }      }, {        data = {          original = {            textEdit = {              newText = "<plaintext>${0}</plaintext>",              range = {                ["end"] = {                  character = 1,                  line = 2                },                start = {                  character = 0,                  line = 2                }              }            }          },          serviceId = "emmet",          uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",          virtualDocumentUri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5Bid%5D.astro.html"        },        detail = "Emmet Abbreviation",        documentation = "<plaintext>|</plaintext>",        insertTextFormat = 2,        label = "plaintext",        textEdit = {          newText = "<plaintext>${0}</plaintext>",          range = {            ["end"] = {              character = 1,              line = 12            },            start = {              character = 0,              line = 12            }          }        }      } }  }}
[DEBUG][2024-02-29 19:47:39] .../lua/vim/lsp.lua:1391	"LSP[astro]"	"client.request"	2	"completionItem/resolve"	{  data = {    original = {      textEdit = {        newText = "<p>${0}</p>",        range = {          ["end"] = {            character = 1,            line = 2          },          start = {            character = 0,            line = 2          }        }      }    },    serviceId = "emmet",    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",    virtualDocumentUri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5Bid%5D.astro.html"  },  detail = "Emmet Abbreviation",  documentation = "<p>|</p>",  insertTextFormat = 2,  label = "p",  textEdit = {    newText = "<p>${0}</p>",    range = {      ["end"] = {        character = 1,        line = 12      },      start = {        character = 0,        line = 12      }    }  }}	<function 1>	19
[DEBUG][2024-02-29 19:47:39] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 9,  jsonrpc = "2.0",  method = "completionItem/resolve",  params = {    data = {      original = {        textEdit = {          newText = "<p>${0}</p>",          range = {            ["end"] = {              character = 1,              line = 2            },            start = {              character = 0,              line = 2            }          }        }      },      serviceId = "emmet",      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",      virtualDocumentUri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5Bid%5D.astro.html"    },    detail = "Emmet Abbreviation",    documentation = "<p>|</p>",    insertTextFormat = 2,    label = "p",    textEdit = {      newText = "<p>${0}</p>",      range = {        ["end"] = {          character = 1,          line = 12        },        start = {          character = 0,          line = 12        }      }    }  }}
[DEBUG][2024-02-29 19:47:39] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 9,  jsonrpc = "2.0",  result = {    data = {      original = {        textEdit = {          newText = "<p>${0}</p>",          range = {            ["end"] = {              character = 1,              line = 2            },            start = {              character = 0,              line = 2            }          }        }      },      serviceId = "emmet",      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",      virtualDocumentUri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5Bid%5D.astro.html"    },    detail = "Emmet Abbreviation",    documentation = "<p>|</p>",    insertTextFormat = 2,    label = "p",    textEdit = {      newText = "<p>${0}</p>",      range = {        ["end"] = {          character = 1,          line = 12        },        start = {          character = 0,          line = 12        }      }    }  }}
[DEBUG][2024-02-29 19:47:39] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  jsonrpc = "2.0",  method = "textDocument/publishDiagnostics",  params = {    diagnostics = {},    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"  }}
[DEBUG][2024-02-29 19:47:40] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  jsonrpc = "2.0",  method = "textDocument/publishDiagnostics",  params = {    diagnostics = {},    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",    version = 5  }}
[DEBUG][2024-02-29 19:47:40] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  jsonrpc = "2.0",  method = "textDocument/publishDiagnostics",  params = {    diagnostics = {},    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",    version = 5  }}
[DEBUG][2024-02-29 19:47:40] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "textDocument/didChange",  params = {    contentChanges = { {        text = "---\nimport { getEvent } from '../../utils/directusClient'\nimport EventsBody from '../../components/Events/EventsBody.astro'\nconst { id } = Astro.params\n\nif (!id) throw new Error('Missing ID parameter')\n\nconst event = await getEvent(id)\n\nexport const prerender = false\n---\n\n\n<div class=\"my-48 flex flex-col items-center justify-center space-y-6\">\n  <EventsBody content={event.event_info} />\n</div>\n"      } },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",      version = 6    }  }}
[DEBUG][2024-02-29 19:47:40] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "textDocument/didChange",  params = {    contentChanges = { {        range = {          ["end"] = {            character = 1,            line = 12          },          start = {            character = 0,            line = 12          }        },        rangeLength = 1,        text = ""      } },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",      version = 6    }  }}
[DEBUG][2024-02-29 19:47:40] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "textDocument/didChange",  params = {    contentChanges = { {        range = {          ["end"] = {            character = 0,            line = 12          },          start = {            character = 0,            line = 12          }        },        rangeLength = 0,        text = "<"      }, {        range = {          ["end"] = {            character = 1,            line = 12          },          start = {            character = 1,            line = 12          }        },        rangeLength = 0,        text = "p"      }, {        range = {          ["end"] = {            character = 2,            line = 12          },          start = {            character = 2,            line = 12          }        },        rangeLength = 0,        text = ">"      }, {        range = {          ["end"] = {            character = 3,            line = 12          },          start = {            character = 0,            line = 12          }        },        rangeLength = 3,        text = "p"      }, {        range = {          ["end"] = {            character = 1,            line = 12          },          start = {            character = 0,            line = 12          }        },        rangeLength = 1,        text = ""      }, {        range = {          ["end"] = {            character = 0,            line = 12          },          start = {            character = 0,            line = 12          }        },        rangeLength = 0,        text = "<p>"      }, {        range = {          ["end"] = {            character = 3,            line = 12          },          start = {            character = 3,            line = 12          }        },        rangeLength = 0,        text = ""      }, {        range = {          ["end"] = {            character = 3,            line = 12          },          start = {            character = 3,            line = 12          }        },        rangeLength = 0,        text = "</p>"      } },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",      version = 14    }  }}
[DEBUG][2024-02-29 19:47:40] .../lua/vim/lsp.lua:1391	"LSP[astro]"	"client.request"	2	"textDocument/documentHighlight"	{  position = {    character = 3,    line = 12  },  textDocument = {    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"  }}	<function 1>	19
[DEBUG][2024-02-29 19:47:40] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 10,  jsonrpc = "2.0",  method = "textDocument/documentHighlight",  params = {    position = {      character = 3,      line = 12    },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"    }  }}
[DEBUG][2024-02-29 19:47:40] .../lua/vim/lsp.lua:1391	"LSP[astro]"	"client.request"	2	"textDocument/completion"	{  context = {    triggerCharacter = ">",    triggerKind = 2  },  position = {    character = 3,    line = 12  },  textDocument = {    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"  }}	<function 1>	19
[DEBUG][2024-02-29 19:47:40] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 11,  jsonrpc = "2.0",  method = "textDocument/completion",  params = {    context = {      triggerCharacter = ">",      triggerKind = 2    },    position = {      character = 3,      line = 12    },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"    }  }}
[DEBUG][2024-02-29 19:47:40] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 10,  jsonrpc = "2.0",  result = { {      kind = 2,      range = {        ["end"] = {          character = 2,          line = 12        },        start = {          character = 1,          line = 12        }      }    }, {      kind = 2,      range = {        ["end"] = {          character = 6,          line = 12        },        start = {          character = 5,          line = 12        }      }    } }}
[DEBUG][2024-02-29 19:47:40] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 6,  jsonrpc = "2.0",  method = "workspace/configuration",  params = {    items = { {        section = "emmet"      } }  }}
[DEBUG][2024-02-29 19:47:40] .../vim/lsp/rpc.lua:403	"server_request: callback result"	{  result = { vim.NIL },  status = true}
[DEBUG][2024-02-29 19:47:40] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 6,  jsonrpc = "2.0",  result = { vim.NIL }}
[DEBUG][2024-02-29 19:47:40] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 11,  jsonrpc = "2.0",  result = {    isIncomplete = false,    items = {}  }}
[DEBUG][2024-02-29 19:47:40] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "textDocument/didChange",  params = {    contentChanges = { {        text = "---\nimport { getEvent } from '../../utils/directusClient'\nimport EventsBody from '../../components/Events/EventsBody.astro'\nconst { id } = Astro.params\n\nif (!id) throw new Error('Missing ID parameter')\n\nconst event = await getEvent(id)\n\nexport const prerender = false\n---\n\n<p></p>\n<div class=\"my-48 flex flex-col items-center justify-center space-y-6\">\n  <EventsBody content={event.event_info} />\n</div>\n"      } },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",      version = 14    }  }}
[DEBUG][2024-02-29 19:47:40] .../lua/vim/lsp.lua:1391	"LSP[astro]"	"client.request"	2	"textDocument/documentHighlight"	{  position = {    character = 2,    line = 12  },  textDocument = {    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"  }}	<function 1>	19
[DEBUG][2024-02-29 19:47:40] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 12,  jsonrpc = "2.0",  method = "textDocument/documentHighlight",  params = {    position = {      character = 2,      line = 12    },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"    }  }}
[DEBUG][2024-02-29 19:47:40] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "$/cancelRequest",  params = {    id = 12  }}
[DEBUG][2024-02-29 19:47:40] .../lua/vim/lsp.lua:1391	"LSP[astro]"	"client.request"	2	"textDocument/documentHighlight"	{  position = {    character = 2,    line = 12  },  textDocument = {    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"  }}	<function 1>	19
[DEBUG][2024-02-29 19:47:40] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 13,  jsonrpc = "2.0",  method = "textDocument/documentHighlight",  params = {    position = {      character = 2,      line = 12    },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"    }  }}
[DEBUG][2024-02-29 19:47:40] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 12,  jsonrpc = "2.0"}
[DEBUG][2024-02-29 19:47:40] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 13,  jsonrpc = "2.0",  result = { {      kind = 2,      range = {        ["end"] = {          character = 2,          line = 12        },        start = {          character = 1,          line = 12        }      }    }, {      kind = 2,      range = {        ["end"] = {          character = 6,          line = 12        },        start = {          character = 5,          line = 12        }      }    }, {      kind = 2,      range = {        ["end"] = {          character = 2,          line = 12        },        start = {          character = 1,          line = 12        }      }    }, {      kind = 2,      range = {        ["end"] = {          character = 6,          line = 12        },        start = {          character = 5,          line = 12        }      }    } }}
[DEBUG][2024-02-29 19:47:40] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  jsonrpc = "2.0",  method = "textDocument/publishDiagnostics",  params = {    diagnostics = {},    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",    version = 14  }}
[DEBUG][2024-02-29 19:47:40] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  jsonrpc = "2.0",  method = "textDocument/publishDiagnostics",  params = {    diagnostics = {},    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",    version = 14  }}
[DEBUG][2024-02-29 19:47:40] .../lua/vim/lsp.lua:1391	"LSP[astro]"	"client.request"	2	"textDocument/documentHighlight"	{  position = {    character = 2,    line = 12  },  textDocument = {    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"  }}	<function 1>	19
[DEBUG][2024-02-29 19:47:40] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 14,  jsonrpc = "2.0",  method = "textDocument/documentHighlight",  params = {    position = {      character = 2,      line = 12    },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"    }  }}
[DEBUG][2024-02-29 19:47:40] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 14,  jsonrpc = "2.0",  result = { {      kind = 2,      range = {        ["end"] = {          character = 2,          line = 12        },        start = {          character = 1,          line = 12        }      }    }, {      kind = 2,      range = {        ["end"] = {          character = 6,          line = 12        },        start = {          character = 5,          line = 12        }      }    }, {      kind = 2,      range = {        ["end"] = {          character = 2,          line = 12        },        start = {          character = 1,          line = 12        }      }    }, {      kind = 2,      range = {        ["end"] = {          character = 6,          line = 12        },        start = {          character = 5,          line = 12        }      }    } }}
[DEBUG][2024-02-29 19:47:40] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  jsonrpc = "2.0",  method = "textDocument/publishDiagnostics",  params = {    diagnostics = {},    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"  }}
[DEBUG][2024-02-29 19:47:41] .../lua/vim/lsp.lua:1391	"LSP[astro]"	"client.request"	2	"textDocument/documentHighlight"	{  position = {    character = 2,    line = 12  },  textDocument = {    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"  }}	<function 1>	19
[DEBUG][2024-02-29 19:47:41] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 15,  jsonrpc = "2.0",  method = "textDocument/documentHighlight",  params = {    position = {      character = 2,      line = 12    },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"    }  }}
[DEBUG][2024-02-29 19:47:41] .../lua/vim/lsp.lua:1391	"LSP[astro]"	"client.request"	2	"textDocument/formatting"	{  options = {    insertSpaces = true,    tabSize = 2  },  textDocument = {    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"  }}	<function 1>	19
[DEBUG][2024-02-29 19:47:41] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 16,  jsonrpc = "2.0",  method = "textDocument/formatting",  params = {    options = {      insertSpaces = true,      tabSize = 2    },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"    }  }}
[DEBUG][2024-02-29 19:47:41] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 15,  jsonrpc = "2.0",  result = { {      kind = 2,      range = {        ["end"] = {          character = 2,          line = 12        },        start = {          character = 1,          line = 12        }      }    }, {      kind = 2,      range = {        ["end"] = {          character = 6,          line = 12        },        start = {          character = 5,          line = 12        }      }    }, {      kind = 2,      range = {        ["end"] = {          character = 2,          line = 12        },        start = {          character = 1,          line = 12        }      }    }, {      kind = 2,      range = {        ["end"] = {          character = 6,          line = 12        },        start = {          character = 5,          line = 12        }      }    } }}
[DEBUG][2024-02-29 19:47:41] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 7,  jsonrpc = "2.0",  method = "workspace/configuration",  params = {    items = { {        section = "volar.format.initialIndent"      } }  }}
[DEBUG][2024-02-29 19:47:41] .../vim/lsp/rpc.lua:403	"server_request: callback result"	{  result = { vim.NIL },  status = true}
[DEBUG][2024-02-29 19:47:41] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 7,  jsonrpc = "2.0",  result = { vim.NIL }}
[DEBUG][2024-02-29 19:47:41] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 8,  jsonrpc = "2.0",  method = "workspace/configuration",  params = {    items = { {        scopeUri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5Bid%5D.astro",        section = "prettier"      } }  }}
[DEBUG][2024-02-29 19:47:41] .../vim/lsp/rpc.lua:403	"server_request: callback result"	{  result = { vim.NIL },  status = true}
[DEBUG][2024-02-29 19:47:41] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 8,  jsonrpc = "2.0",  result = { vim.NIL }}
[DEBUG][2024-02-29 19:47:42] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "$/cancelRequest",  params = {    id = 16  }}
[DEBUG][2024-02-29 19:47:42] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "textDocument/didSave",  params = {    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"    }  }}
[DEBUG][2024-02-29 19:47:42] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "textDocument/didSave",  params = {    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"    }  }}
[DEBUG][2024-02-29 19:47:42] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 16,  jsonrpc = "2.0"}
[DEBUG][2024-02-29 19:47:45] .../lua/vim/lsp.lua:1391	"LSP[astro]"	"client.request"	2	"textDocument/documentHighlight"	{  position = {    character = 6,    line = 12  },  textDocument = {    uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"  }}	<function 1>	19
[DEBUG][2024-02-29 19:47:45] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 17,  jsonrpc = "2.0",  method = "textDocument/documentHighlight",  params = {    position = {      character = 6,      line = 12    },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro"    }  }}
[DEBUG][2024-02-29 19:47:45] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 17,  jsonrpc = "2.0",  result = { {      kind = 2,      range = {        ["end"] = {          character = 2,          line = 12        },        start = {          character = 1,          line = 12        }      }    }, {      kind = 2,      range = {        ["end"] = {          character = 6,          line = 12        },        start = {          character = 5,          line = 12        }      }    }, {      kind = 2,      range = {        ["end"] = {          character = 2,          line = 12        },        start = {          character = 1,          line = 12        }      }    }, {      kind = 2,      range = {        ["end"] = {          character = 6,          line = 12        },        start = {          character = 5,          line = 12        }      }    } }}

Here is a bunch, just from multiple times of me saving (using version 2.6.3)

stauersbol avatar Feb 29 '24 18:02 stauersbol

screenrecord.mp4 Here is a small video of the issue in action, this is purely for reference.

Running hyprland ?

sirjager avatar Feb 29 '24 20:02 sirjager

screenrecord.mp4 Here is a small video of the issue in action, this is purely for reference.

Running hyprland ?

Off topic but yes.

stauersbol avatar Feb 29 '24 20:02 stauersbol

unfortunately I am very new to programming in general and not good at debugging. The logs don't show anything useful for me( as in lsp.log is blank).

What I have found so far is that when inspecting the context object that's passed into volar stuff, the snapshot that ends up getting generated is a StringScriptSnapshot on dynamic routes.

In fact, any characters that would be url enocded anywhere in the file path will break it. so /[path]/test.astro will also not have any lsp.

My guess is that somewhere a URI.parse or URI.file is being used incorrectly or there is an assumption that a path either is or isn't encoded and that's causing a bad uri.

I really appreciate all the effort so we can struggle in agony in neovim instead of using vscode lol.

aaronjconway avatar Feb 29 '24 21:02 aaronjconway

I don't know if the following can help but from my observation it seems that the problem only applies to diagnostics, completion and highlighting. The server is correctly running and code action and documentSymbol work fine, the diagnostics response is always an empty array for some reason and the response from completion request never comes back. And I doubt the problem is related to URI.

luckasRanarison avatar Mar 11 '24 18:03 luckasRanarison

And I doubt the problem is related to URI.

It is definitely not the URI. As the URI is the exact same when I used v2.6.3.

stauersbol avatar Mar 12 '24 08:03 stauersbol

While it might not be related to the URI shown in the logs, it might still be something related to path encoding. I investigated a little and couldn't quite find what just yet, though

Princesseuh avatar Mar 12 '24 08:03 Princesseuh

[DEBUG][2024-02-29 18:53:52] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 58,  jsonrpc = "2.0",  result = { {      newText = "---\nimport { getEvent } from '../../utils/directusClient'\nimport EventsBody from '../../components/Events/EventsBody.astro'\nconst { id } = Astro.params\n\nif (!id) throw new Error('Missing ID parameter')\n\nconst event = await getEvent(id)\n\nexport const prerender = false\n---\n\n<p></p>\n<div class=\"my-48 flex flex-col items-center justify-center space-y-6\">\n  <EventsBody content={event.event_info} />\n</div>\n",      range = {        ["end"] = {          character = 0,          line = 15        },        start = {          character = 0,          line = 0        }      }    } }}
[DEBUG][2024-02-29 18:53:52] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "textDocument/didChange",  params = {    contentChanges = { {        text = "---\nimport { getEvent } from '../../utils/directusClient'\nimport EventsBody from '../../components/Events/EventsBody.astro'\nconst { id } = Astro.params\n\nif (!id) throw new Error('Missing ID parameter')\n\nconst event = await getEvent(id)\n\nexport const prerender = false\n---\n\n<p></p>\n<div class=\"my-48 flex flex-col items-center justify-center space-y-6\">\n  <EventsBody content={event.event_info} />\n</div>\n</div>\n"      } },    textDocument = {      uri = "file:///mnt/data/Projects/bluemeow/website/src/pages/events/%5bid%5d.astro",      version = 38    }  }}

I noticed that the content these 2 logs provide are different, the last one has a added div at the end, which is what I remember happened. But the first log message did not include it. I tried looking in the code, but it seems like there is some boilerplate I'd need to investigate on Volar's end.

EDIT (sorry for the messy \n): Here is how it looks in a better format First log msg:

---\n
import { getEvent } from '../../utils/directusClient'\n
import EventsBody from '../../components/Events/EventsBody.astro'\n
const { id } = Astro.params\n\n
if (!id) throw new Error('Missing ID parameter')\n\n
const event = await getEvent(id)\n\n
export const prerender = false\n
---\n\n
<p></p>\n
<div class=\"my-48 flex flex-col items-center justify-center space-y-6\">
\n  <EventsBody content={event.event_info} />\n
</div>\n

Second log msg:

---\n
import { getEvent } from '../../utils/directusClient'\n
import EventsBody from '../../components/Events/EventsBody.astro'\n
const { id } = Astro.params\n\n
if (!id) throw new Error('Missing ID parameter')\n\n
const event = await getEvent(id)\n\n
export const prerender = false\n
---\n\n
<p></p>\n
<div class=\"my-48 flex flex-col items-center justify-center space-y-6\">
\n  <EventsBody content={event.event_info} />\n
</div>\n
</div>\n

stauersbol avatar Mar 12 '24 09:03 stauersbol

Any update on this @stauersbol?

stuartpbw-id avatar Mar 19 '24 13:03 stuartpbw-id

Any update on this @stauersbol?

Not anymore than what I gave, so you'd have to wait for @Princesseuh to have an update for you

stauersbol avatar Mar 19 '24 13:03 stauersbol

Right on, @stauersbol.

@Princesseuh Let me know how I can help. Happy to provide logs, etc.

stuartpbw-id avatar Mar 19 '24 13:03 stuartpbw-id

A little update!

I think I can find a way to debug the language server. Mason does all the things to setup the actual language server. I can change the local files and see how it behaves and possibly find the place where it fails.

I did some digging on the boilerplate that volar.js uses to handle document changes textDocument/didChange, I saw they had implemented a test-util for this, but they sadly don't ever use it.

EDIT:

I'll also try disabling any formatting (prettier in this case), and saving to see if that is one of the reasons for the appearance of multiple close tags

EDIT 2:

Looks like a possible solution was found in the comment below by Aaron.

stauersbol avatar Apr 22 '24 18:04 stauersbol

@Princesseuh again, I'll mention that I really don't know what I'm doing but I believe I have a solution.

The issue seems to be in Volar. Is the next step bringing this up in volar?

There are some places in volar where we do a .get() on a key where the case was changed. Here you can see the encoding case has changed.

image

in @volar/language-server/lib/uri.js the fileNameToURI function I added a tolowercase in the return and we're now working in neovim. This was because in project/typescriptProject.js there is a context.documents.get() that was checking on a key that hadn't been lower cased yet for whatever reason.

function fileNameToUri(fileName) {
    if (fileName.startsWith('/') && fileName.includes('@@')) {
        const parts = fileName.slice(1).split('@@');
        if (parts.length !== 3) {
            throw new Error('Invalid file name');
        }
        return vscode_uri_1.URI.from({
            scheme: parts[0],
            authority: parts[1],
            path: parts[2],
        }).toString();
    }
    return vscode_uri_1.URI.file(fileName).toString().toLowerCase()

Here is where the key is checked. Because somewhere the encoding is lowercased this key is not found and no snapshot is returned. The no snapshot causes all sort of problems such as inability to save updated state, no completion etc.

So either we should just add the tolowercase in the filenametouri, or maybe figuring out why we are changing the case of the encoding. image

aaronjconway avatar Apr 25 '24 16:04 aaronjconway

Awesome work investigating this! I have brought it up internally in Volar and we'll attempt to get a fix out. I wonder why it works in VS Code then.

Princesseuh avatar Apr 25 '24 17:04 Princesseuh

of course the more I test I realize that if you add the lowercase it disables lsp in other areas. : (

At least now we know that somewhere it's the changing of case in the encoding that's messing things up. I tried to figure out where but was having a hard time. I'm actually not sure why we lowercase at all in uriMap.js

aaronjconway avatar Apr 27 '24 04:04 aaronjconway

Please try the last version!

Princesseuh avatar May 07 '24 09:05 Princesseuh