Comments (4)
Yeah, this has been requested before (See #285)! Perhaps this is something we should have a look at.
For this specific instance, I'm wondering if using the notes section would help. Eg.
error: unknown start of token: \u{37e}
┌─ main.rs:2:30
|
2 | println!("Hello, world!");
| ^
= Unicode character ';' (Greek Question Mark) looks like ';' (Semicolon), but it is not
But I realise there are other instances where this is not as helpful, say with lifetime diagnostics, where you have to step through a sequence of related locations.
It would also be good to think about how this maps onto the language server protocol, but we might not want to limit ourselves by it. Eg. I tend to find lifetime errors easier to understand in the terminal, rather than using rust-analyzer.
from codespan.
As with most pretty error stuff, the logic will be lost in the LSP, which is not necessarily bad, i agree with you in saying cli is way better for some errors, i dont think LSP should limit codespan when it comes to features. The example was the first i could think of, it is obviously very simplistic.
from codespan.
I have not looked at the commits that were made, but maybe #176 could be interesting in this context?
from codespan.
Allowing users to write their own render logic and plug into codespan's renderer would be infinitely helpful when it comes to more specific diagnostics
from codespan.
Related Issues (20)
- Add an option to render more context around lines. HOT 11
- Order-preserving error reporting HOT 1
- Position is off by 2 characters with some strings HOT 6
- release tracking issue HOT 5
- codespan-reporting::Files not implemented for codespan::Files<String> HOT 3
- Display is broken on some platforms HOT 5
- Should non-`term` rendering backends live here? HOT 1
- Cut codespan release with fix? HOT 5
- Use of moved value: `blue` HOT 4
- Accessor for the location of a diagnostic HOT 3
- Implement `Ord` for `Severity` HOT 3
- Are there C bindings for codespan? HOT 2
- How to report inside `Display` implementation? HOT 3
- The destiny of `codespan` (and `codespan-reporting`)
- Make some functions `const`
- Request a new releases for including context before and after a label HOT 6
- Error when an error spans until EOF
- Wrong outer padding
- Move termcolor behind a feature flag
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 codespan.