-
Notifications
You must be signed in to change notification settings - Fork 352
Update Master #361
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
Merged
Update Master #361
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getElementById, getElementsByClassName, querySelector and querySelectorAll are often used Functions.
Summary: This fixes the indentation for expression arrow functions that are continued on multiple lines. This does not affect the `FunctionBody` variant of arrow functions, which were already correct due to the opening brace. Resolves #332. Test Plan: Type ```javascript const myNiftyArrowFunction = (foo, bar) => foo + bar; myNiftyArrowFunction(1, 2); ``` and note that it's indented correctly as you type. Then run `gg=G` and make sure that it stays indented correctly. Note also that the indentation of ```javascript const myFunctionBodiedArrowFunction = (foo, bar) => { doAThing(); return foo + bar; }; myFunctionBodiedArrowFunction(1, 2); ``` is still correct.
Make arrow-functions one-liners
Summary: This regex was modified in 325c048, where the tokens `\(>\)\@!` were added. This was supposed to be a negative lookahead for a literal `>`. However, this didn't work because the regexp has the `\v` flag, so the regexp actually ended up matching nothing. Closes #333. Test Plan: Install the [gerw/vim-HiLinkTrace][HLT] plugin. Write `let x = 3` in a new JavaScript file. Place the cursor on the `x` and enter `:HLT<CR>`. Before the patch is applied, the `SynStack` and `HltTrace` fields of the message should be blank. Then, apply the patch, relaunch vim, and repeat the `HLT` command; the message should now contain `SynStack: jsAssignmentExpr->...`. [HLT]: https://github.com/gerw/vim-HiLinkTrace
Respect 'very-magic' in 'jsAssignmentExpr' regexp
feat(conceal): add arrow_function option
Accept JS expressions in template variables so that their contents are highlighted normally. Change `jsTemplateVar` to a region rather than a match. Fixes #316
…c-args Add jsComment to jsFuncArgs
Add jsLineComment to jsFuncArgs
make the m variable script-local
Added Buffer to jsGlobalObjects
Fix nested template variable syntax highlighting
Add common DOM Functions
Issue #298 Add dollar sign to jsDocParam class
Use shiftwidth() instead of &sw in indent/javascript.vim
Issue #291 better one line scope indentation
* Added support for . within class definition and mapped to jsClassNoise * Linked jsClassNoise to Noise * Tweaked code/whitespace alignment of the jsClass* section
Allowed single quote for param, misplaced localdoc Allowed dash for param
Added jsduck documentation types
Adding first pass at ES6 Class support
Higher specificity for jsTemplate braces
* Added higher specificity to the dots in the spread declaration
Improvements to rest highlighting
Tacking this on since it relates to ES6 functions. The generator astericks were breaking the highlighting of function arguments. This should fix generators
Proper Lambda Support
🎉 |
One thing I still want to add is better argument destructuring support, so lets hold off on this until I can get something sorted for this. |
Our comment detection was a bit buggy because we did not use the extend keyword. This meant that if the comment was contained within a region or a match of sorts, it would get pre-maturely ended by a containing group. Using the extend keyword means that it will override any containing parent matcher and still display a comment, which is how JS actually interprets the code.
This should vastly improve how destructuring is handled in function declarations. It is still far from perfect, and a major problem right now is how to support multiple lines in lambda functions
I also found a pretty big bug overall with how comments are handled, which should definitely get in for this release. |
Since we had to remove the contained argument for jsFuncBlock, it caused false positives for object definitions at the top level of a file. I've made jsBlock a higher priorty than jsFuncBlock by placing jsBlock AFTER jsFuncBlock.
Misc Fixes
Alright, this should be good. Any issues with getting this into |
Great. Let's do it. :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It's been a few months since we last updated
master
, and there's a lot of really good things indevelop
that should definitely be going out soon.