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

Odd errors with JavaScript language server #2547

Closed
aral opened this issue May 23, 2022 · 2 comments · Fixed by #5711
Closed

Odd errors with JavaScript language server #2547

aral opened this issue May 23, 2022 · 2 comments · Fixed by #5711
Labels
A-language-server Area: Language server client C-bug Category: This is a bug

Comments

@aral
Copy link
Contributor

aral commented May 23, 2022

Summary

Just noticed some odd errors with the JavaScript language server. Not sure what’s causing them. If I quit Helix and restart the errors go away until I add more code to the file. Not sure how to reproduce but here’s the code that’s causing it for me.

Screenshot from 2022-05-23 16-36-23

import tapMonkey from '../index.js'
import assert from 'assert'
import strip from 'strip-ansi'

// Test handler tests
tapMonkey.quiet = false
tapMonkey.testHandler({name: 'mock'})
console.log(tapMonkey.spinner)
tapMonkey.spinner.stop()

// General tests

assert(tapMonkey.spinner._spinner.interval === 300, 'spinner internal is as expected')
assert(tapMonkey.spinner._spinner.frames[0] === '  🙈 ', 'animation frame 1 is correct')
assert(tapMonkey.spinner._spinner.frames[1] === '  🙈 ', 'animation frame 2 is correct')
assert(tapMonkey.spinner._spinner.frames[2] === '  🙉 ', 'animation frame 3 is correct')
assert(tapMonkey.spinner._spinner.frames[3] === '  🙊 ', 'animation frame 4 is correct')

assert(strip(tapMonkey.spinner.text).includes('Running mock tests'), 'test name is displayed correctly')

console.log('All tests passed.')
process.exit()

Reproduction Steps

No response

Helix log

~/.cache/helix/helix.log

No pertinent details found in log.

Platform

Linux (Fedora Silverblue 36)

Terminal Emulator

GNOME Console

Helix Version

helix 22.05-dev (8df8ff2)

@aral aral added the C-bug Category: This is a bug label May 23, 2022
@the-mikedavis
Copy link
Member

Is this reproducible in another editor?

I expect that it's a bug in the language server upstream unless helix isn't sending it some information it needs.

@aral
Copy link
Contributor Author

aral commented May 23, 2022

@the-mikedavis Hey Mike, I don’t have access to a different editor at the moment but what’s odd is that after restarting, unless I touch that piece of the code specifically, I don’t get errors for it. So I’m thinking it’s not the LSP as it should still be checking the whole file.

(I wonder if the multi-codepoint emoji is causing issues.)

So this is an example after restart. You can see that I’ve added some unreachable code and that’s being flagged correctly as an error but the other code is fine.

If I can create small reproduction, I’ll update this issue with it.

Screenshot from 2022-05-23 16-47-31

@kirawi kirawi added A-helix-term Area: Helix term improvements A-language-server Area: Language server client and removed A-helix-term Area: Helix term improvements labels Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-server Area: Language server client C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants