Skip to content

Proper handling of cache errors #185

Open
@slrtbtfs

Description

@slrtbtfs

Currently, errors that are raised when accessing the cache aren't properly forwarded to the language client.

For a more correct error handling, all the occurrences in the langserver package of stuff like

location, err := s.cache.Find(&params.TextDocumentPositionParams)
if err != nil {
return nil, nil
}

should be replaced by something like

 location, err := s.cache.Find(&params.TextDocumentPositionParams) 
 if err != nil { 
 	return nil, filterContextExpirations(err) 
 } 

where filterContextExpirations(err) should return nil if the error was caused by an expired document context (in this case the document has changed since the request has started processing and the request is cancelled) and err otherwise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions