From b7248584369b9ed13430b1526ca64ec427255ba2 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Fri, 2 Aug 2024 17:40:19 +0100 Subject: [PATCH 1/6] Changes! --- CHANGELOG.md | 342 +------------------------------------------- changelog/v1.4.md | 353 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 354 insertions(+), 341 deletions(-) create mode 100644 changelog/v1.4.md diff --git a/CHANGELOG.md b/CHANGELOG.md index a57b32ed8..db85a4dfd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,353 +1,13 @@ # Gleam's Changelog -## v1.4.0 - 2024-08-02 - -### Bug Fixes - -- Fixed a bug where pipe function arity errors could have an incorrect error - message. - ([sobolevn](https://github.com/sobolevn)) - -- Fixed a bug where the case of type parameters would not be checked. - ([Surya Rose](https://github.com/gearsdatapacks)) - -- Fixed a bug where the language server would still show completions when inside - a comment. - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - -## v1.4.0-rc1 - 2024-07-29 +## Unreleased ### Build tool -- `gleam docs build` now takes an optional `--target` flag to specify the target - platform for the generated documentation. - ([Jiangda Wang](https://github.com/frank-iii)) - -- Warnings are now emitted each time the project is built, even if the module - the warnings originated from were loaded from the cache rather than - recompiling. - ([Louis Pilfold](https://github.com/lpil)) - ### Compiler -- Labelled arguments can now use the label shorthand syntax. - This means that when you're passing a variable as a labelled argument and it - happens to have the same name as the label, you can omit the variable name: - - ```gleam - pub fn date(day day: Int, month month: Month, year year: Year) -> Date { - todo - } - - pub fn main() { - let day = 11 - let month = October - let year = 1998 - - date(year:, month:, day:) - // This is the same as writing - // date(year: year, month: month, day: day) - } - ``` - - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - -- Labelled pattern variables can now use the label shorthand syntax. - This means that when you're pattern matching on a record constructor and - binding its labelled fields to variables that happen to have the same name, - you can omit the variable name: - - ```gleam - pub type Date - Date(day: Int, month: Month, year: Year) - } - - pub fn main() { - case Date(11, October, 1998) { - Date(year:, month:, day:) -> todo - // This is the same as writing - // Date(year: year, month: month, day: day) -> todo - } - - } - ``` - - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - -- The warning for the deprecated `[..]` pattern has been improved. - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - -- Record accessors are now fault tolerant. This means an invalid label can be - properly detected and won't invalidate the rest of the expression. - ([Ameen Radwan](https://github.com/Acepie)) - -- Erlang type spec generation has been improved to avoid new warnings emitted in - OTP27. - ([Damir Vandic](https://github.com/dvic)) - -- Error messages for invalid record constructors now contain a restructured - example of what the user likely intended. This is especially helpful for - users coming from other languages, like Rust or Go. - - For example, provided a User type: - - ```gleam - pub type User { - name: String - } - ``` - - The compiler errors with the following message: - - ``` - error: Syntax error - ┌─ /src/parse/error.gleam:3:5 - │ - 3 │ name: String, - │ ^^^^ I was not expecting this - - Each custom type variant must have a constructor: - - pub type User { - User( - name: String, - ) - } - ``` - - ([Rahul D. Ghosal](https://github.com/rdghosal)) - -- The `<>` string concatenation operator can now be used in constant - expressions. - ([Thomas](https://github.com/DeviousStoat)) - -- Function calls are now fault tolerant. This means that errors in the function - call arguments won't stop the rest of the call from being analysed. - ([Ameen Radwan](https://github.com/Acepie)) - -- The error message presented when a function is called in a guard has been - improved. - ([Thomas](https://github.com/DeviousStoat)) - -- Case expressions are now fault tolerant. This means an subject, pattern, - guard, or then body can be properly detected and won't invalidate the rest - of the expression. - ([Ameen Radwan](https://github.com/Acepie)) - -- Documentation comments that come before a regular comment are no longer - clumped together with the documentation of the following definition. - Now commenting out a definition won't result in its documentation merging with - the following one's. - - ```gleam - /// This doc comment will be ignored! - // a commented definition - // fn wibble() {} - - /// Wibble's documentation. - fn wibble() { todo } - ``` - - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - -- The `little` and `big` endianness options, the `signed` and `unsigned` integer - options, and sized floats (32-bit and 64-bit), can now be used in bit array - expressions and patterns on the JavaScript target. - ([Richard Viney](https://github.com/richard-viney)) - -- The `utf8` option can now be used with constant strings in bit array patterns - on the JavaScript target. - ([Richard Viney](https://github.com/richard-viney)) - ### Formatter -- The formatter will no longer move a documentation comment below a regular - comment following it. This snippet of code is left as it is by the formatter: - - ```gleam - /// This doc comment will be ignored! - // a commented definition - // fn wibble() {} - - /// Wibble's documentation. - fn wibble() { - todo - } - ``` - - While previously all documentation comments would be merged together into one, - ignoring the regular comment separating them: - - ```gleam - // a commented definition - // fn wibble() {} - - /// This doc comment will be ignored! - /// Wibble's documentation. - fn wibble() { - todo - } - ``` - - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - ### Language Server -- The language server can now show completions for fields if a record access is - being attempted. - ([Ameen Radwan](https://github.com/Acepie)) - -- The language server will now insert a blank line before the first statement - when inserting a new import and there are no other imports at the top of the - module. - ([Zhomart Mukhamejanov](https://github.com/Zhomart)) - -- The language server now suggests a code a action to rename variables, types - and functions when they don't match the Gleam naming requirements: - - ```gleam - let myNumber = 10 - ``` - - Becomes: - - ```gleam - let my_number = 10 - ``` - - ([Surya Rose](https://github.com/gearsdatapacks)) - -- The language server can now suggest a code action to convert `let assert` into - a case expression: - - ```gleam - let assert Ok(value) = get_result() - ``` - - Becomes: - - ```gleam - let value = case get_result() { - Ok(value) -> value - _ -> panic - } - ``` - - ([Surya Rose](https://github.com/gearsdatapacks)) - -- The language server can now show signature help when writing functions. - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - -- The language server now supports listing document symbols, such as functions - and constants, for the current Gleam file. - ([PgBiel](https://github.com/PgBiel)) - -- The language server can now suggest a code action to automatically use - shorthand labels where possible: - - ```gleam - case date { - Day(day: day, month: month, year: year) -> todo - } - ``` - - Becomes: - - ```gleam - case date { - Day(day:, month:, year:) -> todo - } - ``` - - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - -- The language server can now show completions for labels when writing a - function call or record construction. - ([Ameen Radwan](https://github.com/Acepie)) - -- The language server can now suggest a code action to fill in the labels of a - function call: - - ```gleam - pub type Date { - Date(year: Int, month: Int, day: Int) - } - - pub fn main() { - Date() - } - ``` - - Becomes: - - ```gleam - pub type Date { - Date(year: Int, month: Int, day: Int) - } - - pub fn main() { - Date(year: todo, month: todo, day: todo) - } - ``` - - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - -- Completions are now sorted by priority based on why the completion is in the - list. This means that more specific completions like labels and local - definitions will be shown before more broad completions like functions from a - not yet imported module. - ([Ameen Radwan](https://github.com/Acepie)) - ### Bug Fixes - -- Functions, types and constructors named `module_info` are now escaped - in generated Erlang code to avoid conflicts with the builtin - `module_info/0` and `module_info/1` functions. - ([Juraj Petráš](https://github.com/Hackder)) - -- Fixed formatting of comments at the start of a case branch. - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - -- Fixed a bug where a private type could be leaked from an internal module. - ([Ameen Radwan](https://github.com/Acepie)) - -- Fixed a bug where certain binops would not wrap their arguments properly - thus generating invalid JavaScript. - ([Ameen Radwan](https://github.com/Acepie)) - -- Fixed formatting of function definitions marked as `@internal` - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - -- Fixed a bug where importing a record constructor in an unqualified fashion and - aliasing it and then using it in a case guard expression would generate - invalid JavaScript. - ([PgBiel](https://github.com/PgBiel)) - -## v1.3.2 - 2024-07-11 - -### Language Server - -- The language server no longer shows completions when inside a literal string. - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) - -### Bug Fixes - -- Fixed a bug where the compiler would report errors for duplicate `@external` - attributes with inconsistent spans between Erlang and JavaScript. - ([Connor Szczepaniak](https://github.com/cszczepaniak)) - -- Fixed a bug where `gleam add` would fail to parse version specifiers - correctly. - ([Louis Pilfold](https://github.com/lpil)) - -- Fixed a bug where single clause case expressions could generate JavaScript - code with incorrectly rewritten JavaScript variable names. - ([Louis Pilfold](https://github.com/lpil)) - -## v1.3.1 - 2024-07-10 - -### Bug Fixes - -- Fixes a bug with import cycle detection when there is more than 2 imports in - the cycle. - ([Ameen Radwan](https://github.com/Acepie)) diff --git a/changelog/v1.4.md b/changelog/v1.4.md new file mode 100644 index 000000000..c9a901841 --- /dev/null +++ b/changelog/v1.4.md @@ -0,0 +1,353 @@ +# Changelog + +## v1.4.0 - 2024-08-02 + +### Bug Fixes + +- Fixed a bug where pipe function arity errors could have an incorrect error + message. + ([sobolevn](https://github.com/sobolevn)) + +- Fixed a bug where the case of type parameters would not be checked. + ([Surya Rose](https://github.com/gearsdatapacks)) + +- Fixed a bug where the language server would still show completions when inside + a comment. + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + +## v1.4.0-rc1 - 2024-07-29 + +### Build tool + +- `gleam docs build` now takes an optional `--target` flag to specify the target + platform for the generated documentation. + ([Jiangda Wang](https://github.com/frank-iii)) + +- Warnings are now emitted each time the project is built, even if the module + the warnings originated from were loaded from the cache rather than + recompiling. + ([Louis Pilfold](https://github.com/lpil)) + +### Compiler + +- Labelled arguments can now use the label shorthand syntax. + This means that when you're passing a variable as a labelled argument and it + happens to have the same name as the label, you can omit the variable name: + + ```gleam + pub fn date(day day: Int, month month: Month, year year: Year) -> Date { + todo + } + + pub fn main() { + let day = 11 + let month = October + let year = 1998 + + date(year:, month:, day:) + // This is the same as writing + // date(year: year, month: month, day: day) + } + ``` + + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + +- Labelled pattern variables can now use the label shorthand syntax. + This means that when you're pattern matching on a record constructor and + binding its labelled fields to variables that happen to have the same name, + you can omit the variable name: + + ```gleam + pub type Date + Date(day: Int, month: Month, year: Year) + } + + pub fn main() { + case Date(11, October, 1998) { + Date(year:, month:, day:) -> todo + // This is the same as writing + // Date(year: year, month: month, day: day) -> todo + } + + } + ``` + + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + +- The warning for the deprecated `[..]` pattern has been improved. + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + +- Record accessors are now fault tolerant. This means an invalid label can be + properly detected and won't invalidate the rest of the expression. + ([Ameen Radwan](https://github.com/Acepie)) + +- Erlang type spec generation has been improved to avoid new warnings emitted in + OTP27. + ([Damir Vandic](https://github.com/dvic)) + +- Error messages for invalid record constructors now contain a restructured + example of what the user likely intended. This is especially helpful for + users coming from other languages, like Rust or Go. + + For example, provided a User type: + + ```gleam + pub type User { + name: String + } + ``` + + The compiler errors with the following message: + + ``` + error: Syntax error + ┌─ /src/parse/error.gleam:3:5 + │ + 3 │ name: String, + │ ^^^^ I was not expecting this + + Each custom type variant must have a constructor: + + pub type User { + User( + name: String, + ) + } + ``` + + ([Rahul D. Ghosal](https://github.com/rdghosal)) + +- The `<>` string concatenation operator can now be used in constant + expressions. + ([Thomas](https://github.com/DeviousStoat)) + +- Function calls are now fault tolerant. This means that errors in the function + call arguments won't stop the rest of the call from being analysed. + ([Ameen Radwan](https://github.com/Acepie)) + +- The error message presented when a function is called in a guard has been + improved. + ([Thomas](https://github.com/DeviousStoat)) + +- Case expressions are now fault tolerant. This means an subject, pattern, + guard, or then body can be properly detected and won't invalidate the rest + of the expression. + ([Ameen Radwan](https://github.com/Acepie)) + +- Documentation comments that come before a regular comment are no longer + clumped together with the documentation of the following definition. + Now commenting out a definition won't result in its documentation merging with + the following one's. + + ```gleam + /// This doc comment will be ignored! + // a commented definition + // fn wibble() {} + + /// Wibble's documentation. + fn wibble() { todo } + ``` + + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + +- The `little` and `big` endianness options, the `signed` and `unsigned` integer + options, and sized floats (32-bit and 64-bit), can now be used in bit array + expressions and patterns on the JavaScript target. + ([Richard Viney](https://github.com/richard-viney)) + +- The `utf8` option can now be used with constant strings in bit array patterns + on the JavaScript target. + ([Richard Viney](https://github.com/richard-viney)) + +### Formatter + +- The formatter will no longer move a documentation comment below a regular + comment following it. This snippet of code is left as it is by the formatter: + + ```gleam + /// This doc comment will be ignored! + // a commented definition + // fn wibble() {} + + /// Wibble's documentation. + fn wibble() { + todo + } + ``` + + While previously all documentation comments would be merged together into one, + ignoring the regular comment separating them: + + ```gleam + // a commented definition + // fn wibble() {} + + /// This doc comment will be ignored! + /// Wibble's documentation. + fn wibble() { + todo + } + ``` + + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + +### Language Server + +- The language server can now show completions for fields if a record access is + being attempted. + ([Ameen Radwan](https://github.com/Acepie)) + +- The language server will now insert a blank line before the first statement + when inserting a new import and there are no other imports at the top of the + module. + ([Zhomart Mukhamejanov](https://github.com/Zhomart)) + +- The language server now suggests a code a action to rename variables, types + and functions when they don't match the Gleam naming requirements: + + ```gleam + let myNumber = 10 + ``` + + Becomes: + + ```gleam + let my_number = 10 + ``` + + ([Surya Rose](https://github.com/gearsdatapacks)) + +- The language server can now suggest a code action to convert `let assert` into + a case expression: + + ```gleam + let assert Ok(value) = get_result() + ``` + + Becomes: + + ```gleam + let value = case get_result() { + Ok(value) -> value + _ -> panic + } + ``` + + ([Surya Rose](https://github.com/gearsdatapacks)) + +- The language server can now show signature help when writing functions. + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + +- The language server now supports listing document symbols, such as functions + and constants, for the current Gleam file. + ([PgBiel](https://github.com/PgBiel)) + +- The language server can now suggest a code action to automatically use + shorthand labels where possible: + + ```gleam + case date { + Day(day: day, month: month, year: year) -> todo + } + ``` + + Becomes: + + ```gleam + case date { + Day(day:, month:, year:) -> todo + } + ``` + + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + +- The language server can now show completions for labels when writing a + function call or record construction. + ([Ameen Radwan](https://github.com/Acepie)) + +- The language server can now suggest a code action to fill in the labels of a + function call: + + ```gleam + pub type Date { + Date(year: Int, month: Int, day: Int) + } + + pub fn main() { + Date() + } + ``` + + Becomes: + + ```gleam + pub type Date { + Date(year: Int, month: Int, day: Int) + } + + pub fn main() { + Date(year: todo, month: todo, day: todo) + } + ``` + + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + +- Completions are now sorted by priority based on why the completion is in the + list. This means that more specific completions like labels and local + definitions will be shown before more broad completions like functions from a + not yet imported module. + ([Ameen Radwan](https://github.com/Acepie)) + +### Bug Fixes + +- Functions, types and constructors named `module_info` are now escaped + in generated Erlang code to avoid conflicts with the builtin + `module_info/0` and `module_info/1` functions. + ([Juraj Petráš](https://github.com/Hackder)) + +- Fixed formatting of comments at the start of a case branch. + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + +- Fixed a bug where a private type could be leaked from an internal module. + ([Ameen Radwan](https://github.com/Acepie)) + +- Fixed a bug where certain binops would not wrap their arguments properly + thus generating invalid JavaScript. + ([Ameen Radwan](https://github.com/Acepie)) + +- Fixed formatting of function definitions marked as `@internal` + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + +- Fixed a bug where importing a record constructor in an unqualified fashion and + aliasing it and then using it in a case guard expression would generate + invalid JavaScript. + ([PgBiel](https://github.com/PgBiel)) + +## v1.3.2 - 2024-07-11 + +### Language Server + +- The language server no longer shows completions when inside a literal string. + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + +### Bug Fixes + +- Fixed a bug where the compiler would report errors for duplicate `@external` + attributes with inconsistent spans between Erlang and JavaScript. + ([Connor Szczepaniak](https://github.com/cszczepaniak)) + +- Fixed a bug where `gleam add` would fail to parse version specifiers + correctly. + ([Louis Pilfold](https://github.com/lpil)) + +- Fixed a bug where single clause case expressions could generate JavaScript + code with incorrectly rewritten JavaScript variable names. + ([Louis Pilfold](https://github.com/lpil)) + +## v1.3.1 - 2024-07-10 + +### Bug Fixes + +- Fixes a bug with import cycle detection when there is more than 2 imports in + the cycle. + ([Ameen Radwan](https://github.com/Acepie)) From a95bd5066f4c42c32dad85b2f7af2f79a3f82891 Mon Sep 17 00:00:00 2001 From: Ameen Radwan Date: Sat, 3 Aug 2024 13:10:27 -0700 Subject: [PATCH 2/6] lsp show accessor completions for private types in same module --- compiler-core/src/analyse.rs | 2 - .../src/language_server/completer.rs | 3 +- .../src/language_server/tests/completion.rs | 17 +++++++ ...completions_for_private_record_access.snap | 44 +++++++++++++++++++ 4 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 compiler-core/src/language_server/tests/snapshots/gleam_core__language_server__tests__completion__completions_for_private_record_access.snap diff --git a/compiler-core/src/analyse.rs b/compiler-core/src/analyse.rs index 64ad01e92..c0270ddd3 100644 --- a/compiler-core/src/analyse.rs +++ b/compiler-core/src/analyse.rs @@ -279,8 +279,6 @@ impl<'a, A> ModuleAnalyzer<'a, A> { // items. env.module_types .retain(|_, info| info.module == self.module_name); - env.accessors - .retain(|_, accessors| accessors.publicity.is_importable()); // Ensure no exported values have private types in their type signature for value in env.module_values.values() { diff --git a/compiler-core/src/language_server/completer.rs b/compiler-core/src/language_server/completer.rs index 64c2e4277..c7d006db1 100644 --- a/compiler-core/src/language_server/completer.rs +++ b/compiler-core/src/language_server/completer.rs @@ -657,7 +657,8 @@ where match type_.as_ref() { Type::Named { name, module, .. } => importable_modules .get(module) - .and_then(|i| i.accessors.get(name)), + .and_then(|i| i.accessors.get(name)) + .filter(|a| a.publicity.is_importable() || module == &self.module.name), _ => None, } } diff --git a/compiler-core/src/language_server/tests/completion.rs b/compiler-core/src/language_server/tests/completion.rs index 679712da7..df560a271 100644 --- a/compiler-core/src/language_server/tests/completion.rs +++ b/compiler-core/src/language_server/tests/completion.rs @@ -1275,6 +1275,23 @@ fn fun() { assert_completion!(TestProject::for_source(code), Position::new(8, 15)); } +#[test] +fn completions_for_private_record_access() { + let code = " +type Wibble { + Wibble(wibble: Int, wobble: Int) + Wobble(wabble: Int, wobble: Int) +} + +fn fun() { + let wibble = Wibble(1, 2) + wibble.wobble +} +"; + + assert_completion!(TestProject::for_source(code), Position::new(8, 15)); +} + #[test] fn completions_for_record_labels() { let code = " diff --git a/compiler-core/src/language_server/tests/snapshots/gleam_core__language_server__tests__completion__completions_for_private_record_access.snap b/compiler-core/src/language_server/tests/snapshots/gleam_core__language_server__tests__completion__completions_for_private_record_access.snap new file mode 100644 index 000000000..df00a04c9 --- /dev/null +++ b/compiler-core/src/language_server/tests/snapshots/gleam_core__language_server__tests__completion__completions_for_private_record_access.snap @@ -0,0 +1,44 @@ +--- +source: compiler-core/src/language_server/tests/completion.rs +expression: "\ntype Wibble {\n Wibble(wibble: Int, wobble: Int)\n Wobble(wabble: Int, wobble: Int)\n}\n\nfn fun() {\n let wibble = Wibble(1, 2)\n wibble.wobble\n}\n" +--- +type Wibble { + Wibble(wibble: Int, wobble: Int) + Wobble(wabble: Int, wobble: Int) +} + +fn fun() { + let wibble = Wibble(1, 2) + wibble.wobble| +} + + +----- Completion content ----- +[ + CompletionItem { + label: "wobble", + label_details: None, + kind: Some( + Field, + ), + detail: Some( + "Int", + ), + documentation: None, + deprecated: None, + preselect: None, + sort_text: Some( + "1_wobble", + ), + filter_text: None, + insert_text: None, + insert_text_format: None, + insert_text_mode: None, + text_edit: None, + additional_text_edits: None, + command: None, + commit_characters: None, + data: None, + tags: None, + }, +] From 3a4f3c3e712d2638518512187c400b4eb5744470 Mon Sep 17 00:00:00 2001 From: Ameen Radwan Date: Sat, 3 Aug 2024 13:12:04 -0700 Subject: [PATCH 3/6] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index db85a4dfd..236ce7d59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,3 +11,7 @@ ### Language Server ### Bug Fixes + +- Fix a bug that caused record accessors for private types to not be completed + by the LSP, even when in the same module. + ([Ameen Radwan](https://github.com/Acepie)) From d4d52a6dbc45d4c1ce25035acd2f2d49a069117c Mon Sep 17 00:00:00 2001 From: Ameen Radwan Date: Sat, 3 Aug 2024 13:30:09 -0700 Subject: [PATCH 4/6] fix opaque types --- compiler-core/src/type_/expression.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler-core/src/type_/expression.rs b/compiler-core/src/type_/expression.rs index 64646b4ef..f66a94aa7 100644 --- a/compiler-core/src/type_/expression.rs +++ b/compiler-core/src/type_/expression.rs @@ -2224,7 +2224,10 @@ impl<'a, 'b> ExprTyper<'a, 'b> { .environment .importable_modules .get(module) - .and_then(|module| module.accessors.get(name)), + .and_then(|module| module.accessors.get(name)) + .filter(|a| { + a.publicity.is_importable() || module == &self.environment.current_module + }), _something_without_fields => return Err(unknown_field(vec![])), } From 69485cabfd3e4d39347c84c82104d6e50fb71d0a Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Sun, 4 Aug 2024 14:19:22 +0200 Subject: [PATCH 5/6] v1.4.1 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 236ce7d59..792a76044 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ ### Bug Fixes +## v1.4.1 - 2024-08-04 + +### Bug Fixes + - Fix a bug that caused record accessors for private types to not be completed by the LSP, even when in the same module. ([Ameen Radwan](https://github.com/Acepie)) From 9f6523e9cf64c7913b3b01b8b32c3a0abed69812 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Mon, 26 Aug 2024 01:28:50 -0300 Subject: [PATCH 6/6] fix test name --- ...tests__completion__completions_for_private_record_access.snap} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename compiler-core/src/language_server/tests/snapshots/{gleam_core__language_server__tests__completion__completions_for_private_record_access.snap => glistix_core__language_server__tests__completion__completions_for_private_record_access.snap} (100%) diff --git a/compiler-core/src/language_server/tests/snapshots/gleam_core__language_server__tests__completion__completions_for_private_record_access.snap b/compiler-core/src/language_server/tests/snapshots/glistix_core__language_server__tests__completion__completions_for_private_record_access.snap similarity index 100% rename from compiler-core/src/language_server/tests/snapshots/gleam_core__language_server__tests__completion__completions_for_private_record_access.snap rename to compiler-core/src/language_server/tests/snapshots/glistix_core__language_server__tests__completion__completions_for_private_record_access.snap