Skip to content

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
merged 43 commits into from
Apr 6, 2016
Merged

Update Master #361

merged 43 commits into from
Apr 6, 2016

Conversation

amadeus
Copy link
Collaborator

@amadeus amadeus commented Apr 4, 2016

It's been a few months since we last updated master, and there's a lot of really good things in develop that should definitely be going out soon.

Delapouite and others added 30 commits September 23, 2015 22:50
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
make the m variable script-local
Fix nested template variable syntax highlighting
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
amadeus and others added 9 commits April 3, 2016 21:59
Higher specificity for jsTemplate braces
* Added higher specificity to the dots in the spread declaration
Tacking this on since it relates to ES6 functions.  The generator
astericks were breaking the highlighting of function arguments.  This
should fix generators
@davidchambers
Copy link
Collaborator

🎉

@amadeus
Copy link
Collaborator Author

amadeus commented Apr 4, 2016

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.

amadeus added 2 commits April 4, 2016 01:56
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
@amadeus
Copy link
Collaborator Author

amadeus commented Apr 4, 2016

I also found a pretty big bug overall with how comments are handled, which should definitely get in for this release.

amadeus and others added 2 commits April 5, 2016 17:23
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.
@amadeus
Copy link
Collaborator Author

amadeus commented Apr 6, 2016

Alright, this should be good. Any issues with getting this into master?

@davidchambers
Copy link
Collaborator

Great. Let's do it. :)

@amadeus amadeus merged commit 1833982 into master Apr 6, 2016
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.