diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8710c3a92..58e56a418 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: platform: [ubuntu-latest] - otp-version: [23, 24, 25] + otp-version: [23, 24, 25, 26] runs-on: ${{ matrix.platform }} container: image: erlang:${{ matrix.otp-version }} @@ -47,7 +47,7 @@ jobs: - name: Lint run: rebar3 lint - name: Generate Dialyzer PLT for usage in CT Tests - run: dialyzer --build_plt --apps erts kernel stdlib + run: dialyzer --build_plt --apps erts kernel stdlib compiler crypto - name: Start epmd as daemon run: epmd -daemon - name: Run CT Tests diff --git a/apps/els_lsp/test/els_completion_SUITE.erl b/apps/els_lsp/test/els_completion_SUITE.erl index 92a0417f2..a35cc5311 100644 --- a/apps/els_lsp/test/els_completion_SUITE.erl +++ b/apps/els_lsp/test/els_completion_SUITE.erl @@ -634,18 +634,25 @@ exported_functions_arity(Config) -> exported_types(Config) -> TriggerKind = ?COMPLETION_TRIGGER_KIND_CHARACTER, Uri = ?config(code_navigation_uri, Config), - Types = [ - <<"date_time">>, - <<"fd">>, - <<"file_info">>, - <<"filename">>, - <<"filename_all">>, - <<"io_device">>, - <<"mode">>, - <<"name">>, - <<"name_all">>, - <<"posix">> - ], + + OtpRelease = list_to_integer(erlang:system_info(otp_release)), + + Types = + [ + <<"date_time">>, + <<"fd">>, + <<"file_info">>, + <<"filename">>, + <<"filename_all">>, + <<"io_device">> + ] ++ + [<<"location">> || OtpRelease >= 26] ++ + [ + <<"mode">>, + <<"name">>, + <<"name_all">>, + <<"posix">> + ], Expected = [ #{ insertText => <>, @@ -1675,8 +1682,33 @@ resolve_application_remote_otp(Config) -> <<"write/2">> ), #{result := Result} = els_client:completionitem_resolve(Selected), + OtpRelease = list_to_integer(erlang:system_info(otp_release)), Value = case has_eep48(file) of + true when OtpRelease >= 26 -> + << + "```erlang\nwrite(IoDevice, Bytes) -> ok | {error, " + "Reason}\nwhen\n IoDevice :: io_device() | io:device(),\n" + " Bytes :: iodata()," + "\n Reason :: posix() | badarg | terminated.\n```\n\n" + "---\n\n" + "Writes `Bytes` to the file referenced by `IoDevice`\\." + " This function is the only way to write to a file opened in" + " `raw` mode \\(although it works for normally opened files" + " too\\)\\. Returns `ok` if successful, and" + " `{error, Reason}` otherwise\\.\n\nIf the file is opened" + " with `encoding` set to something else than `latin1`," + " each byte written can result in many bytes being written" + " to the file, as the byte range 0\\.\\.255 can represent" + " anything between one and four bytes depending on value" + " and UTF encoding type\\. If you want to write" + " [`unicode:chardata()`](https://erlang.org/doc/man/unicode" + ".html#type-chardata) to the `IoDevice` you should use" + " [`io:put_chars/2`](https://erlang.org/doc/man/io.html" + "#put_chars-2) instead\\.\n\nTypical error reasons:\n\n" + "* **`ebadf`** \n The file is not opened for writing\\.\n\n" + "* **`enospc`** \n No space is left on the device\\.\n" + >>; true -> << "```erlang\nwrite(IoDevice, Bytes) -> ok | {error, " diff --git a/apps/els_lsp/test/els_hover_SUITE.erl b/apps/els_lsp/test/els_hover_SUITE.erl index 95e7c08a2..31beb438c 100644 --- a/apps/els_lsp/test/els_hover_SUITE.erl +++ b/apps/els_lsp/test/els_hover_SUITE.erl @@ -197,8 +197,33 @@ remote_call_otp(Config) -> #{result := Result} = els_client:hover(Uri, 26, 12), ?assert(maps:is_key(contents, Result)), Contents = maps:get(contents, Result), + OtpRelease = list_to_integer(erlang:system_info(otp_release)), Value = case has_eep48(file) of + true when OtpRelease >= 26 -> + << + "```erlang\nwrite(IoDevice, Bytes) -> ok | {error, " + "Reason}\nwhen\n IoDevice :: io_device() | io:device(),\n" + " Bytes :: iodata()," + "\n Reason :: posix() | badarg | terminated.\n```\n\n" + "---\n\n" + "Writes `Bytes` to the file referenced by `IoDevice`\\." + " This function is the only way to write to a file opened in" + " `raw` mode \\(although it works for normally opened files" + " too\\)\\. Returns `ok` if successful, and" + " `{error, Reason}` otherwise\\.\n\nIf the file is opened" + " with `encoding` set to something else than `latin1`," + " each byte written can result in many bytes being written" + " to the file, as the byte range 0\\.\\.255 can represent" + " anything between one and four bytes depending on value" + " and UTF encoding type\\. If you want to write" + " [`unicode:chardata()`](https://erlang.org/doc/man/unicode" + ".html#type-chardata) to the `IoDevice` you should use" + " [`io:put_chars/2`](https://erlang.org/doc/man/io.html" + "#put_chars-2) instead\\.\n\nTypical error reasons:\n\n" + "* **`ebadf`** \n The file is not opened for writing\\.\n\n" + "* **`enospc`** \n No space is left on the device\\.\n" + >>; true -> << "```erlang\nwrite(IoDevice, Bytes) -> ok | {error, Reason}\n" @@ -541,8 +566,8 @@ nonexisting_type(Config) -> #{result := Result} = els_client:hover(Uri, 22, 15), %% The spec for `j' is shown instead of the type docs. Value = - case list_to_integer(erlang:system_info(otp_release)) of - 25 -> + case list_to_integer(erlang:system_info(otp_release)) >= 25 of + true -> << "```erlang\nj(_ :: doesnt:exist()) -> ok.\n```\n\n" "---\n\n\n"