Skip to content

Commit 05698c1

Browse files
committed
fixed diagnostics temporarily
1 parent 72690de commit 05698c1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

documents/documents.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ func (d *DocumentState) newErrorCollector() ddperror.Handler {
5656

5757
func (d *DocumentState) reParseInContext(modules map[string]*ast.Module, errorHandler ddperror.Handler) (err error) {
5858
d.Module, err = parser.Parse(parser.Options{
59-
FileName: d.Path,
60-
Source: []byte(d.Content),
61-
Modules: merge_map_into(preparsed_duden, modules),
59+
FileName: d.Path,
60+
Source: []byte(d.Content),
61+
// TODO: make this work better
62+
// Modules: merge_map_into(preparsed_duden, modules),
63+
Modules: preparsed_duden,
6264
ErrorHandler: errorHandler,
6365
})
6466
d.NeedReparse.Store(false)

handlers/diagnostics.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ func (d *diagnosticVisitor) add(err ddperror.Error) {
9696
Severity: severity,
9797
Source: &errSrc,
9898
Message: fmt.Sprintf("%s (%d)", err.Msg, err.Code),
99+
Code: &protocol.IntegerOrString{Value: err.Code},
99100
}
100101
if err.File != d.path {
101102
diagnostic.Range = protocol.Range{Start: protocol.Position{Line: 0, Character: 0}, End: protocol.Position{Line: 0, Character: 1}}

0 commit comments

Comments
 (0)