@codingame/monaco-editor-wrapper 5.3.2 → 5.4.0-full-workbench.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/assets/Angular.ng-template-17.1.0.vsix/CHANGELOG.md +969 -0
  2. package/dist/assets/Angular.ng-template-17.1.0.vsix/README.md +69 -0
  3. package/dist/assets/Angular.ng-template-17.1.0.vsix/angular.png +0 -0
  4. package/dist/assets/Dart-Code.dart-code-3.81.20240117.vsix/CHANGELOG.md +1 -0
  5. package/dist/assets/Dart-Code.dart-code-3.81.20240117.vsix/README.md +89 -0
  6. package/dist/assets/Dart-Code.dart-code-3.81.20240117.vsix/dart.png +0 -0
  7. package/dist/assets/IMCTradingBV.svlangserver-0.4.1.vsix/CHANGELOG.md +56 -0
  8. package/dist/assets/IMCTradingBV.svlangserver-0.4.1.vsix/README.md +320 -0
  9. package/dist/assets/IMCTradingBV.svlangserver-0.4.1.vsix/icon.png +0 -0
  10. package/dist/assets/JakeBecker.elixir-ls-0.19.0.vsix/CHANGELOG.md +997 -0
  11. package/dist/assets/JakeBecker.elixir-ls-0.19.0.vsix/README.md +219 -0
  12. package/dist/assets/JakeBecker.elixir-ls-0.19.0.vsix/logo.png +0 -0
  13. package/dist/assets/JuanBlanco.solidity-0.0.165.vsix/README.md +416 -0
  14. package/dist/assets/JuanBlanco.solidity-0.0.165.vsix/icon.png +0 -0
  15. package/dist/assets/REditorSupport.r-2.8.2.vsix/CHANGELOG.md +987 -0
  16. package/dist/assets/REditorSupport.r-2.8.2.vsix/README.md +78 -0
  17. package/dist/assets/REditorSupport.r-2.8.2.vsix/Rlogo.png +0 -0
  18. package/dist/assets/alefragnani.pascal-9.6.0.vsix/CHANGELOG.md +188 -0
  19. package/dist/assets/alefragnani.pascal-9.6.0.vsix/README.md +249 -0
  20. package/dist/assets/alefragnani.pascal-9.6.0.vsix/icon.png +0 -0
  21. package/dist/assets/batisteo.vscode-django-1.15.0.vsix/CHANGELOG.md +7 -0
  22. package/dist/assets/batisteo.vscode-django-1.15.0.vsix/README.md +99 -0
  23. package/dist/assets/batisteo.vscode-django-1.15.0.vsix/vscode-django-icon.png +0 -0
  24. package/dist/assets/bitwisecook.tcl-0.4.3.vsix/CHANGELOG.md +4 -0
  25. package/dist/assets/bitwisecook.tcl-0.4.3.vsix/README.md +19 -0
  26. package/dist/assets/bitwisecook.tcl-0.4.3.vsix/Tcl-powered.png +0 -0
  27. package/dist/assets/broadcomMFD.cobol-language-support-2.1.0.vsix/CHANGELOG.md +469 -0
  28. package/dist/assets/broadcomMFD.cobol-language-support-2.1.0.vsix/README.md +401 -0
  29. package/dist/assets/broadcomMFD.cobol-language-support-2.1.0.vsix/logo.png +0 -0
  30. package/dist/assets/castwide.solargraph-0.24.1.vsix/CHANGELOG.md +256 -0
  31. package/dist/assets/castwide.solargraph-0.24.1.vsix/README.md +178 -0
  32. package/dist/assets/castwide.solargraph-0.24.1.vsix/solargraph.png +0 -0
  33. package/dist/assets/ckolkman.vscode-postgres-1.4.3.vsix/CHANGELOG.md +232 -0
  34. package/dist/assets/ckolkman.vscode-postgres-1.4.3.vsix/README.md +86 -0
  35. package/dist/assets/golang.Go-0.40.3.vsix/CHANGELOG.md +2934 -0
  36. package/dist/assets/golang.Go-0.40.3.vsix/README.md +217 -0
  37. package/dist/assets/golang.Go-0.40.3.vsix/go-logo-blue.png +0 -0
  38. package/dist/assets/johnsoncodehk.vscode-angular-1.0.22.vsix/README.md +44 -0
  39. package/dist/assets/justusadam.language-haskell-3.6.0.vsix/CHANGELOG.md +357 -0
  40. package/dist/assets/justusadam.language-haskell-3.6.0.vsix/README.md +68 -0
  41. package/dist/assets/justusadam.language-haskell-3.6.0.vsix/logo.png +0 -0
  42. package/dist/assets/mathiasfrohlich.Kotlin-1.7.1.vsix/CHANGELOG.md +43 -0
  43. package/dist/assets/mathiasfrohlich.Kotlin-1.7.1.vsix/README.md +40 -0
  44. package/dist/assets/mathiasfrohlich.Kotlin-1.7.1.vsix/icon.png +0 -0
  45. package/dist/assets/ms-dotnettools.csharp-2.16.24.vsix/CHANGELOG.md +1697 -0
  46. package/dist/assets/ms-dotnettools.csharp-2.16.24.vsix/README.md +87 -0
  47. package/dist/assets/ms-dotnettools.csharp-2.16.24.vsix/csharpIcon.png +0 -0
  48. package/dist/assets/ms-python.python-2023.25.10221012.vsix/CHANGELOG.md +11139 -0
  49. package/dist/assets/ms-python.python-2023.25.10221012.vsix/README.md +105 -0
  50. package/dist/assets/ms-python.python-2023.25.10221012.vsix/icon.png +0 -0
  51. package/dist/assets/ms-vscode.cpptools-1.19.2.vsix/CHANGELOG.md +2180 -0
  52. package/dist/assets/ms-vscode.cpptools-1.19.2.vsix/LanguageCCPP_color_128x.png +0 -0
  53. package/dist/assets/ms-vscode.cpptools-1.19.2.vsix/README.md +78 -0
  54. package/dist/assets/ocamllabs.ocaml-platform-1.16.1.vsix/CHANGELOG.md +510 -0
  55. package/dist/assets/ocamllabs.ocaml-platform-1.16.1.vsix/README.md +539 -0
  56. package/dist/assets/ocamllabs.ocaml-platform-1.16.1.vsix/logo.png +0 -0
  57. package/dist/assets/pgourlain.erlang-0.9.8.vsix/CHANGELOG.md +802 -0
  58. package/dist/assets/pgourlain.erlang-0.9.8.vsix/README.md +101 -0
  59. package/dist/assets/pgourlain.erlang-0.9.8.vsix/icon.png +0 -0
  60. package/dist/assets/redhat.java-1.27.2024012608.vsix/CHANGELOG.md +1571 -0
  61. package/dist/assets/redhat.java-1.27.2024012608.vsix/README.md +283 -0
  62. package/dist/assets/redhat.java-1.27.2024012608.vsix/icon128.png +0 -0
  63. package/dist/assets/scala-lang.scala-0.5.7.vsix/CHANGELOG.md +276 -0
  64. package/dist/assets/scala-lang.scala-0.5.7.vsix/README.md +33 -0
  65. package/dist/assets/scala-lang.scala-0.5.7.vsix/smooth-spiral.png +0 -0
  66. package/dist/assets/scalameta.metals-1.27.3.vsix/README.md +600 -0
  67. package/dist/assets/scalameta.metals-1.27.3.vsix/logo.png +0 -0
  68. package/dist/assets/sumneko.lua-3.7.4.vsix/README.md +101 -0
  69. package/dist/assets/sumneko.lua-3.7.4.vsix/changelog.md +1965 -0
  70. package/dist/assets/sumneko.lua-3.7.4.vsix/logo.png +0 -0
  71. package/dist/assets/svelte.svelte-vscode-108.2.1.vsix/CHANGELOG.md +3 -0
  72. package/dist/assets/svelte.svelte-vscode-108.2.1.vsix/README.md +100 -0
  73. package/dist/assets/svelte.svelte-vscode-108.2.1.vsix/logo.png +0 -0
  74. package/dist/assets/webfreak.code-d-0.23.2.vsix/CHANGELOG.md +543 -0
  75. package/dist/assets/webfreak.code-d-0.23.2.vsix/README.md +81 -0
  76. package/dist/assets/webfreak.code-d-0.23.2.vsix/dlogo-square.png +0 -0
  77. package/dist/extensions/Angular.ng-template-17.1.0.vsix.js +7 -1
  78. package/dist/extensions/Dart-Code.dart-code-3.81.20240117.vsix.js +7 -1
  79. package/dist/extensions/IMCTradingBV.svlangserver-0.4.1.vsix.js +7 -1
  80. package/dist/extensions/JakeBecker.elixir-ls-0.19.0.vsix.js +7 -1
  81. package/dist/extensions/JuanBlanco.solidity-0.0.165.vsix.js +5 -1
  82. package/dist/extensions/REditorSupport.r-2.8.2.vsix.js +7 -1
  83. package/dist/extensions/alefragnani.pascal-9.6.0.vsix.js +7 -1
  84. package/dist/extensions/batisteo.vscode-django-1.15.0.vsix.js +7 -1
  85. package/dist/extensions/bitwisecook.tcl-0.4.3.vsix.js +7 -1
  86. package/dist/extensions/broadcomMFD.cobol-language-support-2.1.0.vsix.js +7 -1
  87. package/dist/extensions/castwide.solargraph-0.24.1.vsix.js +7 -1
  88. package/dist/extensions/ckolkman.vscode-postgres-1.4.3.vsix.js +5 -1
  89. package/dist/extensions/golang.Go-0.40.3.vsix.js +7 -1
  90. package/dist/extensions/johnsoncodehk.vscode-angular-1.0.22.vsix.js +3 -1
  91. package/dist/extensions/justusadam.language-haskell-3.6.0.vsix.js +7 -1
  92. package/dist/extensions/mathiasfrohlich.Kotlin-1.7.1.vsix.js +7 -1
  93. package/dist/extensions/ms-dotnettools.csharp-2.16.24.vsix.js +7 -1
  94. package/dist/extensions/ms-python.python-2023.25.10221012.vsix.js +7 -1
  95. package/dist/extensions/ms-vscode.cpptools-1.19.2.vsix.js +7 -1
  96. package/dist/extensions/ocamllabs.ocaml-platform-1.16.1.vsix.js +7 -1
  97. package/dist/extensions/pgourlain.erlang-0.9.8.vsix.js +7 -1
  98. package/dist/extensions/redhat.java-1.27.2024012608.vsix.js +7 -1
  99. package/dist/extensions/scala-lang.scala-0.5.7.vsix.js +7 -1
  100. package/dist/extensions/scalameta.metals-1.27.3.vsix.js +5 -1
  101. package/dist/extensions/sumneko.lua-3.7.4.vsix.js +7 -1
  102. package/dist/extensions/svelte.svelte-vscode-108.2.1.vsix.js +7 -1
  103. package/dist/extensions/webfreak.code-d-0.23.2.vsix.js +7 -1
  104. package/dist/features/workbench.d.ts +5 -0
  105. package/dist/features/workbench.js +20 -0
  106. package/dist/services.js +3 -1
  107. package/package.json +81 -75
  108. package/stats.html +1 -1
@@ -0,0 +1,600 @@
1
+ # Metals extension for Visual Studio Code
2
+
3
+ ![Completions](https://user-images.githubusercontent.com/1408093/56036958-725bac00-5d2e-11e9-9cf7-46249125494a.gif)
4
+
5
+ The following table shows the status of various features.
6
+
7
+ | Feature | Status | Notes |
8
+ | --------------------- | :----: | ------------------------------------------------------------------------------------------------ |
9
+ | Import build | ✅ | Works with sbt, Gradle, Maven, Mill and Bloop. |
10
+ | Compile errors | ✅ | Syntax errors as you type and type errors on file save. |
11
+ | Completions | ✅ | |
12
+ | Hover (type at point) | ✅ | |
13
+ | Goto definition | ✅ | Works for project sources and Java/Scala library dependencies. |
14
+ | Document symbols | ✅ | |
15
+ | Formatting | ✅ | Uses Scalafmt. |
16
+ | Find references | ✅ | |
17
+ | Find implementations | ✅ | |
18
+ | Workspace symbol | ✅ | Searches workspace sources and library dependencies. All-lowercase queries are case-insensitive. |
19
+ | Highlight | ✅ | |
20
+ | Folding | ✅ | |
21
+ | Rename symbol | ✅ | |
22
+ | Run/Debug | ✅ | |
23
+ | Code actions | ✅ | |
24
+ | Organize imports | ✅ | |
25
+ | Show implicits | ✅ | |
26
+ | Basic Java support | ✅ | Most feature aside from signature help and semantic tokens. |
27
+
28
+ ## Requirements
29
+
30
+ **Java 8, 11, 17 provided by OpenJDK or Oracle**. Eclipse OpenJ9 is not
31
+ supported, please make sure the `JAVA_HOME` environment variable points to a
32
+ valid Java 8, 11 or 17 installation.
33
+
34
+ **macOS, Linux or Windows**. Metals is developed on many operating systems and
35
+ every PR is tested on Ubuntu, Windows and MacOS.
36
+
37
+ **Scala 2.13, 2.12, 2.11 and Scala 3**. Metals supports these Scala versions:
38
+
39
+ - **Scala 2.13**: 2.13.12, 2.13.11, 2.13.10, 2.13.9, 2.13.8, 2.13.7, 2.13.6,
40
+ 2.13.5
41
+
42
+ - **Scala 2.12**: 2.12.18, 2.12.17, 2.12.16, 2.12.15, 2.12.14, 2.12.13, 2.12.12,
43
+ 2.12.11
44
+
45
+ - **Scala 2.11**: 2.11.12
46
+
47
+ - **Scala 3**: 3.3.1, 3.3.0, 3.2.2, 3.2.1, 3.2.0, 3.1.3, 3.1.2, 3.1.1, 3.1.0
48
+
49
+ Note that 2.11.x support is deprecated and it will be removed in future
50
+ releases. It's recommended to upgrade to Scala 2.12 or Scala 2.13
51
+
52
+ ## Installation
53
+
54
+ Install the Metals extension from the
55
+ [Marketplace](https://marketplace.visualstudio.com/items?itemName=scalameta.metals)
56
+ by clicking on this badge
57
+ [![Install Metals extension](https://img.shields.io/badge/metals-vscode-blue.png)](https://github.com/scalameta/metals-vscode/blob/HEAD/vscode:extension/scalameta.metals)
58
+ or via the VS Code editor:
59
+
60
+ ![install stable version](https://imgur.com/Qew0fNH.png)
61
+
62
+ > Make sure to disable the extensions
63
+ > [Scala Language Server](https://marketplace.visualstudio.com/items?itemName=dragos.scala-lsp)
64
+ > and
65
+ > [Scala (sbt)](https://marketplace.visualstudio.com/items?itemName=lightbend.vscode-sbt-scala)
66
+ > if they are installed. The
67
+ > [Dotty Language Server](https://marketplace.visualstudio.com/items?itemName=lampepfl.dotty)
68
+ > does **not** need to be disabled because the Metals and Dotty extensions don't
69
+ > conflict with each other. However, if you want to work on Scala 3 code in a
70
+ > workspace that was previously opened with `Dotty Language Server` you need to
71
+ > first remove `.dotty-ide-artifact` before opening the workspace with Metals.
72
+
73
+ Next, open a directory containing your Scala code. The extension activates when
74
+ the main directory contains `build.sbt` or `build.sc` file, a Scala file is
75
+ opened, which includes `*.sbt`, `*.scala` and `*.sc` file, or a standard Scala
76
+ directory structure `src/main/scala` is detected.
77
+
78
+ It is also possible to opt in to install the pre-release version and try out the
79
+ latest cutting edge features from Metals server. Apart from new features,
80
+ pre-release versions also include many bugfixes. It's encouraged to use them
81
+ with [SNAPSHOT](#SNAPSHOT) releases of Metals server. Using pre-release versions
82
+ may result in less stable experience and it is not indented for beginners.
83
+ Pre-release versions follow `major.minor.PATCH` versioning.
84
+
85
+ ![Install the pre-release extension](https://imgur.com/CzOTleE.png)
86
+
87
+ ## Importing a build
88
+
89
+ The first time you open Metals in a new workspace it prompts you to import the
90
+ build. Click "Import build" to start the installation step.
91
+
92
+ ![Import build](https://i.imgur.com/0VqZWay.png)
93
+
94
+ - "Not now" disables this prompt for 2 minutes.
95
+ - "Don't show again" disables this prompt forever, use `rm -rf .metals/` to
96
+ re-enable the prompt.
97
+ - Use `tail -f .metals/metals.log` to watch the build import progress.
98
+ - Behind the scenes, Metals uses [Bloop](https://scalacenter.github.io/bloop/)
99
+ to import sbt builds, but you don't need Bloop installed on your machine to
100
+ run this step.
101
+
102
+ Once the import step completes, compilation starts for your open `*.scala`
103
+ files.
104
+
105
+ Once the sources have compiled successfully, you can navigate the codebase with
106
+ goto definition.
107
+
108
+ ### Custom sbt launcher
109
+
110
+ By default, Metals runs an embedded `sbt-launch.jar` launcher that respects
111
+ `.sbtopts` and `.jvmopts`. However, the environment variables `SBT_OPTS` and
112
+ `JAVA_OPTS` are not respected.
113
+
114
+ Update the "Sbt Script" setting to use a custom `sbt` script instead of the
115
+ default Metals launcher if you need further customizations like reading
116
+ environment variables.
117
+
118
+ ![Sbt Launcher](https://i.imgur.com/NuwEBe4.png)
119
+
120
+ ### Speeding up import
121
+
122
+ The "Import build" step can take a long time, especially the first time you run
123
+ it in a new build. The exact time depends on the complexity of the build and if
124
+ library dependencies need to be downloaded. For example, this step can take
125
+ everything from 10 seconds in small cached builds up to 10-15 minutes in large
126
+ uncached builds.
127
+
128
+ Consult the
129
+ [Bloop documentation](https://scalacenter.github.io/bloop/docs/build-tools/sbt#speeding-up-build-export)
130
+ to learn how to speed up build import.
131
+
132
+ ### Importing changes
133
+
134
+ When you change `build.sbt` or sources under `project/`, you will be prompted to
135
+ re-import the build.
136
+
137
+ ![Import sbt changes](https://i.imgur.com/72kdZkL.png)
138
+
139
+ ### Manually trigger build import
140
+
141
+ To manually trigger a build import, execute the "Import build" command through
142
+ the command palette (`Cmd + Shift + P`).
143
+
144
+ ![Import build command](https://i.imgur.com/QHLKt8u.png)
145
+
146
+ ## Run doctor
147
+
148
+ Execute the "Run Doctor" through the command palette to troubleshoot potential
149
+ configuration problems in your workspace.
150
+
151
+ ![Run doctor command](https://i.imgur.com/K02g0UM.png)
152
+
153
+ ## Configure Java version
154
+
155
+ The VS Code plugin uses by default the `JAVA_HOME` environment variable (via
156
+ [`locate-java-home`](https://www.npmjs.com/package/locate-java-home)) to locate
157
+ the `java` executable. To override the default Java home location, update the
158
+ "Java Home" variable in the settings menu.
159
+
160
+ ![Java Home setting](https://i.imgur.com/sKrPKk2.png)
161
+
162
+ If this setting is defined, the VS Code plugin uses the custom path instead of
163
+ the `JAVA_HOME` environment variable.
164
+
165
+ ### macOS
166
+
167
+ To globally configure `$JAVA_HOME` for all GUI applications, see
168
+ [this Stackoverflow answer](https://stackoverflow.com/questions/135688/setting-environment-variables-on-os-x).
169
+
170
+ If you prefer to manually configure Java home through VS Code, run the following
171
+ command to copy the Java 8 home path.
172
+
173
+ ```sh
174
+ /usr/libexec/java_home -v 1.8 | pbcopy
175
+ ```
176
+
177
+ ## Custom artifact repositories (Maven or Ivy resolvers)
178
+
179
+ Use the 'Custom Repositories' setting for the Metals VS Code extension to tell
180
+ [Coursier](https://get-coursier.io/docs/other-proxy) to try to download Metals
181
+ artifacts from your private artifact repository.
182
+
183
+ Use `.jvmopts` to set sbt options
184
+ (https://www.scala-sbt.org/1.0/docs/Proxy-Repositories.html) for
185
+ `sbt bloopInstall` which resolves library dependencies. You can also provide a
186
+ custom sbt script (see 'Custom sbt launcher').
187
+
188
+ ## HTTP proxy
189
+
190
+ Metals uses [Coursier](https://get-coursier.io/docs/other-proxy) to download
191
+ artifacts from Maven Central. To use Metals behind an HTTP proxy, configure the
192
+ system properties `-Dhttps.proxyHost=… -Dhttps.proxyPort=…` in one of the
193
+ following locations:
194
+
195
+ - `.jvmopts` file in the workspace directory.
196
+ - `JAVA_OPTS` environment variable, make sure to start `code` from your terminal
197
+ when using this option since environment variables don't always propagate
198
+ correctly when opening VS Code as a GUI application outside a terminal.
199
+ - "Server Properties" setting for the Metals VS Code extension, which can be
200
+ configured per-workspace or per-user.
201
+
202
+ ## Using latest Metals SNAPSHOT
203
+
204
+ Update the "Server Version" setting to try out the latest pending Metals
205
+ features.
206
+
207
+ See
208
+ https://scalameta.org/metals/docs/editors/vscode.html#using-latest-metals-snapshot
209
+ to find the latest SNAPSHOT version.
210
+
211
+ Run the "Reload Window" command after updating the setting for the new version
212
+ to take effect.
213
+
214
+ ## Files and Directories to include in your Gitignore
215
+
216
+ The Metals server places logs and other files in the `.metals` directory. The
217
+ Bloop compile server places logs and compilation artifacts in the `.bloop`
218
+ directory. The Bloop plugin that generates Bloop configuration is added in the
219
+ `metals.sbt` file, which is added at `project/metals.sbt` as well as further
220
+ `project` directories depending on how deep `*.sbt` files need to be supported.
221
+ To support each `*.sbt` file Metals needs to create an additional file at
222
+ `./project/project/metals.sbt` relative to the sbt file. Working with Ammonite
223
+ scripts will place compiled scripts into the `.ammonite` directory. It's
224
+ recommended to exclude these directories and files from version control systems
225
+ like git.
226
+
227
+ ```sh
228
+ # ~/.gitignore
229
+ .metals/
230
+ .bloop/
231
+ .ammonite/
232
+ metals.sbt
233
+ ```
234
+
235
+ ## Show document symbols
236
+
237
+ Run the "Explorer: Focus on Outline View" command to open the symbol outline for
238
+ the current file in the sidebar.
239
+
240
+ ![Document Symbols Outline](https://i.imgur.com/T0kVJsr.gif)
241
+
242
+ Run the "Open Symbol in File" command to search for a symbol in the current file
243
+ without opening the sidebar.
244
+
245
+ ![Document Symbols Command](https://i.imgur.com/0PJ4brd.png)
246
+
247
+ As you type, the symbol outline is also visible at the top of the file.
248
+ ![Document Symbols Outline](https://i.imgur.com/L217n4q.png)
249
+
250
+ ## Go to parent code lenses
251
+
252
+ Metals has the ability to display code lenses that, when invoked, will go to the
253
+ parent class that contains the definition of the method or symbol.
254
+ Unfortunately, it might cause some lag in larger code bases, which is why it is
255
+ not enabled currently by default.
256
+
257
+ To enable the feature you need to modify the setting
258
+ `metals.superMethodLensesEnabled` to `true`.
259
+
260
+ Even without using the code lenses it's still possible to navigate the method
261
+ hierarchy using two commands:
262
+
263
+ - `Metals: Go to super method` - immediately goes to the parent of the method
264
+ the cursor is pointing to
265
+
266
+ - `Metals: Reveal super method hierachy` - displays the full method hierachy and
267
+ enables to move to any parent, it is best used with the Metals Quick Pick
268
+ extension.
269
+
270
+ You can also bind those commands to a shortcut.
271
+
272
+ ## Create new project from template
273
+
274
+ It is possible using Metals to easily setup a new project using the exiting
275
+ [giter8](https://github.com/foundweekends/giter8/wiki/giter8-templates)
276
+ templates. This is an equivalent to the `sbt new` command, which uses the same
277
+ mechanism. There is a great number of templates already available and it should
278
+ be easy to find something for yourself. To start the setup you can use the
279
+ Metals: New Scala project command, which works as following:
280
+
281
+ 1. Choose the template and then:
282
+ 1. Use the proposed templates.
283
+ 2. Choose "Discover more" and then choose from the list downloaded from the
284
+ Giter8 wiki page.
285
+ 3. Input a custom Github repository following the `organization/repo` schema.
286
+ 2. Navigate to the parent directory that you want to create your new project in.
287
+ 3. Choose the name or accept the default one.
288
+
289
+ 4. Choose whether to open a new window for the created project or use the
290
+ existing one.
291
+
292
+ The same command will be invoked when clicking the "New Scala Project" button in
293
+ the Metals view.
294
+
295
+ If you feel like a template should be included in the default displayed ones do
296
+ not hesitate to create a
297
+ [PR](https://github.com/scalameta/metals/blob/cda5b8c2029e5f201fb8d0636e0365d796407bd9/metals/src/main/scala/scala/meta/internal/builds/NewProjectProvider.scala#L308)
298
+ or file an issue.
299
+
300
+ ## Running and debugging your code
301
+
302
+ Metals supports running and debugging tests and main methods via the
303
+ [Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol/).
304
+ The protocol is used to communicate between the editor and debugger, which means
305
+ that applications can be run the same as for any other language in the natively
306
+ supported `Run` view. When using Metals the debugger itself is
307
+ [Bloop](https://scalacenter.github.io/bloop/), which is also responsible for
308
+ starting the actual process.
309
+
310
+ Users can begin the debugging session in two ways:
311
+
312
+ ### via code lenses
313
+
314
+ ![lenses](https://i.imgur.com/5nTnrcS.png)
315
+
316
+ For each main or test class Metals shows two code lenses `run | debug` or
317
+ `test | test debug`, which show up above the definition as a kind of virtual
318
+ text. Clicking `run` or `test` will start running the main class or test without
319
+ stopping at any breakpoints, while clicking `debug` or `test debug` will pause
320
+ once any of them are hit. It's not possible to add any arguments or java
321
+ properties when running using this method.
322
+
323
+ ### via a `launch.json` configuration
324
+
325
+ Visual Studio Code uses `.vscode/launch.json` to store user defined
326
+ configurations, which can be run using:
327
+
328
+ - The `Run -> Start Debugging` menu item or `workbench.action.debug.start`
329
+ shortcut.
330
+ - The `Run -> Run Without Debugging` menu item or `workbench.action.debug.run`
331
+ shortcut.
332
+
333
+ If a user doesn't have anything yet saved, a configuration wizard will pop up to
334
+ guide them. In the end users should end up with something like this:
335
+
336
+ ```json
337
+ {
338
+ "version": "0.2.0",
339
+ "configurations": [
340
+ // Main class configuration
341
+ {
342
+ "type": "scala",
343
+ "request": "launch",
344
+ // configuration name visible for the user
345
+ "name": "Launch Main",
346
+ // full name of the class to run
347
+ "mainClass": "com.example.Main",
348
+ // optional arguments for the main class
349
+ "args": [],
350
+ // optional jvm properties to use
351
+ "jvmOptions": []
352
+ },
353
+ // Test class configuration
354
+ {
355
+ "type": "scala",
356
+ "request": "launch",
357
+ // configuration name visible for the user
358
+ "name": "Launch Test",
359
+ // full name of the class to run
360
+ "testClass": "com.example.Test"
361
+ },
362
+ // Attach debugger when running via:
363
+ // `-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=localhost:5005`
364
+ {
365
+ "type": "scala",
366
+ "request": "attach",
367
+ "name": "Attach debugger",
368
+ // name of the module that is being debugging
369
+ "buildTarget": "root",
370
+ // Host of the jvm to connect to
371
+ "hostName": "localhost",
372
+ // Port to connect to
373
+ "port": 5005
374
+ }
375
+ ]
376
+ }
377
+ ```
378
+
379
+ You can also add an optional build target name, which is needed in case there
380
+ are more than one class with the same name or when launching a class from
381
+ outside the project. Inside `"configurations":` add the key `buildTarget` with
382
+ your target name, e.g. `root`:
383
+
384
+ ```json
385
+ "buildTarget": "root"
386
+ ```
387
+
388
+ The build target name corresponds to your project name. For example in sbt for
389
+ `lazy val interfaces = project` the name of the build target will be
390
+ `interfaces` for sources and `interfaces-test` for tests. To make sure you have
391
+ the correct target names please run the command `Metals: Run Doctor`.
392
+
393
+ Multiple configurations can be stored in that file and can be chosen either
394
+ manually in the `Run` view or can be picked by invoking a shortcut defined under
395
+ `workbench.action.debug.selectandstart`.
396
+
397
+ ### via Metals' commands
398
+
399
+ You can also use commands that can be easily bound to shortcuts:
400
+
401
+ - `metals.run-current-file` - Run main class in the current file.
402
+ - `metals.test-current-file` - Run test class in the current file
403
+ - `metals.test-current-target` - Run all tests in the current project.
404
+
405
+ To assign shortcuts just go to the Keyboard Shortcuts page (`File` ->
406
+ `Preferences` -> `Keyboard Shortcuts`) and search for a command, click on it and
407
+ use your preferred shortcut.
408
+
409
+ ## On type formatting for multiline string formatting
410
+
411
+ ![on-type](https://imgur.com/a0O2vCs.gif)
412
+
413
+ To properly support adding `|` in multiline strings we are using the
414
+ `onTypeFormatting` method. The functionality is enabled by default, but you can
415
+ disable/enable `onTypeFormatting` inside Visual Studio Code settings by checking
416
+ `Editor: Format On Type`:
417
+
418
+ ![on-type-setting](https://i.imgur.com/s6nT9rC.png)
419
+
420
+ ## Formatting on paste for multiline strings
421
+
422
+ Whenever text is paste into a multiline string with `|` it will be properly
423
+ formatted by Metals:
424
+
425
+ ![format-on-paste](https://i.imgur.com/fF0XWYC.gif)
426
+
427
+ This feature is enabled by default. If you need to disable/enable formatting on
428
+ paste in Visual Studio Code you can check the `Editor: Format On Paste` setting:
429
+
430
+ ![format-on-paste-setting](https://i.imgur.com/rMrk27F.png)
431
+
432
+ ## Worksheets
433
+
434
+ Worksheets are a great way to explore an api, try out an idea, or code up an
435
+ example and quickly see the evaluated expression or result. Behind the scenes
436
+ worksheets are powered by the great work done in
437
+ [mdoc](https://scalameta.org/mdoc/).
438
+
439
+ ### Getting started with Worksheets
440
+
441
+ To get started with a worksheet you can either use the `metals.new-scala-file`
442
+ command and select _Worksheet_ or create a file called `*.worksheet.sc`. This
443
+ format is important since this is what tells Metals that it's meant to be
444
+ treated as a worksheet and not just a Scala script. Where you create the script
445
+ also matters. If you'd like to use classes and values from your project, you
446
+ need to make sure the worksheet is created inside of your sources next to any
447
+ existing Scala files. directory. You can still create a worksheet in other
448
+ places, but you will only have access to the standard library and your
449
+ dependencies.
450
+
451
+ ### Evaluations
452
+
453
+ After saving you'll see the result of the expression as a decoration at the end
454
+ of the line. You may not see the full result for example if it's too long, so
455
+ you are also able to hover on the decoration to expand the decoration.
456
+
457
+ Keep in mind that you don't need to wrap your code in an `object`. In worksheets
458
+ everything can be evaluated at the top level.
459
+
460
+ ### Using dependencies in worksheets
461
+
462
+ You are able to include an external dependency in your worksheet by including it
463
+ in one of the following two ways.
464
+
465
+ ```scala
466
+ // $dep.`organisation`::artifact:version` style
467
+ import $dep.`com.lihaoyi::scalatags:0.7.0`
468
+
469
+ // $ivy.`organisation::artifact:version` style
470
+ import $ivy.`com.lihaoyi::scalatags:0.7.0`
471
+ ```
472
+
473
+ `::` is the same as `%%` in sbt, which will append the current Scala binary
474
+ version to the artifact name.
475
+
476
+ You can also import `scalac` options in a special `$scalac` import like below:
477
+
478
+ ```scala
479
+ import $scalac.`-Ywarn-unused`
480
+ ```
481
+
482
+ ### Troubleshooting
483
+
484
+ Since worksheets are not standard Scala files, you may run into issues with some
485
+ constructs. For example, you may see an error like this:
486
+
487
+ ```
488
+ value classes may not be a member of another class - mdoc
489
+ ```
490
+
491
+ This means that one of the classes defined in the worksheet extends AnyVal,
492
+ which is not currently supported. You can work around this by moving the class
493
+ to a separate file or removing the AnyVal parent.
494
+
495
+ ## Running scalafix rules
496
+
497
+ Scalafix allows users to specify some refactoring and linting rules that can be
498
+ applied to your codebase. Please checkout the
499
+ [scalafix website](https://scalacenter.github.io/scalafix) for more information.
500
+
501
+ Since Metals v0.11.7 it's now possible to run scalafix rules using a special
502
+ command `metals.scalafix-run`. In VS Code can be also run using the default
503
+ shortcut of `shift + alt + ctrl + o`. This should run all the rules defined in
504
+ your `.scalafix.conf` file. All built-in rules and the
505
+ [community hygiene ones](https://scalacenter.github.io/scalafix/docs/rules/community-rules.html#hygiene-rules)
506
+ can be run without any additional settings. However, for all the other rules
507
+ users need to add an additional dependency in the
508
+ `metals.scalafixRulesDependencies` user setting. Those rules need to be in form
509
+ of strings such as `com.github.liancheng::organize-imports:0.6.0`, which follows
510
+ the same convention as [coursier dependencies](https://get-coursier.io/).
511
+
512
+ A sample scalafix configuration can be seen below:
513
+
514
+ ```hocon
515
+ rules = [
516
+ OrganizeImports,
517
+ ExplicitResultTypes,
518
+ RemoveUnused
519
+ ]
520
+
521
+ RemoveUnused.imports = false
522
+
523
+ OrganizeImports.groupedImports = Explode
524
+ OrganizeImports.expandRelative = true
525
+ OrganizeImports.removeUnused = true
526
+ OrganizeImports.groups = [
527
+ "re:javax?\."
528
+ "scala."
529
+ "scala.meta."
530
+ "*"
531
+ ]
532
+
533
+ ```
534
+
535
+ ## Searching a symbol in the workspace
536
+
537
+ Metals provides an alternative command to the native "Go to symbol in
538
+ workspace..." command, in order to work around some VS Code limitations (see
539
+ [this issue](https://github.com/microsoft/vscode/issues/98125) for more context)
540
+ and provide richer search capabilities.
541
+
542
+ You can invoke this command from the command palette (look for "Metals: Search
543
+ symbol in workspace"). Optionally you can also bind this command to a shortcut.
544
+ For example, if you want to replace the native command with the Metals one you
545
+ can configure this shortcut:
546
+
547
+ ```js
548
+ {
549
+ "key": "ctrl+t", // or "cmd+t" if you're on macOS
550
+ "command": "metals.symbol-search",
551
+ "when": "editorLangId == scala"
552
+ }
553
+ ```
554
+
555
+ ## Test Explorer
556
+
557
+ Metals 0.11.0 implements Visual Studio Code's
558
+ [Testing API](https://code.visualstudio.com/api/extension-guides/testing).
559
+
560
+ Test Explorer UI is a new default way to run/debug test suites and replaces Code
561
+ Lenses. The new UI adds a testing view, which shows all test suites declared in
562
+ project's modules. From this panel it's possible to
563
+
564
+ - view all discovered test suites grouped by build targets (modules) and filter
565
+ them
566
+ - run/debug test
567
+ - navigate to test's definition.
568
+
569
+ ![test-explorer](https://i.imgur.com/Z3VtS0O.gif)
570
+
571
+ NOTE: While Metals detects test suites for most of existing testing frameworks,
572
+ support for recognizing individual tests is more limited. Metals supports the
573
+ current set of test frameworks when it comes to individual test discovery:
574
+
575
+ - Junit
576
+ - MUnit
577
+ - Scalatest
578
+
579
+ If you encounter an error, create an
580
+ [issue](https://github.com/scalameta/metals/issues).
581
+
582
+ ## Coming from IntelliJ
583
+
584
+ Install the
585
+ [IntelliJ IDEA Keybindings](https://marketplace.visualstudio.com/items?itemName=k--kato.intellij-idea-keybindings)
586
+ extension to use default IntelliJ shortcuts with VS Code.
587
+
588
+ | IntelliJ | VS Code |
589
+ | ---------------- | ------------------------- |
590
+ | Go to class | Go to symbol in workspace |
591
+ | Parameter info | Trigger parameter hints |
592
+ | Basic completion | Trigger suggest |
593
+ | Type info | Show hover |
594
+ | Expand | Fold |
595
+ | Extend Selection | Expand selection |
596
+
597
+ ## GitHub Codespaces and GitHub.dev support
598
+
599
+ See
600
+ https://scalameta.org/metals/docs/editors/online-ides#github-codespaces-and-githubdev