Update JavaScript outline queries (#2596)

Add support for exported const declarations in the outline view. Did not
include more context (e.g., whether or not the it's exported or not)
because we're not doing that for TypeScript right now. We could do that
in a follow up pull request, addressing both JavaScript and TypeScript
at once.


**Before**

<img width="1186" alt="outline-before"
src="https://github.com/zed-industries/zed/assets/503025/e72b0ed4-52b0-4a7c-af70-b2f4758e3554">

**After**

<img width="1186" alt="outline-after"
src="https://github.com/zed-industries/zed/assets/503025/cd91bc7f-8ce3-485f-9b33-d487ad6c718d">


Release Notes:

- Added support for exported const declarations in the JavaScript
outline view. Fixed
[#1399](https://github.com/zed-industries/community/issues/1399).
This commit is contained in:
Max Brunsfeld 2023-06-09 08:34:14 -07:00 committed by GitHub
commit 738b06a778
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,6 +18,13 @@
"interface" @context
name: (_) @name) @item
(program
(export_statement
(lexical_declaration
["let" "const"] @context
(variable_declarator
name: (_) @name) @item)))
(program
(lexical_declaration
["let" "const"] @context