Skip to content

Conversation

@azdanov
Copy link
Contributor

@azdanov azdanov commented May 17, 2025

Closes #1501

📑 Description

This should be done after #1502 and #1503. I merged dap.lua, since now the init.lua file is smaller and more managable.
I noticed that yioneko/nvim-vtsls is used, but I'm not sure if it was configured properly or not to use custom commands. Maybe those needs to be assigned to some keys.

Need to check if there are any other packs (angular/vue, etc) depend on this one.

ℹ Additional Information

See previous issue #962 where discussion was about adding biome.js, maybe there are some relevant details there.

@github-actions
Copy link

github-actions bot commented May 17, 2025

Review Checklist

Does this PR follow the [Contribution Guidelines](development guidelines)? Following is a partial checklist:

Proper conventional commit scoping:

  • If you are adding a new plugin, the scope would be the name of the category it is being added into. ex. feat(utility): added noice.nvim plugin

  • If you are modifying a pre-existing plugin or pack, the scope would be the name of the plugin folder. ex. fix(noice-nvim): fix LSP handler error

  • Pull request title has the appropriate conventional commit type and scope where the scope is the name of the pre-existing directory in the project as described above

  • README is properly formatted and uses fenced in links with <url> unless they are inside a [title](url)

  • Entry returns a single plugin spec with the new plugin as the only top level spec (not applicable for recipes or packs).

  • Proper usage of opts table rather than setting things up with the config function.

  • Proper usage of specs table for all specs that are not dependencies of a given plugin (not applicable for recipes or packs).

@azdanov azdanov marked this pull request as ready for review May 20, 2025 02:38
@azdanov azdanov requested review from a team and Copilot May 20, 2025 02:38

This comment was marked as outdated.

@Uzaaft
Copy link
Member

Uzaaft commented Aug 25, 2025

This didnt work, so I am removing the dap configuration for now.

  {
    "mfussenegger/nvim-dap",
    optional = true,
    opts = function()
      local dap = require "dap"
      if not dap.adapters["pwa-node"] then
        dap.adapters["pwa-node"] = {
          type = "server",
          host = "localhost",
          port = "${port}",
          executable = { command = vim.fn.exepath "js-debug-adapter", args = { "${port}" } },
        }
      end
      if not dap.adapters.node then
        dap.adapters.node = function(cb, config)
          if config.type == "node" then config.type = "pwa-node" end
          local pwa_adapter = dap.adapters["pwa-node"]
          if type(pwa_adapter) == "function" then
            pwa_adapter(cb, config)
          else
            cb(pwa_adapter)
          end
        end
      end

      local js_filetypes = { "typescript", "javascript", "typescriptreact", "javascriptreact" }
      local js_config = {
        {
          type = "pwa-node",
          request = "launch",
          name = "Launch file",
          program = "${file}",
          cwd = "${workspaceFolder}",
        },
        {
          type = "pwa-node",
          request = "attach",
          name = "Attach",
          processId = require("dap.utils").pick_process,
          cwd = "${workspaceFolder}",
        },
      }

      for _, language in ipairs(js_filetypes) do
        if not dap.configurations[language] then dap.configurations[language] = js_config end
      end

      local vscode_filetypes = require("dap.ext.vscode").type_to_filetypes
      vscode_filetypes["node"] = js_filetypes
      vscode_filetypes["pwa-node"] = js_filetypes
    end,
  },

@Uzaaft Uzaaft force-pushed the refactor-typescript branch from 2455166 to c29c347 Compare August 25, 2025 08:05
@Uzaaft Uzaaft merged commit 8d7a63c into AstroNvim:main Aug 25, 2025
16 checks passed
@azdanov azdanov deleted the refactor-typescript branch August 25, 2025 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor typescript pack

2 participants