-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CodeMap::remove_file #7
base: master
Are you sure you want to change the base?
Conversation
Useful for long running processes with state (think REPL). Current implementation is linear, can be optimized later to be `O(1)`.
So far the goal has been to make it hard to obtain invalid spans, while going this direction probably means that more functions should return I worry about adding methods for operations the datastructure isn't really designed for. The "index into concatenated files" technique that |
A function may have a reference to a struct which references File and CodeMap, and remove that File when last reference to File is dropped.
Yep, I think it should be 64-bit.
I was thinking about having own struct like
But unfortunately That's why I came up with this solution. |
Here: https://github.com/kevinmehall/codemap-diagnostic/blob/c0eaceccd13fe05dee1903a83e1421aafd9584bb/src/lib.rs#L62 |
Yeah, I think you're running into some of the same limitations that I have. The "index into concatenated files" thing from rustc seems clever but is probably premature optimization for many cases. One change I've been thinking about is to make I think the |
OK, there is a couple of ways to fix this issue. Do you know how to fix it without breaking backward compatibility? (Codemap-diagnostic follows semver conventions I presume.) |
I'm currently working on a project that A lot of these trade-offs were made intentionally for one reason or another in rustc, and have changed over times. There's a lot of projects that would want the ready-made (and great) compiler error emitter, but may want to make very different tradeoffs in the code map/span encoding. I'd be willing to work on making |
Let's move the codemap-diagnostic side of this over to an issue on that repo: kevinmehall/codemap-diagnostic#7 |
Useful for long running processes with state (think REPL).
Current implementation is linear, can be optimized later to be
O(1)
.