Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper handling of cache errors #185

Open
slrtbtfs opened this issue Jul 8, 2020 · 0 comments
Open

Proper handling of cache errors #185

slrtbtfs opened this issue Jul 8, 2020 · 0 comments

Comments

@slrtbtfs
Copy link
Member

slrtbtfs commented Jul 8, 2020

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.

@slrtbtfs slrtbtfs changed the title Proper error handling of cache errors Proper handling of cache errors Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant