Skip to content

Commit

Permalink
feat: add preliminary completion for observable js chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbuhr committed Feb 25, 2024
1 parent d62b8a9 commit a9ee42d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
5 changes: 0 additions & 5 deletions lua/config/experimental.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ local actions = require("telescope.actions")
local action_state = require("telescope.actions.state")
local ts_utils = require("nvim-treesitter.ts_utils")

vim.filetype.add({
extension = {
webr = "r",
},
})

local otter = require("otter")

Expand Down
9 changes: 9 additions & 0 deletions lua/config/global.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,12 @@ vim.opt.scrolloff = 5

-- (don't == 0) replace certain elements with prettier ones
vim.opt.conceallevel = 0


-- add new filetypes
vim.filetype.add({
extension = {
ojs = "javascript",
},
})

10 changes: 9 additions & 1 deletion lua/plugins/quarto.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ return {
},
opts = {
lspFeatures = {
languages = { "r", "python", "julia", "bash", "lua", "html", "dot" },
languages = { "r", "python", "julia", "bash", "lua", "html", "dot", "javascript", "typescript", "ojs" },
},
},
},
Expand Down Expand Up @@ -58,6 +58,7 @@ return {
"javascript",
"mermaid",
"norg",
"typescript"
},
highlight = {
enable = true,
Expand Down Expand Up @@ -286,6 +287,13 @@ return {
flags = lsp_flags,
})

lspconfig.tsserver.setup({
on_attach = on_attach,
capabilities = capabilities,
flags = lsp_flags,
filetypes = { "javascript", "typescript", "ojs" },
})

local function strsplit(s, delimiter)
local result = {}
for match in (s .. delimiter):gmatch("(.-)" .. delimiter) do
Expand Down

0 comments on commit a9ee42d

Please sign in to comment.