Commit graph

86 commits

Author SHA1 Message Date
Alan Zimmerman
9fd2bc40aa Bump extension version to 0.38
Summary: As title, preparing for release

Reviewed By: Balajiganapathi

Differential Revision: D78654847

fbshipit-source-id: 0b1f3c93dc5bafc4bfd724a726e149a1411f0b9f
2025-07-21 03:23:34 -07:00
Roberto Aloi
2a6be21a05 Bump VS Code extension to 0.37.0
Summary: In preparation for release.

Reviewed By: michalmuskala

Differential Revision: D77928426

fbshipit-source-id: 81a47344451f813233d77b818ea2ccd60443c07b
2025-07-08 04:38:50 -07:00
Paul O'Shannessy
9de77c6b20 Update License Headers for Open Source
Summary: The license header we use for our Apache + MIT dual licensed projects can be made more explicit. This has not actual implications on licensing, but does clarify what it means for a project to be dual licensed.

Reviewed By: bigfootjon

Differential Revision: D77550482

fbshipit-source-id: 24267af9a7715bfc604b5840ce29776705428516
2025-07-01 12:42:03 -07:00
Alan Zimmerman
b9ea82e72f fix dependabot alert
Summary: As title

Reviewed By: michalmuskala

Differential Revision: D76805912

fbshipit-source-id: 2d416daad6d6f48f7c3da6a7ca2e371e98cf717f
2025-06-17 02:28:20 -07:00
Alan Zimmerman
8efddf6b93 fix dependabot alert
Reviewed By: michalmuskala

Differential Revision: D76805648

fbshipit-source-id: 057ce47fb41eb3a1f94f568ca352674caa448bfa
2025-06-17 02:25:32 -07:00
Roberto Aloi
d278bba698 Semantic highlighting for exported types
Summary: Similarly to what we already do for exported functions, highlight exported types with an underscore.

Reviewed By: TD5

Differential Revision: D76540890

fbshipit-source-id: 457b8f9da8848295f05fb2432b8640d957bdba6d
2025-06-13 15:21:42 -07:00
Bhasawut Singhaphan
4edb9b6e01 Fix the configurationAttributes of edb Attach to Erlang Node option (#98)
Summary:
The configuration attributes were misconfigured. When using `Attach to Erlang Node` launch.json
complains about missing properties of "node", "cwd", and property  "config" is not allowed.

So, update these attributes in package.json to fix the issues.

before:
<img width="375" alt="Screenshot 2568-05-30 at 00 37 11" src="https://github.com/user-attachments/assets/e1c794f8-3704-4c6c-b4c8-85888a8d1678" />

<img width="310" alt="Screenshot 2568-05-30 at 00 37 01" src="https://github.com/user-attachments/assets/40ec2068-5b7e-4200-8181-aed9ff63011b" />

after:
<img width="333" alt="Screenshot 2568-05-30 at 01 05 09" src="https://github.com/user-attachments/assets/46ee20a4-cd06-4e99-9985-c3e802741864" />

Pull Request resolved: https://github.com/WhatsApp/erlang-language-platform/pull/98

Reviewed By: robertoaloi

Differential Revision: D75783374

Pulled By: jcpetruzza

fbshipit-source-id: acdd632ec171a3a4cc464bf7577622f8d60683c9
2025-06-03 02:10:25 -07:00
Daniel Gorin
94348d8406 Update debug code-lenses so they work with rebar3 and latest edb version (#96)
Summary:
* Launch configurations were no longer valid
* Fixed the code to launch rebar3, so that it injects the necessary code to register with the debugger
* Updated documentation
* In the process, made it easier to log from the extension

Pull Request resolved: https://github.com/WhatsApp/erlang-language-platform/pull/96

Reviewed By: alanz

Differential Revision: D75441461

Pulled By: robertoaloi

fbshipit-source-id: 29427ca620989c4280747ff8dd1a01176d9ab029
2025-05-28 07:45:36 -07:00
Roberto Aloi
833d235e84 Support for embedded Markdown comments
Summary:
Erlang/OTP 27 introduces Markdown comments. While this makes it in theory simpler to author in-code documentation, the VS Code extension does not yet recognize comments as Markdown.

This change makes VS Code recognize doc blocks as Markdown, using the concept of an [embedded language](https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide#embedded-languages).

This provides features such as:

* Syntax highlighting for italic, bold, code blocks, etc
* Matching parentheses
* Ability to embed Erlang code blocks with syntax highlighting
* Etc

While this simply works(TM), it makes the doc block too evident and distracting:

{F1978476087}

To preserve the look-and-feel of the old edoc-style comment, we override the default colour for the embedded markdown block. This seems to work fine in both light and dark mode and can always be overridden by a user using the `settings.json` file:

```
"editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": "meta.embedded.block.markdown",
                "settings": {
                    "foreground": "MY_FAVOURITE_COLOUR"
                }
            }
        ],
    }
```

The change is being upstreamed [here](https://github.com/erlang-ls/grammar/pull/18).

Reviewed By: alanz

Differential Revision: D75152988

fbshipit-source-id: 3922007c13678be99fb27c99e53f8597c7dcba8f
2025-05-28 00:15:25 -07:00
Roberto Aloi
039dd82b8b Stop computing EDoc diagnostics
Summary:
* Do not compute EDoc diagnostics by default
* Add a config option to enable them

Reviewed By: michalmuskala

Differential Revision: D74727423

fbshipit-source-id: f40213de4b4e1176bbfc7a85593af0cf1aaf0e1e
2025-05-15 03:53:02 -07:00
Alan Zimmerman
76481f74d1 Bump extension version to 0.36 marketplace release
Summary: As title

Reviewed By: robertoaloi

Differential Revision: D74801926

fbshipit-source-id: 2c4d4c451bec47a7d242926f28c6620a7446a203
2025-05-15 03:45:17 -07:00
Roberto Aloi
42be64e8c8 Update third-party Erlang grammar
Summary:
Update the grammar used to provide syntax highlighting in VS Code to include the latest contributions.

Major changes are:

* Doc/moduledoc attributes showed as comments and not regular strings
* Fixes for verbatim strings

Reviewed By: michalmuskala

Differential Revision: D74242608

fbshipit-source-id: dac26b72123719e607ca12b03de6f0041cd74e5f
2025-05-06 04:41:01 -07:00
Roberto Aloi
01f12130ad Add support for elp.restartServer command (#90)
Summary:
Adds the ability to restart the ELP server from the VS Code command palette.

Closes #90.

Reviewed By: alanz

Differential Revision: D72441620

fbshipit-source-id: 7346149f6756520c0fa9cc4fccb0488009eccae7
2025-04-04 01:33:28 -07:00
Roberto Aloi
1990ec1fd9 Bump OSS VS Code extension for release
Summary: Bump version from `0.34.0` to `0.35.0`.

Reviewed By: alanz

Differential Revision: D72305672

fbshipit-source-id: 823144a8641309d46bc5e4854518a5af020a3d28
2025-04-02 03:50:15 -07:00
Roberto Aloi
5cd4fee440 Bump OSS VS Code extension to 0.34.0
Summary: To release the OSS version of the VS Code extension.

Reviewed By: ilya-klyuchnikov

Differential Revision: D69578829

fbshipit-source-id: 01d0b50e2068323e30e8e943a4ebee0923b8d655
2025-02-13 00:55:01 -08:00
Roberto Aloi
20258d3d39 Add support for CodeActionResolve
Summary:
This adds a middleware for resolving code actions. The idea is to intercept `CodeAction` requests and, in case a user input is required, an input box is presented to the user to get additional input.

This is useful, for example, in case of a "extract function" or "extract variable" operation, where the user can specify the name of the new function/variable without having to perform a subsequent rename.

Built-in validation is added for atoms and variables

Fixes #76.

Reviewed By: alanz

Differential Revision: D69112486

fbshipit-source-id: 6384c0cce1ff03d350abdc1630ce75b16c3e9bf5
2025-02-05 03:49:46 -08:00
Roberto Aloi
67c3fe5ce8 Disable TSC auto-detection
Summary: We define wrapper `npm` tasks for the `tsc` tasks in the `package.json`, following the VS Code extension template. By disabling auto-discovery, we don't get duplicate tasks when starting a debugging session.

Reviewed By: jcpetruzza

Differential Revision: D68437997

fbshipit-source-id: 26b85bdd7ce407e4331677ed0bf442d1af2bfc2a
2025-01-22 05:00:53 -08:00
Roberto Aloi
5ee8019050 Add debug launch configuration
Summary:
This config allows to open a TS file from the extension and have a "Run extension" debug config already available.

It also adds the client JS files so that stopping at a breakpoint works.

Reviewed By: jcpetruzza

Differential Revision: D68437898

fbshipit-source-id: f5be84b536de524156193b69e348f06092f689a3
2025-01-22 05:00:53 -08:00
Roberto Aloi
5f60141980 Enable run lenses by default
Summary: Enable the code lenses mechanism and, specifically, the "run" ones, allowing users to trigger tests from the IDE for `rebar3` and `buck2` projects.

Reviewed By: alanz

Differential Revision: D68438514

fbshipit-source-id: b13d000717e899beb70246cf9b481e5f91c237bc
2025-01-21 05:04:22 -08:00
Roberto Aloi
2ee4a2cd55 Bump VS Code extension for OSS release
Summary: Bump to trigger a new build of the OSS VS Code extension for ELP.

Reviewed By: alanz

Differential Revision: D68437508

fbshipit-source-id: a2c688d5f00c5f8a30609275e837ce0b6a0c629b
2025-01-21 03:47:25 -08:00
Roberto Aloi
71978c9c8b Add support for elp.debugSingle command
Summary: * Add a `elp.debugSingle` command, which will eventually be used by the ELP "debug" code lens to start a debugging session for a given testcase.

Reviewed By: alanz

Differential Revision: D68159114

fbshipit-source-id: f0c2396f40518b1dd590eea49c6b300265899d7a
2025-01-16 00:48:46 -08:00
Roberto Aloi
9ca22ec50f Add support for elp.runSingle command
Summary:
* Add support for custom commands, which are registered during activation
* Register a `elp.runSingle` command, used by the ELP Common Test code lens
* Move the configuration to its own file, for easier reuse

Reviewed By: alanz

Differential Revision: D68155846

fbshipit-source-id: 180948f408dd7e9ce3406e2d96b71c420f51c3d2
2025-01-16 00:48:46 -08:00
Roberto Aloi
9e2cfe8aca Use explicit vscode namespace
Summary:
Just a simple refactoring, to make it clear which types and functions are local and which ones are coming from `vscode`.

No functional change.

Reviewed By: alanz

Differential Revision: D68155847

fbshipit-source-id: fbfe8f003b04c2afd82b66e4ff6473cbb11ba5a2
2025-01-16 00:48:46 -08:00
Roberto Aloi
639fa32867 Use rebar3 test profile by default
Summary:
The debugger is typically used to troubleshoot a test. Therefore, use the "test" profile by default, so that the test suite itself is already loaded.

The repetition is due to the command being present as:

* A default config that is dynamically added if no launch configuration is available (user clicks on "debug")
* Default values used to created to populate an initial config
* A snippet that the user can use via the "Create Config" UI in VS Code (via Intellisense)

Reviewed By: jcpetruzza

Differential Revision: D68094987

fbshipit-source-id: e31d348e854efc2b101ab466e0b10a47c1dd8ce2
2025-01-14 01:09:49 -08:00
Roberto Aloi
dae95bd2b0 Add configuration snippet for debugger
Summary: This entry in the config allows the user to auto-create a basic launch configuration using the VS Code "Add config" button.

Reviewed By: jcpetruzza

Differential Revision: D68019111

fbshipit-source-id: 05c55b4980c45e75f9a169772291414a559350ff
2025-01-13 03:32:07 -08:00
Roberto Aloi
e07a06ef6e Add missing dash to sname option
Summary: Fix a typo in the flag name.

Reviewed By: jcpetruzza

Differential Revision: D68019110

fbshipit-source-id: b0ff8b4be5212fdd9d3cd28c94edeebfdabd0a09
2025-01-13 03:32:07 -08:00
Roberto Aloi
943a078da1 Create dedicated output channel for logging purposes
Summary: Putting in place the basic logging infra, with a sample log message.

Reviewed By: jcpetruzza

Differential Revision: D68019109

fbshipit-source-id: c3784b99238e15704c2130965892a087e6e52b10
2025-01-13 03:32:07 -08:00
Roberto Aloi
acde460642 Advertise ability to set breakpoints
Summary: Without this option, it is not possible to set breakpoints on Erlang files.

Reviewed By: jcpetruzza

Differential Revision: D68016545

fbshipit-source-id: 5e0296dfc1b7a5fe46d4e8f56a83f6c7f395bb1b
2025-01-13 03:32:07 -08:00
Roberto Aloi
967cd0b87f Use rebar3 based launch config by default
Summary: Instead of using plain `erl`, use the more common `rebar3 shell`

Reviewed By: jcpetruzza

Differential Revision: D68016544

fbshipit-source-id: 5513498ef8df3e2acd1a702a88268950082c96d6
2025-01-13 03:32:07 -08:00
Roberto Aloi
e6755f6da5 Pass custom Erlang installation path as part of launch configuration
Summary: Reuse the custom Erlang installation path when launching the debuggee.

Reviewed By: jcpetruzza

Differential Revision: D68016543

fbshipit-source-id: 432e510d46c68b47c3b00db2535da2ca843f8481
2025-01-13 03:32:07 -08:00
Roberto Aloi
b69409172f Add ability to specify custom Erlang installation for DAP
Summary: Allow the user to specify a custom Erlang installation directory. This is useful when using a debugger that requires a specialized version of Erlang/OTP.

Reviewed By: jcpetruzza

Differential Revision: D68013698

fbshipit-source-id: 2dcc7d39e7d2c17dc9b38ceddcaa2efd6fd30855
2025-01-13 03:32:07 -08:00
Roberto Aloi
b6ca1377f0 Preliminary support for debugger
Summary: Basic debugger support for the ELP VS Code extension.

Reviewed By: jcpetruzza

Differential Revision: D67941710

fbshipit-source-id: ee87b30cf267a3bbdfe1fafc0b0c2e0f1050b641
2025-01-13 03:32:07 -08:00
Alan Zimmerman
dbcd5f0899 Fix dependabot alert
Summary: As title

Reviewed By: jcpetruzza

Differential Revision: D67097048

fbshipit-source-id: a55e7d696695a5bd8ca881745dbbef2def5f0099
2024-12-11 08:45:10 -08:00
Roberto Aloi
bf666c6579 Enable code coverage by default
Summary: Now that OTP 27 is rolled out to dev environments, let's enable code coverage by default when running tests via the code lenses.

Reviewed By: alanz

Differential Revision: D66957756

fbshipit-source-id: 12ad58c5844010ddd31367941eb22a056d9dd0fa
2024-12-10 05:07:05 -08:00
Roberto Aloi
6cff2fca2e Bump extension to 0.32.0 for release
Summary: Preparing for OSS release.

Reviewed By: alanz

Differential Revision: D66959588

fbshipit-source-id: 43e5d5d50048a6b9caefcb5aad8060548c7420b0
2024-12-09 06:25:57 -08:00
Roberto Aloi
9173af2315 Bump vulnerable cross-spawn dependency
Summary: Bump the dependency to a non-vulnerable version.

Reviewed By: alanz

Differential Revision: D66287445

fbshipit-source-id: b350349aab2cd49a3b29cfd551d6af684b933fba
2024-11-21 03:19:59 -08:00
Roberto Aloi
125337d4a5 Remove obsolete activation event for VS Code extension
Summary: This activation event can be removed as VS Code generates these automatically from the package.json contribution declarations.

Reviewed By: alanz

Differential Revision: D66286868

fbshipit-source-id: ded12d678844cb56979888860794280401754c8e
2024-11-21 03:19:32 -08:00
Alan Zimmerman
168d8e6a09 Allow configuring native diagnostics to be on-save only
Summary:
Currently the ELP native diagnostics (in particular syntax errors) are updated as the file changes from typing.

This can be annoying, with large red squiggles while writing new code.

Provide a new setting, `ELP/Diagnostics/OnSave` to select only presenting them when the file is saved, as currently happens for eqwalizer and erlang service diagnostics

Reviewed By: jcpetruzza

Differential Revision: D66001074

fbshipit-source-id: 8356b5bc79a864e5e93467228af5fdff20659723
2024-11-15 10:01:38 -08:00
Alan Zimmerman
31a4b8cd85 Remove no-longer-used config option
Summary: This also sync's the config options into the OSS extension package.json, and internal extension likewise.

Reviewed By: robertoaloi

Differential Revision: D65474060

fbshipit-source-id: bf06f405b7b63b72e5819ad3c9bfd0a7893993b6
2024-11-08 03:28:18 -08:00
Roberto Aloi
4742b6322c Bump VS Code extension to 0.31.0
Summary: As per [instructions](https://www.internalfb.com/code/elp/src/fbsource/fbcode/whatsapp/elp/docs/meta_only/How-Tos/HowToReleaseELPonGitHub.md).

Reviewed By: jcpetruzza

Differential Revision: D65599297

fbshipit-source-id: 9dcf0ababcd66aa648b5e94b1e8ddb485bd435fb
2024-11-07 06:46:10 -08:00
Alan Zimmerman
07de467dff 6/n semantic token types: Bring in 'type_dynamic' semantic token tag
Summary:
We now that we have cheap, reliable semantic token highlighting of the Eqwalizer `dynamic/0` and `dynamic/1` types, but re-using the semantic tag intended for bound variables in patterns.

We introduce a new tag, `type_dynamic`, and work it through into both the internal and OSS VS Code extensions to highlight in bold.

This is chosen as it does not clash with the bound variables which uses underline, and it is theme-independent.

 https://pxl.cl/5R4Nj

Reviewed By: robertoaloi

Differential Revision: D65215906

fbshipit-source-id: cf80de49a6d15e70c98250bdb12351d94884eb7a
2024-10-31 08:58:34 -07:00
Alan Zimmerman
d1e59db765 Bump VS Code extension version to 0.30.0
Summary: Preparing for OSS release

Reviewed By: robertoaloi

Differential Revision: D64029698

fbshipit-source-id: 5808fb1d9cbd4a12dd69974e70075abe44f28ba9
2024-10-08 02:06:24 -07:00
Alan Zimmerman
d14edcd295 Bump VS Code extension version to 0.29
Summary: Preparing for imminent release

Reviewed By: michalmuskala

Differential Revision: D62384547

fbshipit-source-id: 3269132966e416a716a3637188d3968682ab1933
2024-09-10 02:36:30 -07:00
Roberto Aloi
e1c2294cd3 Bump vulnerable dependencies
Summary: As detected by Dependabot.

Reviewed By: alanz

Differential Revision: D62098752

fbshipit-source-id: 20505d947c58d7c636cefc122689887287ac4ed3
2024-09-02 05:02:40 -07:00
Roberto Aloi
5d3976d847 Bump OSS VS Code extension to 0.28.0
Summary: In preparation for a new OSS release.

Reviewed By: alanz

Differential Revision: D60673665

fbshipit-source-id: 5ecbb91dad39d0a62c1ac1d7cfb1cfbf400bab51
2024-08-03 02:34:44 -07:00
Alan Zimmerman
ffad3c7098 Bump vscode extension version for imminent release
Summary: As title

Reviewed By: VLanvin

Differential Revision: D59747651

fbshipit-source-id: 8485706cd13f2d0f529dcda61bf1f03e05604e81
2024-07-15 03:08:40 -07:00
Alan Zimmerman
80cadd3671 Fix dependabot alert for vscode client
Summary: Fix [dependabot alert](https://github.com/WhatsApp/erlang-language-platform/security/dependabot/27) for  `editors/code/package-lock.json` by running `npm audit fix`

Reviewed By: sopotc

Differential Revision: D59263361

fbshipit-source-id: 68180b5f2e3cd56548f3aa43c74ad4fdf2d467ec
2024-07-02 01:50:29 -07:00
Roberto Aloi
e76a54ac1f Update third-party grammar
Summary: Import the latest available version of the grammar, which includes support for OTP 27.

Reviewed By: alanz

Differential Revision: D59057702

fbshipit-source-id: 72dcaaa7d43faa067be7e0f00e89796816383519
2024-06-26 06:58:32 -07:00
Roberto Aloi
dd91c9aef0 Bump extension
Summary: For the ELP OSS Release

Reviewed By: mapoulin

Differential Revision: D58286005

fbshipit-source-id: 23d501e744b7001e5a19cdd6f3e8488b9e557fd6
2024-06-07 06:25:00 -07:00
Alan Zimmerman
f69546abc7 Bump vscode extension version for imminent release
Summary: As title

Reviewed By: michalmuskala

Differential Revision: D57778578

fbshipit-source-id: e6dd069c401cdb1281cdbdcc960627e85d084286
2024-05-24 07:30:02 -07:00