Skip to content

Commit a9ee42d

Browse files
committed
feat: add preliminary completion for observable js chunks
1 parent d62b8a9 commit a9ee42d

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

lua/config/experimental.lua

-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ local actions = require("telescope.actions")
55
local action_state = require("telescope.actions.state")
66
local ts_utils = require("nvim-treesitter.ts_utils")
77

8-
vim.filetype.add({
9-
extension = {
10-
webr = "r",
11-
},
12-
})
138

149
local otter = require("otter")
1510

lua/config/global.lua

+9
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,12 @@ vim.opt.scrolloff = 5
8282

8383
-- (don't == 0) replace certain elements with prettier ones
8484
vim.opt.conceallevel = 0
85+
86+
87+
-- add new filetypes
88+
vim.filetype.add({
89+
extension = {
90+
ojs = "javascript",
91+
},
92+
})
93+

lua/plugins/quarto.lua

+9-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ return {
2727
},
2828
opts = {
2929
lspFeatures = {
30-
languages = { "r", "python", "julia", "bash", "lua", "html", "dot" },
30+
languages = { "r", "python", "julia", "bash", "lua", "html", "dot", "javascript", "typescript", "ojs" },
3131
},
3232
},
3333
},
@@ -58,6 +58,7 @@ return {
5858
"javascript",
5959
"mermaid",
6060
"norg",
61+
"typescript"
6162
},
6263
highlight = {
6364
enable = true,
@@ -286,6 +287,13 @@ return {
286287
flags = lsp_flags,
287288
})
288289

290+
lspconfig.tsserver.setup({
291+
on_attach = on_attach,
292+
capabilities = capabilities,
293+
flags = lsp_flags,
294+
filetypes = { "javascript", "typescript", "ojs" },
295+
})
296+
289297
local function strsplit(s, delimiter)
290298
local result = {}
291299
for match in (s .. delimiter):gmatch("(.-)" .. delimiter) do

0 commit comments

Comments
 (0)