Comments (3)
Are there currently any tests of completion that involve a file that fails to compile?
There are some in test/elixir_sense/suggestion_test.exs
from elixir_sense.
I hit some other similar errors lately, e.g.
add_call_to_line({Module.concat(module), call, length(params)}, {line, column + 1})
** (FunctionClauseError) no function clause matching in :elixir_aliases.do_concat/2
(elixir 1.10.3) src/elixir_aliases.erl:120: :elixir_aliases.do_concat([{:state, [line: 50, column: 5], nil}, :Process], "Elixir")
(elixir 1.10.3) src/elixir_aliases.erl:108: :elixir_aliases.concat/1
(elixir_sense 1.0.1) lib/elixir_sense/core/metadata_builder.ex:990: ElixirSense.Core.MetadataBuilder.pre/2
(elixir 1.10.3) lib/macro.ex:430: anonymous fn/4 in Macro.do_traverse_args/4
(elixir 1.10.3) lib/enum.ex:1520: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
(elixir 1.10.3) lib/enum.ex:1520: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
(elixir 1.10.3) lib/macro.ex:396: Macro.do_traverse/4
(elixir 1.10.3) lib/macro.ex:411: Macro.do_traverse/4
** (FunctionClauseError) no function clause matching in :elixir_aliases.do_concat/2
(elixir 1.10.3) src/elixir_aliases.erl:120: :elixir_aliases.do_concat([{:|>, [line: 517, column: 5], [{:++, [line: 516, column: 28], [{:news, [line: 516, column: 23], nil}, {:modifys, [line: 516, column: 31], nil}]}, {{:., [line: 517, column: 12], [{:__aliases__, [line: 517, column: 8], [:Enum]}, :group_by]}, [line: 517, column: 12], [{:fn, [line: 517, column: 22], [{:->, [line: 517, column: 48], [[{:{}, [line: 517, column: 25], [{:side, [line: 517, column: 26], nil}, {:_price, [line: 517, column: 32], nil}, {:_order, [line: 517, column: 40], nil}]}], {:side, [line: 517, column: 51], nil}]}]}]}]}, :I], "Elixir")
(elixir 1.10.3) src/elixir_aliases.erl:108: :elixir_aliases.concat/1
(elixir_sense 1.0.1) lib/elixir_sense/core/state.ex:974: ElixirSense.Core.State.expand_alias/2
(elixir_sense 1.0.1) lib/elixir_sense/core/metadata_builder.ex:1226: ElixirSense.Core.MetadataBuilder.get_binding_type/2
(elixir_sense 1.0.1) lib/elixir_sense/core/metadata_builder.ex:753: ElixirSense.Core.MetadataBuilder.pre/2
(elixir 1.10.3) lib/macro.ex:430: anonymous fn/4 in Macro.do_traverse_args/4
(elixir 1.10.3) lib/enum.ex:1520: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
(elixir 1.10.3) lib/enum.ex:1520: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
(elixir 1.10.3) lib/macro.ex:396: Macro.do_traverse/4
(elixir 1.10.3) lib/macro.ex:411: Macro.do_traverse/4
(elixir 1.10.3) lib/enum.ex:1520: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
(elixir 1.10.3) lib/macro.ex:416: Macro.do_traverse/4
(elixir 1.10.3) lib/enum.ex:1520: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
(elixir 1.10.3) lib/enum.ex:1520: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
(elixir 1.10.3) lib/macro.ex:396: Macro.do_traverse/4
(elixir 1.10.3) lib/enum.ex:1520: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
(elixir 1.10.3) lib/enum.ex:1520: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
(elixir 1.10.3) lib/macro.ex:396: Macro.do_traverse/4
(elixir 1.10.3) lib/macro.ex:411: Macro.do_traverse/4
(elixir 1.10.3) lib/enum.ex:1520: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
Unfortunately it is not worth fixing every one. Metadata builder makes assumptions that AST is relatively sane. In the case with @do ...
the parser assumes that function block is the attribute value which is obviously illegal. The best we can do is catch the error and replace the faulty AST node with nil.
from elixir_sense.
Thanks, that seems like a sane fix
from elixir_sense.
Related Issues (20)
- Type system could handle function captures
- Signature provider reveals opaque type details
- No specs on metadata type suggestions
- Duplicated signatures for local dunctions
- Provide full documentation for code in current buffer
- Local macro is available only after definition
- Incorrect handling of alias and require with warn option
- Suggestion crash on elixir 1.15
- quote used as variable not working correctly with docs and definition provider
- Binding does not respect requires and local macro position
- Multiple meta looks bad in docs
- No spec in signature and docs for module_info on local module
- Invalid handling of MACRO- in params reducer
- Add hidden metadata on doc:false and underscored functions and types
- Variable matching regex is invalid
- Document that this is included in elixir-ls HOT 2
- Language Server crashes when autocompleting `:pg`
- Definition provider does not work for nested phoenix scopes HOT 3
- Error when Module Attribute in Docstring HOT 3
- What does providers being deprecated mean for plugins? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elixir_sense.