Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/lib-common/src/scopeSupportFacets/javascript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = {
"branch.loop.iteration": notApplicable,

// Miscellaneous
"statement.misc": notApplicable,
environment: notApplicable,
selector: notApplicable,
unit: notApplicable,
Expand Down Expand Up @@ -352,5 +351,6 @@ export const javascriptScopeSupport: LanguageScopeSupportFacetMap = {
"argument.actual.enum.iteration": notApplicable,

// Miscellaneous
"statement.misc": notApplicable,
"statement.package": notApplicable,
};
1 change: 1 addition & 0 deletions packages/lib-common/src/scopeSupportFacets/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const typescriptScopeSupport: LanguageScopeSupportFacetMap = {
"statement.iteration.interface": supported,
"statement.typeAlias": supported,
"statement.method.interface": supported,
"statement.misc": supported,

"value.typeAlias": supported,
"value.field.enum": supported,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
declare module "foo" {}
---

[Content] =
[Removal] =
[Domain] = 0:0-0:23
>-----------------------<
0| declare module "foo" {}

[Insertion delimiter] = "\n"
2 changes: 1 addition & 1 deletion resources/queries/javascript.core.scm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
;; This is disabled since we want the whole statement and not just the block
;; (statement_block)
] @statement
(#not-parent-type? @statement export_statement)
(#not-parent-type? @statement export_statement ambient_declaration)
)

(
Expand Down
4 changes: 3 additions & 1 deletion resources/queries/typescript.core.scm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
;; `javascript.jsx.scm`, and tree-sitter would complain because those node
;; types are not defined in the typescript grammar.

;; https://github.com/tree-sitter/tree-sitter-typescript/blob/4ad3010c91d700026d036b5230e2d99ba94ae8a4/typescript/src/grammar.json

;; import javascript.core.scm

;;!! class Foo { bar(); }
Expand Down Expand Up @@ -514,7 +516,7 @@
(module)
(type_alias_declaration)
] @statement
(#not-parent-type? @statement export_statement)
(#not-parent-type? @statement export_statement ambient_declaration)
)

;; Statements with optional trailing `;`
Expand Down
Loading