emacs-lsp / lsp-metals

lsp-mode :heart: metals
https://emacs-lsp.github.io/lsp-metals
GNU General Public License v3.0
58 stars 34 forks source link

Resolve #57. Add project ID setting support to DAP debug templates to allow values other than 'root' #59

Closed izeigerman closed 2 years ago

izeigerman commented 2 years ago

This is to support project layouts that don't have an umbrella module with name root which encompasses all submodules. More details can be found in the corresponding issue (https://github.com/emacs-lsp/lsp-metals/issues/57).

This change introduces a new setting projectId which can be specified as part of the DAP configuration template. Here is an example of a template which uses a new setting:

(dap-register-debug-template
  "Scala Attach Core"
  (list :type "scala"
        :request "attach"
        :name "Scala Attach Core"
        :projectId "core"
        :hostName "localhost"
        :port 5005))
izeigerman commented 2 years ago

Perhaps the new setting should be called moduleId instead. Open to suggestions on this one.

yyoncho commented 2 years ago

Perhaps the new setting should be called moduleId instead. Open to suggestions on this one.

Usually, the best way is to crosscheck what vscode is doing.

izeigerman commented 2 years ago

@yyoncho this is a great advice, thank you! According to the source and docs this attribute should actually be called buildTarget, so I'll name it as such.

izeigerman commented 2 years ago

@yyoncho the change has been pushed.

izeigerman commented 2 years ago

Hey @yyoncho! Please let me know if this change is good to go. Thanks

yyoncho commented 2 years ago

@izeigerman I am not scala user, not sure how to test but I saw that @HuangBoHong tested it, so I will approve and merge it.