Comments (15)
@doorgan I'll tackle that in a few minutes in the PR I have open
from elixir.
1.17.0 onwards.
from elixir.
What are you using this for? I believe this has been discussed before, but we cannot fix this without making structs somewhat inconsistent:
iex(3)> Code.string_to_quoted! "%Foo{foo: 321}", columns: true
{:%, [line: 1, column: 1],
[
{:__aliases__, [line: 1, column: 2], [:Foo]},
{:%{}, [line: 1, column: 5], [foo: 321]}
In that case, we show the starting line as the one in {
, but perhaps that's a smaller problem to live with. /cc @lukaszsamson
from elixir.
This is in Sourceror. When matching on a map literal and patching that node the column is off by 1 character so when you go to replace that range of characters with a replacement map it ends up with %%{a: 1}
from elixir.
But if this is a wontfix
would you suggest that in Sourceror that for just map literals the column is adjusted by -1
?
from elixir.
Pinging @doorgan as well then. :)
from elixir.
We can fix this in sourceror's range function itself if it's a known issue that won't be fixed soon!
from elixir.
I think the biggest issue is that, if we fix it for map
s, you still should not offset the %{}
inside struct. So I wonder which one is more or less work?
from elixir.
Isn’t it fixed already on master? See fd4e6b5
from elixir.
Thank you @lukaszsamson. I remember we had a recent discussion about this, but I didn't remember it was already fixed. :)
from elixir.
@lukaszsamson thank you :)
from elixir.
@josevalim if fixed on master
how should Sourcer address this for the time being? I don't want to wait on the next Elixir release but I can do a patch in Sourcerer to address this temporarily and then I guess Sourceror should do a version limit up to the current minor version of Elixir then remove that patch for the next release?
from elixir.
I guess I could really just fix this in LiveView Native and limit on the Elixir version for now then release without the patch later
from elixir.
@bcardarella What I used to do was to backport fixes to main to the vendored Elixir modules in Sourceror. I stopped doing that when I raised the minimum elixir version requirement, but I can see us keep doing it 🤔 Or doing Version
checks for known bugs
from elixir.
@josevalim I'm going to implement a fix in Sourceror using @doorgan's suggestion on branching based on version. Do you know yet what the likely version will have the fix @lukaszsamson mentioned? Next minor?
from elixir.
Related Issues (20)
- Erroneous "typing violation" warning HOT 1
- Internal consistency check failed: The following label(s) were referenced but not defined HOT 10
- Mix. Project.deps_tree does not include recently added local deps HOT 2
- Release remote console does not use application logger configuration HOT 5
- Path escaping for rebar shell command in deps.compile.ex HOT 3
- Expose the language tokenizer HOT 1
- EEx closing tag inside string has higher precedence than string HOT 1
- Test coverage gap when using defstruct
- Make it easier to spot compile-time graphs HOT 33
- Protocol.UndefinedError executing tests on elixir 1.17.2 HOT 4
- Lack of documentation when Logger.Formatter drops metadata due to unmeet printable conditions HOT 3
- Subsequent WHEN keywords wipeout previous WHEN lists without any warning or error HOT 3
- Too many threads triggers instability on 32-bit systems / std_alloc: Cannot allocate 512 bytes of memory (of type "bpd") HOT 4
- `mix format` on lines exactly 1 character longer than the limit HOT 2
- `File.read/1` missing 1st binary of `/dev/stdin` which comes from Unix pipe HOT 3
- Improve mix.exs related documentation HOT 1
- Compiler crashes when invalid number of arguments is used on clauses with guards HOT 1
- Add `Tuple.to_map/1` HOT 1
- `--repeat-until-failure` doesn't re-run `test/test_helper.exs` HOT 5
- String.replace can create an invalid string? 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.