Precise, cross-project code navigation at GitHub scale Douglas - - PowerPoint PPT Presentation

precise cross project code navigation at github scale
SMART_READER_LITE
LIVE PREVIEW

Precise, cross-project code navigation at GitHub scale Douglas - - PowerPoint PPT Presentation

FOSDEM 2020 Precise, cross-project code navigation at GitHub scale Douglas Creager @dcreager February 1, 2020 FOSDEM 2020 Precise, cross-project code navigation at GitHub scale Douglas Creager @dcreager February 1, 2020 Back in


slide-1
SLIDE 1

Precise, cross-project code navigation at GitHub scale

FOSDEM 2020

Douglas Creager — @dcreager February 1, 2020

slide-2
SLIDE 2

Precise, cross-project code navigation at GitHub scale

FOSDEM 2020

Douglas Creager — @dcreager February 1, 2020

slide-3
SLIDE 3

Back in November... Back in November...

slide-4
SLIDE 4

github.com

slide-5
SLIDE 5

github.com

slide-6
SLIDE 6

github.com

slide-7
SLIDE 7

github.com

slide-8
SLIDE 8

Limitations Limitations

slide-9
SLIDE 9

Only three languages are GA

Go Python Ruby (JavaScript, TypeScript, and PHP are in beta; more on the way!)

slide-10
SLIDE 10

“Fuzzy” (or ctags-like) symbol matching

slide-11
SLIDE 11

github.com

slide-12
SLIDE 12

github.com

slide-13
SLIDE 13

Can only follow links within a repository

slide-14
SLIDE 14

Limitations Limitations

slide-15
SLIDE 15

Takeaways

Local development ≠ Hosted service Incremental processing is a must Within-repo = Cross-repo

slide-16
SLIDE 16

Local development Hosted service ≠

slide-17
SLIDE 17
slide-18
SLIDE 18

Local development

User choice is paramount Context is a single workspace Interactive

slide-19
SLIDE 19

Local development

User choice is paramount Context is a single workspace Interactive

LSP

slide-20
SLIDE 20

Local development

User choice is paramount Context is a single workspace Interactive

LSP

M × N → M + N Long-running sidecar process Maintains long-lived in-memory state

slide-21
SLIDE 21

Hosted service

Lots of simultaneous contexts Looks more like a database Not as interactive ...but latency still counts!

slide-22
SLIDE 22

Hosted service

Lots of simultaneous contexts Looks more like a database Not as interactive ...but latency still counts! Everything is hidden behind an API

slide-23
SLIDE 23

Hosted service

Lots of simultaneous contexts Looks more like a database Not as interactive ...but latency still counts! Everything is hidden behind an API ...and we carry a pager

slide-24
SLIDE 24

Code generation

slide-25
SLIDE 25

tree-sitter parser for the language

slide-26
SLIDE 26

machine-readable description of the generated parser

slide-27
SLIDE 27

automatically generate AST data types from that grammar description

slide-28
SLIDE 28

including automatically generated API documentation!

slide-29
SLIDE 29

pattern-matching rules to pull out the definitions and references

slide-30
SLIDE 30

some boilerplate but not too bad

slide-31
SLIDE 31

We can produce fuzzy symbol matches incrementally.

slide-32
SLIDE 32

Incremental processing is a must

slide-33
SLIDE 33

Can we do that for precise symbol matches too?

slide-34
SLIDE 34
slide-35
SLIDE 35
slide-36
SLIDE 36
slide-37
SLIDE 37

Within repository Across repositories =

slide-38
SLIDE 38

Takeaways

Local development ≠ Hosted service Incremental processing is a must Within-repo = Cross-repo

slide-39
SLIDE 39

Thank you!

@dcreager https://github.com/github/semantic/ https://github.com/tree-sitter/tree-sitter/ Image credits (CC-BY-2.0 unless otherwise noted)

Sundial, liz west. https://flic.kr/p/EWBd4 Rain chain, lo fidelion. https://flic.kr/p/F12EUN go, Luis de Bethencourt. https://flic.kr/p/4c5RaR Ball Python, Renee Grayson. https://flic.kr/p/KTMCBL Halsschmuck mit rotem Edelstein auf dunklem Hintergrund, Ivan Radic. https://flic.kr/p/2fBnsE6 Out of Focus Beach Scene, jmclellon. https://flic.kr/p/28wcV4Z (Public domain) Han Pottery Pigpen, Gary Todd. https://flic.kr/p/gGuDug (Public domain) Mangshan National Park, cattan2011. https://flic.kr/p/NjJUYx laptop-iphone-desk, Coffee Channel. https://flic.kr/p/23rikHK Computer racks, Tristan Schmurr. https://flic.kr/p/22uf6Ax Clones, Manuel. https://flic.kr/p/WYQJQL (Public domain) Inchworm, Katja Schulz. https://flic.kr/p/PJMP4w Red Arrows Spaghetti Burst, Clint Budd. https://flic.kr/p/WmLc1n

slide-40
SLIDE 40