Bump sourceror dependency to v0.12.2#841
Bump sourceror dependency to v0.12.2#841robmckinnon wants to merge 3 commits intoelixir-lsp:masterfrom
Conversation
0ef38bb to
81ef758
Compare
81ef758 to
4b120fc
Compare
| ElixirSense.string_to_quoted(s, 1, 6, token_metadata: true) | ||
| def from(s, opts) when is_binary(s) do | ||
| if opts[:include_comments] do | ||
| Sourceror.parse_string(s) |
There was a problem hiding this comment.
Does sourceror fix errors like ElixirSense does?
There was a problem hiding this comment.
I don't know. I'm not familar with how ElixirSense fixes errors. Do you have examples or tests that check for this? We could extend those to test Sourceror's behaviour.
| test "from\1" do | ||
| assert {:ok, | ||
| {:def, [do: [line: 1, column: 16], end: [line: 3, column: 3], line: 1, column: 3], | ||
| [ | ||
| {:foo, [closing: [line: 1, column: 14], line: 1, column: 7], | ||
| [{:baz, [line: 1, column: 11], nil}]}, | ||
| [do: {:__block__, [], []}] | ||
| ]}} = | ||
| Ast.from(""" | ||
| def foo(baz) do | ||
| # TODO | ||
| end | ||
| """) |
There was a problem hiding this comment.
these assertions are pretty hard core, and are really testing the calls to elixir sense / sourceror
Perhaps instead, just ensure we're calling the two libs correctly in each case by using Patch?
There was a problem hiding this comment.
The sourceror github page says to expect "frequent breaking changes".
Perhaps we leave the assertion of the returned AST structure -- at least for the Ast.from(_, include_comments: true) call -- to catch any breaking changes?
I depend on the AST returned by sourceror for the extract function refactoring code I'm writing in a separate branch.
Use Sourceror.parse_string/1 when include_comments: true.
60b5803 to
4895dc1
Compare
|
Sourceror library introduces problems with Mix.install and conflicts with sourceror versions used by client projects. If we want it we need it vendored like dialyxir and jason |
@lukaszsamson Are you intending to remove When making this PR I found I needed to use # use tag to ensure sourceror/lib_vendored is included
{:sourceror, github: "doorgan/sourceror", tag: "v0.12.2"},
Which client projects have the conflicts? |
Yes. It's not really used anywhere
No idea TBH, but most likely no. A lot of people reported problems with build related to that dependency. Just search for sourceror in issues here/vsdode/forum/slack. And we need a proper vendoring. OTP has no code sandboxing. Whenever a client project has it as a dependency in some other version it will override modules from our dependencies. |
Bump sourceror dependency to v0.12
refactor.extract.functioncode action that works with sourceror v0.12.sourceror/lib_vendoredis included and compilation in VSCode works.Pass include_comments option to CodeMod.Ast.from/2
Sourceror.parse_string/1wheninclude_comments: trueoption passed toCodeMod.Ast.from/2.CodeMod.Ast.from/2.