56 Commits

Author SHA1 Message Date
Johann150 225d8d1c44 change error types (#295)
- move error to files module; removed the special error types from codespan-lsp
- use error type in codespan and codespan-lsp
- make dependency on codespan-reporting non-optional
2020-10-07 14:01:20 +02:00
Johann150 6b06e5f69a Make diagnostic locus point to the first primary label (#260) 2020-07-13 08:13:16 +10:00
Brendan Zabarauskas 713290ab1a Add notes to multifile examples 2020-04-28 18:44:02 +10:00
Brendan Zabarauskas 3d2a0ef0b0 Merge pull request #219 from brendanzab/svg-improvements
Svg generation improvements
2020-03-28 12:54:56 +11:00
Brendan Zabarauskas 5d7e89730e Compute height of SVG dynamically 2020-03-28 12:44:42 +11:00
Boomber 079306ee4a Update codespan-reporting/examples/reusable_diagnostic.rs 2020-03-26 07:18:14 +07:00
Boomber 07c9475540 Commit all other suggestions
I really need to learn how to do pull request

Co-Authored-By: Brendan Zabarauskas <bjzaba@yahoo.com.au>
2020-03-26 07:11:51 +07:00
Boomber 855a429e8f Grammar
Co-Authored-By: Brendan Zabarauskas <bjzaba@yahoo.com.au>
2020-03-26 07:09:00 +07:00
Boomber e34c56b9b2 Change indentation 2020-03-26 06:27:47 +07:00
Boomber 9a148aa2d0 Reusable Diagnostic Example 2020-03-26 06:17:06 +07:00
Brendan Zabarauskas 6cfb5ebb26 Implement a rudimentary escaper in svg example
Just for fun!
2020-03-25 12:19:57 +11:00
Brendan Zabarauskas 3b6093a5a3 Fix formatting in example 2020-03-24 19:46:19 +11:00
Brendan Zabarauskas a9d2ee172f Use "<repl>" as the file name in the calculator repl 2020-03-12 21:20:39 +11:00
Brendan Zabarauskas 0b172b43bc Improve example documentation 2020-03-12 21:17:20 +11:00
Brendan Zabarauskas 9ac72cc74d Rename readme preview example 2020-03-11 14:19:16 +11:00
Brendan Zabarauskas f2a8131d6b Style improvements 2020-03-10 20:10:39 +11:00
Brendan Zabarauskas d5af85d40f Add peg example
Adds an example using the peg parser generator crate
2020-03-10 20:06:46 +11:00
Brendan Zabarauskas 4ed295a7dc Use anyhow::Result in examples 2020-03-10 18:50:33 +11:00
Brendan Zabarauskas 2bcbfab13c Implement a custom file example 2020-03-10 16:32:44 +11:00
Brendan Zabarauskas cbf72af5c9 SVG preview cleanups
This removes the box shadow which was clipping wierdly, and makes the SVG size a bit less confusing. The width of the SVG is set to 882 in order to be consistent with Github’s content width.
2020-03-09 18:16:09 +11:00
Brendan Zabarauskas 4474072ae6 Add SVG sample to README
Closes #87
2020-03-09 17:42:11 +11:00
Brendan Zabarauskas 07f0da6bf5 Minor improvements to multilabel rendering
Working towards #100, this slightly cleans up the rendering of diagnostics with multiple labels.
2020-03-09 14:09:54 +11:00
Brendan Zabarauskas bfca929b1c Diagnostic API cleanups 2020-02-29 13:43:26 +11:00
Brendan Zabarauskas 0861df7150 Move file-related items into a submodule 2020-02-27 09:54:23 +11:00
Brendan Zabarauskas c16dfab918 Add SimpleFile and SimpleFiles structs
This adds the `SimpleFile` and `SimpleFiles` structures to the `codespan_reporting` crate to get people started with their programming languages. It also inverts the dependency between `codespan` and `codespan_reporting`. That way users of `codespan_reporting` no longer have to depend on `codespan` if they don’t want to.
2020-02-26 21:42:19 +11:00
Brendan Zabarauskas c3af8bf382 Improve type inference for Files::{add, update}
This removes the implicit conversions for the `Files::{add, update}` methods now that we parameterise `Files` by the source type (see #144).
2020-01-06 11:06:54 +11:00
Ryan Cumming b0d9574640 Update reporting & lsp crates for generic source
This ports `codespan-reporting` and `codespan-lsp` to use `Files`'s new
`Source` generic parameter.
2020-01-05 12:20:03 +11:00
Brendan Zabarauskas ed99d65cdc Update structopt and unicode-segmentation 2019-12-18 10:40:47 +11:00
Brendan Zabarauskas ca5516abb7 Rename ‘emitter’ module to ‘term’ 2019-06-23 13:51:26 +10:00
Brendan Zabarauskas 3a05c32646 Use submodules rather than reexporting 2019-06-23 13:24:38 +10:00
Brendan Zabarauskas 071a0a8615 Make example more succinct 2019-06-07 00:08:42 +10:00
Brendan Zabarauskas 18d3bbdb2e Break up emitter module 2019-06-06 16:50:01 +10:00
Brendan Zabarauskas a8aa7b3f91 Add additional notes to primary source section
Closes #74
2019-06-06 14:53:00 +10:00
Brendan Zabarauskas 34b3a48fd4 Add case example to emitter 2019-06-06 14:23:22 +10:00
Brendan Zabarauskas f42ca77c4d Add a multifile example and fix unicode width
Fixes #41
2019-06-06 12:40:26 +10:00
Brendan Zabarauskas 8064d1e5c6 Use unindent to clean up example 2019-06-06 11:26:14 +10:00
Brendan Zabarauskas c84bcb0816 Rendering tweaks
It seems that the half-line box drawing characters aren’t as widely supported, so I’m avoiding this for now. Using a border style inspired by hedgehog: https://hedgehog.qa/article/haskell-state-machine.
2019-06-05 14:26:25 +10:00
Brendan Zabarauskas 9b8f70f927 Make example error messages more like rustc’s 2019-06-04 18:57:38 +10:00
Brendan Zabarauskas a1a23066ac Add range operator overload 2019-06-04 18:47:23 +10:00
Brendan Zabarauskas b585e8dfce Remove filespan type 2019-06-04 18:39:10 +10:00
Brendan Zabarauskas 0f6c0f35d7 Use file id instead of global byte indices 2019-06-04 15:12:05 +10:00
Brendan Zabarauskas de55abb81b Rename CodeMap to Files 2019-06-01 23:26:38 +10:00
Brendan Zabarauskas 093ffba31e Rename FileMap to File 2019-06-01 23:23:53 +10:00
Brendan Zabarauskas b23ef45954 Make diagnostics look closer to what the LSP expects 2019-05-30 21:54:07 +10:00
Brendan Zabarauskas b0ec5e20db Add color configuration 2019-05-30 13:51:29 +10:00
Markus Westerlind 60bb6ac950 Update the edition to 2018 2019-04-30 08:45:33 +02:00
Louis Pilfold ed482b93a3 Support multi-line diagnostics
Closes https://github.com/brendanzab/codespan/issues/23
2019-02-24 20:18:57 +00:00
Brendan Zabarauskas ea3dcc66a1 Run rustfmt 2018-11-29 12:35:21 +11:00
Gary Tierney bff170e14e Update emitter example to use a diagnostic code 2018-06-30 17:27:24 +01:00
Brendan Zabarauskas f688a76e6e Fix structopt application naming 2018-04-18 22:13:46 +10:00