-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add textobject for javascript #3213
Add textobject for javascript #3213
Conversation
To fix the docs CI, you'll need to run |
You have forgotten about generator functions and class expressions:
|
Thanks for this! Can we get all of: https://github.com/nvim-treesitter/nvim-treesitter-textobjects/blob/master/queries/javascript/textobjects.scm ? (Sorry I don't really know the technical details of this matter) |
It looks like this already covers the textobjects from nvim-treesitter which are implemented in helix (i.e. not ones like |
this is my test file,
// js
// function
function a() { }
function b(b1) { }
export function c() { }
const d = function() { }
const e = {
f1: function(c, d) { },
f2: () => { }
}
const f1 = (a) => { }
const f2 = () => { () => { }; }
const f3 = f1(() => { })
const f4 = x => x + 1
// class
class A {
constructor() { }
tes1(a, b = 1) { }
}
export class B { }
const C = class { }
// ts
interface I1 {
s: string
b: boolean
(b: boolean): string
}
type T2 = {
s: string
b: boolean
f: () => void
}
class D implements I1 {
constructor(s: string, b: boolean) {
this.s = s
this.b = b
}
s: string
b: boolean
f(b: boolean): string {
return b ? "ok": ""
}
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These look great, thanks for working on this!
Fix #3177