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

Implement binding types for var/let/const variables. #5296

Closed
wants to merge 8 commits into from
Closed

Implement binding types for var/let/const variables. #5296

wants to merge 8 commits into from

Conversation

tmcw
Copy link
Contributor

@tmcw tmcw commented Mar 6, 2018

Work in progress! This doesn't pass the full test suite yet, and I'm not sure why yet. This aims to fix #5138 - it makes the register() method in the JavaScript highlighting mode aware of the type of binding it is in, and also adds block context that contains block-scoped definitions. Review + hints for how to get to the finish line much appreciated!

@marijnh
Copy link
Member

marijnh commented Mar 7, 2018

Nice. I'd keep a single chain of scopes, rather than separate ones for function and block scopes, though. You can add a property that describes the type of the scope.

@tmcw
Copy link
Contributor Author

tmcw commented May 14, 2018

Okay, refactored to use a single chain of scopes. Still pretty baffled by what's going wrong with the indentation failures, though - I can see that it's now setting align=true when re-entering the mode, and that's aligning certain blocks incorrectly, but how that connects to the very minimal code change is a mystery.

@tmcw
Copy link
Contributor Author

tmcw commented May 16, 2018

It works! May also want to implement for scopes.

@tmcw tmcw changed the title [WIP] Implement binding types for var/let/const variables. Implement binding types for var/let/const variables. May 17, 2018
marijnh added a commit that referenced this pull request May 22, 2018
@marijnh
Copy link
Member

marijnh commented May 22, 2018

Merged as 40027e2 and adjusted in 2e99e14 to avoid allocating too many objects

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

Successfully merging this pull request may close these issues.

JavaScript mode scope highlighting doesn't adjust for let/const block scopes
2 participants