Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
dcreager
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
14 ms
·
91.
▲
by
dcreager
5y ago
The repo owner gets to define the base Docker image that’s used in the codespace. And then it also looks for a dotfiles repo under your user account, which you can use to install all of your personal customizations. You can see mine at htt
92.
▲
by
dcreager
5y ago
You can also create a separate codespace for each package if they’re independent of each other and you don’t need to test things in the downstream repo in a way that requires your changes being available “locally”.
93.
▲
by
dcreager
5y ago
The codespace is backed by a regular Linux VM, so we can clone the upstream repo and edit/compile/debug/etc in that just like we would locally on our laptops and workstations.
94.
▲
by
dcreager
6y ago
We do have C and C++ grammars [1,2] but they need some love. You're right that these two languages are among the hardest to support. You could get a tree-sitter external scanner to mimic the preprocessor without too much difficulty, bu
95.
▲
by
dcreager
6y ago
Hi there! You're right that the C grammar in particular is one that could use some love. C is not one of the languages that we're syntax highlighting with tree-sitter yet, nor is it one of the languages that we support Code Naviga
96.
▲
by
dcreager
6y ago
> Does GitHub currently use tree-sitter for syntax highlighting? For some languages, yes. https://news.ycombinator.com/item?id=26227214 > If yes, are the libraries open-source? They are! tree-sitter itself is open-s
97.
▲
by
dcreager
6y ago
My team is only writing tree-sitter parsers as part of working on GitHub developer productivity features like Code Navigation. So the short version is that we (i.e., my team at GitHub) haven't written a tree-sitter parser for SQL becau
98.
▲
by
dcreager
6y ago
That's the current plan! In particular, because we want to allow language communities to implement support for their own languages, and not have to be blocked on my team finding the time to do it. (Just like they can do now with the pa
99.
▲
by
dcreager
6y ago
You don't get the AST _diff_ as the result (you get a new tree whose structure is shared with the old tree), but tree-sitter is specifically designed to support this kind of incremental edit use case: https://tree-sitter.git
100.
▲
by
dcreager
6y ago
We've looked at LSIF before, and decided against it for a few reasons, mostly around COGS, operational overhead, and indexing latency. I gave a talk at last year's FOSDEM [1] going into some of the details. (Caveat that that tal
101.
▲
by
dcreager
6y ago
That’s great, thanks for the link to the grammar repo! I can’t commit to a specific timeline but I’ll definitely put this on the list.
102.
▲
by
dcreager
6y ago
We really appreciate the contributions you all have sent back to tree-sitter and the various language grammars, too!
103.
▲
by
dcreager
6y ago
Yes! This is a great point. It's similar to what I mentioned over on this thread [1] about how we're working on a more precise version of Code Navigation based on tree-sitter. The tl;dr is that you'd write something like tree
104.
▲
by
dcreager
6y ago
[EDITED to make the example actually line up with OP's test] There's no symbol table in the parser, so at parse time, we don't distinguish those cases: $ cat test.rb module Test def test1 x = 14; x end
105.
▲
by
dcreager
6y ago
We're currently working on a more precise version of the Code Nav that's shipped on github.com, which is very similar in spirit to this!
106.
▲
by
dcreager
6y ago
Ahh my mistake! :-) To be fair, we're cheating a little bit because the Ruby grammar relies so heavily on an external scannar, which is just under 1,000 lines of C++: https://github.com/tree-sitter/tree-sitter-ruby
107.
▲
by
dcreager
6y ago
I don't think you can do this without recompiling, since the grammars get translated into C code before use. But the built-in command line tools (‘tree-sitter parse’, etc) all support a mode where they will detect local changes to a c
108.
▲
by
dcreager
6y ago
We also have several of the language grammars published as crates: https://crates.io/search?q=tree-sitter (And doing the same for other grammars is a fairly painless process.) So if you're writing a tool for a single
109.
▲
by
dcreager
6y ago
We are also using this to power a lot of the program analysis features on github.com. We use it to generate the symbol list for Code Navigation, as an example, and are starting to look at extracting more semantic information about some lan
110.
▲
by
dcreager
6y ago
This is more a function of Ruby than of tree-sitter. The tree-sitter grammars for other languages are hopefully less inscrutable. For Ruby, we basically just ported whitequark's parser [1] over to tree-sitter's grammar DSL and s
111.
▲
by
dcreager
6y ago
Worth calling out that the syntax highlighting support is used to highlight several languages in github.com. (Linguist is still used for the long tail of languages, but we plan to migrate more and more over to tree-sitter-based highlightin
112.
▲
by
dcreager
6y ago
Hi there! I manage the GitHub team responsible for the Code Nav part of this. Re 30-80% coverage, can you elaborate on the biggest missing piece for you? Is it the number of languages that are covered, or too many false positives in the res
113.
▲
by
dcreager
7y ago
It's live! https://twitter.com/natfriedman/status/1118647837951004672
114.
▲
by
dcreager
7y ago
And now it's live on GitHub! https://twitter.com/natfriedman/status/1118647837951004672
115.
▲
NP-hard isn't the end of the world
(dcreager.net)
1 points
by
dcreager
8y ago
|
0 comments
116.
▲
Clean Git histories and code review workflows
(dcreager.net)
3 points
by
dcreager
8y ago
|
0 comments
117.
▲
Network Error Logging: Client-Side Monitoring of HTTP Requests
(dcreager.net)
4 points
by
dcreager
9y ago
|
0 comments
118.
▲
Shared library versions
(dcreager.net)
3 points
by
dcreager
9y ago
|
0 comments