mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-13 01:47:51 +08:00
Show content of compiler error.
This commit is contained in:
parent
a016fb8cbe
commit
9ca0f83256
|
@ -131,7 +131,7 @@ func (ed *Editor) refresh(fullRefresh bool) error {
|
||||||
_, err := ed.evaler.Compile(name, src, n)
|
_, err := ed.evaler.Compile(name, src, n)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err, ok := err.(*errutil.ContextualError); ok {
|
if err, ok := err.(*errutil.ContextualError); ok {
|
||||||
ed.addTip("compiler error highlighted")
|
ed.addTip("compiler error: %s", err)
|
||||||
p := err.Pos()
|
p := err.Pos()
|
||||||
for i, token := range ed.tokens {
|
for i, token := range ed.tokens {
|
||||||
if token.Node.Begin() <= p && p < token.Node.End() {
|
if token.Node.Begin() <= p && p < token.Node.End() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user