Comments (5)
Thank you!
The message is not truncated, we don't include the snippet because we expect you to show it. I think however it can be confusing. Perhaps we should end the message by saying "typing violation found"?
We could compute the spam though, that would benefit both the console warning and the terminal one.
And what do you expect to be in detail?
from elixir.
we don't include the snippet because we expect you to show it
I don't think I follow. This is clearly different than TokenMissingError
etc. where snippets are returned. I don't insist that the snippet is needed. Position/span is sufficient for LSP
And what do you expect to be in detail?
Other errors have exception in detail. I would expect to find some structured info about the type problem:
- positions where conflicting types are defined
- the conflicting types as data
In LSP Diagnostic besides the main position/span (range
property) and message
, there is a collection relatedInformation
which can contain additional positions and messages. It's possible to build diagnostics that reference type definitions in another files. This is an example from elixir-ls
from elixir.
This is clearly different than TokenMissingError etc. where snippets are returned. I don't insist that the snippet is needed.
I think that's rather a flaw in TokenMissingError. I don't think we include it anywhere else. If you do IO.warn("hello", __ENV__)
in the module body, does the diagnostic have the snippet as well or not really?
Other errors have exception in detail. I would expect to find some structured info about the type problem:
Got it. I will see what we can expose. Perhaps we can expose the traces.
from elixir.
does the diagnostic have the snippet as well or not really?
No, only some of them do. The changes to include snippets were introduced in 1.16. In fact they do look ugly if the UI displaying it is not using a monospaced font (and there is no markdown support in diagnostic messages but that's VSCode issue microsoft/vscode#54272)
![Screenshot 2024-06-09 at 08 09 42](https://private-user-images.githubusercontent.com/1078186/337951648-9866b1a7-41e5-4997-bb8f-53ea89b86e19.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1MDg5NDgsIm5iZiI6MTcyNDUwODY0OCwicGF0aCI6Ii8xMDc4MTg2LzMzNzk1MTY0OC05ODY2YjFhNy00MWU1LTQ5OTctYmI4Zi01M2VhODliODZlMTkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYW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kNCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.rDftSqkFOPYUneyRd8IK-nBmPhnIj-mQAAq9VO2eSvE)
![Screenshot 2024-06-09 at 08 11 03](https://private-user-images.githubusercontent.com/1078186/337951860-4cf083e6-9a34-4359-b366-ce23b3031eff.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1MDg5NDgsIm5iZiI6MTcyNDUwODY0OCwicGF0aCI6Ii8xMDc4MTg2LzMzNzk1MTg2MC00Y2YwODNlNi05YTM0LTQzNTktYjM2Ni1jZTIzYjMwMzFlZmYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjRUMTQxMDQ4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZGRiZjdmOGVjMDNmMTlmOTJiMDBlY2JjY2VmZjcwODJkOTJhMGRkMTUzMDRjMjljM2ZkOTM2Nzg1ZmU3MzBlNSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.fr593nsU1VRZswoE9qljtciLtJ7wtJMpF4vpetK4vYE)
from elixir.
For completeness, the reason why syntax error, token missing error, etc include the snippets is because they are exceptions. You can probably intercept those exceptions and render something without the snippets if desired.
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.