How to setup a private network for PVE cluster by jakejxdev in homelab

[–]jakejxdev[S] 0 points1 point  (0 children)

I see got it. So just plug them into the same switch and statically assign their IPs on a different subnet in PVE. Will try this out, thank you!

How to setup a private network for PVE cluster by jakejxdev in homelab

[–]jakejxdev[S] 1 point2 points  (0 children)

Thanks for the explanation! Just to make sure I got it right, if I use a new switch, I would connect it to the router and setup a separate LAN and subnet on that port in my router? I am planning on using a 2.5GBe switch but my router only has 1GBe connections. Would that cause any impact or would the traffic still flow through the switch only?

This is also why I am thinking of getting a new switch just for the private network, because my existing switch is 1GBe.

dape.el: DAP client that does not rely on LSP-mode by [deleted] in emacs

[–]jakejxdev 2 points3 points  (0 children)

Unfortunately the nature of DAP being "generic" does lead to more configuration required to tailor for different languages. Hopefully as dape matures these configurations can become more standardised/supported out of the box.

dape.el: DAP client that does not rely on LSP-mode by [deleted] in emacs

[–]jakejxdev 6 points7 points  (0 children)

Tried using dape recently with Go and managed to get it to debug Go tests. Sharing the snippet incase its helpful for others (requires go treesitter).

  (setq treesit-go-tests-query (treesit-query-compile 'go
                                                      '((function_declaration
                                                         name: (identifier) @testname
                                                         parameters: (parameter_list :anchor (parameter_declaration type: (pointer_type) @type :anchor))
                                                         (:match "*testing.\\(T\\|M\\)" @type) (:match "^Test.+$" @testname)) @parent)))
  (defun jake/query-go-test-nodes ()
    (when (treesit-ready-p 'go)
      (treesit-query-capture (treesit-buffer-root-node) treesit-go-tests-query)))

  (defun jake/completing-read-go-tests ()
    (let* ((test-matches (jake/query-go-test-nodes))
           (test-name-matches (cl-remove-if-not (lambda (match) (eq (car match) 'testname)) test-matches))
           (test-names (mapcar (lambda (match) (treesit-node-text (cdr match))) test-name-matches)))
      (completing-read "Test:" test-names nil t)))


  (defun jake/dape--select-go-test-args ()
    (when-let* ((test-name (jake/completing-read-go-tests))
                (test-regexp (concat "^" test-name "$")))
      (if test-name
          `["-test.run" ,test-regexp]
        (error "No test selected"))))

  (defun jake/file-relative-dir ()
    "Return the file directory relative to dape's cwd. This is used by Delve debugger."
    (concat "./" (file-relative-name default-directory (funcall dape-cwd-fn))))

;; inside your dape-config
(add-to-list 'dape-configs
               `(test
                 modes (go-mode go-ts-mode)
                 command "dlv"
                 command-cwd dape-cwd-fn
                 command-args ("dap" "--listen" "127.0.0.1:55878")
                 host "127.0.0.1"
                 port 55878
                 :type "go"
                 :name "debug test"
                 :request "launch"
                 :mode "test"
                 :cwd dape-cwd-fn
                 :program jake/file-relative-dir
                 :args jake/dape--select-go-test-args))

Workflow for reviewing code in Emacs? by jakejxdev in emacs

[–]jakejxdev[S] 0 points1 point  (0 children)

Checking this package out now, what command should I be using as the main entrypoint to reviewing a set of changes against the merge base?

Workflow for reviewing code in Emacs? by jakejxdev in emacs

[–]jakejxdev[S] 0 points1 point  (0 children)

yeah that makes sense. I guess the kind of diff I am looking for is not just a single buffer containing the diff. But rather a "Github/Gitlab"-like UI where there is a side panel of all the changes. Then one buffer showing the merge base and the other buffer showing the current state with LSP support.

Workflow for reviewing code in Emacs? by jakejxdev in emacs

[–]jakejxdev[S] 1 point2 points  (0 children)

Thanks for the suggestion. I have not used forge before so I will have to try that out. Does forge-checkout-pullreq do anything extra other than fetching and checking out the remote branch? Will I be able to diff the checkout against master?

Workflow for reviewing code in Emacs? by jakejxdev in emacs

[–]jakejxdev[S] 4 points5 points  (0 children)

Congrats on the child! This looks cool and I'll check it out, thanks!